Commit Graph

10 Commits

Author SHA1 Message Date
Heiko Schocher 9b107e6138 post, i2c: add missing curly bracket in i2c_post_test
If CONFIG_SYS_POST_I2C_ADDRS is not defined and CONFIG_SYS_POST_I2C
is activated, i2c_probe() is not called in the for statement,
because missing curly bracket.

Signed-off-by: Heiko Schocher <hs@denx.de>
2010-11-17 08:04:03 +01:00
Wolfgang Denk 8343f8a764 post/drivers/i2c.c: fix compile error
Commit 7e263ce "post/i2c: Clean up detection logic" added a "const"
qualifier to the declaration of i2c_addr_list[], missing the fact that
the list gets modified later in the code, which results in build
errors like these:

i2c.c: In function 'i2c_post_test':
i2c.c:88: error: assignment of read-only location

Remove the incorrect "const".

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Peter Tyser <ptyser@xes-inc.com>
Cc: Heiko Schocher <hs@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
2010-10-27 20:09:59 +02:00
Peter Tyser 9d921f19b3 post/i2c: Add ability to ignore I2C devices
Add the ability to not report an I2C POST error for a set of given I2C
addresses on bootup.  This is useful for cases when a device may or may
not be present, and neither case is considered an error.  For example:

- Some form factors such as XMC and Compact PCI Express have an I2C
  EEPROM whose address changes based on geographical address.  Eg
  installed in one slot its EEPROM address is, 0x50, in another its
  0x51, etc.  This allows multiple devices to have their EEPROMs present
  on the same I2C bus.  Thus the I2C devices present for an XMC or
  CPCIe card depend on if and where other cards are installed in the
  same system.

- Some cards have optional I2C devices.  Eg one hardware build
  configuration has different I2C devices than another and software
  can't determine if the optional device should be present or not.

- Some cards have optional daughtercards with I2C devices on them.

- I2C EEPROMs address range depends on their size.  Its possible to
  support differently size EEPROMs by only probing the EEPROM's base
  address and ignoring the other addresses that are impacted by its
  size.

A new CONFIG_SYS_POST_I2C_IGNORES define has been added which specifies
a list of I2C addresses for the I2C POST to ignore.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-22 02:19:14 -05:00
Peter Tyser 60aaaa0782 post/i2c: Rename I2C_ADDR_LIST to CONFIG_SYS_POST_I2C_ADDRS
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-22 02:19:00 -05:00
Peter Tyser 9f949c9ac2 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: Peter Tyser <ptyser@xes-inc.com>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-22 02:18:42 -05:00
Peter Tyser 7e263cea88 post/i2c: Clean up detection logic
The logic previously used in the I2C post was a bit convoluted.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-22 02:18:36 -05:00
Peter Tyser b9b1bc8542 post/i2c: General clean up
- Clean up ifdeffery
- Update coding style

No functional change should have occurred.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-22 02:18:30 -05:00
Jean-Christophe PLAGNIOL-VILLARD 6d0f6bcf33 rename CFG_ macros to CONFIG_SYS
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18 21:54:03 +02:00
Yuri Tikhonov 0a51e9248e POST: preparations for moving CONFIG_POST to Makefiles
Remove CONFIG_POST ifdefs from the post/ source files.

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-22 14:38:38 +02:00
Wolfgang Denk ad5bb451ad Restructure POST directory to support of other CPUs, boards, etc. 2007-03-06 18:08:43 +01:00