summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2021-06-28 11:57:51 -0700
committerCommit Bot <commit-bot@chromium.org>2021-07-14 18:13:03 +0000
commit735a1ac3848adcbbdda0cb1c912f858462ecc03f (patch)
tree3593413d367dc2f8f1a5bb7f610264b02dcf12d9
parent5e90b637a30bf2d8555e56b5d7aae7fa8894d658 (diff)
downloadchrome-ec-735a1ac3848adcbbdda0cb1c912f858462ecc03f.tar.gz
herobrine_npcx9: Update GPIOs
Update the GPIOs to match the schematic. Also update the hibnerate wake sources. BRANCH=None BUG=b:192253134, b:193583152 TEST=Built the herobrine_npcx9 image successfully. Change-Id: I4ed20de0f242f6c1f5fbddef6a59526482b970d1 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2993217 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--board/herobrine_npcx9/board.c2
-rw-r--r--board/herobrine_npcx9/board.h7
-rw-r--r--board/herobrine_npcx9/gpio.inc122
3 files changed, 61 insertions, 70 deletions
diff --git a/board/herobrine_npcx9/board.c b/board/herobrine_npcx9/board.c
index 2ad97b43a5..ade3bfa88a 100644
--- a/board/herobrine_npcx9/board.c
+++ b/board/herobrine_npcx9/board.c
@@ -36,7 +36,7 @@ const enum gpio_signal hibernate_wake_pins[] = {
GPIO_LID_OPEN,
GPIO_AC_PRESENT,
GPIO_POWER_BUTTON_L,
- GPIO_EC_RST_ODL,
+ GPIO_RTC_EC_WAKE_ODL,
};
const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
diff --git a/board/herobrine_npcx9/board.h b/board/herobrine_npcx9/board.h
index 1bd29352a7..0c7d7278db 100644
--- a/board/herobrine_npcx9/board.h
+++ b/board/herobrine_npcx9/board.h
@@ -65,9 +65,12 @@
/* GPIO alias */
#define GPIO_AC_PRESENT GPIO_ACOK_OD
#define GPIO_WP_L GPIO_EC_WP_ODL
-#define GPIO_SWITCHCAP_PG GPIO_SWITCHCAP_GPIO_1
+#define GPIO_SWITCHCAP_PG GPIO_SRC_VPH_PWR_PG
#define GPIO_ACOK_OD GPIO_CHG_ACOK_OD
-#define GPIO_EN_PP5000 GPIO_EN_PP5000_A
+#define GPIO_EN_PP5000 GPIO_EN_PP5000_S3
+#define GPIO_POWER_GOOD GPIO_MB_POWER_GOOD
+#define GPIO_EC_INT_L GPIO_AP_EC_INT_L
+#define GPIO_DP_HOT_PLUG_DET GPIO_DP_HOT_PLUG_DET_R
#ifndef __ASSEMBLER__
diff --git a/board/herobrine_npcx9/gpio.inc b/board/herobrine_npcx9/gpio.inc
index fcc863c77b..5c13269be3 100644
--- a/board/herobrine_npcx9/gpio.inc
+++ b/board/herobrine_npcx9/gpio.inc
@@ -15,69 +15,63 @@ GPIO_INT(USB_C0_SWCTL_INT_ODL, PIN(0, 3), GPIO_INT_FALLING, ppc_interrupt) /* I
GPIO_INT(USB_C1_SWCTL_INT_ODL, PIN(4, 0), GPIO_INT_FALLING, ppc_interrupt) /* Interrupt from port-1 PPC */
GPIO_INT(USB_C0_BC12_INT_L, PIN(6, 1), GPIO_INT_FALLING | GPIO_PULL_UP, usb0_evt) /* Interrupt from port-0 BC1.2 */
GPIO_INT(USB_C1_BC12_INT_L, PIN(8, 2), GPIO_INT_FALLING | GPIO_PULL_UP, usb1_evt) /* Interrupt from port-1 BC1.2 */
-GPIO_INT(USB_A0_OC_ODL, PIN(D, 1), GPIO_INT_BOTH | GPIO_PULL_UP, usba_oc_interrupt)
+GPIO_INT(USB_A0_OC_ODL, PIN(F, 4), GPIO_INT_BOTH | GPIO_PULL_UP, usba_oc_interrupt)
/* System interrupts */
-GPIO_INT(CHG_ACOK_OD, PIN(0, 0), GPIO_INT_BOTH, extpower_interrupt) /* ACOK */
-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(LID_OPEN_EC, PIN(D, 2), GPIO_INT_BOTH, 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, power_signal_interrupt) /* Indicate when AP triggers reset/shutdown */
+GPIO_INT(CHG_ACOK_OD, PIN(D, 2), GPIO_INT_BOTH, extpower_interrupt) /* ACOK */
+GPIO_INT(EC_PWR_BTN_ODL, PIN(0, 0), GPIO_INT_BOTH, power_button_interrupt) /* Power button */
+GPIO_INT(EC_VOLDN_BTN_ODL, PIN(6, 2), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) /* Volume Up button */
+GPIO_INT(EC_VOLUP_BTN_ODL, PIN(C, 2), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) /* Volume Down button */
+GPIO_INT(EC_WP_ODL, PIN(D, 3), GPIO_INT_BOTH, switch_interrupt) /* Write protection */
+GPIO_INT(LID_OPEN_EC, PIN(0, 1), GPIO_INT_BOTH, lid_interrupt) /* Lid open */
+GPIO_INT(AP_RST_L, PIN(5, 1), GPIO_INT_BOTH | GPIO_SEL_1P8V, chipset_ap_rst_interrupt) /* PMIC to signal AP reset */
+GPIO_INT(PS_HOLD, PIN(A, 6), GPIO_INT_BOTH | GPIO_PULL_DOWN, power_signal_interrupt) /* Indicate when AP triggers reset/shutdown */
GPIO_INT(AP_SUSPEND, PIN(5, 7), GPIO_INT_BOTH, power_signal_interrupt) /* Suspend signal from PMIC */
-GPIO_INT(DEPRECATED_AP_RST_REQ, PIN(C, 2), GPIO_INT_BOTH | GPIO_PULL_DOWN | GPIO_SEL_1P8V, power_signal_interrupt) /* Deprecated AP initiated reset indicator */
/*
* When switch-cap is off, the POWER_GOOD signal is floating. Need a pull-down
* to make it low. Overload the interrupt function chipset_warm_reset_interrupt
* for not only signalling power_signal_interrupt but also handling the logic
* of WARM_RESET_L which is pulled-up by the same rail of POWER_GOOD.
*/
-GPIO_INT(POWER_GOOD, PIN(5, 4), GPIO_INT_BOTH | GPIO_PULL_DOWN, chipset_power_good_interrupt) /* SRC_PP1800_S10A from PMIC */
-GPIO_INT(WARM_RESET_L, PIN(F, 4), GPIO_INT_BOTH | GPIO_SEL_1P8V, chipset_warm_reset_interrupt) /* AP warm reset */
+GPIO_INT(MB_POWER_GOOD, PIN(3, 7), GPIO_INT_BOTH | GPIO_PULL_DOWN, chipset_power_good_interrupt) /* PP1800_L18B from PMIC */
+GPIO_INT(WARM_RESET_L, PIN(B, 0), GPIO_INT_BOTH | GPIO_SEL_1P8V, chipset_warm_reset_interrupt) /* AP warm reset */
GPIO_INT(AP_EC_SPI_CS_L, PIN(5, 3), GPIO_INT_FALLING | GPIO_PULL_DOWN, shi_cs_event) /* EC SPI Chip Select */
/* Sensor interrupts */
GPIO_INT(TABLET_MODE_L, PIN(C, 6), GPIO_INT_BOTH, gmr_tablet_switch_isr)
-GPIO_INT(ACCEL_GYRO_INT_L, PIN(A, 0), GPIO_INT_FALLING, bmi160_interrupt) /* Accelerometer/gyro interrupt */
+GPIO_INT(ACCEL_GYRO_INT_L, PIN(A, 3), GPIO_INT_FALLING, bmi160_interrupt) /* Accelerometer/gyro interrupt */
-/*
- * EC_RST_ODL used to be a wake source from PSL mode. However, we disabled
- * the PSL mode. This GPIO does nothing now. Simply set it an INPUT.
- */
-GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INPUT) /* EC reset */
-GPIO(EC_ENTERING_RW, PIN(E, 1), GPIO_OUT_LOW) /* Indicate when EC is entering RW code */
-GPIO(CCD_MODE_ODL, PIN(E, 3), GPIO_INPUT) /* Case Closed Debug Mode */
+GPIO(RTC_EC_WAKE_ODL , PIN(0, 2), GPIO_INPUT) /* RTC interrupt */
+GPIO(EC_ENTERING_RW, PIN(7, 2), GPIO_OUT_LOW) /* Indicate when EC is entering RW code */
+GPIO(CCD_MODE_ODL, PIN(6, 3), GPIO_INPUT) /* Case Closed Debug Mode */
GPIO(EC_BATT_PRES_ODL, PIN(E, 5), GPIO_INPUT) /* Battery Present */
+GPIO(EC_GSC_PACKET_MODE, PIN(8, 3), GPIO_OUT_LOW) /* GSC Packet Mode */
/* PMIC/AP 1.8V */
-GPIO(PMIC_RESIN_L, PIN(3, 2), GPIO_ODR_HIGH) /* PMIC reset trigger */
-GPIO(PMIC_KPD_PWR_ODL, PIN(D, 6), GPIO_ODR_HIGH) /* PMIC power button */
-GPIO(EC_INT_L, PIN(A, 2), GPIO_ODR_HIGH) /* Interrupt line between AP and EC */
+GPIO(PMIC_RESIN_L, PIN(A, 0), GPIO_ODR_HIGH) /* PMIC reset trigger */
+GPIO(PMIC_KPD_PWR_ODL, PIN(A, 2), GPIO_ODR_HIGH) /* PMIC power button */
+GPIO(AP_EC_INT_L, PIN(5, 6), GPIO_ODR_HIGH) /* Interrupt line between AP and EC */
/* Power enables */
-GPIO(HIBERNATE_L, PIN(5, 2), GPIO_ODR_HIGH) /* EC hibernate */
GPIO(SWITCHCAP_ON, PIN(D, 5), GPIO_OUT_LOW) /* Enable switch cap */
-GPIO(EN_PP3300_A, PIN(A, 6), GPIO_OUT_LOW) /* Enable PP3300 */
-GPIO(EN_PP5000_A, PIN(6, 7), GPIO_OUT_LOW) /* Enable PP5000 */
+GPIO(EN_PP5000_S3, PIN(7, 3), GPIO_OUT_LOW) /* Enable PP5000 */
GPIO(EC_BL_DISABLE_L, PIN(B, 6), GPIO_OUT_LOW) /* Backlight disable signal from EC */
/* Sensors */
-GPIO(LID_ACCEL_INT_L, PIN(5, 6), GPIO_INPUT) /* Lid accel sensor interrupt */
+GPIO(LID_ACCEL_INT_L, PIN(A, 1), GPIO_INPUT) /* Lid accel sensor interrupt */
/* Control the gate for trackpad IRQ. High closes the gate.
* This is always set low so that the OS can manage the trackpad. */
-GPIO(TRACKPAD_INT_GATE, PIN(7, 4), GPIO_OUT_LOW)
+GPIO(TP_INT_GATE, PIN(7, 4), GPIO_OUT_LOW)
/* USB-C */
GPIO(USB_C0_PD_RST_L, PIN(F, 1), GPIO_OUT_HIGH) /* Port-0 TCPC chip reset */
GPIO(USB_C1_PD_RST_L, PIN(E, 4), GPIO_OUT_HIGH) /* Port-1 TCPC chip reset */
-GPIO(DP_MUX_OE_L, PIN(9, 6), GPIO_ODR_HIGH) /* DP mux enable, actually Open-Drain */
+GPIO(DP_MUX_OE_L, PIN(B, 1), GPIO_ODR_HIGH) /* DP mux enable, actually Open-Drain */
GPIO(DP_MUX_SEL, PIN(4, 5), GPIO_OUT_LOW) /* DP mux selection: L:C0, H:C1 */
-GPIO(DP_HOT_PLUG_DET, PIN(9, 5), GPIO_OUT_LOW) /* DP HPD to AP */
+GPIO(DP_HOT_PLUG_DET_R, PIN(9, 5), GPIO_OUT_LOW) /* DP HPD to AP */
/* USB-A */
-GPIO(EN_USB_A_5V, PIN(8, 6), GPIO_OUT_LOW)
+GPIO(EN_USB_A_5V, PIN(F, 0), GPIO_OUT_LOW)
GPIO(USB_A_CDP_ILIM_EN_L, PIN(7, 5), GPIO_OUT_HIGH) /* H:CDP, L:SDP. Only one USB-A port, always CDP */
/* LEDs */
@@ -95,15 +89,6 @@ GPIO(AP_EC_SPI_MOSI, PIN(4, 6), GPIO_INPUT | GPIO_PULL_DOWN)
GPIO(AP_EC_SPI_MISO, PIN(4, 7), GPIO_INPUT | GPIO_PULL_DOWN)
GPIO(AP_EC_SPI_CLK, PIN(5, 5), GPIO_INPUT | GPIO_PULL_DOWN)
-/* PWM */
-GPIO(KB_BL_PWM, PIN(8, 0), GPIO_INPUT) /* PWM3 */
-GPIO(EDP_BKLTCTL, PIN(B, 7), GPIO_INPUT) /* PWM5 */
-
-/* ADC */
-GPIO(PPVAR_BOOSTIN_SENSE, PIN(4, 4), GPIO_INPUT) /* ADC1 */
-GPIO(CHARGER_IADP, PIN(4, 3), GPIO_INPUT) /* ADC2 */
-GPIO(CHARGER_PMON, PIN(4, 2), GPIO_INPUT) /* ADC3 */
-
/* I2C */
GPIO(EC_I2C_POWER_SCL, PIN(B, 5), GPIO_INPUT)
GPIO(EC_I2C_POWER_SDA, PIN(B, 4), GPIO_INPUT)
@@ -111,60 +96,63 @@ GPIO(EC_I2C_USB_C0_PD_SCL, PIN(9, 0), GPIO_INPUT)
GPIO(EC_I2C_USB_C0_PD_SDA, PIN(8, 7), GPIO_INPUT)
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_RTC_SCL, PIN(F, 3), GPIO_INPUT)
+GPIO(EC_I2C_RTC_SDA, PIN(F, 2), 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_SENSOR_SCL, PIN(B, 3), GPIO_INPUT | GPIO_SEL_1P8V)
GPIO(EC_I2C_SENSOR_SDA, PIN(B, 2), GPIO_INPUT | GPIO_SEL_1P8V)
/* Board/SKU IDs */
-GPIO(BRD_ID0, PIN(C, 7), GPIO_INPUT)
-GPIO(BRD_ID1, PIN(9, 3), GPIO_INPUT)
-GPIO(BRD_ID2, PIN(6, 3), GPIO_INPUT)
-GPIO(SKU_ID0, PIN(F, 0), GPIO_INPUT)
-GPIO(SKU_ID1, PIN(4, 1), GPIO_INPUT)
-GPIO(SKU_ID2, PIN(D, 4), GPIO_INPUT)
+GPIO(BRD_ID0, PIN(9, 4), GPIO_INPUT)
+GPIO(BRD_ID1, PIN(9, 7), GPIO_INPUT)
+GPIO(BRD_ID2, PIN(A, 5), GPIO_INPUT)
+GPIO(SKU_ID0, PIN(6, 7), GPIO_INPUT)
+GPIO(SKU_ID1, PIN(7, 0), GPIO_INPUT)
+GPIO(SKU_ID2, PIN(E, 1), GPIO_INPUT)
/* Switchcap */
/*
* GPIO0 is configured as PVC_PG. When the chip in power down mode, it outputs
* high-Z. Set pull-down to avoid floating.
*/
-GPIO(SWITCHCAP_GPIO_1, PIN(E, 2), GPIO_INPUT | GPIO_PULL_DOWN) /* Switchcap GPIO0 */
+GPIO(SRC_VPH_PWR_PG, PIN(E, 2), GPIO_INPUT | GPIO_PULL_DOWN) /* Switchcap GPIO0 */
/* Special straps */
GPIO(ARM_X86, PIN(6, 6), GPIO_OUT_LOW) /* NC, low for power saving */
/* Unused GPIOs, NC. */
-UNUSED(PIN(5, 1))
-UNUSED(PIN(D, 0))
-UNUSED(PIN(F, 3))
-UNUSED(PIN(9, 4))
-UNUSED(PIN(9, 7))
-UNUSED(PIN(A, 7))
-UNUSED(PIN(B, 0))
-UNUSED(PIN(A, 5))
-UNUSED(PIN(3, 5))
-UNUSED(PIN(7, 2))
-UNUSED(PIN(8, 1))
-UNUSED(PIN(3, 7))
+UNUSED(PIN(5, 2))
+UNUSED(PIN(5, 4))
UNUSED(PIN(7, 6))
-UNUSED(PIN(3, 4))
UNUSED(PIN(C, 5))
-UNUSED(PIN(7, 3))
-UNUSED(PIN(D, 7))
-UNUSED(PIN(A, 3))
-UNUSED(PIN(6, 2))
+UNUSED(PIN(D, 1))
+UNUSED(PIN(D, 0))
+UNUSED(PIN(E, 3))
+UNUSED(PIN(C, 1))
UNUSED(PIN(0, 4))
-UNUSED(PIN(8, 3))
-UNUSED(PIN(B, 1))
+UNUSED(PIN(D, 6))
+UNUSED(PIN(3, 2))
+UNUSED(PIN(3, 5))
+UNUSED(PIN(D, 7))
+UNUSED(PIN(8, 6))
+UNUSED(PIN(D, 4))
+UNUSED(PIN(4, 1))
+UNUSED(PIN(3, 4))
+UNUSED(PIN(C, 7))
+UNUSED(PIN(A, 4))
+UNUSED(PIN(9, 6))
+UNUSED(PIN(9, 3))
+UNUSED(PIN(A, 7))
UNUSED(PIN(5, 0))
-UNUSED(PIN(D, 3))
+UNUSED(PIN(8, 1))
/* Alternate functions GPIO definitions */
ALTERNATE(PIN_MASK(6, 0x30), 0, MODULE_UART, 0) /* UART (GPIO64/65) */
ALTERNATE(PIN_MASK(B, 0x30), 1, MODULE_I2C, 0) /* I2C0 (GPIOB4/B5) */
ALTERNATE(PIN_MASK(9, 0x07), 1, MODULE_I2C, 0) /* I2C1 SDA (GPIO90), I2C2 (GPIO91/92) */
ALTERNATE(PIN_MASK(8, 0x80), 1, MODULE_I2C, 0) /* I2C1 SCL (GPIO87) */
+ALTERNATE(PIN_MASK(F, 0x0C), 1, MODULE_I2C, 0) /* I2C4 (GPIOF2/F3) */
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(4, 0x1C), 0, MODULE_ADC, 0) /* ADC1 (GPIO44), ADC2 (GPIO43), ADC3 (GPIO42) */