diff --git a/src/soc/amd/stoneyridge/early_fch.c b/src/soc/amd/stoneyridge/early_fch.c index b46bde787f..763e3f2901 100644 --- a/src/soc/amd/stoneyridge/early_fch.c +++ b/src/soc/amd/stoneyridge/early_fch.c @@ -127,6 +127,9 @@ void bootblock_fch_early_init(void) fch_enable_legacy_io(); enable_aoac_devices(); + if (CONFIG(AMD_SOC_CONSOLE_UART)) + set_uart_config(CONFIG_UART_FOR_CONSOLE); + /* disable the keyboard reset function before mainboard GPIO setup */ if (CONFIG(DISABLE_KEYBOARD_RESET_PIN)) fch_disable_kb_rst(); diff --git a/src/soc/amd/stoneyridge/include/soc/southbridge.h b/src/soc/amd/stoneyridge/include/soc/southbridge.h index e00bf8ef3e..32c102c50f 100644 --- a/src/soc/amd/stoneyridge/include/soc/southbridge.h +++ b/src/soc/amd/stoneyridge/include/soc/southbridge.h @@ -184,6 +184,8 @@ void fch_final(void *chip_info); void enable_aoac_devices(void); void fch_clk_output_48Mhz(u32 osc); +void set_uart_config(unsigned int idx); + /* * Call the mainboard to get the USB Over Current Map. The mainboard * returns the map and 0 on Success or -1 on error or no map. There is diff --git a/src/soc/amd/stoneyridge/uart.c b/src/soc/amd/stoneyridge/uart.c index 969146dc07..3b6d49caea 100644 --- a/src/soc/amd/stoneyridge/uart.c +++ b/src/soc/amd/stoneyridge/uart.c @@ -6,6 +6,7 @@ #include #include #include +#include #include static const struct soc_uart_ctrlr_info uart_info[] = { @@ -26,3 +27,11 @@ uintptr_t get_uart_base(unsigned int idx) return uart_info[idx].base; } + +void set_uart_config(unsigned int idx) +{ + if (idx >= ARRAY_SIZE(uart_info)) + return; + + gpio_configure_pads(uart_info[idx].mux, 2); +}