ec/google/chromeec: Define ACPI_NOTIFY_CROS_EC_MKBP constant
[coreboot.git] / src / soc / intel / elkhartlake / espi.c
blobde2a84f8f03583d4e183bb12e0b4460f1502d081
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <arch/ioapic.h>
4 #include <device/device.h>
5 #include <device/pci.h>
6 #include <device/pci_ops.h>
7 #include <intelblocks/itss.h>
8 #include <intelblocks/lpc_lib.h>
9 #include <intelpch/espi.h>
10 #include <pc80/isa-dma.h>
11 #include <pc80/i8259.h>
12 #include <soc/iomap.h>
13 #include <soc/irq.h>
14 #include <soc/pci_devs.h>
15 #include <soc/pcr_ids.h>
16 #include <soc/soc_chip.h>
17 #include <static.h>
19 void soc_get_gen_io_dec_range(uint32_t gen_io_dec[LPC_NUM_GENERIC_IO_RANGES])
21 const config_t *config = config_of_soc();
23 gen_io_dec[0] = config->gen1_dec;
24 gen_io_dec[1] = config->gen2_dec;
25 gen_io_dec[2] = config->gen3_dec;
26 gen_io_dec[3] = config->gen4_dec;
29 #if ENV_RAMSTAGE
30 void lpc_soc_init(struct device *dev)
32 /* Legacy initialization */
33 isa_dma_init();
34 pch_misc_init();
36 /* Enable CLKRUN_EN for power gating ESPI */
37 lpc_enable_pci_clk_cntl();
39 /* Set ESPI Serial IRQ mode */
40 if (CONFIG(SERIRQ_CONTINUOUS_MODE))
41 lpc_set_serirq_mode(SERIRQ_CONTINUOUS);
42 else
43 lpc_set_serirq_mode(SERIRQ_QUIET);
45 /* Interrupt configuration */
46 pch_enable_ioapic();
47 pch_pirq_init();
48 setup_i8259();
49 i8259_configure_irq_trigger(9, 1);
52 #endif