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