soc/intel/xeon_sp/skx: Use Kconfig symbol
[coreboot2.git] / src / soc / amd / phoenix / early_fch.c
blobbcfddb2241bc5d891450ba87bc34723dcb709fe8
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* TODO: Update for Phoenix */
5 #include <amdblocks/acpimmio.h>
6 #include <amdblocks/aoac.h>
7 #include <amdblocks/espi.h>
8 #include <amdblocks/i2c.h>
9 #include <amdblocks/lpc.h>
10 #include <amdblocks/pmlib.h>
11 #include <amdblocks/smbus.h>
12 #include <amdblocks/uart.h>
13 #include <soc/i2c.h>
14 #include <soc/southbridge.h>
15 #include <soc/uart.h>
17 #include "chip.h"
19 /* Before console init */
20 void fch_pre_init(void)
23 * PM_04_ACPIMMIO_DECODE_EN which enables the ACPIMMIO decode is already set after
24 * reset. Since the IO port based indirect PM register space access isn't implemented
25 * in Phoenix any more, don't call enable_acpimmio_decode_pm04() which uses the
26 * indirect PM register space access via the IO ports that aren't implemented any more.
28 /* Setup SPI base by calling lpc_early_init before setting up eSPI. */
29 lpc_early_init();
31 /* Setup eSPI to enable port80 routing if the board is using eSPI and the eSPI
32 interface hasn't already been set up in verstage on PSP */
33 if (CONFIG(SOC_AMD_COMMON_BLOCK_USE_ESPI) && !CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK))
34 configure_espi_with_mb_hook();
36 fch_spi_early_init();
37 fch_smbus_init();
38 fch_enable_cf9_io();
39 fch_enable_legacy_io();
40 fch_disable_legacy_dma_io();
41 enable_aoac_devices();
44 * On reset Range_0 defaults to enabled. We want to start with a clean
45 * slate to not have things unexpectedly enabled.
47 clear_uart_legacy_config();
49 if (CONFIG(AMD_SOC_CONSOLE_UART))
50 set_uart_config(CONFIG_UART_FOR_CONSOLE);
52 /* disable the keyboard reset function before mainboard GPIO setup */
53 if (CONFIG(DISABLE_KEYBOARD_RESET_PIN))
54 fch_disable_kb_rst();
57 /* After console init */
58 void fch_early_init(void)
60 reset_i2c_peripherals();
61 pm_set_power_failure_state();
62 fch_print_pmxc0_status();
63 i2c_soc_early_init();
64 show_spi_speeds_and_modes();
66 if (CONFIG(DISABLE_SPI_FLASH_ROM_SHARING))
67 lpc_disable_spi_rom_sharing();