ec/google/chromeec: Enable ACPI memory mapping for Microchip EC
[coreboot.git] / src / soc / intel / alderlake / espi.c
blobbdc41a6a30edb7100fd64710bf10dcbf00176cc7
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /*
4 * This file is created based on Intel Alder Lake Processor PCH Datasheet
5 * Document number: 621483
6 * Chapter number: 2
7 */
9 #include <device/pci.h>
10 #include <pc80/isa-dma.h>
11 #include <pc80/i8259.h>
12 #include <arch/ioapic.h>
13 #include <intelblocks/itss.h>
14 #include <intelblocks/lpc_lib.h>
15 #include <intelblocks/pcr.h>
16 #include <intelpch/espi.h>
17 #include <soc/iomap.h>
18 #include <soc/irq.h>
19 #include <soc/pci_devs.h>
20 #include <soc/pcr_ids.h>
21 #include <soc/soc_chip.h>
22 #include <static.h>
24 void soc_get_gen_io_dec_range(uint32_t gen_io_dec[LPC_NUM_GENERIC_IO_RANGES])
26 const config_t *config = config_of_soc();
28 gen_io_dec[0] = config->gen1_dec;
29 gen_io_dec[1] = config->gen2_dec;
30 gen_io_dec[2] = config->gen3_dec;
31 gen_io_dec[3] = config->gen4_dec;
34 #if ENV_RAMSTAGE
35 void lpc_soc_init(struct device *dev)
37 /* Legacy initialization */
38 isa_dma_init();
39 pch_misc_init();
41 /* Enable CLKRUN_EN for power gating ESPI */
42 lpc_enable_pci_clk_cntl();
44 /* Set ESPI Serial IRQ mode */
45 if (CONFIG(SERIRQ_CONTINUOUS_MODE))
46 lpc_set_serirq_mode(SERIRQ_CONTINUOUS);
47 else
48 lpc_set_serirq_mode(SERIRQ_QUIET);
50 /* Interrupt configuration */
51 pch_enable_ioapic();
52 pch_pirq_init();
53 setup_i8259();
54 i8259_configure_irq_trigger(9, 1);
56 #endif