summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-09-14 15:16:33 -0700
committerCommit Bot <commit-bot@chromium.org>2020-09-17 01:47:17 +0000
commit6e31d6a118d877ea53bef6d15016608bfee26583 (patch)
tree54e703ddb276f40faccbcb62bf7be97b1fcef565
parentdfa1d9370950aeae0a28aebe1aa0d6cec25ef707 (diff)
downloadchrome-ec-6e31d6a118d877ea53bef6d15016608bfee26583.tar.gz
Coachz: Reflect the GPIO change
Rename the GPIOs to reflect the netnames. Add the GPIOs for the hall sensors, not implemented yet. Add the GPIOs for the base detection, not implemented yet. Add the GPIOs and I2C bus for the stylus, not implemented yet. BRANCH=None BUG=b:167884598 TEST=Built the Coachz image. Change-Id: If30e00d8ede0b6ca2e9a4f9efe474c22a8a16933 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2411507 Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
-rw-r--r--baseboard/trogdor/baseboard.h1
-rw-r--r--board/coachz/board.h4
-rw-r--r--board/coachz/gpio.inc29
-rw-r--r--board/coachz/led.c2
4 files changed, 26 insertions, 10 deletions
diff --git a/baseboard/trogdor/baseboard.h b/baseboard/trogdor/baseboard.h
index ab89ef8770..6cc669f8fc 100644
--- a/baseboard/trogdor/baseboard.h
+++ b/baseboard/trogdor/baseboard.h
@@ -176,6 +176,7 @@
#define I2C_PORT_POWER NPCX_I2C_PORT0_0
#define I2C_PORT_TCPC0 NPCX_I2C_PORT1_0
#define I2C_PORT_TCPC1 NPCX_I2C_PORT2_0
+#define I2C_PORT_WLC NPCX_I2C_PORT3_0
#define I2C_PORT_EEPROM NPCX_I2C_PORT5_0
#define I2C_PORT_SENSOR NPCX_I2C_PORT7_0
diff --git a/board/coachz/board.h b/board/coachz/board.h
index ff95b400d2..3930f44f8c 100644
--- a/board/coachz/board.h
+++ b/board/coachz/board.h
@@ -43,8 +43,8 @@
#define OPT3001_I2C_ADDR_FLAGS OPT3001_I2C_ADDR1_FLAGS
/* GPIO alias */
-#define GPIO_AC_PRESENT GPIO_ACOK_OD
-#define GPIO_WP_L GPIO_EC_WP_ODL
+#define GPIO_AC_PRESENT GPIO_CHG_ACOK_OD
+#define GPIO_WP_L GPIO_EC_FLASH_WP_ODL
#define GPIO_PMIC_RESIN_L GPIO_PM845_RESIN_L
#ifndef __ASSEMBLER__
diff --git a/board/coachz/gpio.inc b/board/coachz/gpio.inc
index a4c956489b..7af01d9047 100644
--- a/board/coachz/gpio.inc
+++ b/board/coachz/gpio.inc
@@ -17,12 +17,12 @@ GPIO_INT(USB_C0_BC12_INT_L, PIN(6, 1), GPIO_INT_FALLING, usb0_evt) /* Interr
GPIO_INT(USB_C1_BC12_INT_L, PIN(8, 2), GPIO_INT_FALLING, usb1_evt) /* Interrupt from port-1 BC1.2 */
/* System interrupts */
-GPIO_INT(ACOK_OD, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, extpower_interrupt) /* AC OK? */
+GPIO_INT(CHG_ACOK_OD, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, extpower_interrupt) /* AC OK? */
GPIO_INT(CCD_MODE_ODL, PIN(E, 3), GPIO_INT_FALLING, board_connect_c0_sbu) /* Case Closed Debug Mode */
GPIO_INT(EC_PWR_BTN_ODL, PIN(0, 1), GPIO_INT_BOTH, power_button_interrupt) /* Power button */
GPIO_INT(EC_VOLDN_BTN_ODL, PIN(7, 0), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) /* Volume Up button */
GPIO_INT(EC_VOLUP_BTN_ODL, PIN(F, 2), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) /* Volume Down button */
-GPIO_INT(EC_WP_ODL, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) /* Write protection */
+GPIO_INT(EC_FLASH_WP_ODL, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) /* Write protection */
GPIO_INT(LID_OPEN_EC, PIN(D, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, lid_interrupt) /* Lid open? */
GPIO_INT(AP_RST_L, PIN(C, 1), GPIO_INT_BOTH | GPIO_SEL_1P8V, chipset_ap_rst_interrupt) /* PMIC to signal AP reset */
GPIO_INT(PS_HOLD, PIN(A, 4), GPIO_INT_BOTH | GPIO_PULL_DOWN | GPIO_SEL_1P8V, power_signal_interrupt) /* Indicate when AP triggers reset/shutdown */
@@ -72,6 +72,22 @@ GPIO(EC_BL_DISABLE_L, PIN(B, 6), GPIO_OUT_LOW) /* Backlight disable sign
/* Sensors */
GPIO(REVERSE_DOCK_EC, PIN(C, 6), GPIO_INPUT)
+/* TODO(b/168714440): Implement the hall sensor interrupts */
+GPIO(LID_INT_N_HALL1, PIN(7, 3), GPIO_INPUT)
+GPIO(LID_INT_N_HALL2, PIN(6, 0), GPIO_INPUT)
+GPIO(LID_INT_N_HALL3, PIN(D, 7), GPIO_INPUT)
+/* TODO(waihong): Should remove it from hardware */
+GPIO(CAM_LED, PIN(3, 0), GPIO_INPUT)
+
+/* Stylus */
+/* TODO(b/168652326): Implement the WLC controls */
+GPIO(WLC_IRQ_CONN, PIN(7, 4), GPIO_INPUT)
+GPIO(WLC_NRST_CONN, PIN(C, 5), GPIO_INPUT)
+
+/* Base detection */
+/* TODO(b/168712053): Implement the base detection */
+GPIO(BASE_DET_L, PIN(3, 7), GPIO_INPUT)
+GPIO(EN_BASE, PIN(0, 4), GPIO_INPUT)
/* USB-C */
GPIO(USB_C0_PD_RST_L, PIN(F, 1), GPIO_ODR_HIGH) /* Port-0 TCPC chip reset, actaully Open-Drain */
@@ -79,10 +95,6 @@ GPIO(USB_C1_PD_RST_L, PIN(E, 4), GPIO_ODR_HIGH) /* Port-1 TCPC chip reset
GPIO(DP_MUX_OE_L, PIN(9, 6), GPIO_OUT_HIGH) /* DP mux enable */
GPIO(DP_MUX_SEL, PIN(4, 5), GPIO_OUT_HIGH) /* DP mux selection: L:C0, H:C1 */
GPIO(DP_HOT_PLUG_DET, PIN(9, 5), GPIO_OUT_LOW) /* DP HPD to AP */
-/* TODO(waihong): Remove it from schematic. No use. */
-GPIO(USBC_MUX_CONF0, PIN(5, 1), GPIO_INPUT)
-GPIO(USB_C0_VBUS_DET_L, PIN(6, 2), GPIO_INPUT) /* Deprecated BC1.2 VBUS detection on port-0 */
-GPIO(USB_C1_VBUS_DET_L, PIN(8, 3), GPIO_INPUT) /* Deprecated BC1.2 VBUS detection on port-1 */
/* USB-A */
GPIO(EN_USB_A_5V, PIN(8, 6), GPIO_INPUT) /* NC, backup only */
@@ -90,7 +102,7 @@ GPIO(USB_A_CDP_ILIM_EN, PIN(7, 5), GPIO_INPUT) /* NC, backup only */
/* LEDs */
GPIO(EC_CHG_LED_Y_C1, PIN(C, 3), GPIO_OUT_LOW)
-GPIO(EC_CHG_LED_B_C1, PIN(C, 4), GPIO_OUT_LOW)
+GPIO(EC_CHG_LED_W_C1, PIN(C, 4), GPIO_OUT_LOW)
/* PWM */
GPIO(EDP_BKLTCTL, PIN(B, 7), GPIO_INPUT) /* PWM5 */
@@ -109,6 +121,8 @@ GPIO(EC_I2C_USB_C1_PD_SCL, PIN(9, 2), GPIO_INPUT)
GPIO(EC_I2C_USB_C1_PD_SDA, PIN(9, 1), GPIO_INPUT)
GPIO(EC_I2C_EEPROM_SCL, PIN(3, 3), GPIO_INPUT)
GPIO(EC_I2C_EEPROM_SDA, PIN(3, 6), GPIO_INPUT)
+GPIO(EC_I2C_WLC_SCL, PIN(D, 1), GPIO_INPUT)
+GPIO(EC_I2C_WLC_SDA, PIN(D, 0), GPIO_INPUT)
GPIO(EC_I2C_SENSOR_SCL, PIN(B, 3), GPIO_INPUT | GPIO_SEL_1P8V)
GPIO(EC_I2C_SENSOR_SDA, PIN(B, 2), GPIO_INPUT | GPIO_SEL_1P8V)
@@ -134,6 +148,7 @@ ALTERNATE(PIN_MASK(9, 0x07), 1, MODULE_I2C, 0) /* I2C1 SDA (GPIO90),
ALTERNATE(PIN_MASK(8, 0x80), 1, MODULE_I2C, 0) /* I2C1 SCL (GPIO87) */
ALTERNATE(PIN_MASK(3, 0x48), 1, MODULE_I2C, 0) /* I2C5 (GPIO33/36) */
ALTERNATE(PIN_MASK(B, 0x0C), 1, MODULE_I2C, GPIO_SEL_1P8V) /* I2C7 (GPIOB2/B3) - 1.8V */
+ALTERNATE(PIN_MASK(D, 0x03), 1, MODULE_I2C, 0) /* I2C3 (GPIOD0/D1) */
ALTERNATE(PIN_MASK(4, 0x1C), 0, MODULE_ADC, 0) /* ADC1 (GPIO44), ADC2 (GPIO43), ADC3 (GPIO42) */
ALTERNATE(PIN_MASK(4, 0xC0), 1, MODULE_SPI, GPIO_SEL_1P8V) /* SHI_SDO (GPIO47), SHI_SDI (GPIO46) */
ALTERNATE(PIN_MASK(5, 0x28), 1, MODULE_SPI, GPIO_SEL_1P8V) /* SHI_SCLK (GPIO55), SHI_CS# (GPIO53) */
diff --git a/board/coachz/led.c b/board/coachz/led.c
index f9c91c1c6a..45a90b157d 100644
--- a/board/coachz/led.c
+++ b/board/coachz/led.c
@@ -39,7 +39,7 @@ static void led_set_color(enum led_color color)
{
gpio_set_level(GPIO_EC_CHG_LED_Y_C1,
(color == LED_AMBER) ? BAT_LED_ON : BAT_LED_OFF);
- gpio_set_level(GPIO_EC_CHG_LED_B_C1,
+ gpio_set_level(GPIO_EC_CHG_LED_W_C1,
(color == LED_BLUE) ? BAT_LED_ON : BAT_LED_OFF);
}