Patrick Georgi | ac95903 | 2020-05-05 22:49:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Lance Zhao | a7ff9c5 | 2015-11-12 18:19:41 -0800 | [diff] [blame] | 2 | |
Lance Zhao | a7ff9c5 | 2015-11-12 18:19:41 -0800 | [diff] [blame] | 3 | #include <device/pci.h> |
Ravi Sarawadi | efa606b | 2017-08-04 16:26:09 -0700 | [diff] [blame] | 4 | #include <intelblocks/lpc_lib.h> |
| 5 | #include <intelblocks/rtc.h> |
Ravi Sarawadi | efa606b | 2017-08-04 16:26:09 -0700 | [diff] [blame] | 6 | #include <soc/pcr_ids.h> |
Jagadish Krishnamoorthy | b6b233a | 2016-05-17 18:06:49 -0700 | [diff] [blame] | 7 | #include <soc/pm.h> |
Sean Rhodes | 7a82a80 | 2022-06-02 11:28:43 +0100 | [diff] [blame] | 8 | #include <soc/intel/common/block/lpc/lpc_def.h> |
Alexandru Gagniuc | 3aa34a8 | 2016-04-04 10:47:49 -0700 | [diff] [blame] | 9 | #include "chip.h" |
| 10 | |
Sean Rhodes | 7a82a80 | 2022-06-02 11:28:43 +0100 | [diff] [blame] | 11 | void soc_get_gen_io_dec_range(uint32_t gen_io_dec[LPC_NUM_GENERIC_IO_RANGES]) |
| 12 | { |
| 13 | const config_t *config = config_of_soc(); |
| 14 | |
| 15 | gen_io_dec[0] = config->gen1_dec; |
| 16 | gen_io_dec[1] = config->gen2_dec; |
| 17 | gen_io_dec[2] = config->gen3_dec; |
| 18 | gen_io_dec[3] = config->gen4_dec; |
| 19 | } |
| 20 | |
Subrata Banik | 8885206 | 2018-01-10 10:51:50 +0530 | [diff] [blame] | 21 | void lpc_soc_init(struct device *dev) |
Alexandru Gagniuc | 3aa34a8 | 2016-04-04 10:47:49 -0700 | [diff] [blame] | 22 | { |
Ravi Sarawadi | efa606b | 2017-08-04 16:26:09 -0700 | [diff] [blame] | 23 | const struct soc_intel_apollolake_config *cfg; |
Kyösti Mälkki | 8950cfb | 2019-07-13 22:16:25 +0300 | [diff] [blame] | 24 | cfg = config_of(dev); |
Alexandru Gagniuc | 3aa34a8 | 2016-04-04 10:47:49 -0700 | [diff] [blame] | 25 | |
Ravi Sarawadi | efa606b | 2017-08-04 16:26:09 -0700 | [diff] [blame] | 26 | /* Set LPC Serial IRQ mode */ |
| 27 | lpc_set_serirq_mode(cfg->serirq_mode); |
Jagadish Krishnamoorthy | b6b233a | 2016-05-17 18:06:49 -0700 | [diff] [blame] | 28 | |
| 29 | /* Initialize RTC */ |
| 30 | rtc_init(); |
Alexandru Gagniuc | 3aa34a8 | 2016-04-04 10:47:49 -0700 | [diff] [blame] | 31 | } |