summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2019-05-28 15:17:25 -0600
committerchrome-bot <chrome-bot@chromium.org>2019-05-30 16:57:44 -0700
commit6f37f1fe24ea647ee04a55a3195c34d9b0dcae79 (patch)
tree5cf312862237c75a1f2b3b1e57115720daa48b27
parent21de92a83ce6866115d1f217a9d53291040ddb51 (diff)
downloadchrome-ec-6f37f1fe24ea647ee04a55a3195c34d9b0dcae79.tar.gz
helios: Scrub GPIOS
Remove baseboard-specific GPIOs. Remove a few functions in board.c that won't exist due to only one pin supporting PP5000_A enable. BUG=b:133501368 BRANCH=none TEST=Compiles Change-Id: I18d3067c71f9fec2d9e68f339eb3f0f299ae2690 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1631306 Tested-by: Scott Collyer <scollyer@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>
-rw-r--r--board/helios/board.c43
-rw-r--r--board/helios/board.h4
-rw-r--r--board/helios/gpio.inc14
3 files changed, 5 insertions, 56 deletions
diff --git a/board/helios/board.c b/board/helios/board.c
index 13b2c6db6f..79c41d08db 100644
--- a/board/helios/board.c
+++ b/board/helios/board.c
@@ -85,11 +85,6 @@ static void tcpc_alert_event(enum gpio_signal signal)
schedule_deferred_pd_interrupt(port);
}
-static void hdmi_hpd_interrupt(enum gpio_signal signal)
-{
- baseboard_mst_enable_control(MST_HDMI, gpio_get_level(signal));
-}
-
static void bc12_interrupt(enum gpio_signal signal)
{
switch (signal) {
@@ -381,50 +376,12 @@ static void setup_fans(void)
thermal_params[TEMP_SENSOR_2] = thermal_a;
}
-/* Sets the gpio flags correct taking into account warm resets */
-static void reset_gpio_flags(enum gpio_signal signal, int flags)
-{
- /*
- * If the system was already on, we cannot set the value otherwise we
- * may change the value from the previous image which could cause a
- * brownout.
- */
- if (system_is_reboot_warm() || system_jumped_to_this_image())
- flags &= ~(GPIO_LOW | GPIO_HIGH);
-
- gpio_set_flags(signal, flags);
-}
-
-/* Runtime GPIO defaults */
-enum gpio_signal gpio_en_pp5000_a = GPIO_EN_PP5000_A_V1;
-
-static void board_gpio_set_pp5000(void)
-{
- uint32_t board_id = 0;
-
- /* Errors will count as board_id 0 */
- cbi_get_board_version(&board_id);
-
- if (board_id == 0) {
- reset_gpio_flags(GPIO_EN_PP5000_A_V0, GPIO_OUT_LOW);
- /* Change runtime default for V0 */
- gpio_en_pp5000_a = GPIO_EN_PP5000_A_V0;
- } else if (board_id >= 1) {
- reset_gpio_flags(GPIO_EN_PP5000_A_V1, GPIO_OUT_LOW);
- }
-
-}
-
static void board_init(void)
{
/* Initialize Fans */
setup_fans();
/* Enable gpio interrupt for base accelgyro sensor */
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
- /* Enable HDMI HPD interrupt. */
- gpio_enable_interrupt(GPIO_HDMI_CONN_HPD);
- /* Select correct gpio signal for PP5000_A control */
- board_gpio_set_pp5000();
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
diff --git a/board/helios/board.h b/board/helios/board.h
index 040e8cbc87..a7b98b9bb5 100644
--- a/board/helios/board.h
+++ b/board/helios/board.h
@@ -110,10 +110,6 @@
#include "gpio_signal.h"
#include "registers.h"
-/* GPIO signals updated base on board version. */
-#define GPIO_EN_PP5000_A gpio_en_pp5000_a
-extern enum gpio_signal gpio_en_pp5000_a;
-
enum adc_channel {
ADC_TEMP_SENSOR_1, /* ADC0 */
ADC_TEMP_SENSOR_2, /* ADC1 */
diff --git a/board/helios/gpio.inc b/board/helios/gpio.inc
index 63ac5a2271..f00cbacbc7 100644
--- a/board/helios/gpio.inc
+++ b/board/helios/gpio.inc
@@ -16,7 +16,7 @@ GPIO_INT(ACOK_OD, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, ex
/* Power sequencing interrupts */
GPIO_INT(SLP_S0_L, PIN(D, 5), GPIO_INT_BOTH, power_signal_interrupt)
-#ifndef CONFIG_HOSTCMD_ESPI_VW_SIGNALS
+#ifndef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS
GPIO_INT(SLP_S3_L, PIN(A, 5), GPIO_INT_BOTH, power_signal_interrupt)
GPIO_INT(SLP_S4_L, PIN(D, 4), GPIO_INT_BOTH, power_signal_interrupt)
#endif
@@ -35,8 +35,6 @@ GPIO_INT(USB_C1_TCPC_INT_ODL, PIN(F, 5), GPIO_INT_FALLING, tcpc_alert_event)
GPIO_INT(USB_C0_BC12_INT_ODL, PIN(9, 5), GPIO_INT_FALLING, bc12_interrupt)
GPIO_INT(USB_C1_BC12_INT_ODL, PIN(E, 4), GPIO_INT_FALLING, bc12_interrupt)
-GPIO_INT(HDMI_CONN_HPD, PIN(7, 2), GPIO_INT_BOTH, hdmi_hpd_interrupt)
-
/* Volume button interrupts */
GPIO_INT(EC_VOLDN_BTN_ODL, PIN(9, 3), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt)
GPIO_INT(EC_VOLUP_BTN_ODL, PIN(7, 5), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt)
@@ -47,8 +45,7 @@ GPIO(PCH_WAKE_L, PIN(7, 4), GPIO_ODR_HIGH) /* EC_PCH_WAKE_O
GPIO(PCH_PWRBTN_L, PIN(C, 1), GPIO_ODR_HIGH) /* EC_PCH_PWR_BTN_ODL */
/* Power Sequencing Signals */
-GPIO(EN_PP5000_A_V1, PIN(A, 4), GPIO_DEFAULT)
-GPIO(EN_PP5000_A_V0, PIN(7, 3), GPIO_DEFAULT)
+GPIO(EN_PP5000_A, PIN(A, 4), GPIO_OUT_LOW)
GPIO(EN_A_RAILS, PIN(A, 3), GPIO_OUT_LOW)
GPIO(EC_PCH_RSMRST_L, PIN(A, 6), GPIO_OUT_LOW)
GPIO(EC_PROCHOT_ODL, PIN(6, 3), GPIO_ODR_HIGH)
@@ -70,11 +67,11 @@ GPIO(EC_BATT_PRES_ODL, PIN(E, 1), GPIO_INPUT)
GPIO(LED_1_L, PIN(C, 4), GPIO_OUT_HIGH) /* Yellow (hatch) */
GPIO(LED_2_L, PIN(C, 3), GPIO_OUT_HIGH) /* White (hatch) */
GPIO(LED_3_L, PIN(C, 2), GPIO_OUT_HIGH)
-GPIO(LED_4_L, PIN(6, 0), GPIO_OUT_HIGH)
GPIO(EC_KB_BL_EN, PIN(8, 6), GPIO_OUT_LOW) /* Keyboard backlight */
GPIO(EN_PP5000_FAN, PIN(6, 1), GPIO_OUT_LOW)
-GPIO(EN_MST, PIN(9, 6), GPIO_OUT_LOW)
+/* TODO (b/133788856): this is a NC on Helios, but Hatch baseboard depends on this signal */
+GPIO(EN_MST, PIN(9, 6), GPIO_INPUT | GPIO_PULL_DOWN)
/* I2C pins - Alternate function below configures I2C module on these pins */
GPIO(I2C0_SCL, PIN(B, 5), GPIO_INPUT |
@@ -99,8 +96,7 @@ ALTERNATE(PIN_MASK(3, 0x03), 0, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT) /* KS
ALTERNATE(PIN_MASK(2, 0xFC), 0, MODULE_KEYBOARD_SCAN, GPIO_KB_INPUT) /* KSI_02-07 */
ALTERNATE(PIN_MASK(2, 0x03), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_00-01 */
ALTERNATE(PIN_MASK(1, 0x7F), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_03-09 */
-ALTERNATE(PIN_MASK(0, 0xF0), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_10-13 */
-ALTERNATE(PIN_MASK(8, 0x04), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_14 */
+ALTERNATE(PIN_MASK(0, 0xE0), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_10-12 */
/* Alternate functions GPIO definitions */
ALTERNATE(PIN_MASK(B, 0x30), 0, MODULE_I2C, (GPIO_INPUT | GPIO_SEL_1P8V)) /* I2C0 1.8V */