summaryrefslogtreecommitdiff
path: root/board/grunt
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2018-08-01 18:29:40 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-08-02 17:58:49 -0700
commit1a0e7d1371ea2aea694e6ffc91c08dd94927bdd3 (patch)
tree211d8d63dbac24d1a2bd9d87656ef9c01acbc945 /board/grunt
parent3209c682a8c40fc2e628879936ba565e81ba0f2a (diff)
downloadchrome-ec-1a0e7d1371ea2aea694e6ffc91c08dd94927bdd3.tar.gz
grunt: Remove support for board version 0
We no longer need to support both version 0 and 2. BUG=b:74538637 BRANCH=none TEST=build Change-Id: I37eb7adfd2e9e1f50cb30f489c593bfd00b220d9 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1159722 Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org>
Diffstat (limited to 'board/grunt')
-rw-r--r--board/grunt/board.c44
-rw-r--r--board/grunt/gpio.inc10
2 files changed, 12 insertions, 42 deletions
diff --git a/board/grunt/board.c b/board/grunt/board.c
index 4794a8b952..a3d6154bde 100644
--- a/board/grunt/board.c
+++ b/board/grunt/board.c
@@ -50,17 +50,10 @@
#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
-/*
- * These GPIOs change pins depending on board version. They are configured
- * in board_init.
- */
-static enum gpio_signal gpio_usb_c1_oc_l = GPIO_USB_C1_OC_L_V2;
-static enum gpio_signal gpio_usb_c0_pd_rst_l = GPIO_USB_C0_PD_RST_L_V2;
-
static void tcpc_alert_event(enum gpio_signal signal)
{
if ((signal == GPIO_USB_C0_PD_INT_ODL) &&
- !gpio_get_level(gpio_usb_c0_pd_rst_l))
+ !gpio_get_level(GPIO_USB_C0_PD_RST_L))
return;
if ((signal == GPIO_USB_C1_PD_INT_ODL) &&
@@ -77,7 +70,7 @@ static void tcpc_alert_event(enum gpio_signal signal)
static void anx74xx_cable_det_handler(void)
{
int cable_det = gpio_get_level(GPIO_USB_C0_CABLE_DET);
- int reset_n = gpio_get_level(gpio_usb_c0_pd_rst_l);
+ int reset_n = gpio_get_level(GPIO_USB_C0_PD_RST_L);
/*
* A cable_det low->high transition was detected. If following the
@@ -144,24 +137,6 @@ BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
static void board_init(void)
{
- if (system_get_board_version() < 2) {
- /*
- * These GPIOs change pins depending on board version. Change
- * them here from the V2 pin to the V0 pin.
- */
- gpio_usb_c1_oc_l = GPIO_USB_C1_OC_L_V0;
- gpio_usb_c0_pd_rst_l = GPIO_USB_C0_PD_RST_L_V0;
- } else {
- /* Alternate functions for board version 2 only. */
- gpio_set_alternate_function(GPIO_F, 0x02, 1); /* ADC8 */
- gpio_set_alternate_function(GPIO_0, 0x10, 0); /* KSO_13 */
- gpio_set_alternate_function(GPIO_8, 0x04, 0); /* KSO_14 */
- }
-
- /* Now that we know which pin to use, set the correct output mode. */
- gpio_set_flags(gpio_usb_c1_oc_l, GPIO_OUT_HIGH);
- gpio_set_flags(gpio_usb_c0_pd_rst_l, GPIO_OUT_HIGH);
-
/* Enable Gyro interrupts */
gpio_enable_interrupt(GPIO_6AXIS_INT_L);
}
@@ -170,7 +145,7 @@ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
void board_overcurrent_event(int port)
{
enum gpio_signal signal = (port == 0) ? GPIO_USB_C0_OC_L
- : gpio_usb_c1_oc_l;
+ : GPIO_USB_C1_OC_L;
gpio_set_level(signal, 0);
@@ -187,10 +162,7 @@ void board_tcpc_init(void)
/* Enable PPC interrupts. */
gpio_enable_interrupt(GPIO_USB_C0_SWCTL_INT_ODL);
- if (system_get_board_version() < 2)
- gpio_enable_interrupt(GPIO_USB_C1_SWCTL_INT_ODL_V0);
- else
- gpio_enable_interrupt(GPIO_USB_C1_SWCTL_INT_ODL_V2);
+ gpio_enable_interrupt(GPIO_USB_C1_SWCTL_INT_ODL);
/* Enable TCPC interrupts. */
gpio_enable_interrupt(GPIO_USB_C0_PD_INT_ODL);
@@ -217,7 +189,7 @@ uint16_t tcpc_get_alert_status(void)
uint16_t status = 0;
if (!gpio_get_level(GPIO_USB_C0_PD_INT_ODL)) {
- if (gpio_get_level(gpio_usb_c0_pd_rst_l))
+ if (gpio_get_level(GPIO_USB_C0_PD_RST_L))
status |= PD_STATUS_TCPC_ALERT_0;
}
@@ -245,10 +217,10 @@ void board_set_tcpc_power_mode(int port, int mode)
case ANX74XX_NORMAL_MODE:
gpio_set_level(GPIO_EN_USB_C0_TCPC_PWR, 1);
msleep(ANX74XX_PWR_H_RST_H_DELAY_MS);
- gpio_set_level(gpio_usb_c0_pd_rst_l, 1);
+ gpio_set_level(GPIO_USB_C0_PD_RST_L, 1);
break;
case ANX74XX_STANDBY_MODE:
- gpio_set_level(gpio_usb_c0_pd_rst_l, 0);
+ gpio_set_level(GPIO_USB_C0_PD_RST_L, 0);
msleep(ANX74XX_RST_L_PWR_L_DELAY_MS);
gpio_set_level(GPIO_EN_USB_C0_TCPC_PWR, 0);
msleep(ANX74XX_PWR_L_PWR_H_DELAY_MS);
@@ -264,7 +236,7 @@ void board_reset_pd_mcu(void)
gpio_set_level(GPIO_USB_C1_PD_RST_L, 0);
/* Assert reset to TCPC0 (anx3429) */
- gpio_set_level(gpio_usb_c0_pd_rst_l, 0);
+ gpio_set_level(GPIO_USB_C0_PD_RST_L, 0);
/* TCPC1 (ps8751) requires 1ms reset down assertion */
msleep(MAX(1, ANX74XX_RST_L_PWR_L_DELAY_MS));
diff --git a/board/grunt/gpio.inc b/board/grunt/gpio.inc
index b38f8f4783..fc3cf253f2 100644
--- a/board/grunt/gpio.inc
+++ b/board/grunt/gpio.inc
@@ -11,8 +11,7 @@
GPIO_INT(USB_C0_PD_INT_ODL, PIN(A, 0), GPIO_INT_FALLING, tcpc_alert_event)
GPIO_INT(USB_C1_PD_INT_ODL, PIN(F, 5), GPIO_INT_FALLING, tcpc_alert_event)
GPIO_INT(USB_C0_SWCTL_INT_ODL, PIN(0, 3), GPIO_INT_FALLING, ppc_interrupt)
-GPIO_INT(USB_C1_SWCTL_INT_ODL_V0, PIN(0, 4), GPIO_INT_FALLING, ppc_interrupt)
-GPIO_INT(USB_C1_SWCTL_INT_ODL_V2, PIN(D, 4), GPIO_INT_FALLING, ppc_interrupt)
+GPIO_INT(USB_C1_SWCTL_INT_ODL, PIN(D, 4), GPIO_INT_FALLING, ppc_interrupt)
GPIO_INT(PCH_SLP_S3_L, PIN(A, 6), GPIO_INT_BOTH, power_signal_interrupt)
GPIO_INT(PCH_SLP_S5_L, PIN(A, 3), GPIO_INT_BOTH, power_signal_interrupt)
GPIO_INT(S0_PGOOD, PIN(F, 4), GPIO_INT_BOTH, power_signal_interrupt)
@@ -73,10 +72,8 @@ GPIO(EN_USB_A0_5V, PIN(6, 1), GPIO_OUT_LOW) /* Enable A0 5V Charging */
GPIO(EN_USB_A1_5V, PIN(C, 0), GPIO_OUT_LOW) /* Enable A1 5V Charging */
GPIO(EN_USB_C0_TCPC_PWR, PIN(6, 0), GPIO_OUT_LOW) /* Enable C0 TCPC Power */
GPIO(USB_C0_OC_L, PIN(7, 3), GPIO_OUT_HIGH) /* C0 Over Current */
-GPIO(USB_C1_OC_L_V0, PIN(D, 7), GPIO_INPUT) /* C1 Over Current */
-GPIO(USB_C1_OC_L_V2, PIN(7, 2), GPIO_INPUT) /* C1 Over Current */
-GPIO(USB_C0_PD_RST_L_V0, PIN(F, 1), GPIO_INPUT) /* C0 PD Reset */
-GPIO(USB_C0_PD_RST_L_V2, PIN(3, 2), GPIO_INPUT) /* C0 PD Reset */
+GPIO(USB_C1_OC_L, PIN(7, 2), GPIO_OUT_HIGH) /* C1 Over Current */
+GPIO(USB_C0_PD_RST_L, PIN(3, 2), GPIO_OUT_HIGH) /* C0 PD Reset */
GPIO(USB_C1_PD_RST_L, PIN(D, 5), GPIO_OUT_HIGH) /* C1 PD Reset */
GPIO(USB_C0_BC12_VBUS_ON_L, PIN(4, 0), GPIO_ODR_HIGH) /* C0 BC1.2 Power */
GPIO(USB_C1_BC12_VBUS_ON_L, PIN(B, 1), GPIO_ODR_HIGH | GPIO_PULL_UP) /* C1 BC1.2 Power */
@@ -103,6 +100,7 @@ ALTERNATE(PIN_MASK(3, 0x48), 0, MODULE_I2C, 0) /* I2C5 */
ALTERNATE(PIN_MASK(B, 0x0C), 0, MODULE_I2C, 0) /* I2C7 */
ALTERNATE(PIN_MASK(4, 0x30), 0, MODULE_ADC, 0) /* ADC0-1 */
ALTERNATE(PIN_MASK(4, 0x02), 0, MODULE_ADC, 0) /* ADC4 */
+ALTERNATE(PIN_MASK(F, 0x02), 0, MODULE_ADC, 0) /* ADC8 */
ALTERNATE(PIN_MASK(F, 0x01), 0, MODULE_ADC, 0) /* ADC9 */
ALTERNATE(PIN_MASK(B, 0x80), 0, MODULE_PWM, 0) /* KB Backlight */
ALTERNATE(PIN_MASK(C, 0x18), 0, MODULE_PWM, 0) /* LED 1 & 2 */