blob: ef61d4ee0914bc48c26eee3b8ee6350f97957777 [file] [log] [blame]
Angel Pons9fdd5572022-05-06 21:12:14 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <console/console.h>
Angel Pons322b1c32022-05-06 22:18:21 +02004#include <delay.h>
Angel Pons567ece42022-05-06 21:56:48 +02005#include <northbridge/intel/haswell/haswell.h>
Angel Pons9fdd5572022-05-06 21:12:14 +02006#include <northbridge/intel/haswell/raminit.h>
Angel Pons322b1c32022-05-06 22:18:21 +02007#include <southbridge/intel/lynxpoint/me.h>
Angel Pons70c61852022-05-06 23:17:39 +02008#include <southbridge/intel/lynxpoint/pch.h>
Angel Pons567ece42022-05-06 21:56:48 +02009#include <types.h>
10
11static bool early_init_native(int s3resume)
12{
13 printk(BIOS_DEBUG, "Starting native platform initialisation\n");
14
Angel Pons322b1c32022-05-06 22:18:21 +020015 intel_early_me_init();
16 /** TODO: CPU replacement check must be skipped in warm boots and S3 resumes **/
17 const bool cpu_replaced = !s3resume && intel_early_me_cpu_replacement_check();
18
Angel Pons70c61852022-05-06 23:17:39 +020019 early_usb_init();
20
Angel Pons567ece42022-05-06 21:56:48 +020021 if (!CONFIG(INTEL_LYNXPOINT_LP))
22 dmi_early_init();
23
Angel Pons322b1c32022-05-06 22:18:21 +020024 return cpu_replaced;
Angel Pons567ece42022-05-06 21:56:48 +020025}
Angel Pons9fdd5572022-05-06 21:12:14 +020026
27void perform_raminit(const int s3resume)
28{
29 /*
30 * See, this function's name is a lie. There are more things to
31 * do that memory initialisation, but they are relatively easy.
32 */
Angel Pons567ece42022-05-06 21:56:48 +020033 const bool cpu_replaced = early_init_native(s3resume);
34
35 (void)cpu_replaced;
Angel Pons9fdd5572022-05-06 21:12:14 +020036
Angel Pons322b1c32022-05-06 22:18:21 +020037 /** TODO: Move after raminit */
38 if (intel_early_me_uma_size() > 0) {
39 /** TODO: Update status once raminit is implemented **/
40 uint8_t me_status = ME_INIT_STATUS_ERROR;
41 intel_early_me_init_done(me_status);
42 }
43
44 intel_early_me_status();
45
Angel Pons9fdd5572022-05-06 21:12:14 +020046 /** TODO: Implement the required magic **/
47 die("NATIVE RAMINIT: More Magic (tm) required.\n");
48}