summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorJosh Tsai <Josh_Tsai@compal.corp-partner.google.com>2021-05-04 21:13:14 +0800
committerCommit Bot <commit-bot@chromium.org>2021-05-05 07:03:48 +0000
commit47546a1431877e82d82405e1a830e1f48ca1b04e (patch)
tree9f0ef8b0fd19b25d44f6b685f6d7a003cd7200ad /board
parent90ff2e74092bc13b9ef6eee8efddaed5670df1d5 (diff)
downloadchrome-ec-47546a1431877e82d82405e1a830e1f48ca1b04e.tar.gz
Cret: Removed PD port 1 configuration and modified HDMI gpio setting
Due to cret only support a USB PD port 0 on MB side, so remove the PD port 1 configuration in board layer. Also change the GPIOF5 and GPIO92 to HDMI function. BUG=b:186393859,b:185009499 BRANCH=dedede TEST=DUT can power on, and HDMI function is normal. Signed-off-by: Josh Tsai <Josh_Tsai@compal.corp-partner.google.com> Change-Id: I477a157aeb9115fa5b827a1412f0862c480207d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2870892 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Commit-Queue: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Tested-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com>
Diffstat (limited to 'board')
-rw-r--r--board/cret/board.c120
-rw-r--r--board/cret/board.h24
-rw-r--r--board/cret/ec.tasklist5
-rw-r--r--board/cret/gpio.inc6
4 files changed, 13 insertions, 142 deletions
diff --git a/board/cret/board.c b/board/cret/board.c
index a01fa05cea..6fe4fa0147 100644
--- a/board/cret/board.c
+++ b/board/cret/board.c
@@ -18,7 +18,6 @@
#include "driver/accelgyro_lsm6dsm.h"
#include "driver/bc12/pi3usb9201.h"
#include "driver/charger/isl923x.h"
-#include "driver/retimer/nb7v904m.h"
#include "driver/tcpm/raa489000.h"
#include "driver/tcpm/tcpci.h"
#include "driver/usb_mux/pi3usb3x532.h"
@@ -87,41 +86,6 @@ static void usb_c0_interrupt(enum gpio_signal s)
}
-/* C1 interrupt line shared by BC 1.2, TCPC, and charger */
-static void check_c1_line(void);
-DECLARE_DEFERRED(check_c1_line);
-
-static void notify_c1_chips(void)
-{
- schedule_deferred_pd_interrupt(1);
- task_set_event(TASK_ID_USB_CHG_P1, USB_CHG_EVENT_BC12);
-}
-
-static void check_c1_line(void)
-{
- /*
- * If line is still being held low, see if there's more to process from
- * one of the chips.
- */
- if (!gpio_get_level(GPIO_SUB_C1_INT_EN_RAILS_ODL)) {
- notify_c1_chips();
- hook_call_deferred(&check_c1_line_data, INT_RECHECK_US);
- }
-}
-
-static void sub_usb_c1_interrupt(enum gpio_signal s)
-{
- /* Cancel any previous calls to check the interrupt line */
- hook_call_deferred(&check_c1_line_data, -1);
-
- /* Notify all chips using this line that an interrupt came in */
- notify_c1_chips();
-
- /* Check the line again in 5ms */
- hook_call_deferred(&check_c1_line_data, INT_RECHECK_US);
-
-}
-
static void sub_hdmi_hpd_interrupt(enum gpio_signal s)
{
int hdmi_hpd_odl = gpio_get_level(GPIO_EC_I2C_SUB_C1_SDA_HDMI_HPD_ODL);
@@ -171,18 +135,6 @@ void board_init(void)
gpio_enable_interrupt(GPIO_USB_C0_INT_ODL);
check_c0_line();
- /* Disable i2c on HDMI pins */
- gpio_config_pin(MODULE_I2C,
- GPIO_EC_I2C_SUB_C1_SDA_HDMI_HPD_ODL, 0);
- gpio_config_pin(MODULE_I2C,
- GPIO_EC_I2C_SUB_C1_SCL_HDMI_EN_ODL, 0);
-
- /* Set HDMI and sub-rail enables to output */
- gpio_set_flags(GPIO_EC_I2C_SUB_C1_SCL_HDMI_EN_ODL,
- chipset_in_state(CHIPSET_STATE_ON) ?
- GPIO_ODR_LOW : GPIO_ODR_HIGH);
- gpio_set_flags(GPIO_SUB_C1_INT_EN_RAILS_ODL, GPIO_ODR_HIGH);
-
/* Enable interrupt for passing through HPD */
gpio_enable_interrupt(GPIO_EC_I2C_SUB_C1_SDA_HDMI_HPD_ODL);
@@ -199,13 +151,15 @@ DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
/* Enable HDMI any time the SoC is on */
static void hdmi_enable(void)
{
- gpio_set_level(GPIO_EC_I2C_SUB_C1_SCL_HDMI_EN_ODL, 0);
+ gpio_set_level(GPIO_EC_HDMI_EN_ODL, 0);
+ gpio_set_level(GPIO_HDMI_PP3300_EN, 1);
}
DECLARE_HOOK(HOOK_CHIPSET_STARTUP, hdmi_enable, HOOK_PRIO_DEFAULT);
static void hdmi_disable(void)
{
- gpio_set_level(GPIO_EC_I2C_SUB_C1_SCL_HDMI_EN_ODL, 1);
+ gpio_set_level(GPIO_EC_HDMI_EN_ODL, 1);
+ gpio_set_level(GPIO_HDMI_PP3300_EN, 0);
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, hdmi_disable, HOOK_PRIO_DEFAULT);
@@ -261,30 +215,16 @@ __override void board_power_5v_enable(int enable)
*/
set_5v_gpio(!!enable);
- if (get_cbi_fw_config_db() == DB_1A_HDMI) {
- gpio_set_level(GPIO_SUB_C1_INT_EN_RAILS_ODL, !enable);
- } else {
- if (isl923x_set_comparator_inversion(1, !!enable))
- CPRINTS("Failed to %sable sub rails!", enable ?
- "en" : "dis");
- }
-
}
__override uint8_t board_get_usb_pd_port_count(void)
{
- if (get_cbi_fw_config_db() == DB_1A_HDMI)
- return CONFIG_USB_PD_PORT_MAX_COUNT - 1;
- else
- return CONFIG_USB_PD_PORT_MAX_COUNT;
+ return CONFIG_USB_PD_PORT_MAX_COUNT;
}
__override uint8_t board_get_charger_chip_count(void)
{
- if (get_cbi_fw_config_db() == DB_1A_HDMI)
- return CHARGER_NUM - 1;
- else
- return CHARGER_NUM;
+ return CHARGER_NUM;
}
int board_is_sourcing_vbus(int port)
@@ -500,12 +440,6 @@ const struct charger_config_t chg_chips[] = {
.i2c_addr_flags = ISL923X_ADDR_FLAGS,
.drv = &isl923x_drv,
},
-
- {
- .i2c_port = I2C_PORT_SUB_USB_C1,
- .i2c_addr_flags = ISL923X_ADDR_FLAGS,
- .drv = &isl923x_drv,
- },
};
const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = {
@@ -514,12 +448,6 @@ const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = {
.i2c_addr_flags = PI3USB9201_I2C_ADDR_3_FLAGS,
.flags = PI3USB9201_ALWAYS_POWERED,
},
-
- {
- .i2c_port = I2C_PORT_SUB_USB_C1,
- .i2c_addr_flags = PI3USB9201_I2C_ADDR_3_FLAGS,
- .flags = PI3USB9201_ALWAYS_POWERED,
- },
};
/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
@@ -554,23 +482,6 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
.flags = TCPC_FLAGS_TCPCI_REV2_0,
.drv = &raa489000_tcpm_drv,
},
-
- {
- .bus_type = EC_BUS_TYPE_I2C,
- .i2c_info = {
- .port = I2C_PORT_SUB_USB_C1,
- .addr_flags = RAA489000_TCPC0_I2C_FLAGS,
- },
- .flags = TCPC_FLAGS_TCPCI_REV2_0,
- .drv = &raa489000_tcpm_drv,
- },
-};
-
-const struct usb_mux usbc1_retimer = {
- .usb_port = 1,
- .i2c_port = I2C_PORT_SUB_USB_C1,
- .i2c_addr_flags = NB7V904M_I2C_ADDR0,
- .driver = &nb7v904m_usb_redriver_drv,
};
const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{
@@ -579,13 +490,6 @@ const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
.i2c_addr_flags = PI3USB3X532_I2C_ADDR0,
.driver = &pi3usb3x532_usb_mux_driver,
},
- {
- .usb_port = 1,
- .i2c_port = I2C_PORT_SUB_USB_C1,
- .i2c_addr_flags = PI3USB3X532_I2C_ADDR0,
- .driver = &pi3usb3x532_usb_mux_driver,
- .next_mux = &usbc1_retimer,
- }
};
uint16_t tcpc_get_alert_status(void)
@@ -609,18 +513,6 @@ uint16_t tcpc_get_alert_status(void)
}
}
- if (board_get_usb_pd_port_count() > 1 &&
- !gpio_get_level(GPIO_SUB_C1_INT_EN_RAILS_ODL)) {
- if (!tcpc_read16(1, TCPC_REG_ALERT, &regval)) {
- /* TCPCI spec Rev 1.0 says to ignore bits 14:12. */
- if (!(tcpc_config[1].flags & TCPC_FLAGS_TCPCI_REV2_0))
- regval &= ~((1 << 14) | (1 << 13) | (1 << 12));
-
- if (regval)
- status |= PD_STATUS_TCPC_ALERT_1;
- }
- }
-
return status;
}
diff --git a/board/cret/board.h b/board/cret/board.h
index 899f315096..a2deef2e99 100644
--- a/board/cret/board.h
+++ b/board/cret/board.h
@@ -32,9 +32,6 @@
#define CONFIG_CHARGER_RAA489000
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10
#define CONFIG_CHARGER_SENSE_RESISTOR 10
-#define CONFIG_OCPC_DEF_RBATT_MOHMS 22 /* R_DS(on) 11.6mOhm + 10mOhm sns rstr */
-#define CONFIG_OCPC
-#undef CONFIG_CHARGER_SINGLE_CHIP
#undef CONFIG_USB_PD_TCPC_LPM_EXIT_DEBOUNCE
#define CONFIG_USB_PD_TCPC_LPM_EXIT_DEBOUNCE (100 * MSEC)
@@ -44,7 +41,8 @@
* Note this line might already have its pull up disabled for HDMI DBs, but
* it should be fine to set again before z-state.
*/
-#define GPIO_USB_C1_INT_ODL GPIO_SUB_C1_INT_EN_RAILS_ODL
+#define GPIO_EC_HDMI_EN_ODL GPIO_EC_I2C_SBU_USB_C1_SCL
+#define GPIO_HDMI_PP3300_EN GPIO_SUB_USB_C1_INT_ODL
/* LED */
#define CONFIG_LED_PWM
@@ -64,10 +62,9 @@
/* USB */
#define CONFIG_BC12_DETECT_PI3USB9201
-#define CONFIG_USBC_RETIMER_NB7V904M
/* USB PD */
-#define CONFIG_USB_PD_PORT_MAX_COUNT 2
+#define CONFIG_USB_PD_PORT_MAX_COUNT 1
#define CONFIG_USB_PD_TCPM_RAA489000
/* USB defines specific to external TCPCs */
@@ -103,15 +100,6 @@
#define I2C_ADDR_EEPROM_FLAGS 0x50 /* 7b address */
-/*
- * I2C pin names for baseboard
- *
- * Note: these lines will be set as i2c on start-up, but this should be
- * okay since they're ODL.
- */
-#define GPIO_EC_I2C_SUB_USB_C1_SCL GPIO_EC_I2C_SUB_C1_SCL_HDMI_EN_ODL
-#define GPIO_EC_I2C_SUB_USB_C1_SDA GPIO_EC_I2C_SUB_C1_SDA_HDMI_HPD_ODL
-
/* Sensors */
#define CONFIG_CMD_ACCELS
#define CONFIG_CMD_ACCEL_INFO
@@ -143,12 +131,6 @@
#include "gpio_signal.h"
#include "registers.h"
-enum chg_id {
- CHARGER_PRIMARY,
- CHARGER_SECONDARY,
- CHARGER_NUM,
-};
-
enum adc_channel {
ADC_TEMP_SENSOR_1, /* ADC0 */
ADC_TEMP_SENSOR_2, /* ADC1 */
diff --git a/board/cret/ec.tasklist b/board/cret/ec.tasklist
index d4fb416bce..ee5333eb17 100644
--- a/board/cret/ec.tasklist
+++ b/board/cret/ec.tasklist
@@ -11,7 +11,6 @@
TASK_ALWAYS(HOOKS, hook_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_ALWAYS(MOTIONSENSE, motion_sense_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_ALWAYS(USB_CHG_P0, usb_charger_task, 0, LARGER_TASK_STACK_SIZE) \
- TASK_ALWAYS(USB_CHG_P1, usb_charger_task, 1, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(CHARGER, charger_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \
@@ -20,6 +19,4 @@
TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_ALWAYS(POWERBTN, power_button_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_ALWAYS(PD_C0, pd_task, NULL, ULTRA_TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_C1, pd_task, NULL, ULTRA_TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_INT_C0, pd_interrupt_handler_task, 0, ULTRA_TASK_STACK_SIZE) \
- TASK_ALWAYS(PD_INT_C1, pd_interrupt_handler_task, 1, ULTRA_TASK_STACK_SIZE)
+ TASK_ALWAYS(PD_INT_C0, pd_interrupt_handler_task, 0, ULTRA_TASK_STACK_SIZE)
diff --git a/board/cret/gpio.inc b/board/cret/gpio.inc
index 085c8e95b0..11efceb32f 100644
--- a/board/cret/gpio.inc
+++ b/board/cret/gpio.inc
@@ -26,7 +26,6 @@ GPIO_INT(PG_PP1050_ST_OD, PIN(4, 2), GPIO_INT_BOTH, power_signal_interrupt)
/* USB-C interrupts */
GPIO_INT(USB_C0_INT_ODL, PIN(6, 2), GPIO_INT_FALLING | GPIO_PULL_UP, usb_c0_interrupt)
-GPIO_INT(SUB_C1_INT_EN_RAILS_ODL, PIN(F, 5), GPIO_INT_FALLING | GPIO_PULL_UP, sub_usb_c1_interrupt) /* C1 interrupt OR 5V power en */
GPIO_INT(EC_I2C_SUB_C1_SDA_HDMI_HPD_ODL, PIN(9, 1), GPIO_INT_BOTH, sub_hdmi_hpd_interrupt) /* C1 I2C SDA OR HDMI_HPD */
GPIO_INT(USB_C0_CCSBU_OVP_ODL, PIN(A, 2), GPIO_INT_FALLING | GPIO_PULL_UP, c0_ccsbu_ovp_interrupt) /* Fault protection */
@@ -51,7 +50,6 @@ GPIO(EC_I2C_SENSOR_SCL, PIN(B, 5), GPIO_INPUT)
GPIO(EC_I2C_SENSOR_SDA, PIN(B, 4), GPIO_INPUT)
GPIO(EC_I2C_USB_C0_SCL, PIN(9, 0), GPIO_INPUT)
GPIO(EC_I2C_USB_C0_SDA, PIN(8, 7), GPIO_INPUT)
-GPIO(EC_I2C_SUB_C1_SCL_HDMI_EN_ODL, PIN(9, 2), GPIO_INPUT) /* C1 I2C SCL OR HDMI en */
/* Misc Enables */
GPIO(EN_VCCIO_EXT, PIN(6, 1), GPIO_OUT_LOW)
@@ -63,6 +61,8 @@ GPIO(EN_SLP_Z, PIN(8, 3), GPIO_OUT_LOW)
GPIO(EN_BL_OD, PIN(D, 3), GPIO_ODR_LOW)
GPIO(IMVP9_PE, PIN(E, 0), GPIO_OUT_LOW)
GPIO(ECH1_PACKET_MODE, PIN(7, 5), GPIO_OUT_LOW)
+GPIO(SUB_USB_C1_INT_ODL, PIN(F, 5), GPIO_OUT_LOW) /* 5V power en */
+GPIO(EC_I2C_SBU_USB_C1_SCL, PIN(9, 2), GPIO_ODR_LOW) /* HDMI en */
/* Power Sequencing */
GPIO(EC_AP_PSYS, PIN(B, 7), GPIO_OUT_LOW)
@@ -121,7 +121,7 @@ ALTERNATE(PIN_MASK(6, 0x30), 0, MODULE_UART, 0) /* UART1 */
/* I2C */
ALTERNATE(PIN_MASK(B, 0x3C), 0, MODULE_I2C, 0) /* I2C7,I2C0 */
ALTERNATE(PIN_MASK(3, 0x48), 0, MODULE_I2C, 0) /* I2C5 */
-ALTERNATE(PIN_MASK(9, 0x07), 0, MODULE_I2C, 0) /* I2C2, I2C1 SCL */
+ALTERNATE(PIN_MASK(9, 0x01), 0, MODULE_I2C, 0) /* I2C2, I2C1 SCL */
ALTERNATE(PIN_MASK(8, 0x80), 0, MODULE_I2C, 0) /* I2C1 SDA */
/* NC pins, enable internal pull-up to avoid floating state. */