summaryrefslogtreecommitdiff
path: root/board/compulab/common
diff options
context:
space:
mode:
authorNikita Kiryanov <nikita@compulab.co.il>2015-09-06 11:48:35 +0300
committerStefano Babic <sbabic@denx.de>2015-09-13 10:35:06 +0200
commit72898ac7b80b42060b30d17cf185ea7a01194840 (patch)
tree796d7d644ad15af4c98b539a3be3391a026347cf /board/compulab/common
parentd9cbb264e8c277af0ae8c55bac01b8564dfc3f9c (diff)
downloadu-boot-imx-72898ac7b80b42060b30d17cf185ea7a01194840.zip
u-boot-imx-72898ac7b80b42060b30d17cf185ea7a01194840.tar.gz
u-boot-imx-72898ac7b80b42060b30d17cf185ea7a01194840.tar.bz2
compulab: eeprom: select i2c bus when querying for board rev
Add support for selecting which eeprom is queried for board revision by extending cl_eeprom_get_board_rev() to accept an i2c bus number. Cc: Stefano Babic <sbabic@denx.de> Cc: Igor Grinberg <grinberg@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Diffstat (limited to 'board/compulab/common')
-rw-r--r--board/compulab/common/eeprom.c4
-rw-r--r--board/compulab/common/eeprom.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c
index 77bcea4..aaacd2e 100644
--- a/board/compulab/common/eeprom.c
+++ b/board/compulab/common/eeprom.c
@@ -121,7 +121,7 @@ static u32 board_rev;
* Routine: cl_eeprom_get_board_rev
* Description: read system revision from eeprom
*/
-u32 cl_eeprom_get_board_rev(void)
+u32 cl_eeprom_get_board_rev(uint eeprom_bus)
{
char str[5]; /* Legacy representation can contain at most 4 digits */
uint offset = BOARD_REV_OFFSET_LEGACY;
@@ -129,7 +129,7 @@ u32 cl_eeprom_get_board_rev(void)
if (board_rev)
return board_rev;
- if (cl_eeprom_setup(CONFIG_SYS_I2C_EEPROM_BUS))
+ if (cl_eeprom_setup(eeprom_bus))
return 0;
if (cl_eeprom_layout != LAYOUT_LEGACY)
diff --git a/board/compulab/common/eeprom.h b/board/compulab/common/eeprom.h
index 50c6b02..e74c379 100644
--- a/board/compulab/common/eeprom.h
+++ b/board/compulab/common/eeprom.h
@@ -12,13 +12,13 @@
#ifdef CONFIG_SYS_I2C
int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus);
-u32 cl_eeprom_get_board_rev(void);
+u32 cl_eeprom_get_board_rev(uint eeprom_bus);
#else
static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus)
{
return 1;
}
-static inline u32 cl_eeprom_get_board_rev(void)
+static inline u32 cl_eeprom_get_board_rev(uint eeprom_bus)
{
return 0;
}