Lev has uploaded this change for review. ( https://review.coreboot.org/25546
Change subject: util/scripts/ucode_h_to_bin.sh: Accept microcode in INC format ......................................................................
util/scripts/ucode_h_to_bin.sh: Accept microcode in INC format
Intel supply microcode (at least for MinnowBoard) in Intel Assembly *.inc format rather than C header. This change allow to pass in configuration directory with *.inc files rather than list of *.h files.
Change-Id: I3c716e5ad42e55ab3a3a67de1e9bf10e58855540 Signed-off-by: Bartek Pastudzki Bartek.Pastudzki@3mdeb.com --- M src/soc/intel/fsp_baytrail/Kconfig M util/scripts/ucode_h_to_bin.sh 2 files changed, 17 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/25546/1
diff --git a/src/soc/intel/fsp_baytrail/Kconfig b/src/soc/intel/fsp_baytrail/Kconfig index 549ea55..f4cc16c 100644 --- a/src/soc/intel/fsp_baytrail/Kconfig +++ b/src/soc/intel/fsp_baytrail/Kconfig @@ -97,7 +97,7 @@
config CPU_MICROCODE_HEADER_FILES string - default "../intel/cpu/baytrail/microcode/M0130673322.h ../intel/cpu/baytrail/microcode/M0130679901.h ../intel/cpu/baytrail/microcode/M0230672228.h" + default "../Vlv2MiscBinariesPkg/Microcode"
## Baytrail Specific FSP Kconfig source src/soc/intel/fsp_baytrail/fsp/Kconfig diff --git a/util/scripts/ucode_h_to_bin.sh b/util/scripts/ucode_h_to_bin.sh index 2d7f5fa..b834dcd 100755 --- a/util/scripts/ucode_h_to_bin.sh +++ b/util/scripts/ucode_h_to_bin.sh @@ -40,8 +40,23 @@ unsigned int microcode[] = { EOF
+include_file() { + if [ ${1: -4} == ".inc" ]; then + awk '{gsub( /h.*$/, "", $2 ); print "0x" $2 ","; }' $1 >> ${TMPFILE}.c + else + echo "#include "$1"" >> "${TMPFILE}.c" + fi +} + for UCODE in ${@:2}; do - echo "#include "$UCODE"" >> "${TMPFILE}.c" + if [ -d "$UCODE" ]; then + for f in "$UCODE/"*.inc + do + include_file "$f" + done + else + include_file "$UCODE" + fi done
cat >> "${TMPFILE}.c" << EOF