[U-Boot] [PATCH v2 1/3] freescale: vid: Return i2c mux to default channel

IR chip is on one of the channels on multiplexed I2C-bus. Reset to default channel after accessing.
Signed-off-by: Wenbin Song wenbin.song@nxp.com --- Changes for v2: -Rework the commit message and the tag int the subject. --- board/freescale/common/vid.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c index 1bd65a8..a6a132a 100644 --- a/board/freescale/common/vid.c +++ b/board/freescale/common/vid.c @@ -454,6 +454,9 @@ int adjust_vdd(ulong vdd_override) exit: if (re_enable) enable_interrupts(); + + i2c_multiplexer_select_vid_channel(I2C_MUX_CH_DEFAULT); + return ret; }
@@ -469,7 +472,7 @@ static int print_vdd(void) ret = find_ir_chip_on_i2c(); if (ret < 0) { printf("VID: Could not find voltage regulator on I2C.\n"); - return -1; + goto exit; } else { i2caddress = ret; debug("VID: IR Chip found on I2C address 0x%02x\n", i2caddress); @@ -481,11 +484,14 @@ static int print_vdd(void) vdd_last = read_voltage(i2caddress); if (vdd_last < 0) { printf("VID: Couldn't read sensor abort VID adjustment\n"); - return -1; + goto exit; } printf("VID: Core voltage is at %d mV\n", vdd_last); +exit: + i2c_multiplexer_select_vid_channel(I2C_MUX_CH_DEFAULT); + + return ret < 0 ? -1 : 0;
- return 0; }
static int do_vdd_override(cmd_tbl_t *cmdtp,

Return i2c mux to the default channel after accessing retimer.
Signed-off-by: Wenbin Song wenbin.song@nxp.com --- Change for v2: -Rework the commit message and the subject --- board/freescale/ls1043aqds/ls1043aqds.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c index a72fe52..fba6b88 100644 --- a/board/freescale/ls1043aqds/ls1043aqds.c +++ b/board/freescale/ls1043aqds/ls1043aqds.c @@ -170,8 +170,7 @@ void board_retimer_init(void) u8 reg;
/* Retimer is connected to I2C1_CH7_CH5 */ - reg = I2C_MUX_CH7; - i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, ®, 1); + select_i2c_ch_pca9547(I2C_MUX_CH7); reg = I2C_MUX_CH5; i2c_write(I2C_MUX_PCA_ADDR_SEC, 0, 1, ®, 1);
@@ -219,6 +218,9 @@ void board_retimer_init(void) i2c_write(I2C_RETIMER_ADDR, 0x63, 1, ®, 1); reg = 0xcd; i2c_write(I2C_RETIMER_ADDR, 0x64, 1, ®, 1); + + /* Return the default channel */ + select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); }
int board_early_init_f(void)

On 03/08/2016 09:47 PM, Wenbin Song wrote:
Return i2c mux to the default channel after accessing retimer.
Signed-off-by: Wenbin Song wenbin.song@nxp.com
Change for v2:
-Rework the commit message and the subject
board/freescale/ls1043aqds/ls1043aqds.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Applied to u-boot-fsl-qoriq, awaiting upstream.
Thanks.
York

Signed-off-by: Wenbin Song wenbin.song@nxp.com --- Changes for v2: -Rework the subject --- include/configs/ls1043aqds.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h index 158cf02..e269522 100644 --- a/include/configs/ls1043aqds.h +++ b/include/configs/ls1043aqds.h @@ -114,6 +114,16 @@ unsigned long get_board_ddr_clk(void); #define CONFIG_DOS_PARTITION #define CONFIG_BOARD_LATE_INIT
+ +/* EEPROM */ +#define CONFIG_ID_EEPROM +#define CONFIG_SYS_I2C_EEPROM_NXID +#define CONFIG_SYS_EEPROM_BUS_NUM 0 +#define CONFIG_SYS_I2C_EEPROM_ADDR 0x57 +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 +#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 +#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 + #define CONFIG_SYS_SATA AHCI_BASE_ADDR
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 1

On 03/08/2016 09:47 PM, Wenbin Song wrote:
Signed-off-by: Wenbin Song wenbin.song@nxp.com
Changes for v2:
-Rework the subject
include/configs/ls1043aqds.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
Applied to u-boot-fsl-qoriq, awaiting upstream.
Thanks.
York

On 03/08/2016 09:47 PM, Wenbin Song wrote:
IR chip is on one of the channels on multiplexed I2C-bus. Reset to default channel after accessing.
Signed-off-by: Wenbin Song wenbin.song@nxp.com
Changes for v2:
-Rework the commit message and the tag int the subject.
board/freescale/common/vid.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
Applied to u-boot-fsl-qoriq, awaiting upstream.
Thanks.
York
participants (2)
-
Wenbin Song
-
york sun