diff options
Diffstat (limited to 'src/soc/amd')
-rw-r--r-- | src/soc/amd/stoneyridge/bootblock/bootblock.c | 5 | ||||
-rw-r--r-- | src/soc/amd/stoneyridge/early_setup.c | 3 | ||||
-rw-r--r-- | src/soc/amd/stoneyridge/uart.c | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/soc/amd/stoneyridge/bootblock/bootblock.c b/src/soc/amd/stoneyridge/bootblock/bootblock.c index 3f01603b14..1712b5159a 100644 --- a/src/soc/amd/stoneyridge/bootblock/bootblock.c +++ b/src/soc/amd/stoneyridge/bootblock/bootblock.c @@ -15,6 +15,7 @@ */ #include <stdint.h> +#include <assert.h> #include <console/console.h> #include <smp/node.h> #include <bootblock_common.h> @@ -52,6 +53,10 @@ void bootblock_soc_early_init(void) void bootblock_soc_init(void) { + if (IS_ENABLED(CONFIG_STONEYRIDGE_UART)) + assert(CONFIG_UART_FOR_CONSOLE >= 0 + && CONFIG_UART_FOR_CONSOLE <= 1); + u32 val = cpuid_eax(1); printk(BIOS_DEBUG, "Family_Model: %08x\n", val); diff --git a/src/soc/amd/stoneyridge/early_setup.c b/src/soc/amd/stoneyridge/early_setup.c index e5f123a151..b4e780ece1 100644 --- a/src/soc/amd/stoneyridge/early_setup.c +++ b/src/soc/amd/stoneyridge/early_setup.c @@ -35,6 +35,9 @@ void configure_stoneyridge_uart(void) { u8 byte, byte2; + if (CONFIG_UART_FOR_CONSOLE < 0 || CONFIG_UART_FOR_CONSOLE > 1) + return; + /* Power on the UART and AMBA devices */ byte = read8((void *)ACPI_MMIO_BASE + AOAC_BASE + FCH_AOAC_REG56 + CONFIG_UART_FOR_CONSOLE * 2); diff --git a/src/soc/amd/stoneyridge/uart.c b/src/soc/amd/stoneyridge/uart.c index 9cc0c94894..d5d30061bf 100644 --- a/src/soc/amd/stoneyridge/uart.c +++ b/src/soc/amd/stoneyridge/uart.c @@ -18,6 +18,9 @@ uintptr_t uart_platform_base(int idx) { + if (CONFIG_UART_FOR_CONSOLE < 0 || CONFIG_UART_FOR_CONSOLE > 1) + return 0; + return (uintptr_t)(APU_UART0_BASE + 0x2000 * (idx & 1)); } |