From ad4f6d7c6e10027d420d3bae722b734674643873 Mon Sep 17 00:00:00 2001 From: Chris Wang Date: Tue, 26 Jan 2021 20:09:34 +0800 Subject: soc/amd/picasso: allow USB_PD port setting override Allow to override the RFMUX setting if the board does not use PD chip. BUG=b:177389383 BRANCH=none TEST=Build; Check the USB_PD port been override. Change-Id: Idd559b67668846805005a6e00f5a84655310f348 Signed-off-by: Chris Wang Reviewed-on: https://review.coreboot.org/c/coreboot/+/49932 Reviewed-by: Felix Held Reviewed-by: Raul Rangel Tested-by: build bot (Jenkins) --- src/soc/amd/picasso/fch.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/soc/amd/picasso/fch.c') diff --git a/src/soc/amd/picasso/fch.c b/src/soc/amd/picasso/fch.c index 4fdaa391e7..4db7a8c615 100644 --- a/src/soc/amd/picasso/fch.c +++ b/src/soc/amd/picasso/fch.c @@ -101,6 +101,22 @@ void sb_clk_output_48Mhz(void) misc_write32(MISC_CLK_CNTL1, ctrl); } +static void sb_rfmux_config_override(void) +{ + u8 port; + const struct soc_amd_picasso_config *cfg; + + cfg = config_of_soc(); + + for (port = 0; port < USB_PD_PORT_COUNT; port++) { + if (cfg->usb_pd_config_override[port].rfmux_override_en) { + write32((void *)(USB_PD_PORT_CONTROL + PD_PORT_MUX_OFFSET(port)), + cfg->usb_pd_config_override[port].rfmux_config + | USB_PD_RFMUX_OVERRIDE); + } + } +} + static void sb_init_acpi_ports(void) { u32 reg; @@ -218,6 +234,8 @@ void southbridge_init(void *chip_info) gpp_clk_setup(); sb_clk_output_48Mhz(); + + sb_rfmux_config_override(); } void southbridge_final(void *chip_info) -- cgit v1.2.3