Angel Pons | f94ac9a | 2020-04-05 15:46:48 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 2 | |
Angel Pons | 7a95754 | 2020-10-13 21:22:01 +0200 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
Kyösti Mälkki | a963acd | 2019-08-16 20:34:25 +0300 | [diff] [blame] | 4 | #include <arch/romstage.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 5 | #include <console/console.h> |
Angel Pons | 9d733de | 2020-11-23 13:15:19 +0100 | [diff] [blame] | 6 | #include <cpu/intel/haswell/haswell.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 7 | #include <elog.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 8 | #include <romstage_handoff.h> |
Julius Werner | 4ee4bd5 | 2014-10-20 13:46:39 -0700 | [diff] [blame] | 9 | #include <soc/me.h> |
Julius Werner | 4ee4bd5 | 2014-10-20 13:46:39 -0700 | [diff] [blame] | 10 | #include <soc/pm.h> |
Julius Werner | 4ee4bd5 | 2014-10-20 13:46:39 -0700 | [diff] [blame] | 11 | #include <soc/romstage.h> |
Angel Pons | 733f03d | 2021-01-28 16:59:04 +0100 | [diff] [blame] | 12 | #include <southbridge/intel/lynxpoint/lp_gpio.h> |
Angel Pons | 7a95754 | 2020-10-13 21:22:01 +0200 | [diff] [blame] | 13 | #include <stdint.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 14 | |
Angel Pons | ac1c9bb | 2021-01-20 22:36:20 +0100 | [diff] [blame] | 15 | __weak void mainboard_post_raminit(const int s3resume) |
16 | { | ||||
17 | } | ||||
18 | |||||
Arthur Heymans | 56f7687 | 2019-05-12 14:01:13 +0200 | [diff] [blame] | 19 | /* Entry from cpu/intel/car/romstage.c. */ |
Kyösti Mälkki | 157b189 | 2019-08-16 14:02:25 +0300 | [diff] [blame] | 20 | void mainboard_romstage_entry(void) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 21 | { |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 22 | post_code(0x30); |
23 | |||||
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 24 | /* System Agent Early Initialization */ |
25 | systemagent_early_init(); | ||||
26 | |||||
27 | /* PCH Early Initialization */ | ||||
28 | pch_early_init(); | ||||
29 | |||||
Duncan Laurie | 6168027 | 2014-05-05 12:42:35 -0500 | [diff] [blame] | 30 | /* Get power state */ |
Angel Pons | 24e4edb | 2021-01-20 22:53:42 +0100 | [diff] [blame] | 31 | struct chipset_power_state *const power_state = fill_power_state(); |
Duncan Laurie | 6168027 | 2014-05-05 12:42:35 -0500 | [diff] [blame] | 32 | |
Kyösti Mälkki | 74cb3e7 | 2021-02-17 17:33:17 +0200 | [diff] [blame] | 33 | int s3resume = power_state->prev_sleep_state == ACPI_S3; |
34 | |||||
35 | elog_boot_notify(s3resume); | ||||
Kyösti Mälkki | 7f50afb | 2019-09-11 17:12:26 +0300 | [diff] [blame] | 36 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 37 | /* Print useful platform information */ |
38 | report_platform_info(); | ||||
39 | |||||
40 | /* Set CPU frequency to maximum */ | ||||
41 | set_max_freq(); | ||||
42 | |||||
Arthur Heymans | cadc70f | 2019-05-12 13:44:22 +0200 | [diff] [blame] | 43 | /* Initialize GPIOs */ |
Angel Pons | 88f94a9 | 2021-03-19 15:13:46 +0100 | [diff] [blame] | 44 | setup_pch_lp_gpios(mainboard_lp_gpio_map); |
Arthur Heymans | cadc70f | 2019-05-12 13:44:22 +0200 | [diff] [blame] | 45 | |
Angel Pons | 61615e9 | 2021-06-23 13:02:22 +0200 | [diff] [blame] | 46 | /* Print ME state before MRC */ |
47 | intel_me_status(); | ||||
48 | |||||
49 | /* Save ME HSIO version */ | ||||
50 | intel_me_hsio_version(&power_state->hsio_version, | ||||
51 | &power_state->hsio_checksum); | ||||
52 | |||||
Angel Pons | dc60073 | 2021-06-23 13:11:30 +0200 | [diff] [blame] | 53 | perform_raminit(power_state); |
Angel Pons | d0d528a | 2021-01-20 23:09:16 +0100 | [diff] [blame] | 54 | |
Kyösti Mälkki | 74cb3e7 | 2021-02-17 17:33:17 +0200 | [diff] [blame] | 55 | romstage_handoff_init(s3resume); |
Arthur Heymans | 97e9e56 | 2019-05-12 13:47:35 +0200 | [diff] [blame] | 56 | |
Kyösti Mälkki | 74cb3e7 | 2021-02-17 17:33:17 +0200 | [diff] [blame] | 57 | mainboard_post_raminit(s3resume); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 58 | } |