Angel Pons | f23ae0b | 2020-04-02 23:48:12 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 2 | |
Angel Pons | 45f448f | 2020-07-03 14:46:47 +0200 | [diff] [blame] | 3 | #include <arch/romstage.h> |
Aaron Durbin | 3d0071b | 2013-01-18 14:32:50 -0600 | [diff] [blame] | 4 | #include <console/console.h> |
Angel Pons | 6c49f40 | 2020-08-28 02:02:00 +0200 | [diff] [blame] | 5 | #include <device/mmio.h> |
Angel Pons | 30931f5 | 2021-03-12 13:06:45 +0100 | [diff] [blame] | 6 | #include <elog.h> |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 7 | #include <cpu/x86/lapic.h> |
Aaron Durbin | bf396ff | 2013-02-11 21:50:35 -0600 | [diff] [blame] | 8 | #include <romstage_handoff.h> |
Angel Pons | 6c49f40 | 2020-08-28 02:02:00 +0200 | [diff] [blame] | 9 | #include <security/intel/txt/txt.h> |
| 10 | #include <security/intel/txt/txt_register.h> |
Elyes HAOUAS | 65bb543 | 2018-07-03 14:59:50 +0200 | [diff] [blame] | 11 | #include <northbridge/intel/haswell/haswell.h> |
| 12 | #include <northbridge/intel/haswell/raminit.h> |
Angel Pons | 30931f5 | 2021-03-12 13:06:45 +0100 | [diff] [blame] | 13 | #include <southbridge/intel/common/pmclib.h> |
Elyes HAOUAS | 65bb543 | 2018-07-03 14:59:50 +0200 | [diff] [blame] | 14 | #include <southbridge/intel/lynxpoint/pch.h> |
Angel Pons | 6eea191 | 2020-07-03 14:14:30 +0200 | [diff] [blame] | 15 | |
Angel Pons | 73fa035 | 2020-07-03 12:29:03 +0200 | [diff] [blame] | 16 | void __weak mb_late_romstage_setup(void) |
| 17 | { |
| 18 | } |
| 19 | |
Angel Pons | 45f448f | 2020-07-03 14:46:47 +0200 | [diff] [blame] | 20 | /* The romstage entry point for this platform is not mainboard-specific, hence the name */ |
| 21 | void mainboard_romstage_entry(void) |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 22 | { |
Kyösti Mälkki | 157b189 | 2019-08-16 14:02:25 +0300 | [diff] [blame] | 23 | enable_lapic(); |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 24 | |
Angel Pons | 30931f5 | 2021-03-12 13:06:45 +0100 | [diff] [blame] | 25 | early_pch_init(); |
| 26 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 27 | /* Perform some early chipset initialization required |
| 28 | * before RAM initialization can work |
| 29 | */ |
Angel Pons | e816829 | 2020-07-03 11:42:22 +0200 | [diff] [blame] | 30 | haswell_early_initialization(); |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 31 | printk(BIOS_DEBUG, "Back from haswell_early_initialization()\n"); |
| 32 | |
Angel Pons | d99b693 | 2021-03-12 17:37:42 +0100 | [diff] [blame] | 33 | const int s3resume = southbridge_detect_s3_resume(); |
| 34 | |
| 35 | elog_boot_notify(s3resume); |
| 36 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 37 | /* Prepare USB controller early in S3 resume */ |
Kyösti Mälkki | b6fc13b | 2021-02-17 17:33:09 +0200 | [diff] [blame] | 38 | if (s3resume) |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 39 | enable_usb_bar(); |
| 40 | |
| 41 | post_code(0x3a); |
Angel Pons | 284a547 | 2020-07-03 11:46:50 +0200 | [diff] [blame] | 42 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 43 | report_platform_info(); |
| 44 | |
Angel Pons | 6c49f40 | 2020-08-28 02:02:00 +0200 | [diff] [blame] | 45 | if (CONFIG(INTEL_TXT)) |
| 46 | intel_txt_romstage_init(); |
| 47 | |
Angel Pons | d99b693 | 2021-03-12 17:37:42 +0100 | [diff] [blame] | 48 | perform_raminit(s3resume); |
Kyösti Mälkki | 3d45c40 | 2013-09-07 20:26:36 +0300 | [diff] [blame] | 49 | |
Angel Pons | 6c49f40 | 2020-08-28 02:02:00 +0200 | [diff] [blame] | 50 | if (CONFIG(INTEL_TXT)) { |
| 51 | printk(BIOS_DEBUG, "Check TXT_ERROR register after MRC\n"); |
| 52 | |
| 53 | intel_txt_log_acm_error(read32((void *)TXT_ERROR)); |
| 54 | |
| 55 | intel_txt_log_spad(); |
| 56 | |
| 57 | intel_txt_memory_has_secrets(); |
| 58 | |
| 59 | txt_dump_regions(); |
| 60 | } |
| 61 | |
Tristan Corrick | 334be32 | 2018-12-17 22:10:21 +1300 | [diff] [blame] | 62 | haswell_unhide_peg(); |
| 63 | |
Kyösti Mälkki | b6fc13b | 2021-02-17 17:33:09 +0200 | [diff] [blame] | 64 | romstage_handoff_init(s3resume); |
Aaron Durbin | bf396ff | 2013-02-11 21:50:35 -0600 | [diff] [blame] | 65 | |
Angel Pons | 73fa035 | 2020-07-03 12:29:03 +0200 | [diff] [blame] | 66 | mb_late_romstage_setup(); |
| 67 | |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 68 | post_code(0x3f); |
Aaron Durbin | a267161 | 2013-02-06 21:41:01 -0600 | [diff] [blame] | 69 | } |