Tan, Lean Sheng | 05dfe31 | 2020-08-25 20:40:17 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <arch/io.h> |
| 4 | #include <arch/ioapic.h> |
| 5 | #include <device/device.h> |
| 6 | #include <device/pci.h> |
| 7 | #include <device/pci_ops.h> |
| 8 | #include <intelblocks/itss.h> |
| 9 | #include <intelblocks/lpc_lib.h> |
Tan, Lean Sheng | 05dfe31 | 2020-08-25 20:40:17 -0700 | [diff] [blame] | 10 | #include <pc80/isa-dma.h> |
| 11 | #include <pc80/i8259.h> |
| 12 | #include <soc/espi.h> |
| 13 | #include <soc/iomap.h> |
| 14 | #include <soc/irq.h> |
| 15 | #include <soc/pci_devs.h> |
| 16 | #include <soc/pcr_ids.h> |
| 17 | #include <soc/soc_chip.h> |
| 18 | |
Patrick Georgi | 40b8f01 | 2021-05-12 14:52:12 +0200 | [diff] [blame] | 19 | void soc_get_gen_io_dec_range(uint32_t gen_io_dec[LPC_NUM_GENERIC_IO_RANGES]) |
Tan, Lean Sheng | 05dfe31 | 2020-08-25 20:40:17 -0700 | [diff] [blame] | 20 | { |
Furquan Shaikh | e4f7e04 | 2020-12-23 14:11:00 -0800 | [diff] [blame] | 21 | const config_t *config = config_of_soc(); |
Tan, Lean Sheng | 05dfe31 | 2020-08-25 20:40:17 -0700 | [diff] [blame] | 22 | |
| 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; |
| 27 | } |
| 28 | |
Tan, Lean Sheng | 05dfe31 | 2020-08-25 20:40:17 -0700 | [diff] [blame] | 29 | #if ENV_RAMSTAGE |
Tan, Lean Sheng | 05dfe31 | 2020-08-25 20:40:17 -0700 | [diff] [blame] | 30 | void lpc_soc_init(struct device *dev) |
| 31 | { |
| 32 | /* Legacy initialization */ |
| 33 | isa_dma_init(); |
| 34 | pch_misc_init(); |
| 35 | |
| 36 | /* Enable CLKRUN_EN for power gating ESPI */ |
| 37 | lpc_enable_pci_clk_cntl(); |
| 38 | |
| 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); |
| 44 | |
| 45 | /* Interrupt configuration */ |
Subrata Banik | 1366e44 | 2020-09-29 13:55:50 +0530 | [diff] [blame] | 46 | pch_enable_ioapic(); |
Subrata Banik | 78463a7 | 2020-09-29 14:28:09 +0530 | [diff] [blame] | 47 | pch_pirq_init(); |
Tan, Lean Sheng | 05dfe31 | 2020-08-25 20:40:17 -0700 | [diff] [blame] | 48 | setup_i8259(); |
| 49 | i8259_configure_irq_trigger(9, 1); |
Tan, Lean Sheng | 05dfe31 | 2020-08-25 20:40:17 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | #endif |