0009-nb-intel-haswell-nri-Only-do-CPU-replacement-check-o.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 731216aef3129ae27ad5adc7266cb8a58090c9fc Mon Sep 17 00:00:00 2001
  2. From: Angel Pons <th3fanbus@gmail.com>
  3. Date: Sun, 26 Jun 2022 10:32:12 +0200
  4. Subject: [PATCH 09/26] nb/intel/haswell/nri: Only do CPU replacement check on
  5. cold boots
  6. CPU replacement check should only be done on cold boots.
  7. Change-Id: I98efa105f4df755b23febe12dd7b356787847852
  8. Signed-off-by: Angel Pons <th3fanbus@gmail.com>
  9. ---
  10. .../intel/haswell/native_raminit/raminit_native.c | 13 ++++++-------
  11. 1 file changed, 6 insertions(+), 7 deletions(-)
  12. diff --git a/src/northbridge/intel/haswell/native_raminit/raminit_native.c b/src/northbridge/intel/haswell/native_raminit/raminit_native.c
  13. index 0869db3902..bd9bc8e692 100644
  14. --- a/src/northbridge/intel/haswell/native_raminit/raminit_native.c
  15. +++ b/src/northbridge/intel/haswell/native_raminit/raminit_native.c
  16. @@ -40,15 +40,14 @@ static enum raminit_boot_mode get_boot_mode(void)
  17. return (pmcon_2 & bitmask) == bitmask ? BOOTMODE_WARM : BOOTMODE_COLD;
  18. }
  19. -static bool early_init_native(int s3resume)
  20. +static bool early_init_native(enum raminit_boot_mode bootmode)
  21. {
  22. printk(BIOS_DEBUG, "Starting native platform initialisation\n");
  23. intel_early_me_init();
  24. - /** TODO: CPU replacement check must be skipped in warm boots and S3 resumes **/
  25. - const bool cpu_replaced = !s3resume && intel_early_me_cpu_replacement_check();
  26. + bool cpu_replaced = bootmode == BOOTMODE_COLD && intel_early_me_cpu_replacement_check();
  27. - early_pch_init_native(s3resume);
  28. + early_pch_init_native(bootmode == BOOTMODE_S3);
  29. if (!CONFIG(INTEL_LYNXPOINT_LP))
  30. dmi_early_init();
  31. @@ -176,13 +175,13 @@ void perform_raminit(const int s3resume)
  32. * See, this function's name is a lie. There are more things to
  33. * do that memory initialisation, but they are relatively easy.
  34. */
  35. - const bool cpu_replaced = early_init_native(s3resume);
  36. + const enum raminit_boot_mode orig_bootmode = get_boot_mode();
  37. +
  38. + const bool cpu_replaced = early_init_native(s3resume ? BOOTMODE_S3 : orig_bootmode);
  39. wait_txt_clear();
  40. wrmsr(0x2e6, (msr_t) {.lo = 0, .hi = 0});
  41. - const enum raminit_boot_mode orig_bootmode = get_boot_mode();
  42. -
  43. struct mrc_data md = prepare_mrc_cache();
  44. const enum raminit_boot_mode bootmode =
  45. --
  46. 2.39.2