blob: 6a002548c105775be4be7545e5fda3b4b119b149 [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 Pons567ece42022-05-06 21:56:48 +02008#include <types.h>
9
10static bool early_init_native(int s3resume)
11{
12 printk(BIOS_DEBUG, "Starting native platform initialisation\n");
13
Angel Pons322b1c32022-05-06 22:18:21 +020014 intel_early_me_init();
15 /** TODO: CPU replacement check must be skipped in warm boots and S3 resumes **/
16 const bool cpu_replaced = !s3resume && intel_early_me_cpu_replacement_check();
17
Angel Pons567ece42022-05-06 21:56:48 +020018 if (!CONFIG(INTEL_LYNXPOINT_LP))
19 dmi_early_init();
20
Angel Pons322b1c32022-05-06 22:18:21 +020021 return cpu_replaced;
Angel Pons567ece42022-05-06 21:56:48 +020022}
Angel Pons9fdd5572022-05-06 21:12:14 +020023
24void perform_raminit(const int s3resume)
25{
26 /*
27 * See, this function's name is a lie. There are more things to
28 * do that memory initialisation, but they are relatively easy.
29 */
Angel Pons567ece42022-05-06 21:56:48 +020030 const bool cpu_replaced = early_init_native(s3resume);
31
32 (void)cpu_replaced;
Angel Pons9fdd5572022-05-06 21:12:14 +020033
Angel Pons322b1c32022-05-06 22:18:21 +020034 /** TODO: Move after raminit */
35 if (intel_early_me_uma_size() > 0) {
36 /** TODO: Update status once raminit is implemented **/
37 uint8_t me_status = ME_INIT_STATUS_ERROR;
38 intel_early_me_init_done(me_status);
39 }
40
41 intel_early_me_status();
42
Angel Pons9fdd5572022-05-06 21:12:14 +020043 /** TODO: Implement the required magic **/
44 die("NATIVE RAMINIT: More Magic (tm) required.\n");
45}