mb/google/rauru: Enable vcore DVFS in romstage
[coreboot2.git] / src / soc / amd / genoa_poc / aoac.c
blob53ba88f1b903a5379d4574ec6570d10a40d100b2
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <stdint.h>
4 #include <amdblocks/acpimmio.h>
5 #include <amdblocks/aoac.h>
6 #include <soc/aoac_defs.h>
7 #include <soc/southbridge.h>
8 #include <delay.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 \
14 : -1)
15 #if CONFIG(AMD_SOC_CONSOLE_UART) && FCH_AOAC_UART_FOR_CONSOLE == -1
16 # error Unsupported UART_FOR_CONSOLE chosen
17 #endif
19 void wait_for_aoac_enabled(unsigned int dev)
21 while (!is_aoac_device_enabled(dev))
22 udelay(100);
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);