From d11c814172d9763895d46a12ccd8b409e2c41ab0 Mon Sep 17 00:00:00 2001 From: Ravi Kumar Bokka Date: Mon, 5 Jul 2021 21:03:56 +0530 Subject: [PATCH] mb/google/herobrine: Initialize USB by calling SOC method Initialize by calling `setup_usb_host0()` from SOC code BUG=b:182963902 TEST=Validated USB enumeration on qcom sc7280 development board Signed-off-by: Sandeep Maheswaram Change-Id: Ic378352a97e4f3ed89089f1f7545f8ebb172b1f2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56093 Tested-by: build bot (Jenkins) Reviewed-by: Shelley Chen --- src/mainboard/google/herobrine/mainboard.c | 15 +++++++++++++++ src/mainboard/google/herobrine/romstage.c | 12 +++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/herobrine/mainboard.c b/src/mainboard/google/herobrine/mainboard.c index 82c5fa90b7..e64fb15ae6 100644 --- a/src/mainboard/google/herobrine/mainboard.c +++ b/src/mainboard/google/herobrine/mainboard.c @@ -12,6 +12,20 @@ #include #include #include +#include +#include + +static struct usb_board_data usb0_board_data = { + .parameter_override_x0 = 0xe6, + .parameter_override_x1 = 0x8b, + .parameter_override_x2 = 0x16, + .parameter_override_x3 = 0x03, +}; + +static void setup_usb(void) +{ + setup_usb_host0(&usb0_board_data); +} static void configure_sdhci(void) { @@ -65,6 +79,7 @@ static void mainboard_init(struct device *dev) if (CONFIG(HEROBRINE_HAS_FINGERPRINT)) gpio_output(GPIO_FP_RST_L, 1); + setup_usb(); } static void mainboard_enable(struct device *dev) diff --git a/src/mainboard/google/herobrine/romstage.c b/src/mainboard/google/herobrine/romstage.c index ad2d2a0c46..2ea78b8f91 100644 --- a/src/mainboard/google/herobrine/romstage.c +++ b/src/mainboard/google/herobrine/romstage.c @@ -1,16 +1,26 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include "board.h" #include +static void prepare_usb(void) +{ + /* + * Do DWC3 core and phy reset. Kick these resets + * off early so they get at least 1ms to settle. + */ + reset_usb0(); +} + void platform_romstage_main(void) { shrm_fw_load_reset(); /* QCLib: DDR init & train */ qclib_load_and_run(); - + prepare_usb(); /* This rail needs to be stable by the time we take the FPMCU out of reset in ramstage, so already turn it on here. This needs to happen at least 200ms after this pin was first driven low in the bootblock. */