From 16cb8d0d0c9b29322f646755c62a14ce29473a04 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 8 Jan 2026 16:41:02 +0530 Subject: [PATCH] mb/google/bluey: Add power sequencing for USB-C1 retimer This patch implements the power-on and reset sequence for the USB-C1 retimer on the Bluey mainboard. Sequence Details: - romstage: Added early_setup_usb_typec to ensure all power rails (3.3V, 1.8V, 0.9V) are disabled and the retimer is held in reset early in the boot process. - ramstage (mainboard): Added setup_usb_typec to perform the power-up sequence with the required 1ms delays between rails to ensure hardware stability: BUG=b:473489095 TEST=Able to detect USB devices in HS mode. Change-Id: Ia93c0078aecdec98f3af28e73e7af5af7a3b20d8 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/90699 Tested-by: build bot (Jenkins) Reviewed-by: Pranava Y N Reviewed-by: Jayvik Desai Reviewed-by: Kapil Porwal --- src/mainboard/google/bluey/board.h | 6 ++++++ src/mainboard/google/bluey/mainboard.c | 14 ++++++++++++++ src/mainboard/google/bluey/romstage.c | 16 ++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/mainboard/google/bluey/board.h b/src/mainboard/google/bluey/board.h index 3260b283c7..3d42d89a48 100644 --- a/src/mainboard/google/bluey/board.h +++ b/src/mainboard/google/bluey/board.h @@ -44,6 +44,12 @@ #define GPIO_USB_CAM_RESET_L GPIO(10) #define GPIO_USB_CAM_ENABLE GPIO(206) +/* USB-C1 port specific GPIOs */ +#define GPIO_USB_C1_EN_PP3300 GPIO(186) +#define GPIO_USB_C1_EN_PP1800 GPIO(175) +#define GPIO_USB_C1_EN_PP0900 GPIO(188) +#define GPIO_USB_C1_RETIMER_RESET_L GPIO(176) + void setup_chromeos_gpios(void); bool is_off_mode(void); void configure_parallel_charging(void); diff --git a/src/mainboard/google/bluey/mainboard.c b/src/mainboard/google/bluey/mainboard.c index b93b4188db..b37c0b1e8a 100644 --- a/src/mainboard/google/bluey/mainboard.c +++ b/src/mainboard/google/bluey/mainboard.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -50,8 +51,21 @@ static void enable_usb_camera(void) gpio_output(GPIO_USB_CAM_ENABLE, 1); } +static void setup_usb_typec(void) +{ + gpio_output(GPIO_USB_C1_EN_PP3300, 1); + mdelay(1); + gpio_output(GPIO_USB_C1_EN_PP1800, 1); + mdelay(1); + gpio_output(GPIO_USB_C1_EN_PP0900, 1); + mdelay(1); + gpio_output(GPIO_USB_C1_RETIMER_RESET_L, 1); +} + static void setup_usb(void) { + setup_usb_typec(); + enable_usb_camera(); setup_usb_host0(); } diff --git a/src/mainboard/google/bluey/romstage.c b/src/mainboard/google/bluey/romstage.c index 1c6660112e..e0f1f05743 100644 --- a/src/mainboard/google/bluey/romstage.c +++ b/src/mainboard/google/bluey/romstage.c @@ -86,6 +86,19 @@ static void platform_dump_battery_soc_information(void) printk(BIOS_INFO, "Battery state-of-charge %d%%\n", batt_pct); } +static void early_setup_usb_typec(void) +{ + gpio_output(GPIO_USB_C1_RETIMER_RESET_L, 0); + gpio_output(GPIO_USB_C1_EN_PP3300, 0); + gpio_output(GPIO_USB_C1_EN_PP1800, 0); + gpio_output(GPIO_USB_C1_EN_PP0900, 0); +} + +static void early_setup_usb(void) +{ + early_setup_usb_typec(); +} + void platform_romstage_main(void) { /* Watchdog must be checked first to avoid erasing watchdog info later. */ @@ -107,6 +120,9 @@ void platform_romstage_main(void) qclib_rerun(); + /* Setup early USB related config */ + early_setup_usb(); + /* * Enable this power rail now for FPMCU stability prior to * its reset being deasserted in ramstage. This applies