提交 9f949c9a 编写于 作者: P Peter Tyser 提交者: Kumar Gala

post/i2c: Don't probe address 0

According to the I2C specification device address 0 is the "general call
address", ie a broadcast address.  The I2C specification states that the
format of a general call uses at least 2 bytes, which U-Boot's probing
routine does not adhere to.

Not probing device address 0 will prevent possible issues with devices
that accept general calls.  Additionally, this change shouldn't reduce
POST coverage since each I2C device should still be accessed via its
own, unique address.
Signed-off-by: NPeter Tyser <ptyser@xes-inc.com>
Acked-by: NHeiko Schocher <hs@denx.de>
Acked-by: NWolfgang Denk <wd@denx.de>
Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
上级 7e263cea
......@@ -44,7 +44,8 @@ int i2c_post_test (int flags)
{
unsigned int i;
#ifndef I2C_ADDR_LIST
for (i = 0; i < 128; i++)
/* Start at address 1, address 0 is the general call address */
for (i = 1; i < 128; i++)
if (i2c_probe (i) == 0)
return 0;
......@@ -55,7 +56,8 @@ int i2c_post_test (int flags)
int j;
const unsigned char i2c_addr_list[] = I2C_ADDR_LIST;
for (i = 0; i < 128; i++) {
/* Start at address 1, address 0 is the general call address */
for (i = 1; i < 128; i++) {
if (i2c_probe(i) != 0)
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册