summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorJeff Chase <jnchase@google.com>2021-07-22 15:18:18 -0400
committerCommit Bot <commit-bot@chromium.org>2021-07-23 00:19:24 +0000
commitb00e78a45275dc44245ebf8c91b8209388004d8b (patch)
tree594d59ed10bb419b808e49b6ae067ad2c39a2d25 /board
parentb9f4dee01a57a95b3890c1a77298565432dc4402 (diff)
downloadchrome-ec-b00e78a45275dc44245ebf8c91b8209388004d8b.tar.gz
genesis: update usb-a gpios, remove dead code
Genesis only has three USB-A ports so update GPIOs and power handling. Also remove unused thermal table. BRANCH=puff BUG=b:192008266 TEST=boot; charge phone on each USB port, monitor GPIOs Change-Id: Ie3e5991f41caffa0b0a55adfd293e03befa80ce5 Signed-off-by: Jeff Chase <jnchase@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045536 Reviewed-by: Joe Tessler <jrt@chromium.org> Commit-Queue: Joe Tessler <jrt@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/genesis/board.c70
-rw-r--r--board/genesis/board.h3
-rw-r--r--board/genesis/gpio.inc19
3 files changed, 19 insertions, 73 deletions
diff --git a/board/genesis/board.c b/board/genesis/board.c
index ff056ec79a..5cc45388b8 100644
--- a/board/genesis/board.c
+++ b/board/genesis/board.c
@@ -51,9 +51,9 @@ static int32_t base_5v_power;
* Units are milliwatts (5v x ma current)
*/
#define PWR_BASE_LOAD (5*1335)
-#define PWR_FRONT_HIGH (5*1603)
-#define PWR_FRONT_LOW (5*963)
-#define PWR_REAR (5*1075)
+#define PWR_FRONT_HIGH (5*1500)
+#define PWR_FRONT_LOW (5*900)
+#define PWR_REAR (5*1500)
#define PWR_HDMI (5*562)
#define PWR_C_HIGH (5*3740)
#define PWR_C_LOW (5*2090)
@@ -70,11 +70,11 @@ static void update_5v_usage(void)
* Recalculate the 5V load, assuming no throttling.
*/
base_5v_power = PWR_BASE_LOAD;
- if (!gpio_get_level(GPIO_USB_A0_OC_ODL)) {
+ if (!gpio_get_level(GPIO_USB_A2_OC_ODL)) {
front_ports++;
base_5v_power += PWR_FRONT_LOW;
}
- if (!gpio_get_level(GPIO_USB_A1_OC_ODL)) {
+ if (!gpio_get_level(GPIO_USB_A3_OC_ODL)) {
front_ports++;
base_5v_power += PWR_FRONT_LOW;
}
@@ -83,11 +83,7 @@ static void update_5v_usage(void)
*/
if (front_ports > 0)
base_5v_power += PWR_FRONT_HIGH - PWR_FRONT_LOW;
- if (!gpio_get_level(GPIO_USB_A2_OC_ODL))
- base_5v_power += PWR_REAR;
- if (!gpio_get_level(GPIO_USB_A3_OC_ODL))
- base_5v_power += PWR_REAR;
- if (ec_config_get_usb4_present() && !gpio_get_level(GPIO_USB_A4_OC_ODL))
+ if (!gpio_get_level(GPIO_USB_A1_OC_ODL))
base_5v_power += PWR_REAR;
if (!gpio_get_level(GPIO_HDMI_CONN0_OC_ODL))
base_5v_power += PWR_HDMI;
@@ -247,19 +243,6 @@ const static struct ec_thermal_config thermal_a = {
.temp_fan_max = C_TO_K(84),
};
-const static struct ec_thermal_config thermal_b = {
- .temp_host = {
- [EC_TEMP_THRESH_WARN] = 0,
- [EC_TEMP_THRESH_HIGH] = C_TO_K(78),
- [EC_TEMP_THRESH_HALT] = C_TO_K(85),
- },
- .temp_host_release = {
- [EC_TEMP_THRESH_WARN] = 0,
- [EC_TEMP_THRESH_HIGH] = C_TO_K(70),
- [EC_TEMP_THRESH_HALT] = 0,
- },
-};
-
struct ec_thermal_config thermal_params[] = {
[TEMP_SENSOR_CORE] = thermal_a,
};
@@ -352,49 +335,12 @@ int extpower_is_present(void)
int board_is_c10_gate_enabled(void)
{
- /*
- * Puff proto drives EN_PP5000_HDMI from EN_S0_RAILS so we cannot gate
- * core rails while in S0 because HDMI should remain powered.
- * EN_PP5000_HDMI is a separate EC output on all other boards.
- */
- return board_version != 0;
+ return 0;
}
void board_enable_s0_rails(int enable)
{
- /* This output isn't connected on protos; safe to set anyway. */
- gpio_set_level(GPIO_EN_PP5000_HDMI, enable);
-}
-
-int ec_config_get_usb4_present(void)
-{
- return !(fw_config & EC_CFG_NO_USB4_MASK);
-}
-
-unsigned int ec_config_get_thermal_solution(void)
-{
- return (fw_config & EC_CFG_THERMAL_MASK) >> EC_CFG_THERMAL_L;
-}
-
-static void setup_thermal(void)
-{
- unsigned int table = ec_config_get_thermal_solution();
- /* Configure Fan */
- switch (table) {
- /* Default and table0 use single fan */
- case 0:
- default:
- thermal_params[TEMP_SENSOR_CORE] = thermal_a;
- break;
- /* Table1 is fanless */
- case 1:
- fan_set_count(0);
- thermal_params[TEMP_SENSOR_CORE] = thermal_b;
- break;
- }
}
-/* fan_set_count should be called before HOOK_INIT/HOOK_PRIO_DEFAULT */
-DECLARE_HOOK(HOOK_INIT, setup_thermal, HOOK_PRIO_DEFAULT - 1);
/*
* Power monitoring and management.
@@ -529,7 +475,7 @@ static void power_monitor(void)
if (diff & THROT_TYPE_A) {
int typea_bc = (new_state & THROT_TYPE_A) ? 1 : 0;
- gpio_set_level(GPIO_USB_A_LOW_PWR_OD, typea_bc);
+ gpio_set_level(GPIO_USB_A3_LOW_PWR_OD, typea_bc);
}
hook_call_deferred(&power_monitor_data, delay);
}
diff --git a/board/genesis/board.h b/board/genesis/board.h
index af7af55f7c..14d1a8475d 100644
--- a/board/genesis/board.h
+++ b/board/genesis/board.h
@@ -170,8 +170,6 @@ enum temp_sensor_id {
/* Board specific handlers */
-void board_reset_pd_mcu(void);
-void board_set_tcpc_power_mode(int port, int mode);
void led_alert(int enable);
void show_critical_error(void);
@@ -197,7 +195,6 @@ void show_critical_error(void);
#define EC_CFG_THERMAL_H 7
#define EC_CFG_THERMAL_MASK GENMASK(EC_CFG_THERMAL_H, EC_CFG_THERMAL_L)
-int ec_config_get_usb4_present(void);
unsigned int ec_config_get_thermal_solution(void);
#endif /* !__ASSEMBLER__ */
diff --git a/board/genesis/gpio.inc b/board/genesis/gpio.inc
index 6ab2b1602f..6a905fdf04 100644
--- a/board/genesis/gpio.inc
+++ b/board/genesis/gpio.inc
@@ -50,12 +50,9 @@ GPIO(BJ_ADP_PRESENT_L, PIN(8, 2), GPIO_INT_BOTH | GPIO_PULL_UP)
/* Port power control interrupts */
GPIO_INT(HDMI_CONN0_OC_ODL, PIN(0, 7), GPIO_INT_BOTH, port_ocp_interrupt)
GPIO_INT(HDMI_CONN1_OC_ODL, PIN(0, 6), GPIO_INT_BOTH, port_ocp_interrupt)
-GPIO_INT(USB_A0_OC_ODL, PIN(E, 4), GPIO_INT_BOTH, port_ocp_interrupt)
GPIO_INT(USB_A1_OC_ODL, PIN(A, 2), GPIO_INT_BOTH, port_ocp_interrupt)
GPIO_INT(USB_A2_OC_ODL, PIN(F, 5), GPIO_INT_BOTH, port_ocp_interrupt)
GPIO_INT(USB_A3_OC_ODL, PIN(0, 3), GPIO_INT_BOTH, port_ocp_interrupt)
-/* May be reconfigured as input */
-GPIO_INT(USB_A4_OC_ODL, PIN(B, 0), GPIO_OUT_LOW | GPIO_INT_BOTH, port_ocp_interrupt)
/* PCH/CPU signals */
GPIO(EC_PCH_PWROK, PIN(0, 5), GPIO_OUT_LOW)
@@ -84,22 +81,29 @@ GPIO(EN_PPVAR_BJ_ADP_L, PIN(0, 4), GPIO_OUT_LOW)
/* USB type A */
GPIO(EN_PP5000_USB_VBUS, PIN(8, 3), GPIO_OUT_LOW)
GPIO(USB_A_LOW_PWR_OD, PIN(9, 4), GPIO_ODR_LOW)
-GPIO(USB_A2_STATUS_L, PIN(6, 1), GPIO_INPUT)
-GPIO(USB_A3_STATUS_L, PIN(C, 7), GPIO_INPUT)
+GPIO(USB_A3_LOW_PWR_OD, PIN(5, 0), GPIO_ODR_LOW)
+GPIO(USB_A1_STATUS_L, PIN(6, 1), GPIO_INPUT)
+GPIO(USB_A2_STATUS_L, PIN(C, 7), GPIO_INPUT)
+GPIO(USB_A3_STATUS_L, PIN(D, 2), GPIO_INPUT)
/* USB type C */
GPIO(USB_C0_TCPC_RST, PIN(9, 7), GPIO_OUT_LOW)
GPIO(USB_C0_POL_L, PIN(0, 0), GPIO_INPUT | GPIO_SEL_1P8V) /* USB-C Polarity */
+/* TPU */
+GPIO(PP3300_TPU_EN, PIN(E, 4), GPIO_OUT_HIGH)
+
+/* PSE controller */
+GPIO(EC_PSE_PWM_INT, PIN(B, 0), GPIO_INPUT) /* PSE controller interrupt */
+GPIO(EC_RST_LTC4291_L, PIN(9, 6), GPIO_OUT_HIGH) /* PSE controller reset */
+
/* Misc. */
GPIO(M2_SSD_PLN, PIN(A, 0), GPIO_INPUT)
GPIO(EC_ENTERING_RW, PIN(E, 3), GPIO_OUT_LOW)
GPIO(CCD_MODE_ODL, PIN(E, 5), GPIO_ODR_HIGH)
GPIO(PACKET_MODE_EN, PIN(7, 5), GPIO_OUT_LOW)
-GPIO(EC_RST_LTC4291_L, PIN(9, 6), GPIO_OUT_HIGH) /* PSE controller reset */
/* HDMI/CEC */
-GPIO(EN_PP5000_HDMI, PIN(5, 0), GPIO_OUT_LOW)
GPIO(HDMI_CONN0_CEC_OUT, PIN(B, 1), GPIO_ODR_HIGH)
GPIO(HDMI_CONN0_CEC_IN, PIN(4, 0), GPIO_INPUT)
GPIO(HDMI_CONN1_CEC_OUT, PIN(9, 5), GPIO_ODR_HIGH)
@@ -161,7 +165,6 @@ UNUSED(PIN(3, 2)) /* E5 NC */
UNUSED(PIN(D, 6)) /* F6 NC */
UNUSED(PIN(3, 5)) /* F5 NC */
UNUSED(PIN(5, 6)) /* M2 NC */
-UNUSED(PIN(D, 2)) /* C11 NC */
UNUSED(PIN(8, 6)) /* J8 NC */
UNUSED(PIN(9, 3)) /* M11 NC */
UNUSED(PIN(7, 2)) /* H6 NC */