diff options
-rw-r--r-- | board/adlrvpp_mchp1521/board.h | 7 | ||||
-rw-r--r-- | board/sklrvp_mchp/board.c | 26 | ||||
-rw-r--r-- | board/sklrvp_mchp/board.h | 7 | ||||
-rw-r--r-- | board/sklrvp_mchp1723/board.h | 7 | ||||
-rw-r--r-- | chip/mchp/registers-mec152x.h | 4 | ||||
-rw-r--r-- | chip/mchp/registers-mec172x.h | 4 |
6 files changed, 8 insertions, 47 deletions
diff --git a/board/adlrvpp_mchp1521/board.h b/board/adlrvpp_mchp1521/board.h index b78f433dfd..1d3cb4828f 100644 --- a/board/adlrvpp_mchp1521/board.h +++ b/board/adlrvpp_mchp1521/board.h @@ -131,13 +131,6 @@ /* To do: Remove once fan register details are added in mchp/fan.c */ #undef CONFIG_FANS -/* - * MEC152x I2C controllers are multi-port. - * Each controller can use any of the 11 ports. - */ -#define I2C_CONTROLLER_COUNT 3 -#define I2C_PORT_COUNT 3 - /* Use internal silicon 32KHz oscillator */ #undef CONFIG_CLOCK_SRC_EXTERNAL diff --git a/board/sklrvp_mchp/board.c b/board/sklrvp_mchp/board.c index d7fb99e565..af286a7df0 100644 --- a/board/sklrvp_mchp/board.c +++ b/board/sklrvp_mchp/board.c @@ -181,32 +181,6 @@ const struct charger_config_t chg_chips[] = { }, }; -/* - * MEC152x map ports to controller. - * Ports may map to the same controller. - */ -const uint16_t i2c_port_to_ctrl[I2C_PORT_COUNT] = { - (MCHP_I2C_CTRL0 << 8) + MCHP_I2C_PORT4, - (MCHP_I2C_CTRL1 << 8) + MCHP_I2C_PORT5, - (MCHP_I2C_CTRL2 << 8) + MCHP_I2C_PORT0, - (MCHP_I2C_CTRL3 << 8) + MCHP_I2C_PORT2, -}; - -/* - * default to I2C0 because callers may not check - * return value if we returned an error code. - */ -int board_i2c_p2c(int port) -{ - int i; - - for (i = 0; i < I2C_PORT_COUNT; i++) - if ((i2c_port_to_ctrl[i] & 0xFF) == port) - return (int)(i2c_port_to_ctrl[i] >> 8); - - return -1; -} - static void sklrvp_init(void) { int extpwr = extpower_is_present(); diff --git a/board/sklrvp_mchp/board.h b/board/sklrvp_mchp/board.h index 144a843277..c415af8107 100644 --- a/board/sklrvp_mchp/board.h +++ b/board/sklrvp_mchp/board.h @@ -195,13 +195,6 @@ #define CONFIG_USB_PD_TCPM_FUSB307 #define CONFIG_USB_PD_TCPM_TCPCI -/* - * MEC152x I2C controllers are multi-port. - * Each controller can use any of the 11 ports. - */ -#define I2C_CONTROLLER_COUNT 4 -#define I2C_PORT_COUNT 4 - #define I2C_PORT_CHARGER MCHP_I2C_PORT2 #define I2C_PORT_BATTERY MCHP_I2C_PORT2 #define I2C_PORT_PCA9555_BOARD_ID_GPIO MCHP_I2C_PORT2 diff --git a/board/sklrvp_mchp1723/board.h b/board/sklrvp_mchp1723/board.h index 64e69f1ff8..4e9518a439 100644 --- a/board/sklrvp_mchp1723/board.h +++ b/board/sklrvp_mchp1723/board.h @@ -193,13 +193,6 @@ #define CONFIG_USB_PD_TCPM_FUSB307 #define CONFIG_USB_PD_TCPM_TCPCI -/* - * MEC172x I2C controllers are multi-port. - * Each controller can use any of the 16 ports. - */ -#define I2C_CONTROLLER_COUNT 5 -#define I2C_PORT_COUNT 5 - #define I2C_PORT_CHARGER MCHP_I2C_PORT2 #define I2C_PORT_BATTERY MCHP_I2C_PORT2 #define I2C_PORT_PCA9555_BOARD_ID_GPIO MCHP_I2C_PORT2 diff --git a/chip/mchp/registers-mec152x.h b/chip/mchp/registers-mec152x.h index 5256b7e795..10021ede8b 100644 --- a/chip/mchp/registers-mec152x.h +++ b/chip/mchp/registers-mec152x.h @@ -1063,6 +1063,10 @@ enum MCHP_i2c_port { MCHP_I2C_PORT_COUNT, }; +/* I2C ports & Configs */ +#define I2C_CONTROLLER_COUNT MCHP_I2C_CTRL_MAX +#define I2C_PORT_COUNT MCHP_I2C_PORT_COUNT + /* * I2C controllers 0-4 implement network layer hardware. * I2C controllers 5-7 do include network layer hardware. diff --git a/chip/mchp/registers-mec172x.h b/chip/mchp/registers-mec172x.h index 63222539a5..146ad046dd 100644 --- a/chip/mchp/registers-mec172x.h +++ b/chip/mchp/registers-mec172x.h @@ -1195,6 +1195,10 @@ enum MCHP_i2c_port { MCHP_I2C_PORT_COUNT, }; +/* I2C ports & Configs */ +#define I2C_CONTROLLER_COUNT MCHP_I2C_CTRL_MAX +#define I2C_PORT_COUNT MCHP_I2C_PORT_COUNT + /* All I2C controllers connected to GIRQ13 */ #define MCHP_I2C_GIRQ 13 /* I2C[0:7] -> GIRQ13 bits[0:7] */ |