blob: ce14915b2b6ec8ac906838ead19e57a5ff3fc4bc [file] [log] [blame]
Angel Ponsf23ae0b2020-04-02 23:48:12 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Aaron Durbin3d0071b2013-01-18 14:32:50 -06002
Angel Pons45f448f2020-07-03 14:46:47 +02003#include <arch/romstage.h>
Aaron Durbin3d0071b2013-01-18 14:32:50 -06004#include <console/console.h>
Angel Pons6c49f402020-08-28 02:02:00 +02005#include <device/mmio.h>
Angel Pons30931f52021-03-12 13:06:45 +01006#include <elog.h>
Aaron Durbinbf396ff2013-02-11 21:50:35 -06007#include <romstage_handoff.h>
Angel Pons6c49f402020-08-28 02:02:00 +02008#include <security/intel/txt/txt.h>
9#include <security/intel/txt/txt_register.h>
Elyes HAOUAS65bb5432018-07-03 14:59:50 +020010#include <northbridge/intel/haswell/haswell.h>
11#include <northbridge/intel/haswell/raminit.h>
Angel Pons30931f52021-03-12 13:06:45 +010012#include <southbridge/intel/common/pmclib.h>
Elyes HAOUAS65bb5432018-07-03 14:59:50 +020013#include <southbridge/intel/lynxpoint/pch.h>
Angel Pons6eea1912020-07-03 14:14:30 +020014
Angel Pons73fa0352020-07-03 12:29:03 +020015void __weak mb_late_romstage_setup(void)
16{
17}
18
Angel Pons45f448f2020-07-03 14:46:47 +020019/* The romstage entry point for this platform is not mainboard-specific, hence the name */
20void mainboard_romstage_entry(void)
Aaron Durbina2671612013-02-06 21:41:01 -060021{
Angel Pons30931f52021-03-12 13:06:45 +010022 early_pch_init();
23
Aaron Durbina2671612013-02-06 21:41:01 -060024 /* Perform some early chipset initialization required
25 * before RAM initialization can work
26 */
Angel Ponse8168292020-07-03 11:42:22 +020027 haswell_early_initialization();
Aaron Durbina2671612013-02-06 21:41:01 -060028 printk(BIOS_DEBUG, "Back from haswell_early_initialization()\n");
29
Angel Ponsd99b6932021-03-12 17:37:42 +010030 const int s3resume = southbridge_detect_s3_resume();
31
32 elog_boot_notify(s3resume);
33
Aaron Durbina2671612013-02-06 21:41:01 -060034 /* Prepare USB controller early in S3 resume */
Kyösti Mälkkib6fc13b2021-02-17 17:33:09 +020035 if (s3resume)
Aaron Durbina2671612013-02-06 21:41:01 -060036 enable_usb_bar();
37
38 post_code(0x3a);
Angel Pons284a5472020-07-03 11:46:50 +020039
Aaron Durbina2671612013-02-06 21:41:01 -060040 report_platform_info();
41
Angel Pons6c49f402020-08-28 02:02:00 +020042 if (CONFIG(INTEL_TXT))
43 intel_txt_romstage_init();
44
Angel Ponsd99b6932021-03-12 17:37:42 +010045 perform_raminit(s3resume);
Kyösti Mälkki3d45c402013-09-07 20:26:36 +030046
Angel Pons6c49f402020-08-28 02:02:00 +020047 if (CONFIG(INTEL_TXT)) {
48 printk(BIOS_DEBUG, "Check TXT_ERROR register after MRC\n");
49
Elyes Haouas9a83eae2022-12-03 13:31:38 +010050 intel_txt_log_acm_error(read32p(TXT_ERROR));
Angel Pons6c49f402020-08-28 02:02:00 +020051
52 intel_txt_log_spad();
53
54 intel_txt_memory_has_secrets();
55
56 txt_dump_regions();
57 }
58
Tristan Corrick334be322018-12-17 22:10:21 +130059 haswell_unhide_peg();
60
Kyösti Mälkkib6fc13b2021-02-17 17:33:09 +020061 romstage_handoff_init(s3resume);
Aaron Durbinbf396ff2013-02-11 21:50:35 -060062
Angel Pons73fa0352020-07-03 12:29:03 +020063 mb_late_romstage_setup();
64
Aaron Durbina2671612013-02-06 21:41:01 -060065 post_code(0x3f);
Aaron Durbina2671612013-02-06 21:41:01 -060066}