blob: dd1f1ec14e931c1b2b3d2e1d8e06b9075e155591 [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 Pons9c8c8582022-05-06 23:22:11 +020019 early_thermal_init();
Angel Pons70c61852022-05-06 23:17:39 +020020 early_usb_init();
21
Angel Pons567ece42022-05-06 21:56:48 +020022 if (!CONFIG(INTEL_LYNXPOINT_LP))
23 dmi_early_init();
24
Angel Pons322b1c32022-05-06 22:18:21 +020025 return cpu_replaced;
Angel Pons567ece42022-05-06 21:56:48 +020026}
Angel Pons9fdd5572022-05-06 21:12:14 +020027
28void perform_raminit(const int s3resume)
29{
30 /*
31 * See, this function's name is a lie. There are more things to
32 * do that memory initialisation, but they are relatively easy.
33 */
Angel Pons567ece42022-05-06 21:56:48 +020034 const bool cpu_replaced = early_init_native(s3resume);
35
36 (void)cpu_replaced;
Angel Pons9fdd5572022-05-06 21:12:14 +020037
Angel Pons322b1c32022-05-06 22:18:21 +020038 /** TODO: Move after raminit */
39 if (intel_early_me_uma_size() > 0) {
40 /** TODO: Update status once raminit is implemented **/
41 uint8_t me_status = ME_INIT_STATUS_ERROR;
42 intel_early_me_init_done(me_status);
43 }
44
45 intel_early_me_status();
46
Angel Pons9fdd5572022-05-06 21:12:14 +020047 /** TODO: Implement the required magic **/
48 die("NATIVE RAMINIT: More Magic (tm) required.\n");
49}