Attention is currently required from: Hung-Te Lin, Paul Menzel, Wentao Qin, Yang Wu, Yu-Ping Wu.
Yidi Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/82089?usp=email )
Change subject: mb/google/corsola/wugtrio: Add initialization of USB port0 ......................................................................
Patch Set 4:
(4 comments)
Patchset:
PS4: @Mingjin, is it expected to run through USB3 settings for USB2 configuration ?
File src/mainboard/google/corsola/devicetree.cb:
https://review.coreboot.org/c/coreboot/+/82089/comment/e3a51f44_f46381ee : PS4, Line 3: USB2_PORT SUPPORT_SECONDARY_USB
https://review.coreboot.org/c/coreboot/+/82089/comment/291aa8a3_59574be7 : PS4, Line 4: USB2_PORT1 option SECONDARY_USB_DISABLED 0 option SECONDARY_USB_ENABLED 1
File src/soc/mediatek/common/usb.c:
https://review.coreboot.org/c/coreboot/+/82089/comment/96e42fe7_22e037aa : PS4, Line 15: : #ifdef SOC_MEDIATEK_MT8186_USB_H : void switch_usb_port0_host(void) : { : ippc_regs = (void *)(SSUSB_IPPC_BASE_P0); : phy_ports = (void *)(SSUSB_SIF_BASE_P0); : } : #endif : Please consider the following approach.
common/usb.c ``` void update_usb_base_regs(uintptr_t ippc_base, uintptr_t sif_base) { ippc_regs = (void *)ippc_base; phy_ports = (void *)sif_base; } ```
common/usb_secondary.c ``` void setup_usb_secondary_host(void) { /* We always consider USB2 port as the secondary UBS host regardless of the register naming */ update_usb_base_regs(SSUSB_IPPC_BASE_P0, SSUSB_SIF_BASE_P0); setup_usb_host(); } ```
mt8186/Makeifle.mk ``` ramstage-y += ../common/usb.c ../common/usb_secondary.c usb.c ```
corsola/mainboard.c ``` if (fw_config_probe(FW_CONFIG(SUPPORT_SECONDARY_USB, SECONDARY_USB_ENABLED))) { setup_usb_secondary_host(); } ```