Angel Pons | 9fdd557 | 2022-05-06 21:12:14 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
| 3 | #include <console/console.h> |
Angel Pons | 322b1c3 | 2022-05-06 22:18:21 +0200 | [diff] [blame^] | 4 | #include <delay.h> |
Angel Pons | 567ece4 | 2022-05-06 21:56:48 +0200 | [diff] [blame] | 5 | #include <northbridge/intel/haswell/haswell.h> |
Angel Pons | 9fdd557 | 2022-05-06 21:12:14 +0200 | [diff] [blame] | 6 | #include <northbridge/intel/haswell/raminit.h> |
Angel Pons | 322b1c3 | 2022-05-06 22:18:21 +0200 | [diff] [blame^] | 7 | #include <southbridge/intel/lynxpoint/me.h> |
Angel Pons | 567ece4 | 2022-05-06 21:56:48 +0200 | [diff] [blame] | 8 | #include <types.h> |
| 9 | |
| 10 | static bool early_init_native(int s3resume) |
| 11 | { |
| 12 | printk(BIOS_DEBUG, "Starting native platform initialisation\n"); |
| 13 | |
Angel Pons | 322b1c3 | 2022-05-06 22:18:21 +0200 | [diff] [blame^] | 14 | 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 Pons | 567ece4 | 2022-05-06 21:56:48 +0200 | [diff] [blame] | 18 | if (!CONFIG(INTEL_LYNXPOINT_LP)) |
| 19 | dmi_early_init(); |
| 20 | |
Angel Pons | 322b1c3 | 2022-05-06 22:18:21 +0200 | [diff] [blame^] | 21 | return cpu_replaced; |
Angel Pons | 567ece4 | 2022-05-06 21:56:48 +0200 | [diff] [blame] | 22 | } |
Angel Pons | 9fdd557 | 2022-05-06 21:12:14 +0200 | [diff] [blame] | 23 | |
| 24 | void 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 Pons | 567ece4 | 2022-05-06 21:56:48 +0200 | [diff] [blame] | 30 | const bool cpu_replaced = early_init_native(s3resume); |
| 31 | |
| 32 | (void)cpu_replaced; |
Angel Pons | 9fdd557 | 2022-05-06 21:12:14 +0200 | [diff] [blame] | 33 | |
Angel Pons | 322b1c3 | 2022-05-06 22:18:21 +0200 | [diff] [blame^] | 34 | /** 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 Pons | 9fdd557 | 2022-05-06 21:12:14 +0200 | [diff] [blame] | 43 | /** TODO: Implement the required magic **/ |
| 44 | die("NATIVE RAMINIT: More Magic (tm) required.\n"); |
| 45 | } |