summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2021-10-15 19:15:06 +0800
committerCommit Bot <commit-bot@chromium.org>2021-11-16 11:59:29 +0000
commit71569c14d2c09c75ccb50d4e4a6d5c97dc0442c1 (patch)
treed57d9ae65db14dbb04dec119e6fec699dce290a8
parent75881956cbfaa57da05ceb57ed41742b9ab99b84 (diff)
downloadchrome-ec-71569c14d2c09c75ccb50d4e4a6d5c97dc0442c1.tar.gz
vell: Remove board ID 1 support
Vell is now p2 schematic. Remove unused board ID configuration. BUG=b:205908918 BRANCH=none TEST=make BOARD=vell Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I9c263e8af5ef8f4932328d7dd48f2babd811c8bb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3276016 Reviewed-by: caveh jalali <caveh@chromium.org>
-rw-r--r--board/vell/battery.c11
-rw-r--r--board/vell/board.c55
-rw-r--r--board/vell/board.h2
-rw-r--r--board/vell/gpio.inc34
-rw-r--r--board/vell/usbc_config.c51
5 files changed, 14 insertions, 139 deletions
diff --git a/board/vell/battery.c b/board/vell/battery.c
index 91faab57a3..1f0239a013 100644
--- a/board/vell/battery.c
+++ b/board/vell/battery.c
@@ -11,7 +11,7 @@
#include "compile_time_macros.h"
#include "gpio.h"
/*
- * Battery info for all Brya battery types. Note that the fields
+ * Battery info for all Vell battery types. Note that the fields
* start_charging_min/max and charging_min/max are not used for the charger.
* The effective temperature limits are given by discharging_min/max_c.
*
@@ -100,13 +100,6 @@ const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_POWER_TECH;
enum battery_present battery_hw_present(void)
{
- enum gpio_signal batt_pres;
-
- if (get_board_id() == 1)
- batt_pres = GPIO_ID_1_EC_BATT_PRES_ODL;
- else
- batt_pres = GPIO_EC_BATT_PRES_ODL;
-
/* The GPIO is low when the battery is physically present */
- return gpio_get_level(batt_pres) ? BP_NO : BP_YES;
+ return gpio_get_level(GPIO_EC_BATT_PRES_ODL) ? BP_NO : BP_YES;
}
diff --git a/board/vell/board.c b/board/vell/board.c
index 6776cc3f7f..fd31401495 100644
--- a/board/vell/board.c
+++ b/board/vell/board.c
@@ -43,10 +43,7 @@ static void board_chipset_resume(void)
{
/* Allow keyboard backlight to be enabled */
- if (get_board_id() == 1)
- gpio_set_level(GPIO_ID_1_EC_KB_BL_EN, 1);
- else
- gpio_set_level(GPIO_EC_KB_BL_EN_L, 0);
+ gpio_set_level(GPIO_EC_KB_BL_EN_L, 0);
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
@@ -55,54 +52,6 @@ static void board_chipset_suspend(void)
{
/* Turn off the keyboard backlight if it's on. */
- if (get_board_id() == 1)
- gpio_set_level(GPIO_ID_1_EC_KB_BL_EN, 0);
- else
- gpio_set_level(GPIO_EC_KB_BL_EN_L, 1);
+ gpio_set_level(GPIO_EC_KB_BL_EN_L, 1);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
-
-/*
- * Explicitly apply the board ID 1 *gpio.inc settings to pins that
- * were reassigned on current boards.
- */
-
-static void set_board_id_1_gpios(void)
-{
- if (get_board_id() != 1)
- return;
-
- gpio_set_flags(GPIO_ID_1_EC_KB_BL_EN, GPIO_OUT_LOW);
-}
-DECLARE_HOOK(HOOK_INIT, set_board_id_1_gpios, HOOK_PRIO_FIRST);
-
-/*
- * Reclaim GPIO pins on board ID 1 that are used as ADC inputs on
- * current boards. ALT function group MODULE_ADC pins are set in
- * HOOK_PRIO_INIT_ADC and can be reclaimed right after the hook runs.
- */
-
-static void board_id_1_reclaim_adc(void)
-{
- if (get_board_id() != 1)
- return;
-
- /*
- * GPIO_ID_1_USB_C0_C2_TCPC_RST_ODL is on GPIO34
- *
- * The TCPC has already been reset by board_tcpc_init() executed
- * from HOOK_PRIO_INIT_CHIPSET. Later, the pin gets set to ADC6
- * in HOOK_PRIO_INIT_ADC, so we simply need to set the pin back
- * to GPIO34.
- */
- gpio_set_flags(GPIO_ID_1_USB_C0_C2_TCPC_RST_ODL, GPIO_ODR_HIGH);
- gpio_set_alternate_function(GPIO_PORT_3, BIT(4), GPIO_ALT_FUNC_NONE);
-
- /*
- * The pin gets set to ADC7 in HOOK_PRIO_INIT_ADC, so we simply
- * need to set it back to GPIOE1.
- */
- gpio_set_flags(GPIO_ID_1_EC_BATT_PRES_ODL, GPIO_INPUT);
- gpio_set_alternate_function(GPIO_PORT_E, BIT(1), GPIO_ALT_FUNC_NONE);
-}
-DECLARE_HOOK(HOOK_INIT, board_id_1_reclaim_adc, HOOK_PRIO_INIT_ADC + 1);
diff --git a/board/vell/board.h b/board/vell/board.h
index c1bac89500..6b99df2569 100644
--- a/board/vell/board.h
+++ b/board/vell/board.h
@@ -146,8 +146,6 @@
#define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL
#define GPIO_WP_L GPIO_EC_WP_ODL
-#define GPIO_ID_1_EC_KB_BL_EN GPIO_EC_BATT_PRES_ODL
-
/* System has back-lit keyboard */
#define CONFIG_PWM_KBLIGHT
diff --git a/board/vell/gpio.inc b/board/vell/gpio.inc
index e8751a5f06..27f57f392a 100644
--- a/board/vell/gpio.inc
+++ b/board/vell/gpio.inc
@@ -135,39 +135,7 @@ UNUSED(PIN(6, 6)) /* GPIO66 */
*/
GPIO(EC_KSO_02_INV, PIN(1, 7), GPIO_OUT_LOW)
-/*
- * GPIOE1 is an ALT function ADC INPUT on board ID 2 and a GPIO INPUT on
- * board ID 1. This declaration gives us a signal name to use on board
- * ID 1.
- */
-GPIO(ID_1_EC_BATT_PRES_ODL, PIN(E, 1), GPIO_INPUT)
-
-/*
- * GPIO34 is an INPUT on board ID 2 and ODR_LOW on board ID 1.
- *
- * Since this pin is pulled up to 3.3V through a 30.9K ohm resistor on
- * board ID 2, we will leak about 0.3mW until the pin is put in ALT mode
- * when MODULE_ADC configuration runs. Initializing the pin to ODR_LOW
- * gives us full control on both boards.
- */
-GPIO(ID_1_USB_C0_C2_TCPC_RST_ODL, PIN(3, 4), GPIO_ODR_LOW)
-
-/* Board ID 1 IO expander configuration */
-
-IOEX(ID_1_USB_C0_RT_RST_ODL, EXPIN(IOEX_ID_1_C0_NCT38XX, 0, 2), GPIO_ODR_LOW)
-/* GPIO03_P1 to PU */
-IOEX(ID_1_USB_C0_FRS_EN, EXPIN(IOEX_ID_1_C0_NCT38XX, 0, 4), GPIO_LOW)
-IOEX(ID_1_USB_C0_OC_ODL, EXPIN(IOEX_ID_1_C0_NCT38XX, 0, 6), GPIO_ODR_HIGH)
-/* GPIO07_P1 to PU */
-
-IOEX(ID_1_USB_C2_RT_RST_ODL, EXPIN(IOEX_ID_1_C2_NCT38XX, 0, 2), GPIO_ODR_LOW)
-/* GPIO03_P2 to PU */
-IOEX(ID_1_USB_C2_FRS_EN, EXPIN(IOEX_ID_1_C2_NCT38XX, 0, 4), GPIO_LOW)
-IOEX(ID_1_USB_C1_OC_ODL, EXPIN(IOEX_ID_1_C2_NCT38XX, 0, 6), GPIO_ODR_HIGH)
-IOEX(ID_1_USB_C2_OC_ODL, EXPIN(IOEX_ID_1_C2_NCT38XX, 0, 7), GPIO_ODR_HIGH)
-
-/* Board ID 2 IO expander configuration */
-
+/* IO expander configuration */
/* GPIO02_P2 to PU */
/* GPIO03_P2 to PU */
IOEX(USB_C0_OC_ODL, EXPIN(IOEX_C0_NCT38XX, 0, 4), GPIO_ODR_HIGH)
diff --git a/board/vell/usbc_config.c b/board/vell/usbc_config.c
index f653a93d1f..81c1a28959 100644
--- a/board/vell/usbc_config.c
+++ b/board/vell/usbc_config.c
@@ -265,19 +265,12 @@ __override int bb_retimer_power_enable(const struct usb_mux *me, bool enable)
{
enum ioex_signal rst_signal;
- if (me->usb_port == USBC_PORT_C0) {
- if (get_board_id() == 1)
- rst_signal = IOEX_ID_1_USB_C0_RT_RST_ODL;
- else
- rst_signal = IOEX_USB_C0_RT_RST_ODL;
- } else if (me->usb_port == USBC_PORT_C2) {
- if (get_board_id() == 1)
- rst_signal = IOEX_ID_1_USB_C2_RT_RST_ODL;
- else
- rst_signal = IOEX_USB_C2_RT_RST_ODL;
- } else {
+ if (me->usb_port == USBC_PORT_C0)
+ rst_signal = IOEX_USB_C0_RT_RST_ODL;
+ else if (me->usb_port == USBC_PORT_C2)
+ rst_signal = IOEX_USB_C2_RT_RST_ODL;
+ else
return EC_ERROR_INVAL;
- }
/*
* We do not have a load switch for the burnside bridge chips,
@@ -297,20 +290,6 @@ __override int bb_retimer_power_enable(const struct usb_mux *me, bool enable)
* which powers I2C controller within retimer
*/
msleep(1);
- if (get_board_id() == 1) {
- int val;
-
- /*
- * Check if we were able to deassert
- * reset. Board ID 1 uses a GPIO that is
- * uncontrollable when a debug accessory is
- * connected.
- */
- if (ioex_get_level(rst_signal, &val) != EC_SUCCESS)
- return EC_ERROR_UNKNOWN;
- if (val != 1)
- return EC_ERROR_NOT_POWERED;
- }
} else {
ioex_set_level(rst_signal, 0);
msleep(1);
@@ -320,18 +299,11 @@ __override int bb_retimer_power_enable(const struct usb_mux *me, bool enable)
void board_reset_pd_mcu(void)
{
- enum gpio_signal tcpc_rst;
-
- if (get_board_id() == 1)
- tcpc_rst = GPIO_ID_1_USB_C0_C2_TCPC_RST_ODL;
- else
- tcpc_rst = GPIO_USB_C0_C2_TCPC_RST_ODL;
-
/*
* TODO(b/179648104): figure out correct timing
*/
- gpio_set_level(tcpc_rst, 0);
+ gpio_set_level(GPIO_USB_C0_C2_TCPC_RST_ODL, 0);
if (ec_cfg_usb_db_type() != DB_USB_ABSENT) {
gpio_set_level(GPIO_USB_C1_RST_ODL, 0);
gpio_set_level(GPIO_USB_C1_RT_RST_R_ODL, 0);
@@ -343,7 +315,7 @@ void board_reset_pd_mcu(void)
msleep(20);
- gpio_set_level(tcpc_rst, 1);
+ gpio_set_level(GPIO_USB_C0_C2_TCPC_RST_ODL, 1);
if (ec_cfg_usb_db_type() != DB_USB_ABSENT) {
gpio_set_level(GPIO_USB_C1_RST_ODL, 1);
gpio_set_level(GPIO_USB_C1_RT_RST_R_ODL, 1);
@@ -370,13 +342,8 @@ static void board_tcpc_init(void)
* C0/C2 TCPC, so they must be set up after the TCPC has
* been taken out of reset.
*/
- if (get_board_id() == 1) {
- enable_ioex(IOEX_ID_1_C0_NCT38XX);
- enable_ioex(IOEX_ID_1_C2_NCT38XX);
- } else {
- enable_ioex(IOEX_C0_NCT38XX);
- enable_ioex(IOEX_C2_NCT38XX);
- }
+ enable_ioex(IOEX_C0_NCT38XX);
+ enable_ioex(IOEX_C2_NCT38XX);
}
/* Enable PPC interrupts. */