Commit 72898ac7b80b42060b30d17cf185ea7a01194840
Committed by
Stefano Babic
1 parent
d9cbb264e8
Exists in
v2017.01-smarct4x
and in
33 other branches
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>
Showing 4 changed files with 6 additions and 6 deletions Side-by-side Diff
board/compulab/cm_fx6/cm_fx6.c
board/compulab/cm_t35/cm_t35.c
board/compulab/common/eeprom.c
| ... | ... | @@ -121,7 +121,7 @@ |
| 121 | 121 | * Routine: cl_eeprom_get_board_rev |
| 122 | 122 | * Description: read system revision from eeprom |
| 123 | 123 | */ |
| 124 | -u32 cl_eeprom_get_board_rev(void) | |
| 124 | +u32 cl_eeprom_get_board_rev(uint eeprom_bus) | |
| 125 | 125 | { |
| 126 | 126 | char str[5]; /* Legacy representation can contain at most 4 digits */ |
| 127 | 127 | uint offset = BOARD_REV_OFFSET_LEGACY; |
| ... | ... | @@ -129,7 +129,7 @@ |
| 129 | 129 | if (board_rev) |
| 130 | 130 | return board_rev; |
| 131 | 131 | |
| 132 | - if (cl_eeprom_setup(CONFIG_SYS_I2C_EEPROM_BUS)) | |
| 132 | + if (cl_eeprom_setup(eeprom_bus)) | |
| 133 | 133 | return 0; |
| 134 | 134 | |
| 135 | 135 | if (cl_eeprom_layout != LAYOUT_LEGACY) |
board/compulab/common/eeprom.h
| ... | ... | @@ -12,13 +12,13 @@ |
| 12 | 12 | |
| 13 | 13 | #ifdef CONFIG_SYS_I2C |
| 14 | 14 | int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus); |
| 15 | -u32 cl_eeprom_get_board_rev(void); | |
| 15 | +u32 cl_eeprom_get_board_rev(uint eeprom_bus); | |
| 16 | 16 | #else |
| 17 | 17 | static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus) |
| 18 | 18 | { |
| 19 | 19 | return 1; |
| 20 | 20 | } |
| 21 | -static inline u32 cl_eeprom_get_board_rev(void) | |
| 21 | +static inline u32 cl_eeprom_get_board_rev(uint eeprom_bus) | |
| 22 | 22 | { |
| 23 | 23 | return 0; |
| 24 | 24 | } |