0004-Do-not-use-microcode-updates-on-AMD-platforms.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. From 2b1d40b970d9cbbb4f8fe30679e9b6909aa3d99a Mon Sep 17 00:00:00 2001
  2. From: Leah Rowe <leah@libreboot.org>
  3. Date: Thu, 6 May 2021 17:07:06 +0100
  4. Subject: [PATCH 4/6] Do not use microcode updates on AMD platforms
  5. Coreboot is hardcoding the use of microcode updates on some platforms.
  6. Just nuke it from orbit. This is the libre branch of osboot, so microcode must
  7. not be used.
  8. ---
  9. src/cpu/Makefile.inc | 52 +------------------
  10. src/cpu/amd/family_10h-family_15h/Kconfig | 1 -
  11. .../amd/family_10h-family_15h/Makefile.inc | 10 +---
  12. 3 files changed, 2 insertions(+), 61 deletions(-)
  13. diff --git a/src/cpu/Makefile.inc b/src/cpu/Makefile.inc
  14. index b80c30d72b..e7909d32ed 100644
  15. --- a/src/cpu/Makefile.inc
  16. +++ b/src/cpu/Makefile.inc
  17. @@ -14,54 +14,4 @@ $(eval $(call create_class_compiler,cpu_microcode,x86_32))
  18. ## Rules for building the microcode blob in CBFS
  19. ################################################################################
  20. -ifneq ($(CONFIG_CPU_MICROCODE_MULTIPLE_FILES), y)
  21. -cbfs-files-$(CONFIG_USE_CPU_MICROCODE_CBFS_BINS) += cpu_microcode_blob.bin
  22. -endif
  23. -
  24. -ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER),y)
  25. -cbfs-files-y += cpu_microcode_blob.bin
  26. -cpu_microcode_blob.bin-file = $(objgenerated)/microcode.bin
  27. -
  28. -$(objgenerated)/microcode.bin: $(call strip_quotes,$(CONFIG_CPU_MICROCODE_HEADER_FILES))
  29. - echo " util/scripts/ucode_h_to_bin.sh $(objgenerated)/microcode.bin \"$(CONFIG_CPU_MICROCODE_HEADER_FILES)\""
  30. - util/scripts/ucode_h_to_bin.sh $(objgenerated)/microcode.bin $(CONFIG_CPU_MICROCODE_HEADER_FILES)
  31. -endif
  32. -
  33. -ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS),y)
  34. -cpu_microcode_bins := $(call strip_quotes,$(CONFIG_CPU_UCODE_BINARIES))
  35. -endif
  36. -# otherwise `cpu_microcode_bins` should be filled by platform makefiles
  37. -
  38. -# We just mash all microcode binaries together into one binary to rule them all.
  39. -# This approach assumes that the microcode binaries are properly padded, and
  40. -# their headers specify the correct size. This works fairly well on isolatied
  41. -# updates, such as Intel and some AMD microcode, but won't work very well if the
  42. -# updates are wrapped in a container, like AMD's microcode update container. If
  43. -# there is only one microcode binary (i.e. one container), then we don't have
  44. -# this issue, and this rule will continue to work.
  45. -$(obj)/cpu_microcode_blob.bin: $$(wildcard $$(cpu_microcode_bins))
  46. - for bin in $(cpu_microcode_bins); do \
  47. - if [ ! -f "$$bin" ]; then \
  48. - echo "Microcode error: $$bin does not exist"; \
  49. - NO_MICROCODE_FILE=1; \
  50. - fi; \
  51. - done; \
  52. - if [ -n "$$NO_MICROCODE_FILE" ]; then \
  53. - if [ -z "$(CONFIG_USE_BLOBS)" ] && [ -n "$(CONFIG_CPU_MICROCODE_CBFS_DEFAULT_BINS)" ]; then \
  54. - echo "Try enabling binary-only repository in Kconfig 'General setup' menu."; \
  55. - fi; \
  56. - false; \
  57. - fi
  58. - $(if $^,,false) # fail if no file is given at all
  59. - @printf " MICROCODE $(subst $(obj)/,,$(@))\n"
  60. - @echo $(cpu_microcode_bins)
  61. - cat $^ > $@
  62. -
  63. -cpu_microcode_blob.bin-file ?= $(obj)/cpu_microcode_blob.bin
  64. -cpu_microcode_blob.bin-type := microcode
  65. -
  66. -ifneq ($(CONFIG_CPU_MICROCODE_CBFS_LOC),)
  67. -cpu_microcode_blob.bin-COREBOOT-position := $(CONFIG_CPU_MICROCODE_CBFS_LOC)
  68. -else
  69. -cpu_microcode_blob.bin-align := 16
  70. -endif
  71. +# No microcode permitted in this version of coreboot.
  72. diff --git a/src/cpu/amd/family_10h-family_15h/Kconfig b/src/cpu/amd/family_10h-family_15h/Kconfig
  73. index ad4f5f4ba6..21150ab1a7 100644
  74. --- a/src/cpu/amd/family_10h-family_15h/Kconfig
  75. +++ b/src/cpu/amd/family_10h-family_15h/Kconfig
  76. @@ -8,7 +8,6 @@ config CPU_AMD_MODEL_10XXX
  77. select TSC_SYNC_LFENCE
  78. select UDELAY_LAPIC
  79. select SUPPORT_CPU_UCODE_IN_CBFS
  80. - select CPU_MICROCODE_MULTIPLE_FILES
  81. select CAR_GLOBAL_MIGRATION
  82. if CPU_AMD_MODEL_10XXX
  83. diff --git a/src/cpu/amd/family_10h-family_15h/Makefile.inc b/src/cpu/amd/family_10h-family_15h/Makefile.inc
  84. index 7035323026..e0029f562d 100644
  85. --- a/src/cpu/amd/family_10h-family_15h/Makefile.inc
  86. +++ b/src/cpu/amd/family_10h-family_15h/Makefile.inc
  87. @@ -14,12 +14,4 @@ ramstage-y += ram_calc.c
  88. ramstage-y += monotonic_timer.c
  89. ramstage-$(CONFIG_HAVE_ACPI_TABLES) += powernow_acpi.c
  90. -# Microcode for Family 10h, 11h, 12h, and 14h
  91. -cbfs-files-$(CONFIG_CPU_MICROCODE_CBFS_DEFAULT_BINS) += microcode_amd.bin
  92. -microcode_amd.bin-file := 3rdparty/blobs/cpu/amd/family_10h-family_14h/microcode_amd.bin
  93. -microcode_amd.bin-type := microcode
  94. -
  95. -# Microcode for Family 15h
  96. -cbfs-files-$(CONFIG_CPU_MICROCODE_CBFS_DEFAULT_BINS) += microcode_amd_fam15h.bin
  97. -microcode_amd_fam15h.bin-file := 3rdparty/blobs/cpu/amd/family_15h/microcode_amd_fam15h.bin
  98. -microcode_amd_fam15h.bin-type := microcode
  99. +# Microcode deleted in this version of coreboot.
  100. --
  101. 2.25.1