Commit 72898ac7b80b42060b30d17cf185ea7a01194840

Authored by Nikita Kiryanov
Committed by Stefano Babic
1 parent d9cbb264e8

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
... ... @@ -689,7 +689,7 @@
689 689  
690 690 u32 get_board_rev(void)
691 691 {
692   - return cl_eeprom_get_board_rev();
  692 + return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
693 693 }
694 694  
695 695 static struct mxc_serial_platdata cm_fx6_mxc_serial_plat = {
board/compulab/cm_t35/cm_t35.c
... ... @@ -104,7 +104,7 @@
104 104 */
105 105 u32 get_board_rev(void)
106 106 {
107   - return cl_eeprom_get_board_rev();
  107 + return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
108 108 };
109 109  
110 110 int misc_init_r(void)
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 }