diff options
author | Caveh Jalali <caveh@chromium.org> | 2022-06-16 11:54:40 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-16 23:08:20 +0000 |
commit | c3ec66115cd3a23f3939784301264b8ea017aaa2 (patch) | |
tree | 0e5a59e30f97309c0c8d558cd8431727cd6b341a /board | |
parent | 1001293e1e850bb89bdcf789188d6c36f1f90aea (diff) | |
download | chrome-ec-c3ec66115cd3a23f3939784301264b8ea017aaa2.tar.gz |
ghost: Update I2C port map to match schematics
BRANCH=none
BUG=b:230813416
TEST=make passes (with follow-on patches)
Change-Id: If3ce8998c6fa4b30de37ddd9e04852f5c54d03c4
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3710272
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/ghost/board.h | 17 | ||||
-rw-r--r-- | board/ghost/i2c.c | 33 | ||||
-rw-r--r-- | board/ghost/usbc_config.c | 16 |
3 files changed, 38 insertions, 28 deletions
diff --git a/board/ghost/board.h b/board/ghost/board.h index 19818fa1a2..a975b06013 100644 --- a/board/ghost/board.h +++ b/board/ghost/board.h @@ -104,16 +104,17 @@ #define I2C_PORT_SENSOR NPCX_I2C_PORT0_0 -#define I2C_PORT_USB_C0_C2_TCPC NPCX_I2C_PORT1_0 - -#define I2C_PORT_USB_C0_C2_PPC NPCX_I2C_PORT2_0 - -#define I2C_PORT_USB_C0_C2_MUX NPCX_I2C_PORT3_0 +#define I2C_PORT_USB_C0_C1_TCPC NPCX_I2C_PORT1_0 +#define I2C_PORT_USB_C0_C1_PPC NPCX_I2C_PORT2_0 +#define I2C_PORT_USB_C0_RT NPCX_I2C_PORT3_0 +#define I2C_PORT_USB_C1_RT NPCX_I2C_PORT6_1 #define I2C_PORT_BATTERY NPCX_I2C_PORT5_0 -#define I2C_PORT_CHARGER NPCX_I2C_PORT7_0 -#define I2C_PORT_EEPROM NPCX_I2C_PORT7_0 -#define I2C_PORT_MP2964 NPCX_I2C_PORT7_0 +#define I2C_PORT_CHARGER NPCX_I2C_PORT5_0 +#define I2C_PORT_MISC NPCX_I2C_PORT7_0 + +#define I2C_PORT_EEPROM I2C_PORT_MISC +#define I2C_PORT_MP2964 I2C_PORT_MISC #define I2C_ADDR_EEPROM_FLAGS 0x50 diff --git a/board/ghost/i2c.c b/board/ghost/i2c.c index f3426740b9..f65a074344 100644 --- a/board/ghost/i2c.c +++ b/board/ghost/i2c.c @@ -19,30 +19,30 @@ const struct i2c_port_t i2c_ports[] = { }, { /* I2C1 */ - .name = "tcpc0,2", - .port = I2C_PORT_USB_C0_C2_TCPC, + .name = "tcpc0,1", + .port = I2C_PORT_USB_C0_C1_TCPC, /* TODO(b/233013680): set to 1000 when validated */ .kbps = 400, - .scl = GPIO_EC_I2C_USB_C0_C2_TCPC_SCL, - .sda = GPIO_EC_I2C_USB_C0_C2_TCPC_SDA, + .scl = GPIO_EC_I2C_USB_C0_C1_TCPC_SCL, + .sda = GPIO_EC_I2C_USB_C0_C1_TCPC_SDA, }, { /* I2C2 */ - .name = "ppc0,2", - .port = I2C_PORT_USB_C0_C2_PPC, + .name = "ppc0,1", + .port = I2C_PORT_USB_C0_C1_PPC, /* TODO(b/233013680): set to 1000 when validated */ .kbps = 400, - .scl = GPIO_EC_I2C_USB_C0_C2_PPC_BC_SCL, - .sda = GPIO_EC_I2C_USB_C0_C2_PPC_BC_SDA, + .scl = GPIO_EC_I2C_USB_C0_C1_PPC_BC_SCL, + .sda = GPIO_EC_I2C_USB_C0_C1_PPC_BC_SDA, }, { /* I2C3 */ - .name = "retimer0,2", - .port = I2C_PORT_USB_C0_C2_MUX, + .name = "retimer0", + .port = I2C_PORT_USB_C0_RT, /* TODO(b/233013680): set to 1000 when validated */ .kbps = 400, - .scl = GPIO_EC_I2C_USB_C0_C2_RT_SCL, - .sda = GPIO_EC_I2C_USB_C0_C2_RT_SDA, + .scl = GPIO_EC_I2C_USB_C0_RT_SCL, + .sda = GPIO_EC_I2C_USB_C0_RT_SDA, }, { /* I2C5 */ @@ -53,6 +53,15 @@ const struct i2c_port_t i2c_ports[] = { .sda = GPIO_EC_I2C_BAT_SDA, }, { + /* I2C6 */ + .name = "retimer1", + .port = I2C_PORT_USB_C1_RT, + /* TODO(b/233013680): set to 1000 when validated */ + .kbps = 400, + .scl = GPIO_EC_I2C_USB_C1_RT_SCL, + .sda = GPIO_EC_I2C_USB_C1_RT_SDA, + }, + { /* I2C7 */ .name = "eeprom", .port = I2C_PORT_EEPROM, diff --git a/board/ghost/usbc_config.c b/board/ghost/usbc_config.c index a66c680672..b537297e80 100644 --- a/board/ghost/usbc_config.c +++ b/board/ghost/usbc_config.c @@ -41,7 +41,7 @@ const struct tcpc_config_t tcpc_config[] = { [USBC_PORT_C0] = { .bus_type = EC_BUS_TYPE_I2C, .i2c_info = { - .port = I2C_PORT_USB_C0_C2_TCPC, + .port = I2C_PORT_USB_C0_C1_TCPC, .addr_flags = NCT38XX_I2C_ADDR2_1_FLAGS, }, .drv = &nct38xx_tcpm_drv, @@ -51,7 +51,7 @@ const struct tcpc_config_t tcpc_config[] = { [USBC_PORT_C1] = { .bus_type = EC_BUS_TYPE_I2C, .i2c_info = { - .port = I2C_PORT_USB_C0_C2_TCPC, + .port = I2C_PORT_USB_C0_C1_TCPC, .addr_flags = NCT38XX_I2C_ADDR1_1_FLAGS, }, .drv = &nct38xx_tcpm_drv, @@ -66,13 +66,13 @@ BUILD_ASSERT(CONFIG_USB_PD_PORT_MAX_COUNT == USBC_PORT_COUNT); /* USBC PPC configuration */ struct ppc_config_t ppc_chips[] = { [USBC_PORT_C0] = { - .i2c_port = I2C_PORT_USB_C0_C2_PPC, + .i2c_port = I2C_PORT_USB_C0_C1_PPC, .i2c_addr_flags = SYV682X_ADDR2_FLAGS, .frs_en = IOEX_USB_C0_FRS_EN, .drv = &syv682x_drv, }, [USBC_PORT_C1] = { - .i2c_port = I2C_PORT_USB_C0_C2_PPC, + .i2c_port = I2C_PORT_USB_C0_C1_PPC, .i2c_addr_flags = SYV682X_ADDR0_FLAGS, .frs_en = IOEX_USB_C1_FRS_EN, .drv = &syv682x_drv, @@ -99,7 +99,7 @@ const struct usb_mux usb_muxes[] = { .usb_port = USBC_PORT_C0, .driver = &bb_usb_retimer, .hpd_update = bb_retimer_hpd_update, - .i2c_port = I2C_PORT_USB_C0_C2_MUX, + .i2c_port = I2C_PORT_USB_C0_RT, .i2c_addr_flags = USBC_PORT_C0_BB_RETIMER_I2C_ADDR, .next_mux = &usbc0_tcss_usb_mux, }, @@ -107,7 +107,7 @@ const struct usb_mux usb_muxes[] = { .usb_port = USBC_PORT_C1, .driver = &bb_usb_retimer, .hpd_update = bb_retimer_hpd_update, - .i2c_port = I2C_PORT_USB_C0_C2_MUX, + .i2c_port = I2C_PORT_USB_C1_RT, .i2c_addr_flags = USBC_PORT_C1_BB_RETIMER_I2C_ADDR, .next_mux = &usbc1_tcss_usb_mux, }, @@ -126,13 +126,13 @@ BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); struct ioexpander_config_t ioex_config[] = { [IOEX_C0_NCT38XX] = { - .i2c_host_port = I2C_PORT_USB_C0_C2_TCPC, + .i2c_host_port = I2C_PORT_USB_C0_C1_TCPC, .i2c_addr_flags = NCT38XX_I2C_ADDR2_1_FLAGS, .drv = &nct38xx_ioexpander_drv, .flags = IOEX_FLAGS_DEFAULT_INIT_DISABLED, }, [IOEX_C1_NCT38XX] = { - .i2c_host_port = I2C_PORT_USB_C0_C2_TCPC, + .i2c_host_port = I2C_PORT_USB_C0_C1_TCPC, .i2c_addr_flags = NCT38XX_I2C_ADDR1_1_FLAGS, .drv = &nct38xx_ioexpander_drv, .flags = IOEX_FLAGS_DEFAULT_INIT_DISABLED, |