1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <amdblocks/acpimmio.h>
5 #include <amdblocks/aoac.h>
6 #include <soc/aoac_defs.h>
7 #include <soc/southbridge.h>
10 #define FCH_AOAC_UART_FOR_CONSOLE \
11 (CONFIG_UART_FOR_CONSOLE == 0 ? FCH_AOAC_DEV_UART0 \
12 : CONFIG_UART_FOR_CONSOLE == 1 ? FCH_AOAC_DEV_UART1 \
13 : CONFIG_UART_FOR_CONSOLE == 2 ? FCH_AOAC_DEV_UART2 \
15 #if CONFIG(AMD_SOC_CONSOLE_UART) && FCH_AOAC_UART_FOR_CONSOLE == -1
16 # error Unsupported UART_FOR_CONSOLE chosen
19 void wait_for_aoac_enabled(unsigned int dev
)
21 while (!is_aoac_device_enabled(dev
))
25 void enable_aoac_devices(void)
27 if (CONFIG(AMD_SOC_CONSOLE_UART
))
28 power_on_aoac_device(FCH_AOAC_UART_FOR_CONSOLE
);
30 if (CONFIG(AMD_SOC_CONSOLE_UART
))
31 wait_for_aoac_enabled(FCH_AOAC_UART_FOR_CONSOLE
);