Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to review the following change.
Change subject: [WIP]amdfwtool: Take a config file instead of command line parameters ......................................................................
[WIP]amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao zheng.bao@amd.com Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/amdfwtool.sh A util/amdfwtool/data_parse.c A util/amdfwtool/sample.txt 10 files changed, 899 insertions(+), 142 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/1
diff --git a/Makefile.inc b/Makefile.inc index bbb6685..0e10136 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -81,7 +81,7 @@ subdirs-y += src/superio subdirs-y += $(wildcard src/drivers/*) $(wildcard src/drivers/*/*) subdirs-y += src/cpu src/vendorcode -subdirs-y += util/cbfstool util/sconfig util/nvramtool util/pgtblgen +subdirs-y += util/cbfstool util/sconfig util/nvramtool util/pgtblgen util/amdfwtool subdirs-y += util/futility util/marvell util/bincfg util/supermicro subdirs-y += $(wildcard src/arch/*) subdirs-y += src/mainboard/$(MAINBOARDDIR) @@ -566,9 +566,9 @@ cp -a $(top)/util/ifdtool/ifdtool $@
AMDFWTOOL:=$(objutil)/amdfwtool/amdfwtool -$(AMDFWTOOL): $(top)/util/amdfwtool/amdfwtool.c - @printf " HOSTCC $(subst $(obj)/,,$(@))\n" - $(HOSTCC) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -o $@ $< +#$(AMDFWTOOL): $(top)/util/amdfwtool/amdfwtool.c +# @printf " HOSTCC $(subst $(obj)/,,$(@))\n" +# $(HOSTCC) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -o $@ $<
APCB_EDIT_TOOL:=$(top)/util/apcb/apcb_edit.py
@@ -666,7 +666,7 @@ include util/crossgcc/Makefile.inc
.PHONY: tools -tools: $(objutil)/kconfig/conf $(objutil)/kconfig/toada $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(objutil)/sconfig/sconfig $(IFDTOOL) $(CBOOTIMAGE) $(AMDFWTOOL) $(AMDCOMPRESS) $(FUTILITY) $(BINCFG) $(IFITTOOL) $(objutil)/supermicro/smcbiosinfo +tools: $(objutil)/kconfig/conf $(objutil)/kconfig/toada $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(objutil)/sconfig/sconfig $(IFDTOOL) $(CBOOTIMAGE) $(objutil)/amdfwtool/amdfwtool $(AMDCOMPRESS) $(FUTILITY) $(BINCFG) $(IFITTOOL) $(objutil)/supermicro/smcbiosinfo
########################################################################### # Common recipes for all stages @@ -1094,7 +1094,6 @@ endif
$(obj)/coreboot.rom: $(obj)/coreboot.pre $(RAMSTAGE) $(CBFSTOOL) $$(INTERMEDIATE) - @printf " CBFS $(subst $(obj)/,,$(@))\n" # The full ROM may be larger than the CBFS part, so create an empty # file (filled with \377 = 0xff) and copy the CBFS image over it. diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc index 39269e9..20fb5c2 100644 --- a/src/soc/amd/picasso/Makefile.inc +++ b/src/soc/amd/picasso/Makefile.inc @@ -378,14 +378,6 @@ rm -f $@ @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" $(AMDFWTOOL) \ - $(OPT_AMD_PUBKEY_FILE) \ - $(OPT_PSPBTLDR_FILE) \ - $(OPT_PSPSCUREOS_FILE) \ - $(OPT_PSP_SEC_DBG_KEY_FILE) \ - $(OPT_SMUFW1_SUB2_FILE) \ - $(OPT_SMUFW2_SUB2_FILE) \ - $(OPT_SMUFW1_SUB1_FILE) \ - $(OPT_SMUFW2_SUB1_FILE) \ $(OPT_PSP_APCB_FILES) \ $(OPT_APOB_ADDR) \ --apob-nv-size $(shell printf "0x%x" \ @@ -398,38 +390,18 @@ $(OPT_PSP_BIOSBIN_DEST) \ $(OPT_PSP_BIOSBIN_SIZE) \ $(OPT_PSP_SOFTFUSE) \ - $(OPT_PSP_PMUI_FILE1) \ - $(OPT_PSP_PMUI_FILE2) \ - $(OPT_PSP_PMUI_FILE3) \ - $(OPT_PSP_PMUI_FILE4) \ - $(OPT_PSP_PMUD_FILE1) \ - $(OPT_PSP_PMUD_FILE2) \ - $(OPT_PSP_PMUD_FILE3) \ - $(OPT_PSP_PMUD_FILE4) \ - $(OPT_MP2CFG_FILE) \ - $(OPT_ABL0_FILE) \ - $(OPT_ABL1_FILE) \ - $(OPT_ABL2_FILE) \ - $(OPT_ABL3_FILE) \ - $(OPT_ABL4_FILE) \ - $(OPT_ABL5_FILE) \ - $(OPT_ABL6_FILE) \ - $(OPT_ABL7_FILE) \ $(OPT_WHITELIST_FILE) \ - $(OPT_SECG1_FILE) \ - $(OPT_SECG2_FILE) \ - $(OPT_MP2FW1_FILE) \ - $(OPT_MP2FW2_FILE) \ - $(OPT_DRIVERS_FILE) \ - $(OPT_PSP_S0I3_FILE) \ - $(OPT_IKEK_FILE) \ $(OPT_SEC_DEBUG_FILE) \ + --config $(FIRMWARE_LOCATE)/fw.cfg \ --combo-capable \ $(OPT_TOKEN_UNLOCK) \ --flashsize $(CONFIG_ROM_SIZE) \ --location $(shell printf "0x%x" $(PICASSO_FWM_POSITION)) \ --output $@
+# --config /home/baozheng/x86/coreboot-gerrit/src/soc/amd/picasso/fw.cfg \ + + $(PSP_BIOSBIN_FILE): $(PSP_ELF_FILE) $(AMDCOMPRESS) rm -f $@ @printf " AMDCOMPRS $(subst $(obj)/,,$(@))\n" diff --git a/src/soc/amd/picasso/fw.cfg b/src/soc/amd/picasso/fw.cfg new file mode 100644 index 0000000..f5b9d13 --- /dev/null +++ b/src/soc/amd/picasso/fw.cfg @@ -0,0 +1,46 @@ +# sample PSP fw config file +# Move to amd_blob +# type file +AMD_PUBKEY_FILE AmdPubKeyRV.bin +PSPBTLDR_FILE PspBootLoader_prod_RV.sbin +#PUBSIGNEDKEY_FILE RtmPubSignedRV.key +PSP_SMUFW1_SUB1_FILE SmuFirmwareRV2.csbin +PSP_SMUFW1_SUB2_FILE SmuFirmwarePCO.csbin +PSP_SMUFW2_SUB1_FILE SmuFirmware2RV2.csbin +PSP_SMUFW2_SUB2_FILE SmuFirmware2PCO.csbin +PSPSCUREOS_FILE psp_os_combined_prod_RV.sbin +#PSPTRUSTLETS_FILE dr_ftpm_prod_RV.csbin +#PSP_SEC_DBG_KEY_FILE RavenSecureDebug_PublicKey.bin +PSPSCUREOS_FILE psp_os_combined_prod_RV.sbin +PSP_ABL0_FILE AgesaBootloader0_prod_RV.csbin +PSP_ABL1_FILE AgesaBootloader1_prod_RV.csbin +PSP_ABL2_FILE AgesaBootloader2_prod_RV.csbin +PSP_ABL3_FILE AgesaBootloader3_prod_RV.csbin +PSP_ABL4_FILE AgesaBootloader4_prod_RV.csbin +PSP_ABL5_FILE AgesaBootloader5_prod_RV.csbin +PSP_ABL6_FILE AgesaBootloader6_prod_RV.csbin +PSP_ABL7_FILE AgesaBootloader7_prod_RV.csbin +#PSP_SEC_DEBUG_FILE secure_unlock_prod_RV.sbin +PSP_IKEK_FILE PspIkekRV.bin +PSP_SECG1_FILE security_policy_RV2_FP5_AM4.sbin +PSP_SECG2_FILE security_policy_PCO_FP5_AM4.sbin +#PSP_MP2FW1_FILE MP2I2CFWRV2.sbin +#PSP_MP2FW2_FILE MP2I2CFWPCO.sbin +#PSP_MP2CFG_FILE MP2FWConfig.sbin +PSP_DRIVERS_FILE drv_sys_prod_RV.sbin +#PSP_SOFTFUSE 0x0000000010000001 +#PSP_S0I3_FILE dr_agesa_prod_RV.sbin +#PSP_APOBNV_BASE +#PSP_APOBNV_SIZE +# +## BDT +#PSP_APCB0_FILE apcb.bin +PSP_PMUI_FILE1 Appb_Rv_1D_Ddr4_Udimm_Imem.csbin +PSP_PMUI_FILE2 Appb_Rv_2D_Ddr4_Imem.csbin +PSP_PMUI_FILE3 Appb_Rv2_1D_ddr4_Udimm_Imem.csbin +PSP_PMUI_FILE4 Appb_Rv2_2D_ddr4_Udimm_Imem.csbin +PSP_PMUD_FILE1 Appb_Rv_1D_Ddr4_Udimm_Dmem.csbin +PSP_PMUD_FILE2 Appb_Rv_2D_Ddr4_Dmem.csbin +PSP_PMUD_FILE3 Appb_Rv2_1D_ddr4_Udimm_Dmem.csbin +PSP_PMUD_FILE4 Appb_Rv2_2D_ddr4_Udimm_Dmem.csbin +#PSP_MP2CFG_FILE MP2FWConfig.sbin diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile index e9fd91b..9f7a01b 100644 --- a/util/amdfwtool/Makefile +++ b/util/amdfwtool/Makefile @@ -2,15 +2,47 @@ # # All rights reserved. # -# SPDX-License-Identifier: BSD-3-Clause - +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Advanced Micro Devices, Inc. nor the names of +# its contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# #***************************************************************************** HOSTCC ?= cc
-amdfwtool_exe : amdfwtool.c - $(HOSTCC) amdfwtool.c -o amdfwtool +SRC = amdfwtool.c data_parse.c +OBJ = $(SRC:%.c=%.o) +TARGET = amdfwtool +CFLAGS=-O2 -Wall -Wextra -Wshadow -Wno-sign-compare
-amdfwtool : amdfwtool_exe + +$(TARGET): $(OBJ) + $(CC) $(OBJ) $(LDFLAGS) -o $@ + +%.o: %.c $(HEADER) + $(CC) $(CFLAGS) -c -o $@ $< + +amdfwtool_exe : $(TARGET) +# $(HOSTCC) amdfwtool.c -o amdfwtool +# +#amdfwtool : amdfwtool_exe
clean: - @rm -f amdfwtool.o amdfwtool amdfwtool.exe + rm -f $(TARGET) $(OBJ) diff --git a/util/amdfwtool/Makefile.inc b/util/amdfwtool/Makefile.inc new file mode 100644 index 0000000..36ff207d --- /dev/null +++ b/util/amdfwtool/Makefile.inc @@ -0,0 +1,52 @@ +#***************************************************************************** +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Advanced Micro Devices, Inc. nor the names of +# its contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +#***************************************************************************** +#HOSTCC ?= cc + +amdfwtoolobj = amdfwtool.o data_parse.o + +#TARGET = $(objutil)/amdfwtool/amdfwtool +AMDFWTOOLCFLAGS=-O2 -Wall -Wextra -Wshadow -Wno-sign-compare + + +#$(TARGET): $(OBJ) +# $(CC) $(OBJ) $(LDFLAGS) -o $@ + +$(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c # $(HEADER) + printf " AMDFWTOOL\n" + $(HOSTCC) $(AMDFWTOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< + +#amdfwtool_exe : $(TARGET) +# $(HOSTCC) amdfwtool.c -o amdfwtool +# +#amdfwtool : amdfwtool_exe + +#clean: +# rm -f $(TARGET) $(OBJ) +$(objutil)/amdfwtool/amdfwtool: $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) + printf " AMDFWTOOL\n" + $(HOSTCC) $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) -o $@ diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index a5e5110..eb0cae8 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -56,6 +56,9 @@ #include <string.h> #include <stdlib.h> #include <getopt.h> +#include <libgen.h> + +#include "amdfwtool.h"
#ifndef CONFIG_ROM_SIZE #define CONFIG_ROM_SIZE 0x400000 @@ -98,13 +101,6 @@ */ #define PSP_COMBO 0
-#if defined(__GLIBC__) -typedef unsigned long long int uint64_t; -typedef unsigned int uint32_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -#endif - /* * Creates the OSI Fletcher checksum. See 8473-1, Appendix C, section C.3. * The checksum field of the passed PDU does not need to be reset to zero. @@ -216,92 +212,11 @@ printf("-R | --sharedmem Location of PSP/FW shared memory\n"); printf("-P | --sharedmem-size Maximum size of the PSP/FW shared memory area\n"); printf("-h | --help show this help\n"); + printf("-C | --config config file\n"); }
-typedef enum _amd_bios_type { - AMD_BIOS_APCB = 0x60, - AMD_BIOS_APOB = 0x61, - AMD_BIOS_BIN = 0x62, - AMD_BIOS_APOB_NV = 0x63, - AMD_BIOS_PMUI = 0x64, - AMD_BIOS_PMUD = 0x65, - AMD_BIOS_UCODE = 0x66, - AMD_BIOS_APCB_BK = 0x68, - AMD_BIOS_MP2_CFG = 0x6a, - AMD_BIOS_PSP_SHARED_MEM = 0x6b, - AMD_BIOS_L2_PTR = 0x70, - AMD_BIOS_INVALID, -} amd_bios_type;
-#define BDT_LVL1 0x1 -#define BDT_LVL2 0x2 -#define BDT_BOTH (BDT_LVL1 | BDT_LVL2) -typedef struct _amd_bios_entry { - amd_bios_type type; - int region_type; - int reset; - int copy; - int ro; - int zlib; - int inst; - int subpr; - uint64_t src; - uint64_t dest; - size_t size; - char *filename; - int level; -} amd_bios_entry; - -typedef enum _amd_fw_type { - AMD_FW_PSP_PUBKEY = 0, - AMD_FW_PSP_BOOTLOADER = 1, - AMD_FW_PSP_SMU_FIRMWARE = 8, - AMD_FW_PSP_RECOVERY = 3, - AMD_FW_PSP_RTM_PUBKEY = 5, - AMD_FW_PSP_SECURED_OS = 2, - AMD_FW_PSP_NVRAM = 4, - AMD_FW_PSP_SECURED_DEBUG = 9, - AMD_FW_PSP_TRUSTLETS = 12, - AMD_FW_PSP_TRUSTLETKEY = 13, - AMD_FW_PSP_SMU_FIRMWARE2 = 18, - AMD_PSP_FUSE_CHAIN = 11, - AMD_FW_PSP_SMUSCS = 95, - AMD_DEBUG_UNLOCK = 0x13, - AMD_WRAPPED_IKEK = 0x21, - AMD_TOKEN_UNLOCK = 0x22, - AMD_SEC_GASKET = 0x24, - AMD_MP2_FW = 0x25, - AMD_DRIVER_ENTRIES = 0x28, - AMD_S0I3_DRIVER = 0x2d, - AMD_ABL0 = 0x30, - AMD_ABL1 = 0x31, - AMD_ABL2 = 0x32, - AMD_ABL3 = 0x33, - AMD_ABL4 = 0x34, - AMD_ABL5 = 0x35, - AMD_ABL6 = 0x36, - AMD_ABL7 = 0x37, - AMD_FW_PSP_WHITELIST = 0x3a, - AMD_FW_L2_PTR = 0x40, - AMD_FW_PSP_VERSTAGE = 0x52, - AMD_FW_IMC, - AMD_FW_GEC, - AMD_FW_XHCI, - AMD_FW_INVALID, -} amd_fw_type; - -#define PSP_LVL1 0x1 -#define PSP_LVL2 0x2 -#define PSP_BOTH (PSP_LVL1 | PSP_LVL2) -typedef struct _amd_fw_entry { - amd_fw_type type; - uint8_t subprog; - char *filename; - int level; - uint64_t other; -} amd_fw_entry; - -static amd_fw_entry amd_psp_fw_table[] = { +/* static */ amd_fw_entry amd_psp_fw_table[] = { { .type = AMD_FW_PSP_PUBKEY, .level = PSP_BOTH }, { .type = AMD_FW_PSP_BOOTLOADER, .level = PSP_BOTH }, { .type = AMD_FW_PSP_SMU_FIRMWARE, .subprog = 0, .level = PSP_BOTH }, @@ -343,14 +258,14 @@ { .type = AMD_FW_INVALID }, };
-static amd_fw_entry amd_fw_table[] = { +amd_fw_entry amd_fw_table[] = { { .type = AMD_FW_XHCI }, { .type = AMD_FW_IMC }, { .type = AMD_FW_GEC }, { .type = AMD_FW_INVALID }, };
-static amd_bios_entry amd_bios_table[] = { +amd_bios_entry amd_bios_table[] = { { .type = AMD_BIOS_APCB, .inst = 0, .level = BDT_BOTH }, { .type = AMD_BIOS_APCB, .inst = 1, .level = BDT_BOTH }, { .type = AMD_BIOS_APCB, .inst = 2, .level = BDT_BOTH }, @@ -658,6 +573,28 @@ } }
+static void dump_psp_firmwares(amd_fw_entry *fw_table) +{ + amd_fw_entry *index; + + for (index = fw_table; index->type != AMD_FW_INVALID; index++) { + printf("type=%x\n", index->type); + if (index->filename) + printf (" filename=%s\n", index->filename); + } +} + +static void dump_bdt_firmwares(amd_bios_entry *fw_table) +{ + amd_bios_entry *index; + + for (index = fw_table; index->type != AMD_BIOS_INVALID; index++) { + printf("type=%x\n", index->type); + if (index->filename) + printf (" filename=%s\n", index->filename); + } +} + static void integrate_psp_firmwares(context *ctx, psp_directory_table *pspdir, psp_directory_table *pspdir2, @@ -1039,7 +976,7 @@ fill_dir_header(biosdir, count, cookie); } // Unused values: CDE -static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:qR:P:"; +static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:qR:P:C";
static struct option long_options[] = { {"xhci", required_argument, 0, 'x' }, @@ -1087,6 +1024,7 @@ {"apob-nv-base", required_argument, 0, 'F' }, {"apob-nv-size", required_argument, 0, 'H' }, /* other */ + {"config", required_argument, 0, 'C' }, {"output", required_argument, 0, 'o' }, {"flashsize", required_argument, 0, 'f' }, {"location", required_argument, 0, 'l' }, @@ -1097,7 +1035,7 @@ {NULL, 0, 0, 0 } };
-static void register_fw_fuse(char *str) +void register_fw_fuse(char *str) { int i;
@@ -1145,6 +1083,40 @@ } }
+static int register_fw_fuses(int fd, char *dir) +{ + struct stat fd_stat; + unsigned char *config_file; + +// fd = open(, O_RDONLY); +// if (fd < 0) { +// printf("Error opening file: %s: %s\n", +// src_file, strerror(errno)); +// return -1; +// } + + if (fstat(fd, &fd_stat)) { + printf("fstat error 1: %s\n", strerror(errno)); + close(fd); + return -2; + } + + //if (fd_stat.st_size > room) { + // printf("Error: %s will not fit. Exiting.\n", src_file); + // close(fd); + // return -3; + //} + + config_file = malloc (fd_stat.st_size+1); + read(fd, config_file, (size_t)fd_stat.st_size); + + config_file[fd_stat.st_size+1] = '\0'; + + process_config(config_file, dir); + printf("fuse written=[%s,%d] %x\n", __func__, __LINE__, amd_psp_fw_table[16].other); +} + + static void register_bdt_data(amd_bios_type type, int sub, int ins, char name[]) { int i; @@ -1188,8 +1160,8 @@ psp_directory_table *pspdir; int comboable = 0; int fuse_defined = 0; - int targetfd; - char *output = NULL; + int targetfd, configfd; + char *output = NULL, *config = NULL; context ctx = { .rom_size = CONFIG_ROM_SIZE, }; @@ -1427,6 +1399,9 @@ sub = instance = 0; break;
+ case 'C': + config = optarg; + break; case 'h': usage(); return 0; @@ -1434,9 +1409,29 @@ break; } } + #if 1 + if (!config) { + printf("Error: config file is not specified.\n\n"); + retval = 1; + }
- if (!fuse_defined) - register_fw_fuse(DEFAULT_SOFT_FUSE_CHAIN); + configfd = open(config, O_RDONLY); + + if (configfd >=0) { + printf("%s opened\n", config); + register_fw_fuses(configfd, dirname(config)); + } else { + printf("open failed\n"); + } + + + dump_psp_firmwares(amd_psp_fw_table); + dump_bdt_firmwares(amd_bios_table); + printf("close config file\n"); + close (configfd); +#endif + //if (!fuse_defined) + // register_fw_fuse(DEFAULT_SOFT_FUSE_CHAIN);
if (!output) { printf("Error: Output value is not specified.\n\n"); @@ -1571,6 +1566,7 @@ amd_romsig->bios1_entry = BUFF_TO_RUN(ctx, biosdir); }
+ /* TODO:Free the filename. */ targetfd = open(output, O_RDWR | O_CREAT | O_TRUNC, 0666); if (targetfd >= 0) { write(targetfd, amd_romsig, ctx.current - romsig_offset); diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h new file mode 100644 index 0000000..fda41b2 --- /dev/null +++ b/util/amdfwtool/amdfwtool.h @@ -0,0 +1,98 @@ +#ifndef _AMD_FW_TOOL_H_ +#define _AMD_FW_TOOL_H_ +#if defined(__GLIBC__) +typedef unsigned long long int uint64_t; +typedef unsigned int uint32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +#endif + + +typedef enum _amd_fw_type { + AMD_FW_PSP_PUBKEY = 0, + AMD_FW_PSP_BOOTLOADER = 1, + AMD_FW_PSP_SMU_FIRMWARE = 8, + AMD_FW_PSP_RECOVERY = 3, + AMD_FW_PSP_RTM_PUBKEY = 5, + AMD_FW_PSP_SECURED_OS = 2, + AMD_FW_PSP_NVRAM = 4, + AMD_FW_PSP_SECURED_DEBUG = 9, + AMD_FW_PSP_TRUSTLETS = 12, + AMD_FW_PSP_TRUSTLETKEY = 13, + AMD_FW_PSP_SMU_FIRMWARE2 = 18, + AMD_PSP_FUSE_CHAIN = 11, + AMD_FW_PSP_SMUSCS = 95, + AMD_DEBUG_UNLOCK = 0x13, + AMD_WRAPPED_IKEK = 0x21, + AMD_TOKEN_UNLOCK = 0x22, + AMD_SEC_GASKET = 0x24, + AMD_MP2_FW = 0x25, + AMD_DRIVER_ENTRIES = 0x28, + AMD_S0I3_DRIVER = 0x2d, + AMD_ABL0 = 0x30, + AMD_ABL1 = 0x31, + AMD_ABL2 = 0x32, + AMD_ABL3 = 0x33, + AMD_ABL4 = 0x34, + AMD_ABL5 = 0x35, + AMD_ABL6 = 0x36, + AMD_ABL7 = 0x37, + AMD_FW_PSP_WHITELIST = 0x3a, + AMD_FW_L2_PTR = 0x40, + AMD_FW_PSP_VERSTAGE = 0x52, + AMD_FW_IMC, + AMD_FW_GEC, + AMD_FW_XHCI, + AMD_FW_INVALID, +} amd_fw_type; + +typedef enum _amd_bios_type { + AMD_BIOS_APCB = 0x60, + AMD_BIOS_APOB = 0x61, + AMD_BIOS_BIN = 0x62, + AMD_BIOS_APOB_NV = 0x63, + AMD_BIOS_PMUI = 0x64, + AMD_BIOS_PMUD = 0x65, + AMD_BIOS_UCODE = 0x66, + AMD_BIOS_APCB_BK = 0x68, + AMD_BIOS_MP2_CFG = 0x6a, + AMD_BIOS_PSP_SHARED_MEM = 0x6b, + AMD_BIOS_L2_PTR = 0x70, + AMD_BIOS_INVALID, +} amd_bios_type; + + +#define BDT_LVL1 0x1 +#define BDT_LVL2 0x2 +#define BDT_BOTH (BDT_LVL1 | BDT_LVL2) +typedef struct _amd_bios_entry { + amd_bios_type type; + char *filename; + int subpr; + int region_type; + int reset; + int copy; + int ro; + int zlib; + int inst; + uint64_t src; + uint64_t dest; + size_t size; + int level; +} amd_bios_entry; + + +#define PSP_LVL1 0x1 +#define PSP_LVL2 0x2 +#define PSP_BOTH (PSP_LVL1 | PSP_LVL2) +typedef struct _amd_fw_entry { + amd_fw_type type; + char *filename; + uint8_t subprog; + int level; + uint64_t other; +} amd_fw_entry; + +void register_fw_fuse(char *str); + +#endif diff --git a/util/amdfwtool/amdfwtool.sh b/util/amdfwtool/amdfwtool.sh new file mode 100644 index 0000000..50006f8 --- /dev/null +++ b/util/amdfwtool/amdfwtool.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# --pubkey ../../3rdparty/blobs/soc/amd/picasso/PSP/AmdPubKeyRV.bin \ +# --bootloader /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//PspBootLoader_prod_RV.sbin \ +# --rtmpubkey /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//RtmPubSignedRV.key \ +# --secureos /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//psp_os_combined_prod_RV.sbin \ +# --securedebug /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//RavenSecureDebug_PublicKey.bin \ + +# --trustlets /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//dr_ftpm_prod_RV.csbin \ +# --subprogram 2 --smufirmware /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmwarePCO.csbin \ +# --subprogram 2 --smufirmware2 /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmware2PCO.csbin \ +# --subprogram 1 --smufirmware /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmwareRV2.csbin \ +# --subprogram 1 --smufirmware2 /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmware2RV2.csbin \ + +# --soft-fuse 0x0000000010000001 \ +# --subprogram 0 --instance 1 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_1D_Ddr4_Udimm_Imem.csbin \ +# --subprogram 0 --instance 4 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_2D_Ddr4_Imem.csbin \ +# --subprogram 1 --instance 1 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_1D_ddr4_Udimm_Imem.csbin \ +# --subprogram 1 --instance 4 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_2D_ddr4_Udimm_Imem.csbin \ +# --subprogram 0 --instance 1 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_1D_Ddr4_Udimm_Dmem.csbin \ +# --subprogram 0 --instance 4 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_2D_Ddr4_Dmem.csbin \ +# --subprogram 1 --instance 1 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_1D_ddr4_Udimm_Dmem.csbin \ +# --subprogram 1 --instance 4 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_2D_ddr4_Udimm_Dmem.csbin \ +# --mp2-config /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//MP2FWConfig.sbin \ +# --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader0_prod_RV.csbin \ +# --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader1_prod_RV.csbin \ +# --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader2_prod_RV.csbin \ +# --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader3_prod_RV.csbin \ +# --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader4_prod_RV.csbin \ +# --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader5_prod_RV.csbin \ +# --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader6_prod_RV.csbin \ +# --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader7_prod_RV.csbin \ +# --subprog 1 --sec-gasket /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//security_policy_RV2_FP5_AM4.sbin \ +# --subprog 2 --sec-gasket /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//security_policy_PCO_FP5_AM4.sbin \ +# --subprog 1 --mp2-fw /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//MP2I2CFWRV2.sbin \ +# --subprog 2 --mp2-fw /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//MP2I2CFWPCO.sbin \ +# --drv-entry-pts /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//drv_sys_prod_RV.sbin \ +# --ikek /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//PspIkekRV.bin \ +# --secdebug /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//secure_unlock_prod_RV.sbin \ + +./amdfwtool \ + --instance 0 --apcb ../../3rdparty/blobs/mainboard/amd/mandolin/apcb.bin \ + \ + \ + \ + \ + --apob-base 0x9f00000 \ + \ + --apob-nv-size 0x1000 \ + --bios-bin amd_biospsp.img \ + --bios-bin-dest 8078000 \ + --bios-uncomp-size 0x8000 \ + \ + \ + --combo-capable \ + --token-unlock \ + --flashsize 0x00800000 \ + --location 0xff820000 \ + --config sample.txt \ + --output amdfw.rom diff --git a/util/amdfwtool/data_parse.c b/util/amdfwtool/data_parse.c new file mode 100644 index 0000000..03f1a7f --- /dev/null +++ b/util/amdfwtool/data_parse.c @@ -0,0 +1,457 @@ +#include <stdio.h> +#include <regex.h> +#include <string.h> + +#include "amdfwtool.h" + +/* TODO: a empty line does not matched. */ +static const char blank_or_comment_regex[] = + /* a blank line */ + "(^[[:space:]]*$)" "|" /* or ... */ + /* a line consisting of: optional whitespace followed by */ + "(^[[:space:]]*" + /* a '#' character and optionally, additional characters */ + "#.*$)"; +static regex_t blank_or_comment_expr; + +static const char entries_line_regex[] = + /* optional whitespace */ + "^[[:space:]]*" + /* followed by a chunk of nonwhitespace for macro field */ + "([^[:space:]]+)" + /* followed by one or more whitespace characters */ + "[[:space:]]+" + /* followed by a chunk of nonwhitespace for filename field */ + "([^[:space:]]+)" + /* followed by optional whitespace */ + "[[:space:]]*$"; +static regex_t entries_line_expr; + +static const char entries_subprog_line_regex[] = + /* optional whitespace */ + "^[[:space:]]*" + /* followed by a chunk of nonwhitespace for macro field */ + "([^[:space:]]+)" + /* followed by one or more whitespace characters */ + "[[:space:]]+" + /* followed by a chunk of nonwhitespace for filename field */ + "([^[:space:]]+)" + /* followed by one or more whitespace characters */ + "[[:space:]]+" + /* followed by a chunk of nonwhitespace for filename field */ + "([^[:space:]]+)" + /* followed by optional whitespace */ + "[[:space:]]*$"; +static regex_t entries_subprog_line_expr; + +void compile_reg_expr(int cflags, const char *expr, regex_t *reg) +{ + static const size_t ERROR_BUF_SIZE = 256; + char error_msg[ERROR_BUF_SIZE]; + int result; + + if ((result = regcomp(reg, expr, cflags)) != 0) { + regerror(result, reg, error_msg, ERROR_BUF_SIZE); + printf("%s\n", error_msg); + exit(1); + } +} + +extern amd_fw_entry amd_psp_fw_table[]; +extern amd_bios_entry amd_bios_table[]; +void find_register_fw_filename(char *fw_name, char *filename, uint8_t subprog) +{ + unsigned int fw_type, fw_invalid, fw, entry_size; + void *tableptr; + uint8_t /* subprog = 0, */instance = 0; + + printf("fw_name=%s, fn=%s, subprog=%d\n", fw_name, filename, subprog); + if (strcmp(fw_name, "PSPBTLDR_FILE") == 0) { + fw_type = AMD_FW_PSP_BOOTLOADER; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); +// printf("fw_type=%x, size=%x\n", fw_type, entry_size); + } else if (strcmp(fw_name, "AMD_PUBKEY_FILE") == 0) { + fw_type = AMD_FW_PSP_PUBKEY; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); +// printf("fw_type=%x, size=%x\n", fw_type, entry_size); + } else if (strcmp(fw_name, "PUBSIGNEDKEY_FILE") == 0) { + fw_type = AMD_FW_PSP_RTM_PUBKEY; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_SMUFW1_SUB1_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE; + subprog = 1; + instance = 0; + fw_invalid = AMD_FW_INVALID; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_SMUFW1_SUB2_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE; + subprog = 2; + instance = 0; + fw_invalid = AMD_FW_INVALID; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_SMUFW2_SUB1_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE2; + fw_invalid = AMD_FW_INVALID; + subprog = 1; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_SMUFW2_SUB2_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE2; + fw_invalid = AMD_FW_INVALID; + subprog = 2; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_SEC_DBG_KEY_FILE") == 0) { + fw_type = AMD_FW_PSP_SECURED_DEBUG; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_ABL0_FILE") == 0) { + fw_type = AMD_ABL0; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_ABL1_FILE") == 0) { + fw_type = AMD_ABL1; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_ABL2_FILE") == 0) { + fw_type = AMD_ABL2; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_ABL3_FILE") == 0) { + fw_type = AMD_ABL3; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_ABL4_FILE") == 0) { + fw_type = AMD_ABL4; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_ABL5_FILE") == 0) { + fw_type = AMD_ABL5; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_ABL6_FILE") == 0) { + fw_type = AMD_ABL6; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_ABL7_FILE") == 0) { + fw_type = AMD_ABL7; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSPSCUREOS_FILE") == 0) { + fw_type = AMD_FW_PSP_SECURED_OS; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSPTRUSTLETS_FILE") == 0) { + fw_type = AMD_FW_PSP_TRUSTLETS; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_SEC_DEBUG_FILE") == 0) { + fw_type = AMD_DEBUG_UNLOCK; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_IKEK_FILE") == 0) { + fw_type = AMD_WRAPPED_IKEK; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_SECG1_FILE") == 0) { + fw_type = AMD_SEC_GASKET; + fw_invalid = AMD_FW_INVALID; + subprog = 1; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_SECG2_FILE") == 0) { + fw_type = AMD_SEC_GASKET; + fw_invalid = AMD_FW_INVALID; + subprog = 2; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_MP2FW1_FILE") == 0) { + fw_type = AMD_MP2_FW; + fw_invalid = AMD_FW_INVALID; + subprog = 1; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_MP2FW2_FILE") == 0) { + fw_type = AMD_MP2_FW; + fw_invalid = AMD_FW_INVALID; + subprog = 2; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_DRIVERS_FILE") == 0) { + fw_type = AMD_DRIVER_ENTRIES; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_S0I3_FILE") == 0) { + fw_type = AMD_S0I3_DRIVER; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else if (strcmp(fw_name, "PSP_WHITELIST_FILE") == 0) { + fw_type = AMD_FW_PSP_WHITELIST; + fw_invalid = AMD_FW_INVALID; + subprog = 0; + instance = 0; + tableptr = (void *)amd_psp_fw_table; + entry_size = sizeof (amd_fw_entry); + } else { + fw_type = AMD_FW_INVALID; +// return ; + /* TODO: Add more */ + } + +// printf("fw_type=%x, size=%x\n", fw_type, entry_size); + printf("Search and fill the filename\n"); + /* Search and fill the filename */ + while (*(unsigned int *)tableptr != fw_invalid) { + if (*(unsigned int *)tableptr == fw_type && + ((amd_bios_entry *)tableptr)->subpr == subprog) { + printf("type=%d,", *(unsigned int *)tableptr); + printf("found, fn=%s\n", filename); + ((amd_fw_entry *)tableptr)->filename = filename; + break; + } else { +// printf("not found type=%d\n", *(unsigned int *)tableptr); + } + tableptr += entry_size; + } + printf("\n"); + printf("Search and fill the filename 2\n\n"); + #if 1 + if (strcmp(fw_name, "PSP_PMUI_FILE1") == 0) { + fw_type = AMD_BIOS_PMUI; + subprog = 0; + instance = 1; + } else if (strcmp(fw_name, "PSP_PMUI_FILE2") == 0) { + fw_type = AMD_BIOS_PMUI; + subprog = 0; + instance = 4; + } else if (strcmp(fw_name, "PSP_PMUI_FILE3") == 0) { + fw_type = AMD_BIOS_PMUI; + subprog = 1; + instance = 1; + } else if (strcmp(fw_name, "PSP_PMUI_FILE4") == 0) { + fw_type = AMD_BIOS_PMUI; + subprog = 1; + instance = 4; + } else if (strcmp(fw_name, "PSP_PMUD_FILE1") == 0) { + fw_type = AMD_BIOS_PMUD; + subprog = 0; + instance = 1; + } else if (strcmp(fw_name, "PSP_PMUD_FILE2") == 0) { + fw_type = AMD_BIOS_PMUD; + subprog = 0; + instance = 4; + } else if (strcmp(fw_name, "PSP_PMUD_FILE3") == 0) { + fw_type = AMD_BIOS_PMUD; + subprog = 1; + instance = 1; + } else if (strcmp(fw_name, "PSP_PMUD_FILE4") == 0) { + fw_type = AMD_BIOS_PMUD; + subprog = 1; + instance = 4; + } else if (strcmp(fw_name, "PSP_MP2CFG_FILE") == 0) { + fw_type = AMD_BIOS_MP2_CFG; + subprog = 0; + instance = 0; + } else { + fw_type = AMD_BIOS_INVALID; + } + tableptr = (void *)amd_bios_table; + if (fw_type != AMD_BIOS_INVALID) { + while (*(unsigned int *)tableptr != AMD_BIOS_INVALID) { + //printf("%x,%x,%x\n", *(unsigned int *)tableptr, ((amd_bios_entry *)tableptr)->subpr, ((amd_bios_entry *)tableptr)->inst); + if (*(unsigned int *)tableptr == fw_type && + ((amd_bios_entry *)tableptr)->subpr == subprog && + ((amd_bios_entry *)tableptr)->inst == instance) { + ((amd_bios_entry *)tableptr)->filename = filename; + //((amd_bios_entry *)tableptr)->subpr = subprog; + //((amd_bios_entry *)tableptr)->inst = instance; + printf("type=%x,", *(unsigned int *)tableptr); + printf("found, fn=%s\n", filename); + break; + } + tableptr += sizeof (amd_bios_entry); + } + } + + printf("Search and fill the filename 3\n\n"); + if (strcmp(fw_name, "PSP_SOFTFUSE") == 0) { + fw_type = AMD_PSP_FUSE_CHAIN; + } else { + fw_type = AMD_BIOS_INVALID; + } + /* char *filename */ + printf("Search and fill the filename 3.1\n\n"); + tableptr = (void *)amd_psp_fw_table; + if (fw_type != AMD_BIOS_INVALID) { + while (*(unsigned int *)tableptr != AMD_BIOS_INVALID) { + printf("%x,%x,%x\n", *(unsigned int *)tableptr, ((amd_bios_entry *)tableptr)->subpr, ((amd_bios_entry *)tableptr)->inst); + if (*(unsigned int *)tableptr == fw_type) { + //((amd_bios_entry *)tableptr)->filename = filename; + //((amd_bios_entry *)tableptr)->subpr = subprog; + ((amd_fw_entry *)tableptr)->other = strtoull(filename, NULL, 16); + printf("type=%x,", *(unsigned int *)tableptr); + printf("found, fuse=%llx\n", ((amd_fw_entry *)tableptr)->other); + break; + } + tableptr += sizeof (amd_fw_entry); + } + } + printf("fuse written=[] %x\n", amd_psp_fw_table[16].other); + + printf("Search and fill the filename 3.9\n\n"); + +#endif + +} + +unsigned int read_line(char **config, char **oneline) +{ + char *ptr = *config; + char *line_start; + int num; + +// printf("read_line %c\n", **config); + if (*ptr == NULL) return -1; + + line_start = ptr; + while (*ptr != '\n' && *ptr != NULL) { + ptr ++; + } + + num = ptr - line_start; + *oneline = malloc(num+1); + + memcpy (*oneline, line_start, num); + *(*oneline + num) = '\0'; + ptr ++; /* skip enter. */ + //*oneline = ptr; +// printf("readline = %s\n", *oneline); + *config = ptr; + return 0; +} +#define N_MATCHES 4 +void process_config(char *config, char *dir) +{ +// char line [ /* LINE_BUF_SIZE */128]; + char *oneline, *current, *path_filename; + regmatch_t match[N_MATCHES]; + uint8_t subprog = 0; + + compile_reg_expr(REG_EXTENDED | REG_NEWLINE, blank_or_comment_regex, &blank_or_comment_expr); + compile_reg_expr(REG_EXTENDED | REG_NEWLINE, entries_line_regex, &entries_line_expr); + compile_reg_expr(REG_EXTENDED | REG_NEWLINE, entries_subprog_line_regex, &entries_subprog_line_expr); + + /* TODO: temp */ + //strcpy (line, "PSPBTLDR_FILE PspBootLoader_prod_RV.sbin\n\0"); +// strcpy (line, "AMD_PUBKEY_FILE AmdPubKeyRV.bin\n\0"); + + /* Get a line */ + current = config; + while (read_line(¤t, &oneline) != -1) { + /* get line */ + /* blank comment */ +// printf("%d\n", __LINE__); + if (!regexec(&blank_or_comment_expr, oneline, 0, NULL, 0)){ + printf("skip comment and blank\n"); + continue; + } + +// printf("%d\n", __LINE__); + if (regexec(&entries_line_expr, oneline, 3, match, 0) == 0) { + printf("matched entry\n"); + printf("%d, %d, %d\n", match[0].rm_eo, match[1].rm_eo, match[2].rm_eo); + printf("%d, %d, %d\n", match[0].rm_so, match[1].rm_so, match[2].rm_so); + oneline[match[1].rm_eo] = '\0'; + oneline[match[2].rm_eo] = '\0'; + } else if (regexec(&entries_subprog_line_expr, oneline, 4, match, 0) == 0) { + printf("matched subprog entry\n"); + printf("%d, %d, %d\n", match[0].rm_eo, match[1].rm_eo, match[2].rm_eo, match[3].rm_eo); + printf("%d, %d, %d\n", match[0].rm_so, match[1].rm_so, match[2].rm_so, match[3].rm_so); + oneline[match[1].rm_eo] = '\0'; + oneline[match[2].rm_eo] = '\0'; + oneline[match[3].rm_eo] = '\0'; + subprog = oneline[match[3].rm_so] - '0'; + } else { + printf("no match\n"); + continue; + } +// printf("%d\n", __LINE__); +// printf("%d\n", __LINE__); + +// printf("%s, %s\n", &(oneline[match[1].rm_so]), &(oneline[match[2].rm_so])); + path_filename = malloc(256); + strcpy(path_filename, dir); + strcat(path_filename, "/"); + strcat(path_filename, &(oneline[match[2].rm_so])); + find_register_fw_filename(&(oneline[match[1].rm_so]), path_filename, subprog); + + } + + printf("fuse written=[] %x\n", amd_psp_fw_table[16].other); + +} diff --git a/util/amdfwtool/sample.txt b/util/amdfwtool/sample.txt new file mode 100644 index 0000000..8c3edcc --- /dev/null +++ b/util/amdfwtool/sample.txt @@ -0,0 +1,45 @@ +# sample +# PSP +# type file subprog +AMD_PUBKEY_FILE AmdPubKeyRV.bin +PSPBTLDR_FILE PspBootLoader_prod_RV.sbin +PUBSIGNEDKEY_FILE RtmPubSignedRV.key +PSP_SMUFW1_SUB1_FILE SmuFirmwareRV2.csbin +PSP_SMUFW1_SUB2_FILE SmuFirmwarePCO.csbin +PSP_SMUFW2_SUB1_FILE SmuFirmware2RV2.csbin +PSP_SMUFW2_SUB2_FILE SmuFirmware2PCO.csbin +PSPSCUREOS_FILE psp_os_combined_prod_RV.sbin +PSPTRUSTLETS_FILE dr_ftpm_prod_RV.csbin +PSP_SEC_DBG_KEY_FILE RavenSecureDebug_PublicKey.bin +PSPSCUREOS_FILE psp_os_combined_prod_RV.sbin +PSP_ABL0_FILE AgesaBootloader0_prod_RV.csbin +PSP_ABL1_FILE AgesaBootloader1_prod_RV.csbin +PSP_ABL2_FILE AgesaBootloader2_prod_RV.csbin +PSP_ABL3_FILE AgesaBootloader3_prod_RV.csbin +PSP_ABL4_FILE AgesaBootloader4_prod_RV.csbin +PSP_ABL5_FILE AgesaBootloader5_prod_RV.csbin +PSP_ABL6_FILE AgesaBootloader6_prod_RV.csbin +PSP_ABL7_FILE AgesaBootloader7_prod_RV.csbin +PSP_SEC_DEBUG_FILE secure_unlock_prod_RV.sbin +PSP_IKEK_FILE PspIkekRV.bin +PSP_SECG1_FILE security_policy_RV2_FP5_AM4.sbin +PSP_SECG2_FILE security_policy_PCO_FP5_AM4.sbin +PSP_MP2FW1_FILE MP2I2CFWRV2.sbin +PSP_MP2FW2_FILE MP2I2CFWPCO.sbin +PSP_MP2CFG_FILE MP2FWConfig.sbin +PSP_DRIVERS_FILE drv_sys_prod_RV.sbin +PSP_SOFTFUSE 0x0000000010000001 +PSP_S0I3_FILE dr_agesa_prod_RV.sbin +#PSP_APOBNV_BASE +#PSP_APOBNV_SIZE +# +## BDT +#PSP_APCB0_FILE apcb.bin +PSP_PMUI_FILE1 Appb_Rv_1D_Ddr4_Udimm_Imem.csbin +PSP_PMUI_FILE2 Appb_Rv_2D_Ddr4_Imem.csbin +PSP_PMUI_FILE3 Appb_Rv2_1D_ddr4_Udimm_Imem.csbin +PSP_PMUI_FILE4 Appb_Rv2_2D_ddr4_Udimm_Imem.csbin +PSP_PMUD_FILE1 Appb_Rv_1D_Ddr4_Udimm_Dmem.csbin +PSP_PMUD_FILE2 Appb_Rv_2D_Ddr4_Dmem.csbin +PSP_PMUD_FILE3 Appb_Rv2_1D_ddr4_Udimm_Dmem.csbin +PSP_PMUD_FILE4 Appb_Rv2_2D_ddr4_Udimm_Dmem.csbin
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: [WIP]amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 1:
(100 comments)
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.c@... PS1, Line 583: printf (" filename=%s\n", index->filename); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.c@... PS1, Line 594: printf (" filename=%s\n", index->filename); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.c@... PS1, Line 979: static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:qR:P:C"; line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.c@... PS1, Line 1110: config_file = malloc (fd_stat.st_size+1); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.c@... PS1, Line 1420: if (configfd >=0) { spaces required around that '>=' (ctx:WxV)
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.c@... PS1, Line 1431: close (configfd); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh File util/amdfwtool/amdfwtool.sh:
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 4: # --bootloader /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//PspBootLoader_prod_RV.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 5: # --rtmpubkey /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//RtmPubSignedRV.key \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 6: # --secureos /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//psp_os_combined_prod_RV.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 7: # --securedebug /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//RavenSecureDebug_PublicKey.bin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 9: # --trustlets /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//dr_ftpm_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 10: # --subprogram 2 --smufirmware /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmwarePCO.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 11: # --subprogram 2 --smufirmware2 /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmware2PCO.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 12: # --subprogram 1 --smufirmware /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmwareRV2.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 13: # --subprogram 1 --smufirmware2 /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmware2RV2.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 16: # --subprogram 0 --instance 1 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_1D_Ddr4_Udimm_Imem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 17: # --subprogram 0 --instance 4 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_2D_Ddr4_Imem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 18: # --subprogram 1 --instance 1 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_1D_ddr4_Udimm_Imem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 19: # --subprogram 1 --instance 4 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_2D_ddr4_Udimm_Imem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 20: # --subprogram 0 --instance 1 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_1D_Ddr4_Udimm_Dmem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 21: # --subprogram 0 --instance 4 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_2D_Ddr4_Dmem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 22: # --subprogram 1 --instance 1 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_1D_ddr4_Udimm_Dmem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 23: # --subprogram 1 --instance 4 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_2D_ddr4_Udimm_Dmem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 24: # --mp2-config /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//MP2FWConfig.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 25: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader0_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 26: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader1_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 27: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader2_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 28: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader3_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 29: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader4_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 30: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader5_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 31: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader6_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 32: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader7_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 33: # --subprog 1 --sec-gasket /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//security_policy_RV2_FP5_AM4.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 34: # --subprog 2 --sec-gasket /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//security_policy_PCO_FP5_AM4.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 35: # --subprog 1 --mp2-fw /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//MP2I2CFWRV2.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 36: # --subprog 2 --mp2-fw /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//MP2I2CFWPCO.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 37: # --drv-entry-pts /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//drv_sys_prod_RV.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 38: # --ikek /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//PspIkekRV.bin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/amdfwtool.sh... PS1, Line 39: # --secdebug /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//secure_unlock_prod_RV.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 10: "(^[[:space:]]*$)" "|" /* or ... */ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 10: "(^[[:space:]]*$)" "|" /* or ... */ Consecutive strings are generally better as a single string
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 12: "(^[[:space:]]*" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 14: "#.*$)"; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 19: "^[[:space:]]*" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 21: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 23: "[[:space:]]+" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 25: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 27: "[[:space:]]*$"; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 32: "^[[:space:]]*" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 34: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 36: "[[:space:]]+" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 38: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 40: "[[:space:]]+" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 42: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 44: "[[:space:]]*$"; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 53: if ((result = regcomp(reg, expr, cflags)) != 0) { do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 75: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 83: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 91: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 98: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 105: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 112: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 119: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 126: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 133: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 140: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 147: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 154: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 161: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 168: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 175: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 182: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 189: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 196: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 203: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 210: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 217: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 224: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 231: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 238: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 245: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 252: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 259: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 276: } else { else is not generally useful after a break or return
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 326: //printf("%x,%x,%x\n", *(unsigned int *)tableptr, ((amd_bios_entry *)tableptr)->subpr, ((amd_bios_entry *)tableptr)->inst); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 337: tableptr += sizeof (amd_bios_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 342: if (strcmp(fw_name, "PSP_SOFTFUSE") == 0) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 352: printf("%x,%x,%x\n", *(unsigned int *)tableptr, ((amd_bios_entry *)tableptr)->subpr, ((amd_bios_entry *)tableptr)->inst); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 356: ((amd_fw_entry *)tableptr)->other = strtoull(filename, NULL, 16); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 361: tableptr += sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 379: if (*ptr == NULL) return -1; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 382: while (*ptr != '\n' && *ptr != NULL) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 383: ptr ++; space prohibited before that '++' (ctx:WxO)
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 389: memcpy (*oneline, line_start, num); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 391: ptr ++; /* skip enter. */ space prohibited before that '++' (ctx:WxO)
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 405: compile_reg_expr(REG_EXTENDED | REG_NEWLINE, blank_or_comment_regex, &blank_or_comment_expr); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 407: compile_reg_expr(REG_EXTENDED | REG_NEWLINE, entries_subprog_line_regex, &entries_subprog_line_expr); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 419: if (!regexec(&blank_or_comment_expr, oneline, 0, NULL, 0)){ space required before the open brace '{'
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 433: printf("%d, %d, %d\n", match[0].rm_eo, match[1].rm_eo, match[2].rm_eo, match[3].rm_eo); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/1/util/amdfwtool/data_parse.c... PS1, Line 434: printf("%d, %d, %d\n", match[0].rm_so, match[1].rm_so, match[2].rm_so, match[3].rm_so); line over 96 characters
Hello Jason Glenesk, build bot (Jenkins), Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#2).
Change subject: [WIP]amdfwtool: Take a config file instead of command line parameters ......................................................................
[WIP]amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao zheng.bao@amd.com Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw.cfg M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/amdfwtool.sh A util/amdfwtool/data_parse.c A util/amdfwtool/sample.txt 13 files changed, 1,005 insertions(+), 389 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: [WIP]amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 2:
(109 comments)
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.c@... PS2, Line 583: printf (" filename=%s\n", index->filename); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.c@... PS2, Line 594: printf (" filename=%s\n", index->filename); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.c@... PS2, Line 979: static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:qR:P:C"; line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.c@... PS2, Line 1110: config_file = malloc (fd_stat.st_size+1); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.c@... PS2, Line 1420: if (configfd >=0) { spaces required around that '>=' (ctx:WxV)
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.c@... PS2, Line 1431: close (configfd); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh File util/amdfwtool/amdfwtool.sh:
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 4: # --bootloader /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//PspBootLoader_prod_RV.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 5: # --rtmpubkey /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//RtmPubSignedRV.key \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 6: # --secureos /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//psp_os_combined_prod_RV.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 7: # --securedebug /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//RavenSecureDebug_PublicKey.bin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 9: # --trustlets /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//dr_ftpm_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 10: # --subprogram 2 --smufirmware /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmwarePCO.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 11: # --subprogram 2 --smufirmware2 /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmware2PCO.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 12: # --subprogram 1 --smufirmware /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmwareRV2.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 13: # --subprogram 1 --smufirmware2 /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//SmuFirmware2RV2.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 16: # --subprogram 0 --instance 1 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_1D_Ddr4_Udimm_Imem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 17: # --subprogram 0 --instance 4 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_2D_Ddr4_Imem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 18: # --subprogram 1 --instance 1 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_1D_ddr4_Udimm_Imem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 19: # --subprogram 1 --instance 4 --pmu-inst /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_2D_ddr4_Udimm_Imem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 20: # --subprogram 0 --instance 1 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_1D_Ddr4_Udimm_Dmem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 21: # --subprogram 0 --instance 4 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv_2D_Ddr4_Dmem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 22: # --subprogram 1 --instance 1 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_1D_ddr4_Udimm_Dmem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 23: # --subprogram 1 --instance 4 --pmu-data /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//Appb_Rv2_2D_ddr4_Udimm_Dmem.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 24: # --mp2-config /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//MP2FWConfig.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 25: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader0_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 26: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader1_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 27: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader2_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 28: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader3_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 29: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader4_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 30: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader5_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 31: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader6_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 32: # --abl-image /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//AgesaBootloader7_prod_RV.csbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 33: # --subprog 1 --sec-gasket /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//security_policy_RV2_FP5_AM4.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 34: # --subprog 2 --sec-gasket /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//security_policy_PCO_FP5_AM4.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 35: # --subprog 1 --mp2-fw /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//MP2I2CFWRV2.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 36: # --subprog 2 --mp2-fw /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//MP2I2CFWPCO.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 37: # --drv-entry-pts /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//drv_sys_prod_RV.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 38: # --ikek /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//PspIkekRV.bin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/amdfwtool.sh... PS2, Line 39: # --secdebug /home/baozheng/x86/coreboot-gerrit/3rdparty/blobs/soc/amd/picasso/PSP//secure_unlock_prod_RV.sbin \ line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 10: "(^[[:space:]]*$)" "|" /* or ... */ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 10: "(^[[:space:]]*$)" "|" /* or ... */ Consecutive strings are generally better as a single string
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 12: "(^[[:space:]]*" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 14: "#.*$)"; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 19: "^[[:space:]]*" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 21: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 23: "[[:space:]]+" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 25: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 27: "[[:space:]]*$"; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 32: "^[[:space:]]*" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 34: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 36: "[[:space:]]+" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 38: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 40: "[[:space:]]+" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 42: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 44: "[[:space:]]*$"; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 53: if ((result = regcomp(reg, expr, cflags)) != 0) { do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 76: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 85: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 94: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 102: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 109: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 116: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 123: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 130: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 137: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 144: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 151: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 158: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 165: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 172: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 179: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 187: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 194: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 203: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 210: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 217: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 224: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 231: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 238: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 245: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 252: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 260: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 267: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 274: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 282: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 289: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 296: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 304: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 311: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 323: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 331: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 339: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 356: } else { else is not generally useful after a break or return
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 402: //printf("%x,%x,%x\n", *(unsigned int *)tableptr, ((amd_bios_entry *)tableptr)->subpr, ((amd_bios_entry *)tableptr)->inst); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 413: tableptr += sizeof (amd_bios_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 418: if (strcmp(fw_name, "PSP_SOFTFUSE") == 0) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 428: printf("%x,%x,%x\n", *(unsigned int *)tableptr, ((amd_bios_entry *)tableptr)->subpr, ((amd_bios_entry *)tableptr)->inst); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 432: ((amd_fw_entry *)tableptr)->other = strtoull(filename, NULL, 16); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 437: tableptr += sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 455: if (*ptr == NULL) return -1; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 458: while (*ptr != '\n' && *ptr != NULL) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 459: ptr ++; space prohibited before that '++' (ctx:WxO)
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 465: memcpy (*oneline, line_start, num); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 467: ptr ++; /* skip enter. */ space prohibited before that '++' (ctx:WxO)
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 481: compile_reg_expr(REG_EXTENDED | REG_NEWLINE, blank_or_comment_regex, &blank_or_comment_expr); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 483: compile_reg_expr(REG_EXTENDED | REG_NEWLINE, entries_subprog_line_regex, &entries_subprog_line_expr); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 495: if (!regexec(&blank_or_comment_expr, oneline, 0, NULL, 0)){ space required before the open brace '{'
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 509: printf("%d, %d, %d\n", match[0].rm_eo, match[1].rm_eo, match[2].rm_eo, match[3].rm_eo); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/2/util/amdfwtool/data_parse.c... PS2, Line 510: printf("%d, %d, %d\n", match[0].rm_so, match[1].rm_so, match[2].rm_so, match[3].rm_so); line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#3).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c A util/amdfwtool/sample.txt 11 files changed, 791 insertions(+), 389 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/3
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 3:
(73 comments)
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/amdfwtool.c@... PS3, Line 582: printf (" filename=%s\n", index->filename); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/amdfwtool.c@... PS3, Line 592: printf (" filename=%s\n", index->filename); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/amdfwtool.c@... PS3, Line 977: static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:qR:P:C"; line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/amdfwtool.c@... PS3, Line 1095: config_file = malloc (fd_stat.st_size+1); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/amdfwtool.c@... PS3, Line 1404: if (configfd >=0) { spaces required around that '>=' (ctx:WxV)
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/amdfwtool.c@... PS3, Line 1404: if (configfd >=0) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/amdfwtool.c@... PS3, Line 1414: close (configfd); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 11: "(^[[:space:]]*$)" "|" /* or ... */ please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 11: "(^[[:space:]]*$)" "|" /* or ... */ Consecutive strings are generally better as a single string
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 13: "(^[[:space:]]*" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 15: "#.*$)"; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 20: "^[[:space:]]*" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 22: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 24: "[[:space:]]+" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 26: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 28: "[[:space:]]*$"; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 33: "^[[:space:]]*" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 35: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 37: "[[:space:]]+" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 39: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 41: "[[:space:]]+" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 43: "([^[:space:]]+)" please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 45: "[[:space:]]*$"; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 54: if ((result = regcomp(reg, expr, cflags)) != 0) { do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 75: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 84: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 93: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 101: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 108: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 115: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 122: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 129: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 136: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 143: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 150: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 157: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 164: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 171: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 178: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 186: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 193: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 202: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 209: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 216: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 223: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 230: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 237: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 244: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 251: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 259: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 266: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 273: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 281: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 288: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 295: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 303: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 310: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 322: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 330: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 338: entry_size = sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 350: } else { else is not generally useful after a break or return
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 400: tableptr += sizeof (amd_bios_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 404: if (strcmp(fw_name, "PSP_SOFTFUSE") == 0) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 414: ((amd_fw_entry *)tableptr)->other = strtoull(filename, NULL, 16); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 417: tableptr += sizeof (amd_fw_entry); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 430: if (*ptr == '\0') return -1; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 433: while (*ptr != '\n' && *ptr != '\0') { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 434: ptr ++; space prohibited before that '++' (ctx:WxO)
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 440: memcpy (*oneline, line_start, num); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 442: ptr ++; /* skip enter. */ space prohibited before that '++' (ctx:WxO)
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 453: compile_reg_expr(REG_EXTENDED | REG_NEWLINE, blank_or_comment_regex, &blank_or_comment_expr); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 455: compile_reg_expr(REG_EXTENDED | REG_NEWLINE, entries_subprog_line_regex, &entries_subprog_line_expr); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/3/util/amdfwtool/data_parse.c... PS3, Line 462: if (!regexec(&blank_or_comment_expr, oneline, 0, NULL, 0)){ space required before the open brace '{'
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#4).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c A util/amdfwtool/sample.txt 11 files changed, 796 insertions(+), 389 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/4
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/4/util/amdfwtool/data_parse.c File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/4/util/amdfwtool/data_parse.c... PS4, Line 352: } else { else is not generally useful after a break or return
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#5).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c A util/amdfwtool/sample.txt 11 files changed, 794 insertions(+), 389 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/5
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/5/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/5/util/amdfwtool/amdfwtool.c@... PS5, Line 1399: printf("Error: config file is not specified.\n\n"); I would consider maybe leaving the ability to do the command-line arguments or a config file. When I tried building an amd/parmer, this was the error message. Or perhaps keep some of the older options like xhci and imc FW but drop the others.
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#6).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c A util/amdfwtool/sample.txt 11 files changed, 801 insertions(+), 390 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/6
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 6:
(4 comments)
https://review.coreboot.org/c/coreboot/+/42859/6/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/6/util/amdfwtool/amdfwtool.c@... PS6, Line 576: /* Reserved for debuging */ 'debuging' may be misspelled - perhaps 'debugging'?
https://review.coreboot.org/c/coreboot/+/42859/6/util/amdfwtool/amdfwtool.c@... PS6, Line 1406: close (configfd); space prohibited between function name and open parenthesis '('
https://review.coreboot.org/c/coreboot/+/42859/6/util/amdfwtool/amdfwtool.c@... PS6, Line 1408: else else should follow close brace '}'
https://review.coreboot.org/c/coreboot/+/42859/6/util/amdfwtool/amdfwtool.c@... PS6, Line 1558: if (bytes != ctx.current - romsig_offset) { braces {} are not necessary for single statement blocks
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#7).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c A util/amdfwtool/sample.txt 11 files changed, 799 insertions(+), 390 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/7
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#8).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/amdfwtool.c 7 files changed, 134 insertions(+), 391 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/8
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/8/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/8/util/amdfwtool/amdfwtool.c@... PS8, Line 1031: static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:qR:P:C:D"; line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#9).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/amdfwtool.c 7 files changed, 135 insertions(+), 391 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/9
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 9:
Does anyone know what the Jenkins build failing mean?
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#10).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/amdfwtool.c 7 files changed, 135 insertions(+), 391 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/10
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#11).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/amdfwtool.c 7 files changed, 135 insertions(+), 391 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/11
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#12).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 758 insertions(+), 391 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/12
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#13).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 758 insertions(+), 391 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/13
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#14).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 758 insertions(+), 391 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/14
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 14:
I'm not sure if I'm doing something wrong, but when I cherry-pick this patch on top of my local tree and build an image for Mandolin, the amdfw part gets significantly smaller (shrinks from 1109248 bytes without the patch to 100352 bytes with the patch), so I guess some substantial parts are missing, but I didn't get any build error
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 14:
Patch Set 14:
I'm not sure if I'm doing something wrong, but when I cherry-pick this patch on top of my local tree and build an image for Mandolin, the amdfw part gets significantly smaller (shrinks from 1109248 bytes without the patch to 100352 bytes with the patch), so I guess some substantial parts are missing, but I didn't get any build error
I was missing this patch https://review.coreboot.org/c/amd_blobs/+/44170 i'd move the config files out of the blobs repo, since they aren't blobs.
when building with make -j 8 i get this error: AMDFWTOOL cc1: fatal error: config.h: No such file or directory compilation terminated. util/amdfwtool/Makefile.inc:20: recipe for target 'build/util/amdfwtool/amdfwtool.o' failed make: *** [build/util/amdfwtool/amdfwtool.o] Error 1
is config.h the config.h that gets generated from the Kconfig settings? if so, that likely shouldn't be used in the util.
this doesn't happen when building with make with out the -j 8, so there is some dependency missing in the makefile.
when building an image for mandolin, the size of amdfw is now only slightly smaller than without the patch, but in the one test i ran coreboot got stuck early in ramstage after locating fsp-s and parsing the misc hob to get the silicon type.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 14:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/14/Makefile.inc File Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/14/Makefile.inc@676 PS14, Line 676: tools: $(objutil)/kconfig/conf $(objutil)/kconfig/toada $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(objutil)/sconfig/sconfig $(IFDTOOL) $(CBOOTIMAGE) $(AMDCOMPRESS) $(FUTILITY) $(BINCFG) $(IFITTOOL) $(objutil)/supermicro/smcbiosinfo amdfwtool shouldn't be excluded here
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#15).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/mainboard/amd/mandolin/Kconfig M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 13 files changed, 917 insertions(+), 466 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/15
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 15:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42859/15/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/15/util/amdfwtool/data_parse.... PS15, Line 67: void find_register_fw_filename(char *fw_name, char *filename, uint8_t subprog, amd_cb_config *cb_config) line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/15/util/amdfwtool/data_parse.... PS15, Line 537: find_register_fw_filename(&(oneline[match[1].rm_so]), path_filename, subprog, cb_config); line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#16).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M Makefile.inc M src/mainboard/amd/mandolin/Kconfig M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 13 files changed, 917 insertions(+), 466 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/16
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 16:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42859/16/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/16/util/amdfwtool/data_parse.... PS16, Line 67: void find_register_fw_filename(char *fw_name, char *filename, uint8_t subprog, amd_cb_config *cb_config) line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/16/util/amdfwtool/data_parse.... PS16, Line 537: find_register_fw_filename(&(oneline[match[1].rm_so]), path_filename, subprog, cb_config); line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#17).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M 3rdparty/amd_blobs M Makefile.inc M src/mainboard/amd/mandolin/Kconfig M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 14 files changed, 920 insertions(+), 467 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/17
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#18).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M 3rdparty/amd_blobs M Makefile.inc M src/mainboard/amd/mandolin/Kconfig M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 14 files changed, 982 insertions(+), 553 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/18
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 18:
this still makes the multi-threaded build fail for me
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#19).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Signed-off-by: Zheng Bao zheng.bao@amd.com --- M 3rdparty/amd_blobs M Makefile.inc M src/mainboard/amd/mandolin/Kconfig M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile A util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 14 files changed, 982 insertions(+), 553 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/19
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 19:
Patch Set 18:
this still makes the multi-threaded build fail for me
Fixed.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 19:
(4 comments)
only had a brief look right now
https://review.coreboot.org/c/coreboot/+/42859/19/3rdparty/amd_blobs File 3rdparty/amd_blobs:
PS19: i'd just put the configuration files into the corresponding soc directories
https://review.coreboot.org/c/coreboot/+/42859/19/Makefile.inc File Makefile.inc:
PS19: are these changes needed?
https://review.coreboot.org/c/coreboot/+/42859/19/src/mainboard/amd/mandolin... File src/mainboard/amd/mandolin/Kconfig:
PS19: unrelated and Mandolin uses ESPI for the EC; there's no EC driver though
https://review.coreboot.org/c/coreboot/+/42859/19/src/soc/amd/picasso/Kconfi... File src/soc/amd/picasso/Kconfig:
https://review.coreboot.org/c/coreboot/+/42859/19/src/soc/amd/picasso/Kconfi... PS19, Line 428: #config AMD_PUBKEY_FILE : # string : # default "3rdparty/amd_blobs/picasso/PSP/AmdPubKeyRV.bin" please don't just comment out things; remove instead
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#20).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 8 files changed, 888 insertions(+), 400 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/20
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#21).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/amdfwtool.c 5 files changed, 229 insertions(+), 401 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/21
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#22).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 9 files changed, 882 insertions(+), 403 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/22
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#23).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 928 insertions(+), 403 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/23
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 23:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/23/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/23/util/amdfwtool/data_parse.... PS23, Line 535: if (strcmp(&(oneline[match[1].rm_so]), "FIRMWARE_LOCATE") == 0) { braces {} are not necessary for single statement blocks
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#24).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 929 insertions(+), 403 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/24
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#25).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 928 insertions(+), 403 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/25
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 25:
(5 comments)
the cfg files for stoneyridge are probably still missing in this patch; those should also be inside the coreboot tree and not in one of the blobs repos, since those aren't blobs
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/picasso/fw.cfg File src/soc/amd/picasso/fw.cfg:
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/picasso/fw.cfg... PS25, Line 2: # Move to amd_blob remove; where it's now is where it probably should be located
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/stoneyridge/Ma... PS25, Line 273: #cbfs-files-y += apu/amdfw this looks wrong to me
https://review.coreboot.org/c/coreboot/+/42859/25/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/25/src/southbridge/amd/pi/hud... PS25, Line 208: #cbfs-files-y += apu/amdfw same here
https://review.coreboot.org/c/coreboot/+/42859/25/util/amdfwtool/amdfwtool.h File util/amdfwtool/amdfwtool.h:
https://review.coreboot.org/c/coreboot/+/42859/25/util/amdfwtool/amdfwtool.h... PS25, Line 4: //#include "config.h" remove
https://review.coreboot.org/c/coreboot/+/42859/25/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/25/util/amdfwtool/amdfwtool.c... PS25, Line 1339: // case 'b': please remove lines instead of commenting them out. what's removed will still be in the git history, so there's no downside to just remove those lines
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 25:
Patch Set 25:
(5 comments)
the cfg files for stoneyridge are probably still missing in this patch; those should also be inside the coreboot tree and not in one of the blobs repos, since those aren't blobs
ah, just saw that that's done in the next patch
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#26).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 904 insertions(+), 403 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/26
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 27:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42859/19/src/soc/amd/picasso/Kconfi... File src/soc/amd/picasso/Kconfig:
https://review.coreboot.org/c/coreboot/+/42859/19/src/soc/amd/picasso/Kconfi... PS19, Line 428: #config AMD_PUBKEY_FILE : # string : # default "3rdparty/amd_blobs/picasso/PSP/AmdPubKeyRV.bin"
please don't just comment out things; remove instead
Removed.
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/stoneyridge/Ma... PS25, Line 273: #cbfs-files-y += apu/amdfw
this looks wrong to me
This is for splitting the patch into smaller ones. Cause the change has not apply to the Stoney, the Jenkins would report error. Otherwise all the changes should be in one big patch.
https://review.coreboot.org/c/coreboot/+/42859/23/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/23/util/amdfwtool/data_parse.... PS23, Line 535: if (strcmp(&(oneline[match[1].rm_so]), "FIRMWARE_LOCATE") == 0) {
braces {} are not necessary for single statement blocks
add a word below and braces are kept.
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 27:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/picasso/fw.cfg File src/soc/amd/picasso/fw.cfg:
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/picasso/fw.cfg... PS25, Line 2: # Move to amd_blob
remove; where it's now is where it probably should be located
Removed.
https://review.coreboot.org/c/coreboot/+/42859/25/util/amdfwtool/amdfwtool.h File util/amdfwtool/amdfwtool.h:
https://review.coreboot.org/c/coreboot/+/42859/25/util/amdfwtool/amdfwtool.h... PS25, Line 4: //#include "config.h"
remove
Removed.
https://review.coreboot.org/c/coreboot/+/42859/25/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/25/util/amdfwtool/amdfwtool.c... PS25, Line 1339: // case 'b':
please remove lines instead of commenting them out. […]
Done. Removed.
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 28:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42859/19/Makefile.inc File Makefile.inc:
PS19:
are these changes needed?
Ack. This change has moved to a separated patch. We can discuss there.
https://review.coreboot.org/c/coreboot/+/42859/19/src/mainboard/amd/mandolin... File src/mainboard/amd/mandolin/Kconfig:
PS19:
unrelated and Mandolin uses ESPI for the EC; there's no EC driver though
Done. That was a mistake.
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 28:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42859/19/3rdparty/amd_blobs File 3rdparty/amd_blobs:
PS19:
i'd just put the configuration files into the corresponding soc directories
Done. That was mistake.
https://review.coreboot.org/c/coreboot/+/42859/14/Makefile.inc File Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/14/Makefile.inc@676 PS14, Line 676: tools: $(objutil)/kconfig/conf $(objutil)/kconfig/toada $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(objutil)/sconfig/sconfig $(IFDTOOL) $(CBOOTIMAGE) $(AMDCOMPRESS) $(FUTILITY) $(BINCFG) $(IFITTOOL) $(objutil)/supermicro/smcbiosinfo
amdfwtool shouldn't be excluded here
Done. Changed.
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 28:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/5/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/5/util/amdfwtool/amdfwtool.c@... PS5, Line 1399: printf("Error: config file is not specified.\n\n");
I would consider maybe leaving the ability to do the command-line arguments or a config file. […]
Ack. Currently xhci and imc are still in command-line argument. config file is about just PSP FW for now.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 28:
(17 comments)
haven't fully reviewed the c files yet, but wanted to post at least what i've already reviewed/found
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/picasso/Makefi... PS28, Line 135: PSP_USE_PSPSECUREOS="--use-pspsecureos" i like that this is passed as a flag and the corresponding file from the cfg file is added depending on this flag
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... PS28, Line 273: #cbfs-files-y += apu/amdfw haven't tested, but i'd expect that this will cause issues for stoneyridge after this patch is merged and before the next one is merged. is this necessary?
https://review.coreboot.org/c/coreboot/+/42859/28/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/28/src/southbridge/amd/pi/hud... PS28, Line 208: #cbfs-files-y += apu/amdfw same as my comment on the corresponding change in the stoneyridge makefile
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.h File util/amdfwtool/amdfwtool.h:
PS28: please add the spdx line: /* SPDX-License-Identifier: GPL-2.0-only */
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 87: uint8_t g_have_whitelist, g_unlock_secure, g_use_secureos, : g_load_mp2_fw, g_s0i3; this is unused and can be removed
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 601: #if 0 see my comment below on this
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1102: static void register_fw_fuses(int fd, amd_cb_config *cb_config) i find this function name very misleading. process_config_file maybe?
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1117: bytes+1 shouldn't that be [bytes] instead of [bytes + 1]. [bytes] addresses the byte+1th element. also why not just use the file descriptor and read and process the file contents line by line instead of copying the contents to a byte array and processing that array?
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1257: // int abl_image = 0; please remove the commented out lines. same below.
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1548: #if 0 maybe add some parameter to call to those functions conditionally? this is very useful functionality, so i'd like to have it in the tool, but code that won't see the compiler due to being commented out or ifdef'ed out tends to bit-rot over time
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1702: if (targetfd >= 0) { : ssize_t bytes; : bytes = write(targetfd, amd_romsig, ctx.current - romsig_offset); : if (bytes != ctx.current - romsig_offset) : retval = 1; : close(targetfd); : } else { haven't tried, but splitting these lines out into another patch and moving it before the makefile change might fix the issue i was seeing there
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 65: //extern uint8_t g_have_whitelist, g_unlock_secure, g_use_secureos, : // g_load_mp2_fw, g_s0i3; please remove the commented out lines of code. same below.
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 84: subprog = 0; writing to a function parameter, especially before it got read, seems to be a bug to me
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 405: #if 1 remove the #if 1 and corresponding #endif
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 441: tableptr = (void *)amd_bios_table; i'd avoid all these potentially dangerous casts and keep everything as the native type
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 474: unsigned int read_line(char **config, char **oneline) this function seems to be sort-of a reimplementation of getline(). please use the existing function instead
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 498: void process_config(char *config, amd_cb_config *cb_config) i'd pass the file handle instead of a char * with the file contents
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 28:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1253: .rom_size = CONFIG_ROM_SIZE, related to my older comment on the makefile patch: i'd just zero-initialize this and also drop the CONFIG_ROM_SIZE ifdef thing above. it seems that all makefiles that end up calling amdfwtool pass the flash size as parameter, so CONFIG_ROM_SIZE doesn't need to be known and passed in during build time. if no flash size parameter is passed to amdfwtool, it'll just fail, which is exactly what it should be doing there. this is something for a separate patch though.
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#29).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 900 insertions(+), 402 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/29
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#30).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 790 insertions(+), 401 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/30
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 30:
(4 comments)
https://review.coreboot.org/c/coreboot/+/42859/30/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/30/util/amdfwtool/amdfwtool.c... PS30, Line 1455: if ((config_handle = fopen(config, "r")) == NULL) { do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/42859/30/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/30/util/amdfwtool/data_parse.... PS30, Line 450: int get_input_file_line(FILE * f, char line[], int line_buf_size) "foo * bar" should be "foo *bar"
https://review.coreboot.org/c/coreboot/+/42859/30/util/amdfwtool/data_parse.... PS30, Line 462: printf("The line size in config file should be lower than %d bytes.\n", MAX_LINE_SIZE); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/30/util/amdfwtool/data_parse.... PS30, Line 463: exit (1); space prohibited between function name and open parenthesis '('
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 30:
(12 comments)
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... PS28, Line 273: #cbfs-files-y += apu/amdfw
haven't tested, but i'd expect that this will cause issues for stoneyridge after this patch is merge […]
Yes. it has problem. If we want to avoid this, we have to squash all the next 3 patches into one. What do you think?
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.h File util/amdfwtool/amdfwtool.h:
PS28:
please add the spdx line: /* SPDX-License-Identifier: GPL-2. […]
Done. Added.
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 87: uint8_t g_have_whitelist, g_unlock_secure, g_use_secureos, : g_load_mp2_fw, g_s0i3;
this is unused and can be removed
Done. Removed.
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 601: #if 0
see my comment below on this
Done
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1102: static void register_fw_fuses(int fd, amd_cb_config *cb_config)
i find this function name very misleading. […]
Done. Change to process_config_file
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1257: // int abl_image = 0;
please remove the commented out lines. same below.
Done
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1702: if (targetfd >= 0) { : ssize_t bytes; : bytes = write(targetfd, amd_romsig, ctx.current - romsig_offset); : if (bytes != ctx.current - romsig_offset) : retval = 1; : close(targetfd); : } else {
haven't tried, but splitting these lines out into another patch and moving it before the makefile ch […]
Done. Moved.
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 65: //extern uint8_t g_have_whitelist, g_unlock_secure, g_use_secureos, : // g_load_mp2_fw, g_s0i3;
please remove the commented out lines of code. same below.
Done
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 84: subprog = 0;
writing to a function parameter, especially before it got read, seems to be a bug to me
Done. The subprog match check has been removed.
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 405: #if 1
remove the #if 1 and corresponding #endif
Done
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 474: unsigned int read_line(char **config, char **oneline)
this function seems to be sort-of a reimplementation of getline(). […]
Done. use fgets to get a line.
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 498: void process_config(char *config, amd_cb_config *cb_config)
i'd pass the file handle instead of a char * with the file contents
Done. Changed.
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 30:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1117: bytes+1
shouldn't that be [bytes] instead of [bytes + 1]. [bytes] addresses the byte+1th element. […]
Done. Now use FILE handle.
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1548: #if 0
maybe add some parameter to call to those functions conditionally? this is very useful functionality […]
Done. Add a debug option.
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#31).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 622 insertions(+), 401 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/31
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 31:
(6 comments)
https://review.coreboot.org/c/coreboot/+/42859/31/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/31/util/amdfwtool/amdfwtool.c... PS31, Line 1455: if ((config_handle = fopen(config, "r")) == NULL) { do not use assignment in if condition
https://review.coreboot.org/c/coreboot/+/42859/31/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/31/util/amdfwtool/data_parse.... PS31, Line 225: psp_tableptr ++; space prohibited before that '++' (ctx:WxO)
https://review.coreboot.org/c/coreboot/+/42859/31/util/amdfwtool/data_parse.... PS31, Line 275: bhd_tableptr ++; space prohibited before that '++' (ctx:WxO)
https://review.coreboot.org/c/coreboot/+/42859/31/util/amdfwtool/data_parse.... PS31, Line 282: int get_input_file_line(FILE * f, char line[], int line_buf_size) "foo * bar" should be "foo *bar"
https://review.coreboot.org/c/coreboot/+/42859/31/util/amdfwtool/data_parse.... PS31, Line 294: printf("The line size in config file should be lower than %d bytes.\n", MAX_LINE_SIZE); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/31/util/amdfwtool/data_parse.... PS31, Line 295: exit (1); space prohibited between function name and open parenthesis '('
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#32).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 624 insertions(+), 401 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/32
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#33).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 628 insertions(+), 401 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/33
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 33:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/data_parse.... PS28, Line 441: tableptr = (void *)amd_bios_table;
i'd avoid all these potentially dangerous casts and keep everything as the native type
Done
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#34).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 10 files changed, 630 insertions(+), 402 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/34
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 34:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/28/util/amdfwtool/amdfwtool.c... PS28, Line 1253: .rom_size = CONFIG_ROM_SIZE,
related to my older comment on the makefile patch: i'd just zero-initialize this and also drop the C […]
Done. New patch has been created. https://review.coreboot.org/c/coreboot/+/45780
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#35).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 12 files changed, 2,409 insertions(+), 406 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/35
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 35:
(8 comments)
https://review.coreboot.org/c/coreboot/+/42859/35/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/35/util/amdfwtool/amdfwtool-b... PS35, Line 169: printf("-A | --combo-capable Place PSP directory pointer at Embedded Firmware\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/35/util/amdfwtool/amdfwtool-b... PS35, Line 196: printf("-I | --instance <number> Sets instance field for the next BIOS firmware\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/35/util/amdfwtool/amdfwtool-b... PS35, Line 217: printf("-P | --sharedmem-size Maximum size of the PSP/FW shared memory area\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/35/util/amdfwtool/amdfwtool-b... PS35, Line 219: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/35/util/amdfwtool/amdfwtool-b... PS35, Line 241: printf(" 0x2 Micron parts optional, this option is only\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/35/util/amdfwtool/amdfwtool-b... PS35, Line 952: printf("Error: BIOS binary destination and uncompressed size are required\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/35/util/amdfwtool/amdfwtool-b... PS35, Line 957: printf("Error: BIOS binary assumed outside amdfw.rom but no source address given\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/35/util/amdfwtool/amdfwtool-b... PS35, Line 1091: static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:qR:P:C:E:"; line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#36).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 12 files changed, 2,408 insertions(+), 405 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/36
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 36:
(8 comments)
https://review.coreboot.org/c/coreboot/+/42859/36/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/36/util/amdfwtool/amdfwtool-b... PS36, Line 169: printf("-A | --combo-capable Place PSP directory pointer at Embedded Firmware\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/36/util/amdfwtool/amdfwtool-b... PS36, Line 196: printf("-I | --instance <number> Sets instance field for the next BIOS firmware\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/36/util/amdfwtool/amdfwtool-b... PS36, Line 217: printf("-P | --sharedmem-size Maximum size of the PSP/FW shared memory area\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/36/util/amdfwtool/amdfwtool-b... PS36, Line 219: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/36/util/amdfwtool/amdfwtool-b... PS36, Line 241: printf(" 0x2 Micron parts optional, this option is only\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/36/util/amdfwtool/amdfwtool-b... PS36, Line 952: printf("Error: BIOS binary destination and uncompressed size are required\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/36/util/amdfwtool/amdfwtool-b... PS36, Line 957: printf("Error: BIOS binary assumed outside amdfw.rom but no source address given\n"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/36/util/amdfwtool/amdfwtool-b... PS36, Line 1091: static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:qR:P:C:E:"; line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#37).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 12 files changed, 2,413 insertions(+), 405 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/37
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 37:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/37/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/37/util/amdfwtool/amdfwtool-b... PS37, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#38).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 12 files changed, 2,413 insertions(+), 405 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/38
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 38:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/38/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/38/util/amdfwtool/amdfwtool-b... PS38, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Patrick Georgi, Martin Roth, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#39).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 12 files changed, 2,413 insertions(+), 405 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/39
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 39:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool-b... PS39, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 39:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... PS28, Line 273: #cbfs-files-y += apu/amdfw
Yes. it has problem. If we want to avoid this, we have to squash all the next 3 patches into one. […]
I saved the old amdfwtool as amdfwtool-b and other platform still use the old tool. OK?
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 39:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... PS28, Line 273: #cbfs-files-y += apu/amdfw
I saved the old amdfwtool as amdfwtool-b and other platform still use the old tool. […]
i'd prefer to have the stoneyridge and hudson changes squashed into this patch, since those do what is done for picasso in this patch, so that would still be one logical change
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 39:
(4 comments)
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool-b... PS39, Line 243: 0x2 Nit: some indentation issues, which seems odd to me since I didn't see them in the other copy of the file. /shrug
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c... PS39, Line 1086: // Unused values: D Could we keep the list of unused values - we still have quite a long list of arguments.
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c... PS39, Line 156: printf("-x | --xhci <FILE> Add XHCI blob\n"); : printf("-i | --imc <FILE> Add IMC blob\n"); : printf("-g | --gec <FILE> Add GEC blob\n"); Any reason not to move more of these options to the config file?
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c... PS39, Line 1456: exit(1); Can we add a way to generated a config file with no values? How would someone know currently what the options to add to the config file are?
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 40:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/40/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/40/util/amdfwtool/amdfwtool-b... PS40, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 41:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/41/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/41/util/amdfwtool/amdfwtool-b... PS41, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 42:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/42/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/42/util/amdfwtool/amdfwtool-b... PS42, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#43).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 12 files changed, 2,422 insertions(+), 409 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/43
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#44).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 12 files changed, 2,422 insertions(+), 409 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/44
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 44:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42859/44/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/44/util/amdfwtool/amdfwtool-b... PS44, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/44/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/44/util/amdfwtool/amdfwtool.c... PS44, Line 169: printf("-p | --load-mp2-fw Set if load MP2 firmare\n"); 'firmare' may be misspelled - perhaps 'firmware'?
https://review.coreboot.org/c/coreboot/+/42859/44/util/amdfwtool/amdfwtool.c... PS44, Line 219: printf("-d | --debug \n"); unnecessary whitespace before a quoted newline
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#45).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 12 files changed, 2,423 insertions(+), 409 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/45
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 45:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42859/45/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/45/util/amdfwtool/amdfwtool-b... PS45, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/45/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/45/util/amdfwtool/amdfwtool.c... PS45, Line 169: printf("-p | --load-mp2-fw Set if load MP2 firmare\n"); 'firmare' may be misspelled - perhaps 'firmware'?
https://review.coreboot.org/c/coreboot/+/42859/45/util/amdfwtool/amdfwtool.c... PS45, Line 219: printf("-d | --debug \n"); unnecessary whitespace before a quoted newline
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 45:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c... PS39, Line 1086: // Unused values: D
Could we keep the list of unused values - we still have quite a long list of arguments.
Done
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c... PS39, Line 1456: exit(1);
Can we add a way to generated a config file with no values? How would someone know currently what t […]
I dont quite understand. Do you mean to generate the config file instead of a hard copy?
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#46).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To seperate the patch into individual ones, we need to disable the integration of amdfw.rom for other related boards. They will be changed back in the patches in the same stack.
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M Makefile.inc M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Makefile.inc M src/southbridge/amd/pi/hudson/Makefile.inc M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 12 files changed, 2,423 insertions(+), 409 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/46
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 46:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42859/46/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/46/util/amdfwtool/amdfwtool-b... PS46, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/46/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/46/util/amdfwtool/amdfwtool.c... PS46, Line 169: printf("-p | --load-mp2-fw Set if load MP2 firmare\n"); 'firmare' may be misspelled - perhaps 'firmware'?
https://review.coreboot.org/c/coreboot/+/42859/46/util/amdfwtool/amdfwtool.c... PS46, Line 219: printf("-d | --debug \n"); unnecessary whitespace before a quoted newline
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 46:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c... PS39, Line 156: printf("-x | --xhci <FILE> Add XHCI blob\n"); : printf("-i | --imc <FILE> Add IMC blob\n"); : printf("-g | --gec <FILE> Add GEC blob\n");
Any reason not to move more of these options to the config file?
Many old platforms only has these 3 binary to integrate. It is not quite necessary to affect all these old platforms. Just leave it as it is.
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#47).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=Internal Cleanup:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc A util/amdfwtool/amdfwtool-b.c M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 16 files changed, 2,497 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/47
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 47:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool-b... PS47, Line 221: printf(" Stoneyridge, Raven, Picasso, Renoir or Lucienne"); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.c... PS47, Line 169: printf("-p | --load-mp2-fw Set if load MP2 firmare\n"); 'firmare' may be misspelled - perhaps 'firmware'?
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.c... PS47, Line 219: printf("-d | --debug \n"); unnecessary whitespace before a quoted newline
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 47:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool-b... PS39, Line 243: 0x2
Nit: some indentation issues, which seems odd to me since I didn't see them in the other copy of the […]
Done. The files have been removed.
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 47:
(4 comments)
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/25/src/soc/amd/stoneyridge/Ma... PS25, Line 273: #cbfs-files-y += apu/amdfw
This is for splitting the patch into smaller ones. […]
Done
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/28/src/soc/amd/stoneyridge/Ma... PS28, Line 273: #cbfs-files-y += apu/amdfw
i'd prefer to have the stoneyridge and hudson changes squashed into this patch, since those do what […]
Done. Squashed.
https://review.coreboot.org/c/coreboot/+/42859/25/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/25/src/southbridge/amd/pi/hud... PS25, Line 208: #cbfs-files-y += apu/amdfw
same here
Done
https://review.coreboot.org/c/coreboot/+/42859/28/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/28/src/southbridge/amd/pi/hud... PS28, Line 208: #cbfs-files-y += apu/amdfw
same as my comment on the corresponding change in the stoneyridge makefile
Done Squashed.
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 47:
(11 comments)
I think the patch train probably needs to be rebased on
https://review.coreboot.org/c/coreboot/+/42859/47//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42859/47//COMMIT_MSG@9 PS47, Line 9: Internal Cleanup: shouldn't this be just "b:"?
https://review.coreboot.org/c/coreboot/+/42859/47//COMMIT_MSG@10 PS47, Line 10: mandolin Nit: Maybe change to "Build & boot on mandolin"
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/Makefi... PS47, Line 125: "3rdparty/amd_blobs/picasso/PSP" I mention this in the other locations as well. Could this be moved back into a Kconfig symbol so it can be updated by a platform if desired?
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/fw.cfg File src/soc/amd/picasso/fw.cfg:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/fw.cfg... PS47, Line 3: # Should be first line Why does the location need to be the first line? Doesn't the parser look through the entire file for this?
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/stoneyridge/Ma... PS47, Line 105: ifeq ($(CONFIG_AMD_APU_STONEYRIDGE),y) Can we put the directory values into a Kconfig option instead of hardcoding them into the makefile?
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/stoneyridge/Ma... PS47, Line 106: FIRMWARE_LOCATE Change to FIRMWARE_LOCATION?
https://review.coreboot.org/c/coreboot/+/42859/47/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/southbridge/amd/pi/hud... PS47, Line 81: "3rdparty/blobs/southbridge/amd/avalon/PSP" Again, use a Kconfig option please.
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.h File util/amdfwtool/amdfwtool.h:
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.h... PS47, Line 117: endif #endif /* _AMD_FW_TOOL_H_ */
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c... PS39, Line 156: printf("-x | --xhci <FILE> Add XHCI blob\n"); : printf("-i | --imc <FILE> Add IMC blob\n"); : printf("-g | --gec <FILE> Add GEC blob\n");
Many old platforms only has these 3 binary to integrate. […]
Ack
https://review.coreboot.org/c/coreboot/+/42859/39/util/amdfwtool/amdfwtool.c... PS39, Line 1456: exit(1);
I dont quite understand. […]
That's what I was thinking, yes. Generate a sample config file with just the possible values. Maybe it's not worth the trouble. I'll let you decide. If you decide to do it, that's for a future commit, so marking this as resolved.
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.c... PS47, Line 169: printf("-p | --load-mp2-fw Set if load MP2 firmare\n");
'firmare' may be misspelled - perhaps 'firmware'?
Good job, build bot.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 47:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
PS47: since now all platforms are updated in this patch, this copy of the old amdfwtool can be dropped from the patch
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#48).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 727 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/48
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 48:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/48/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/48/util/amdfwtool/amdfwtool.c... PS48, Line 219: printf("-d | --debug \n"); unnecessary whitespace before a quoted newline
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#49).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 727 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/49
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 49:
(4 comments)
https://review.coreboot.org/c/coreboot/+/42859/47//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42859/47//COMMIT_MSG@9 PS47, Line 9: Internal Cleanup:
shouldn't this be just "b:"?
Done. Changed.
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool-b... File util/amdfwtool/amdfwtool-b.c:
PS47:
since now all platforms are updated in this patch, this copy of the old amdfwtool can be dropped fro […]
Done. Removed.
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.h File util/amdfwtool/amdfwtool.h:
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.h... PS47, Line 117: endif
#endif /* _AMD_FW_TOOL_H_ */
Done
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/47/util/amdfwtool/amdfwtool.c... PS47, Line 169: printf("-p | --load-mp2-fw Set if load MP2 firmare\n");
Good job, build bot.
Done.Fix typo.
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 49:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/49/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/49/util/amdfwtool/amdfwtool.c... PS49, Line 219: printf("-d | --debug \n"); unnecessary whitespace before a quoted newline
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 49:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/47//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/42859/47//COMMIT_MSG@10 PS47, Line 10: mandolin
Nit: Maybe change to "Build & boot on mandolin"
Done
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#50).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 727 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/50
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#51).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 715 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/51
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 51:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/51/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/51/util/amdfwtool/amdfwtool.c... PS51, Line 219: printf("-d | --debug \n"); unnecessary whitespace before a quoted newline
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#52).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 734 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/52
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 52:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/52/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/52/util/amdfwtool/amdfwtool.c... PS52, Line 219: printf("-d | --debug \n"); unnecessary whitespace before a quoted newline
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#53).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 730 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/53
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 53:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/53/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/53/util/amdfwtool/amdfwtool.c... PS53, Line 219: printf("-d | --debug \n"); unnecessary whitespace before a quoted newline
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 53:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/Makefi... PS47, Line 125: "3rdparty/amd_blobs/picasso/PSP"
I mention this in the other locations as well. […]
Done. FIRMWARE_LOCATE=$(shell grep -e FIRMWARE_LOCATE $(CONFIG_AMDFW_CONFIG_FILE) | awk '{print $$2}') Use command to extract value from config file.
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/fw.cfg File src/soc/amd/picasso/fw.cfg:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/fw.cfg... PS47, Line 3: # Should be first line
Why does the location need to be the first line? Doesn't the parser look through the entire file fo […]
Done. Add a dedicate loop to search the FIRMWARE_LOCATION
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/stoneyridge/Ma... PS47, Line 105: ifeq ($(CONFIG_AMD_APU_STONEYRIDGE),y)
Can we put the directory values into a Kconfig option instead of hardcoding them into the makefile?
Done. Changed.
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#54).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 730 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/54
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 54:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/stoneyridge/Ma... PS47, Line 106: FIRMWARE_LOCATE
Change to FIRMWARE_LOCATION?
Done. It should be in anther patch because it needs to change code in mainboard folder.
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 54:
(3 comments)
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/Makefi... PS47, Line 125: "3rdparty/amd_blobs/picasso/PSP"
Done. […]
Ack. Other places have been marked as done. This comment is left to be approved.
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/stoneyridge/Ma... PS47, Line 105: ifeq ($(CONFIG_AMD_APU_STONEYRIDGE),y)
Done. Changed.
Done
https://review.coreboot.org/c/coreboot/+/42859/47/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/southbridge/amd/pi/hud... PS47, Line 81: "3rdparty/blobs/southbridge/amd/avalon/PSP"
Again, use a Kconfig option please.
Done
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 54:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/47/src/soc/amd/picasso/Makefi... PS47, Line 125: "3rdparty/amd_blobs/picasso/PSP"
Ack. Other places have been marked as done. This comment is left to be approved.
Done. Resolve it. Put more comments if disagree.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 54:
(2 comments)
https://review.coreboot.org/c/coreboot/+/42859/54/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/54/util/amdfwtool/data_parse.... PS54, Line 265: (void *) this cast is probably unnecessary, since both sides are amd_bios_entry type
https://review.coreboot.org/c/coreboot/+/42859/54/util/amdfwtool/data_parse.... PS54, Line 317: /* get line */ : /* blank comment */ : if (!regexec(&blank_or_comment_expr, oneline, 0, NULL, 0)) { : /* skip comment and blank */ : continue; : } : : if (regexec(&entries_line_expr, oneline, 3, match, 0) == 0) { : oneline[match[1].rm_eo] = '\0'; : oneline[match[2].rm_eo] = '\0'; : } else { : /* no match */ : continue; : } this code is identical to lines 340-353 below, so it's probably a good idea to factor that out into a function (foe example is_valid_config_line(...)) that returns a boolean and then either run the different code parts inside the two loops or continue to the next line
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#55).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 729 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/55
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 55: Code-Review+1
(2 comments)
looks good to me and I'd say that the other small things I found today and didn't comment on yet should be addressed in a follow-up patch, so that this one will finally land in upstream coreboot soon. I'll still need to verify that the resulting amdfw binary doesn't change for the different platforms; when I've done that and the binaries are identical I'll +2 the patch.
https://review.coreboot.org/c/coreboot/+/42859/54/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/54/util/amdfwtool/data_parse.... PS54, Line 265: (void *)
this cast is probably unnecessary, since both sides are amd_bios_entry type
Done
https://review.coreboot.org/c/coreboot/+/42859/54/util/amdfwtool/data_parse.... PS54, Line 317: /* get line */ : /* blank comment */ : if (!regexec(&blank_or_comment_expr, oneline, 0, NULL, 0)) { : /* skip comment and blank */ : continue; : } : : if (regexec(&entries_line_expr, oneline, 3, match, 0) == 0) { : oneline[match[1].rm_eo] = '\0'; : oneline[match[2].rm_eo] = '\0'; : } else { : /* no match */ : continue; : }
this code is identical to lines 340-353 below, so it's probably a good idea to factor that out into […]
Done
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 56: -Code-Review
I did a timeless build (make BUILD_TIMELESS=1 -j 8) for one mainboard of each soc/southbridge that uses amdfwtool and it resulted in identical images for the following platforms:
* picasso: amd/mandolin * merlinfalcon: amd/padmelon * prariefalcon: amd/padmelon * avalon: pcengines/apu2 * bolton/kern: no mainboard in tree, so I couldn't test * hudson: asus/f2a85-m * yangtze: asrock/imb-a180
but resulted in different binaries on the following platform:
* stoneyridge: amd/gardenia
So this patch does change the resulting coreboot.rom for stoneyridge, which shouldn't be the case
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 56:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/56/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/56/src/soc/amd/stoneyridge/Ma... PS56, Line 160: ###18- Check for SMU firmware2 named either *.sbin or *.csbin : ### TODO: Remove *.sbin section after the blobs repo is updated. : SMUFIRMWARE2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE).csbin : SMUFIRMWARE2_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE)_FN.csbin : ifeq ("$(wildcard $(SMUFIRMWARE2_FILE))","") : SMUFIRMWARE2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE).sbin : SMUFIRMWARE2_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE)_FN.sbin : endif : : ifeq ("$(wildcard $(SMUFWM_FN_FILE))","") : SMUFWM_FN_FILE= : SMUFIRMWARE2_FN_FILE= : endif this should probably stay in here, since it's not only used for the amdfwtool call, but also to put the SMU blobs into CBFS
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#57).
Change subject: (WIP)amdfwtool: Take a config file instead of command line parameters ......................................................................
(WIP)amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 729 insertions(+), 538 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/57
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#58).
Change subject: (WIP)amdfwtool: Take a config file instead of command line parameters ......................................................................
(WIP)amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 729 insertions(+), 534 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/58
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: (WIP)amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 58:
(1 comment)
Patch Set 56: -Code-Review
I did a timeless build (make BUILD_TIMELESS=1 -j 8) for one mainboard of each soc/southbridge that uses amdfwtool and it resulted in identical images for the following platforms:
- picasso: amd/mandolin
- merlinfalcon: amd/padmelon
- prariefalcon: amd/padmelon
- avalon: pcengines/apu2
- bolton/kern: no mainboard in tree, so I couldn't test
- hudson: asus/f2a85-m
- yangtze: asrock/imb-a180
but resulted in different binaries on the following platform:
- stoneyridge: amd/gardenia
So this patch does change the resulting coreboot.rom for stoneyridge, which shouldn't be the case
https://review.coreboot.org/c/coreboot/+/42859/56/src/soc/amd/stoneyridge/Ma... File src/soc/amd/stoneyridge/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/56/src/soc/amd/stoneyridge/Ma... PS56, Line 160: ###18- Check for SMU firmware2 named either *.sbin or *.csbin : ### TODO: Remove *.sbin section after the blobs repo is updated. : SMUFIRMWARE2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE).csbin : SMUFIRMWARE2_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE)_FN.csbin : ifeq ("$(wildcard $(SMUFIRMWARE2_FILE))","") : SMUFIRMWARE2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE).sbin : SMUFIRMWARE2_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE)_FN.sbin : endif : : ifeq ("$(wildcard $(SMUFWM_FN_FILE))","") : SMUFWM_FN_FILE= : SMUFIRMWARE2_FN_FILE= : endif
this should probably stay in here, since it's not only used for the amdfwtool call, but also to put […]
Done. Need further work to get the smu2 file from the config file.
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#59).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 733 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/59
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 59:
Seems to be not right. Still WIP.
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 59:
Test ok. patchset 59 is ready for review.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 59: Code-Review+2
looks good to me. it would be good to add to the TEST line in the commit message that timeless builds with and without this patch results in identical coreboot.rom files
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#60).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 733 insertions(+), 548 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/60
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 60:
thanks! I'll merge this tomorrow after the 24h after the last code change have passed
Nikolai Vyssotski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 60:
(8 comments)
Nice work! Sorry to add more. You are almost there.
https://review.coreboot.org/c/coreboot/+/42859/60/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/60/src/soc/amd/picasso/Makefi... PS60, Line 288: --whitelist It looks like we lost ability to add whitelist option. We will need to check CONFIG_HAVE_PSP_WHITELIST_FILE and add this option if it is set.
https://review.coreboot.org/c/coreboot/+/42859/60/src/soc/amd/picasso/Makefi... PS60, Line 227: OPT_TOKEN_UNLOCK=$(call add_opt_prefix, $(PSP_TOKEN_UNLOCK), "") : OPT_PSP_USE_PSPSECUREOS=$(call add_opt_prefix, $(PSP_USE_PSPSECUREOS), "") : OPT_PSP_LOAD_MP2_FW=$(call add_opt_prefix, $(PSP_LOAD_MP2_FW), "") : OPT_PSP_LOAD_S0I3_FW=$(call add_opt_prefix, $(PSP_LOAD_S0I3_FW), "") Do we really need these anymore? We are not really trying to concatenate two strings as we used to do before. There is only one string now PSP_*. It seems like we could set corresponding OPT_PSP_* in the lines above when we are checking CONFIG options and be done with it.
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/amdfwtool.c... PS60, Line 1464: process_config(config_handle, &cb_config); We should be checking the return status here if the config file is parsed correctly and failing the build if not.
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 48: void We really should be returning status and failing the build if we can't parse a non-blank/non-comment line in configuration file correctly.
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 61: fw_type = AMD_FW_INVALID; It may make sense to init fw_type = AMD_FW_INVALID at the top and then set fw_type to a new type here e.g. AMD_FW_SKIP to differentiate between failing/non-parsing and simply non-applicable options. If you split them into two functions as I am suggesting below you can simply return here with a non-failing status.
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 68: fw_type = AMD_FW_INVALID; same as above
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 262: fw_type = AMD_BIOS_INVALID; It may make sense to split find_register_fw_filename() into two functions e.g. find_register_fw_filename_psp_dir() and void find_register_fw_filename_bios_dir(). If both of them return "no match" we should fail the build with a message that current line can not be parsed.
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 306: if (!regexec(&blank_or_comment_expr, oneline, 0, NULL, 0)) { : /* skip comment and blank */ : retval = 1; : } This does not seem to do much. Even if it detects blank line it will keep trying to process it below. I can see it doing something useful if you added "return" or "else" here.
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#61).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 781 insertions(+), 553 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/61
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 61:
(6 comments)
https://review.coreboot.org/c/coreboot/+/42859/61/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/61/util/amdfwtool/amdfwtool.c... PS61, Line 1468: fprintf(stderr, "Config file is parsed error. Please check the format: %s\n", line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/61/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/61/util/amdfwtool/data_parse.... PS61, Line 228: else return 1; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/42859/61/util/amdfwtool/data_parse.... PS61, Line 349: 1: The config file can be parsed correctly. code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/42859/61/util/amdfwtool/data_parse.... PS61, Line 391: if (find_register_fw_filename_psp_dir(&(oneline[match[1].rm_so]), line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/61/util/amdfwtool/data_parse.... PS61, Line 393: if (find_register_fw_filename_bios_dir(&(oneline[match[1].rm_so]), line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/61/util/amdfwtool/data_parse.... PS61, Line 395: return 0; /* This line is not valid. Stop parsing. */ line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#62).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 780 insertions(+), 553 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/62
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 62:
(6 comments)
https://review.coreboot.org/c/coreboot/+/42859/62/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/62/util/amdfwtool/amdfwtool.c... PS62, Line 1468: fprintf(stderr, "Config file is parsed error. Please check the format: %s\n", line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/62/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/62/util/amdfwtool/data_parse.... PS62, Line 228: else return 1; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/42859/62/util/amdfwtool/data_parse.... PS62, Line 349: 1: The config file can be parsed correctly. code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/42859/62/util/amdfwtool/data_parse.... PS62, Line 391: if (find_register_fw_filename_psp_dir(&(oneline[match[1].rm_so]), line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/62/util/amdfwtool/data_parse.... PS62, Line 393: if (find_register_fw_filename_bios_dir(&(oneline[match[1].rm_so]), line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/62/util/amdfwtool/data_parse.... PS62, Line 395: return 0; /* This line is not valid. Stop parsing. */ line over 96 characters
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#63).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 784 insertions(+), 553 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/63
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 63:
(7 comments)
https://review.coreboot.org/c/coreboot/+/42859/60/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/60/src/soc/amd/picasso/Makefi... PS60, Line 288: --whitelist
It looks like we lost ability to add whitelist option. […]
Done
https://review.coreboot.org/c/coreboot/+/42859/60/src/soc/amd/picasso/Makefi... PS60, Line 227: OPT_TOKEN_UNLOCK=$(call add_opt_prefix, $(PSP_TOKEN_UNLOCK), "") : OPT_PSP_USE_PSPSECUREOS=$(call add_opt_prefix, $(PSP_USE_PSPSECUREOS), "") : OPT_PSP_LOAD_MP2_FW=$(call add_opt_prefix, $(PSP_LOAD_MP2_FW), "") : OPT_PSP_LOAD_S0I3_FW=$(call add_opt_prefix, $(PSP_LOAD_S0I3_FW), "")
Do we really need these anymore? We are not really trying to concatenate two strings as we used to d […]
Done
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/amdfwtool.c... PS60, Line 1464: process_config(config_handle, &cb_config);
We should be checking the return status here if the config file is parsed correctly and failing the […]
Done
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 48: void
We really should be returning status and failing the build if we can't parse a non-blank/non-comment […]
Done
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 61: fw_type = AMD_FW_INVALID;
It may make sense to init fw_type = AMD_FW_INVALID at the top and then set fw_type to a new type her […]
Done
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 262: fw_type = AMD_BIOS_INVALID;
It may make sense to split find_register_fw_filename() into two functions e.g. […]
Done
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 306: if (!regexec(&blank_or_comment_expr, oneline, 0, NULL, 0)) { : /* skip comment and blank */ : retval = 1; : }
This does not seem to do much. […]
Done
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 63:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/60/util/amdfwtool/data_parse.... PS60, Line 68: fw_type = AMD_FW_INVALID;
same as above
Done
Nikolai Vyssotski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 63:
(5 comments)
Nice work! Jest a few more. Almost there.
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... PS63, Line 265: $(AMDFWTOOL) \ Sorry, missed that one on previous round. We nee to add configuration file as a dependency now with $(call strip_quotes,$(CONFIG_AMDFW_CONFIG_FILE)) \
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/amdfwtool.c... PS63, Line 1468: "Config file is parsed error: %s\n", This is not clear/proper English. Something like this would be better: fprintf(stderr, "Configuration file %s parsing error\n", config).
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/amdfwtool.c... PS63, Line 1469: strerror(errno)) Calling strerror() here would be bad as proces_config() returns 0 for failure and 1 for success. Thus when it fails it would actually print "Success". We can drop it since proces_config() returns just binary values or we need to fix up return values to be able to use strerror().
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/data_parse.... PS63, Line 208: fw_type = AMD_FW_PSP_WHITELIST; I would not add whitelist file unless it is whitelist configuration. Same as you do with PSPBTLDR_WL_FILE.
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/data_parse.... PS63, Line 399: return 0; /* Stop parsing. */ It would be nice to print which line it choked on - something like: printf("AMDFWTOOL config file line #%d can't be parsed "%s"\n", line_num, oneline).
Nikolai Vyssotski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 63:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... PS63, Line 265: $(AMDFWTOOL) \
Sorry, missed that one on previous round. […]
Hmm, this is even more problematic that I thought. CONFIG_AMDFW_CONFIG_FILE is definitely a good start but then what about all the files/binaries that it points to? We used to list them here as dependencies now we have no way of telling Make that we depend on them. While using this CL I already ran into this issue while trying to help Matt on another issue - the build would not pick up changed PSP_BL file.
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#64).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 788 insertions(+), 553 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/64
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 64:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/64/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/64/util/amdfwtool/data_parse.... PS64, Line 400: printf("Modules name "%s" is not a valid name\n", oneline); line over 96 characters
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 64:
(4 comments)
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/amdfwtool.c... PS63, Line 1468: "Config file is parsed error: %s\n",
This is not clear/proper English. […]
Done
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/amdfwtool.c... PS63, Line 1469: strerror(errno))
Calling strerror() here would be bad as proces_config() returns 0 for failure and 1 for success. […]
Done
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/data_parse.... PS63, Line 208: fw_type = AMD_FW_PSP_WHITELIST;
I would not add whitelist file unless it is whitelist configuration. […]
Done. Removed. Actually the white list file has been removed from the configuration file and gone back to command options.
https://review.coreboot.org/c/coreboot/+/42859/63/util/amdfwtool/data_parse.... PS63, Line 399: return 0; /* Stop parsing. */
It would be nice to print which line it choked on - something like: printf("AMDFWTOOL config file li […]
Done. And if no line with FIRMWARE_LOCATION, also stop parsing.
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 64:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... PS63, Line 265: $(AMDFWTOOL) \
Hmm, this is even more problematic that I thought. […]
Adding a option to amdfwtool to make a list of FW files can solve this problem.
Any suggestion?
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#65).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 819 insertions(+), 559 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/65
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 65:
(5 comments)
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c... PS65, Line 1510: if (list_deps) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... PS65, Line 401: fprintf(stderr, "Modules name "%s" is not valid\n", oneline); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... PS65, Line 403: } else { else is not generally useful after a break or return
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... PS65, Line 404: if (print_deps) Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... PS65, Line 413: fprintf(stderr, "AMDFWTOOL config file line can't be parsed "%s"\n", oneline); line over 96 characters
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 65:
(7 comments)
Some minor changes requested. It looks good other than these that are mostly nits.
https://review.coreboot.org/c/coreboot/+/42859/65/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/65/src/soc/amd/picasso/Makefi... PS65, Line 238: Could you put a comment on DEP_FILES explaining what it's doing?
# Add all the files listed in the config file
This applies to the other makefiles as well.
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Kconfig:
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... PS65, Line 68: string "AMD PSP Firmware config file" Remove this line and move the text to a help block? You don't need two 'string' entries and this doesn't need to be user-editable at this level. If a mainboard wants to use a different config, it can override it in the mainboard kconfig.
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... PS65, Line 69: if CPU_AMD_PI_00730F01 change this to a "depends on" statement so the option doesn't appear for other processors?
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... PS65, Line 100: #SMUFWM_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE).sbin : #SMUFWM_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE)_FN.sbin : #SMUSCS_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuScs$(FIRMWARE_TYPE).bin Why not remove these instead of commenting them out?
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c... PS65, Line 222: /* static */ Is the comment supposed to be on a different line? This seems odd.
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c... PS65, Line 599: /* For debugging */ nit: consider making this a separate commit?
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c... PS65, Line 1031: D remove D from the unused list?
Nikolai Vyssotski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 65:
(4 comments)
I like you approach on resolving the dependency issues. If DEP_FILES is placed in the correct place it works well. I tested it on my system for Mandolin target.
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... PS63, Line 265: $(AMDFWTOOL) \
Adding a option to amdfwtool to make a list of FW files can solve this problem. […]
Looks good to me. You probably want to add DEP_FILES here and not to AMDFW_COMMON_ARGS
https://review.coreboot.org/c/coreboot/+/42859/65/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/65/src/soc/amd/picasso/Makefi... PS65, Line 259: $(DEP_FILES) \ This does not make sense to me. Why would we want to add dependent files to arguments of AMDFWTOOL. Did you mean to add it to the dependency expression below?
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... PS65, Line 401: fprintf(stderr, "Modules name "%s" is not valid\n", oneline);
line over 96 characters
Nicely done. Did you mean "Module name" or "Module's name"?
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... PS65, Line 403: } else {
else is not generally useful after a break or return
I'm with bot on this one. Makes it easier on the eyes.
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#66).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 819 insertions(+), 559 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/66
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 66:
(8 comments)
https://review.coreboot.org/c/coreboot/+/42859/65/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/65/src/soc/amd/picasso/Makefi... PS65, Line 238:
Could you put a comment on DEP_FILES explaining what it's doing? […]
Done
https://review.coreboot.org/c/coreboot/+/42859/65/src/soc/amd/picasso/Makefi... PS65, Line 259: $(DEP_FILES) \
This does not make sense to me. Why would we want to add dependent files to arguments of AMDFWTOOL. […]
Done
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Kconfig:
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... PS65, Line 68: string "AMD PSP Firmware config file"
Remove this line and move the text to a help block? You don't need two 'string' entries and this do […]
Done
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... PS65, Line 69: if CPU_AMD_PI_00730F01
change this to a "depends on" statement so the option doesn't appear for other processors?
Only avalon is active now.
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... PS65, Line 100: #SMUFWM_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE).sbin : #SMUFWM_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE)_FN.sbin : #SMUSCS_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuScs$(FIRMWARE_TYPE).bin
Why not remove these instead of commenting them out?
Done
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c... PS65, Line 222: /* static */
Is the comment supposed to be on a different line? This seems odd.
Done
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c... PS65, Line 1031: D
remove D from the unused list?
Done
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/data_parse.... PS65, Line 401: fprintf(stderr, "Modules name "%s" is not valid\n", oneline);
Nicely done. […]
Done
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#67).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 786 insertions(+), 559 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/67
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 67:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/65/util/amdfwtool/amdfwtool.c... PS65, Line 599: /* For debugging */
nit: consider making this a separate commit?
Done
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 67:
(5 comments)
https://review.coreboot.org/c/coreboot/+/42859/67/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/67/util/amdfwtool/amdfwtool.c... PS67, Line 1478: if (list_deps) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/42859/67/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/67/util/amdfwtool/data_parse.... PS67, Line 401: fprintf(stderr, "Module's name "%s" is not valid\n", oneline); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/67/util/amdfwtool/data_parse.... PS67, Line 403: } else { else is not generally useful after a break or return
https://review.coreboot.org/c/coreboot/+/42859/67/util/amdfwtool/data_parse.... PS67, Line 404: if (print_deps) Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/42859/67/util/amdfwtool/data_parse.... PS67, Line 413: fprintf(stderr, "AMDFWTOOL config file line can't be parsed "%s"\n", oneline); line over 96 characters
Nikolai Vyssotski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 67: Code-Review+1
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 67:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... File src/southbridge/amd/pi/hudson/Kconfig:
https://review.coreboot.org/c/coreboot/+/42859/65/src/southbridge/amd/pi/hud... PS65, Line 69: if CPU_AMD_PI_00730F01
Only avalon is active now.
Done
Hello build bot (Jenkins), Jason Glenesk, Martin Roth, Patrick Georgi, Dave Frodin, Marshall Dawson, Zheng Bao, Nikolai Vyssotski, Matt Papageorge, Justin Frodsham, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42859
to look at the new patch set (#68).
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 786 insertions(+), 559 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42859/68
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 67:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... File src/soc/amd/picasso/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/42859/63/src/soc/amd/picasso/Makefi... PS63, Line 265: $(AMDFWTOOL) \
Looks good to me. […]
Done
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 68:
(5 comments)
https://review.coreboot.org/c/coreboot/+/42859/68/util/amdfwtool/amdfwtool.c File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/42859/68/util/amdfwtool/amdfwtool.c... PS68, Line 1478: if (list_deps) { braces {} are not necessary for single statement blocks
https://review.coreboot.org/c/coreboot/+/42859/68/util/amdfwtool/data_parse.... File util/amdfwtool/data_parse.c:
https://review.coreboot.org/c/coreboot/+/42859/68/util/amdfwtool/data_parse.... PS68, Line 401: fprintf(stderr, "Module's name "%s" is not valid\n", oneline); line over 96 characters
https://review.coreboot.org/c/coreboot/+/42859/68/util/amdfwtool/data_parse.... PS68, Line 403: } else { else is not generally useful after a break or return
https://review.coreboot.org/c/coreboot/+/42859/68/util/amdfwtool/data_parse.... PS68, Line 404: if (print_deps) Too many leading tabs - consider code refactoring
https://review.coreboot.org/c/coreboot/+/42859/68/util/amdfwtool/data_parse.... PS68, Line 413: fprintf(stderr, "AMDFWTOOL config file line can't be parsed "%s"\n", oneline); line over 96 characters
Bao Zheng has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 68:
consistency test have been done on all related board and passed with patchset 68
Nikolai Vyssotski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 68: Code-Review+1
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
Patch Set 68: Code-Review+2
I've verified that now also with the secure debug enable configuration being set the resulting image is identical and works on mandolin
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/42859 )
Change subject: amdfwtool: Take a config file instead of command line parameters ......................................................................
amdfwtool: Take a config file instead of command line parameters
To verify the consistency, see if timeless builds with and without this patch result in identical coreboot.rom files.
BUG=b:154032833 TEST=Build & boot on mandolin
Change-Id: Icae73d0730106aab687486e555ba947796e5e757 Signed-off-by: Zheng Bao fishbaozi@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/42859 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nikolai Vyssotski nikolai.vyssotski@amd.corp-partner.google.com Reviewed-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/picasso/Kconfig M src/soc/amd/picasso/Makefile.inc A src/soc/amd/picasso/fw.cfg M src/soc/amd/stoneyridge/Kconfig M src/soc/amd/stoneyridge/Makefile.inc A src/soc/amd/stoneyridge/fw_cz.cfg A src/soc/amd/stoneyridge/fw_st.cfg M src/southbridge/amd/pi/hudson/Kconfig M src/southbridge/amd/pi/hudson/Makefile.inc A src/southbridge/amd/pi/hudson/fw_avl.cfg M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc M util/amdfwtool/amdfwtool.c A util/amdfwtool/amdfwtool.h A util/amdfwtool/data_parse.c 15 files changed, 786 insertions(+), 559 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, approved Nikolai Vyssotski: Looks good to me, but someone else must approve
diff --git a/src/soc/amd/picasso/Kconfig b/src/soc/amd/picasso/Kconfig index 6a5b932..7e03a41 100644 --- a/src/soc/amd/picasso/Kconfig +++ b/src/soc/amd/picasso/Kconfig @@ -446,9 +446,9 @@ comment "AMD Firmware Directory Table set to location for 16MB ROM" depends on AMD_FWM_POSITION_INDEX = 5
-config AMD_PUBKEY_FILE +config AMDFW_CONFIG_FILE string - default "3rdparty/amd_blobs/picasso/PSP/AmdPubKeyRV.bin" + default "src/soc/amd/picasso/fw.cfg"
config USE_PSPSECUREOS bool @@ -487,16 +487,6 @@ depends on HAVE_PSP_WHITELIST_FILE default "3rdparty/amd_blobs/picasso/PSP/wtl-rvn.sbin"
-config PSP_BOOTLOADER_FILE - string "Specify the PSP Bootloader file path" - default "3rdparty/amd_blobs/picasso/PSP/PspBootLoader_WL_RV.sbin" if HAVE_PSP_WHITELIST_FILE - default "3rdparty/amd_blobs/picasso/PSP/PspBootLoader_prod_RV.sbin" - help - Supply the name of the PSP bootloader file. - - Note that this option may conflict with the whitelist file if a - different PSP bootloader binary is specified. - config PSP_SHAREDMEM_SIZE hex "Maximum size of shared memory area" default 0x3000 if VBOOT diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc index 514b313..7ec695a 100644 --- a/src/soc/amd/picasso/Makefile.inc +++ b/src/soc/amd/picasso/Makefile.inc @@ -125,77 +125,35 @@ # Design Guide for AMD Family 17h Processors" (PID #55758, NDA only). #
-# type = 0x0 -FIRMWARE_LOCATE=$(realpath $(dir $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)))) - -# type = 0x1 -ifeq ($(CONFIG_PSP_BOOTLOADER_FILE),) -$(error CONFIG_PSP_BOOTLOADER_FILE was not defined) -endif -PSPBTLDR_FILE=$(realpath $(call strip_quotes, $(CONFIG_PSP_BOOTLOADER_FILE))) -$(info Adding PSP $(shell dd if=$(PSPBTLDR_FILE) | md5sum)) - -# types = 0x8 and 0x12 -PSP_SMUFW1_SUB1_FILE=$(FIRMWARE_LOCATE)/SmuFirmwareRV2.csbin -PSP_SMUFW1_SUB2_FILE=$(FIRMWARE_LOCATE)/SmuFirmwarePCO.csbin -PSP_SMUFW2_SUB1_FILE=$(FIRMWARE_LOCATE)/SmuFirmware2RV2.csbin -PSP_SMUFW2_SUB2_FILE=$(FIRMWARE_LOCATE)/SmuFirmware2PCO.csbin +FIRMWARE_LOCATE=$(shell grep -e FIRMWARE_LOCATE $(CONFIG_AMDFW_CONFIG_FILE) | awk '{print $$2}')
ifeq ($(CONFIG_PSP_UNLOCK_SECURE_DEBUG),y) -# type = 0x9 -PSP_SEC_DBG_KEY_FILE=$(FIRMWARE_LOCATE)/RavenSecureDebug_PublicKey.bin -# type = 0x13 -PSP_SEC_DEBUG_FILE=$(FIRMWARE_LOCATE)/secure_unlock_prod_RV.sbin # Enable secure debug unlock PSP_SOFTFUSE_BITS += 0 -PSP_TOKEN_UNLOCK="--token-unlock" +OPT_TOKEN_UNLOCK="--token-unlock" endif
ifeq ($(CONFIG_USE_PSPSECUREOS),y) # types = 0x2 -PSPSECUREOS_FILE=$(FIRMWARE_LOCATE)/psp_os_combined_prod_RV.sbin +OPT_PSP_USE_PSPSECUREOS="--use-pspsecureos" endif
-# type = 0x21 -PSP_IKEK_FILE=$(FIRMWARE_LOCATE)/PspIkekRV.bin - -# type = 0x24 -PSP_SECG1_FILE=$(FIRMWARE_LOCATE)/security_policy_RV2_FP5_AM4.sbin -PSP_SECG2_FILE=$(FIRMWARE_LOCATE)/security_policy_PCO_FP5_AM4.sbin
ifeq ($(CONFIG_PSP_LOAD_MP2_FW),y) -# type = 0x25 -PSP_MP2FW1_FILE=$(FIRMWARE_LOCATE)/MP2I2CFWRV2.sbin -PSP_MP2FW2_FILE=$(FIRMWARE_LOCATE)/MP2I2CFWPCO.sbin -# BIOS type = 0x6a -PSP_MP2CFG_FILE=$(FIRMWARE_LOCATE)/MP2FWConfig.sbin +OPT_PSP_LOAD_MP2_FW="--load-mp2-fw" else # Disable MP2 firmware loading PSP_SOFTFUSE_BITS += 29 endif
-# type = 0x28 -PSP_DRIVERS_FILE=$(FIRMWARE_LOCATE)/drv_sys_prod_RV.sbin - ifeq ($(CONFIG_PSP_LOAD_S0I3_FW),y) -PSP_S0I3_FILE=$(FIRMWARE_LOCATE)/dr_agesa_prod_RV.sbin +OPT_PSP_LOAD_S0I3_FW="--load-s0i3" endif
-# types = 0x30 - 0x37 -PSP_ABL0_FILE=$(FIRMWARE_LOCATE)/AgesaBootloader0_prod_RV.csbin -PSP_ABL1_FILE=$(FIRMWARE_LOCATE)/AgesaBootloader1_prod_RV.csbin -PSP_ABL2_FILE=$(FIRMWARE_LOCATE)/AgesaBootloader2_prod_RV.csbin -PSP_ABL3_FILE=$(FIRMWARE_LOCATE)/AgesaBootloader3_prod_RV.csbin -PSP_ABL4_FILE=$(FIRMWARE_LOCATE)/AgesaBootloader4_prod_RV.csbin -PSP_ABL5_FILE=$(FIRMWARE_LOCATE)/AgesaBootloader5_prod_RV.csbin -PSP_ABL6_FILE=$(FIRMWARE_LOCATE)/AgesaBootloader6_prod_RV.csbin -PSP_ABL7_FILE=$(FIRMWARE_LOCATE)/AgesaBootloader7_prod_RV.csbin - # type = 0x3a ifeq ($(CONFIG_HAVE_PSP_WHITELIST_FILE),y) PSP_WHITELIST_FILE=$(CONFIG_PSP_WHITELIST_FILE) endif - # # BIOS Directory Table items - proper ordering is managed by amdfwtool # @@ -216,16 +174,6 @@ APOB_NV_SIZE=$(shell grep "FMAP_SECTION_RW_MRC_CACHE_SIZE" $(obj)/fmap_config.h | awk '{print $$(NF)}') APOB_NV_BASE=$(shell grep "FMAP_SECTION_RW_MRC_CACHE_START" $(obj)/fmap_config.h | awk '{print $$(NF)}')
-# type2 = 0x64, 0x65 -PSP_PMUI_FILE1=$(FIRMWARE_LOCATE)/Appb_Rv_1D_Ddr4_Udimm_Imem.csbin -PSP_PMUI_FILE2=$(FIRMWARE_LOCATE)/Appb_Rv_2D_Ddr4_Imem.csbin -PSP_PMUI_FILE3=$(FIRMWARE_LOCATE)/Appb_Rv2_1D_ddr4_Udimm_Imem.csbin -PSP_PMUI_FILE4=$(FIRMWARE_LOCATE)/Appb_Rv2_2D_ddr4_Udimm_Imem.csbin -PSP_PMUD_FILE1=$(FIRMWARE_LOCATE)/Appb_Rv_1D_Ddr4_Udimm_Dmem.csbin -PSP_PMUD_FILE2=$(FIRMWARE_LOCATE)/Appb_Rv_2D_Ddr4_Dmem.csbin -PSP_PMUD_FILE3=$(FIRMWARE_LOCATE)/Appb_Rv2_1D_ddr4_Udimm_Dmem.csbin -PSP_PMUD_FILE4=$(FIRMWARE_LOCATE)/Appb_Rv2_2D_ddr4_Udimm_Dmem.csbin - # type = 0x66 PSP_UCODE_FILE1=$(FIRMWARE_LOCATE)/UcodePatch_PCO_B1.bin PSP_UCODE_FILE2=$(FIRMWARE_LOCATE)/UcodePatch_PCO_B0.bin @@ -259,33 +207,6 @@
add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), )
-OPT_AMD_PUBKEY_FILE=$(call add_opt_prefix, $(CONFIG_AMD_PUBKEY_FILE), --pubkey) -OPT_PSPBTLDR_FILE=$(call add_opt_prefix, $(PSPBTLDR_FILE), --bootloader) -OPT_SMUFW1_SUB1_FILE=$(call add_opt_prefix, $(PSP_SMUFW1_SUB1_FILE), --subprogram 1 --smufirmware) -OPT_SMUFW1_SUB2_FILE=$(call add_opt_prefix, $(PSP_SMUFW1_SUB2_FILE), --subprogram 2 --smufirmware) -OPT_SMUFW2_SUB1_FILE=$(call add_opt_prefix, $(PSP_SMUFW2_SUB1_FILE), --subprogram 1 --smufirmware2) -OPT_SMUFW2_SUB2_FILE=$(call add_opt_prefix, $(PSP_SMUFW2_SUB2_FILE), --subprogram 2 --smufirmware2) -OPT_PSP_SEC_DBG_KEY_FILE=$(call add_opt_prefix, $(PSP_SEC_DBG_KEY_FILE), --securedebug) -OPT_TOKEN_UNLOCK=$(call add_opt_prefix, $(PSP_TOKEN_UNLOCK), "") -OPT_PSP_SOFTFUSE=$(call add_opt_prefix, $(PSP_SOFTFUSE), --soft-fuse) -OPT_PSPSECUREOS_FILE=$(call add_opt_prefix, $(PSPSECUREOS_FILE), --secureos) -OPT_SEC_DEBUG_FILE=$(call add_opt_prefix, $(PSP_SEC_DEBUG_FILE), --secdebug) -OPT_IKEK_FILE=$(call add_opt_prefix, $(PSP_IKEK_FILE), --ikek) -OPT_SECG1_FILE=$(call add_opt_prefix, $(PSP_SECG1_FILE), --subprog 1 --sec-gasket) -OPT_SECG2_FILE=$(call add_opt_prefix, $(PSP_SECG2_FILE), --subprog 2 --sec-gasket) -OPT_MP2FW1_FILE=$(call add_opt_prefix, $(PSP_MP2FW1_FILE), --subprog 1 --mp2-fw) -OPT_MP2FW2_FILE=$(call add_opt_prefix, $(PSP_MP2FW2_FILE), --subprog 2 --mp2-fw) -OPT_DRIVERS_FILE=$(call add_opt_prefix, $(PSP_DRIVERS_FILE), --drv-entry-pts) -OPT_PSP_S0I3_FILE=$(call add_opt_prefix, $(PSP_S0I3_FILE), --s0i3drv) -OPT_ABL0_FILE=$(call add_opt_prefix, $(PSP_ABL0_FILE), --abl-image) -OPT_ABL1_FILE=$(call add_opt_prefix, $(PSP_ABL1_FILE), --abl-image) -OPT_ABL2_FILE=$(call add_opt_prefix, $(PSP_ABL2_FILE), --abl-image) -OPT_ABL3_FILE=$(call add_opt_prefix, $(PSP_ABL3_FILE), --abl-image) -OPT_ABL4_FILE=$(call add_opt_prefix, $(PSP_ABL4_FILE), --abl-image) -OPT_ABL5_FILE=$(call add_opt_prefix, $(PSP_ABL5_FILE), --abl-image) -OPT_ABL6_FILE=$(call add_opt_prefix, $(PSP_ABL6_FILE), --abl-image) -OPT_ABL7_FILE=$(call add_opt_prefix, $(PSP_ABL7_FILE), --abl-image) -OPT_WHITELIST_FILE=$(call add_opt_prefix, $(PSP_WHITELIST_FILE), --whitelist) OPT_VERSTAGE_FILE=$(call add_opt_prefix, $(PSP_VERSTAGE_FILE), --verstage) OPT_VERSTAGE_SIG_FILE=$(call add_opt_prefix, $(PSP_VERSTAGE_SIG_FILE), --verstage_sig)
@@ -297,15 +218,7 @@ OPT_PSP_BIOSBIN_FILE=$(call add_opt_prefix, $(PSP_BIOSBIN_FILE), --bios-bin) OPT_PSP_BIOSBIN_DEST=$(call add_opt_prefix, $(PSP_BIOSBIN_DEST), --bios-bin-dest) OPT_PSP_BIOSBIN_SIZE=$(call add_opt_prefix, $(PSP_BIOSBIN_SIZE), --bios-uncomp-size) -OPT_PSP_PMUI_FILE1=$(call add_opt_prefix, $(PSP_PMUI_FILE1), --subprogram 0 --instance 1 --pmu-inst) -OPT_PSP_PMUI_FILE2=$(call add_opt_prefix, $(PSP_PMUI_FILE2), --subprogram 0 --instance 4 --pmu-inst) -OPT_PSP_PMUI_FILE3=$(call add_opt_prefix, $(PSP_PMUI_FILE3), --subprogram 1 --instance 1 --pmu-inst) -OPT_PSP_PMUI_FILE4=$(call add_opt_prefix, $(PSP_PMUI_FILE4), --subprogram 1 --instance 4 --pmu-inst) -OPT_PSP_PMUD_FILE1=$(call add_opt_prefix, $(PSP_PMUD_FILE1), --subprogram 0 --instance 1 --pmu-data) -OPT_PSP_PMUD_FILE2=$(call add_opt_prefix, $(PSP_PMUD_FILE2), --subprogram 0 --instance 4 --pmu-data) -OPT_PSP_PMUD_FILE3=$(call add_opt_prefix, $(PSP_PMUD_FILE3), --subprogram 1 --instance 1 --pmu-data) -OPT_PSP_PMUD_FILE4=$(call add_opt_prefix, $(PSP_PMUD_FILE4), --subprogram 1 --instance 4 --pmu-data) -OPT_MP2CFG_FILE=$(call add_opt_prefix, $(PSP_MP2CFG_FILE), --mp2-config) + OPT_PSP_SHAREDMEM_BASE=$(call add_opt_prefix, $(PSP_SHAREDMEM_BASE), --sharedmem) OPT_PSP_SHAREDMEM_SIZE=$(call add_opt_prefix, $(PSP_SHAREDMEM_SIZE), --sharedmem-size) OPT_APOB_NV_SIZE=$(call add_opt_prefix, $(APOB_NV_SIZE), --apob-nv-size) @@ -314,49 +227,28 @@ OPT_EFS_SPI_SPEED=$(call add_opt_prefix, $(CONFIG_EFS_SPI_SPEED), --spi-speed) OPT_EFS_SPI_MICRON_FLAG=$(call add_opt_prefix, $(CONFIG_EFS_SPI_MICRON_FLAG), --spi-micron-flag)
+OPT_PSP_SOFTFUSE=$(call add_opt_prefix, $(PSP_SOFTFUSE), --soft-fuse) + ifeq ($(CONFIG_VBOOT),) OPT_APOB0_NV_SIZE=$(OPT_APOB_NV_SIZE) OPT_APOB0_NV_BASE=$(OPT_APOB_NV_BASE) endif
-AMDFW_COMMON_ARGS=$(OPT_AMD_PUBKEY_FILE) \ - $(OPT_PSPSECUREOS_FILE) \ - $(OPT_PSP_SEC_DBG_KEY_FILE) \ - $(OPT_SMUFW1_SUB2_FILE) \ - $(OPT_SMUFW2_SUB2_FILE) \ - $(OPT_SMUFW1_SUB1_FILE) \ - $(OPT_SMUFW2_SUB1_FILE) \ - $(OPT_PSP_APCB_FILES) \ +OPT_WHITELIST_FILE=$(call add_opt_prefix, $(PSP_WHITELIST_FILE), --whitelist) + +# Add all the files listed in the config file +DEP_FILES=$(shell $(AMDFWTOOL) --config $(CONFIG_AMDFW_CONFIG_FILE) --depend) + +AMDFW_COMMON_ARGS=$(OPT_PSP_APCB_FILES) \ $(OPT_APOB_ADDR) \ $(OPT_PSP_BIOSBIN_FILE) \ $(OPT_PSP_BIOSBIN_DEST) \ $(OPT_PSP_BIOSBIN_SIZE) \ $(OPT_PSP_SOFTFUSE) \ - $(OPT_PSP_PMUI_FILE1) \ - $(OPT_PSP_PMUI_FILE2) \ - $(OPT_PSP_PMUI_FILE3) \ - $(OPT_PSP_PMUI_FILE4) \ - $(OPT_PSP_PMUD_FILE1) \ - $(OPT_PSP_PMUD_FILE2) \ - $(OPT_PSP_PMUD_FILE3) \ - $(OPT_PSP_PMUD_FILE4) \ - $(OPT_MP2CFG_FILE) \ - $(OPT_ABL0_FILE) \ - $(OPT_ABL1_FILE) \ - $(OPT_ABL2_FILE) \ - $(OPT_ABL3_FILE) \ - $(OPT_ABL4_FILE) \ - $(OPT_ABL5_FILE) \ - $(OPT_ABL6_FILE) \ - $(OPT_ABL7_FILE) \ + $(OPT_PSP_USE_PSPSECUREOS) \ + $(OPT_PSP_LOAD_MP2_FW) \ + $(OPT_PSP_LOAD_S0I3_FW) \ $(OPT_WHITELIST_FILE) \ - $(OPT_SECG1_FILE) \ - $(OPT_SECG2_FILE) \ - $(OPT_MP2FW1_FILE) \ - $(OPT_MP2FW2_FILE) \ - $(OPT_DRIVERS_FILE) \ - $(OPT_PSP_S0I3_FILE) \ - $(OPT_IKEK_FILE) \ $(OPT_SEC_DEBUG_FILE) \ $(OPT_PSP_SHAREDMEM_BASE) \ $(OPT_PSP_SHAREDMEM_SIZE) \ @@ -365,45 +257,15 @@ $(OPT_EFS_SPI_READ_MODE) \ $(OPT_EFS_SPI_SPEED) \ $(OPT_EFS_SPI_MICRON_FLAG) \ + --config $(CONFIG_AMDFW_CONFIG_FILE) \ --soc-name "Picasso" \ --flashsize $(CONFIG_ROM_SIZE)
-$(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \ - $(call strip_quotes, $(PSPBTLDR_FILE)) \ - $(call strip_quotes, $(PSPSECUREOS_FILE)) \ - $(call strip_quotes, $(PSP_SEC_DBG_KEY_FILE)) \ - $(call strip_quotes, $(PSP_BIOSBIN_FILE)) \ - $(call strip_quotes, $(PSP_PMUI_FILE1)) \ - $(call strip_quotes, $(PSP_PMUI_FILE2)) \ - $(call strip_quotes, $(PSP_PMUI_FILE3)) \ - $(call strip_quotes, $(PSP_PMUI_FILE4)) \ - $(call strip_quotes, $(PSP_PMUD_FILE1)) \ - $(call strip_quotes, $(PSP_PMUD_FILE2)) \ - $(call strip_quotes, $(PSP_PMUD_FILE3)) \ - $(call strip_quotes, $(PSP_PMUD_FILE4)) \ - $(call strip_quotes, $(PSP_MP2CFG_FILE)) \ - $(call strip_quotes, $(PSP_SMUFW1_SUB1_FILE)) \ - $(call strip_quotes, $(PSP_SMUFW1_SUB2_FILE)) \ - $(call strip_quotes, $(PSP_SMUFW2_SUB1_FILE)) \ - $(call strip_quotes, $(PSP_SMUFW2_SUB2_FILE)) \ - $(call strip_quotes, $(PSP_ABL0_FILE)) \ - $(call strip_quotes, $(PSP_ABL1_FILE)) \ - $(call strip_quotes, $(PSP_ABL2_FILE)) \ - $(call strip_quotes, $(PSP_ABL3_FILE)) \ - $(call strip_quotes, $(PSP_ABL4_FILE)) \ - $(call strip_quotes, $(PSP_ABL5_FILE)) \ - $(call strip_quotes, $(PSP_ABL6_FILE)) \ - $(call strip_quotes, $(PSP_ABL7_FILE)) \ - $(call strip_quotes, $(PSP_WHITELIST_FILE)) \ - $(call strip_quotes, $(PSP_SECG1_FILE)) \ - $(call strip_quotes, $(PSP_SECG2_FILE)) \ - $(call_strip_quotes, $(PSP_DRIVERS_FILE)) \ - $(call_strip_quotes, $(PSP_S0I3_FILE)) \ - $(call_strip_quotes, $(PSP_IKEK_FILE)) \ - $(call_strip_quotes, $(PSP_SEC_DEBUG_FILE)) \ +$(obj)/amdfw.rom: $(call strip_quotes, $(PSP_BIOSBIN_FILE)) \ $(PSP_VERSTAGE_FILE) \ $(PSP_VERSTAGE_SIG_FILE) \ $$(PSP_APCB_FILES) \ + $(DEP_FILES) \ $(AMDFWTOOL) \ $(obj)/fmap_config.h $(if $(PSP_APCB_FILES), ,$(error APCB_SOURCES is not set)) diff --git a/src/soc/amd/picasso/fw.cfg b/src/soc/amd/picasso/fw.cfg new file mode 100644 index 0000000..e746d1e --- /dev/null +++ b/src/soc/amd/picasso/fw.cfg @@ -0,0 +1,39 @@ +# PSP fw config file + +FIRMWARE_LOCATE 3rdparty/amd_blobs/picasso/PSP + +# type file +AMD_PUBKEY_FILE AmdPubKeyRV.bin +PSPBTLDR_FILE PspBootLoader_prod_RV.sbin +PSPBTLDR_WL_FILE PspBootLoader_WL_RV.sbin +PSP_SMUFW1_SUB1_FILE SmuFirmwareRV2.csbin +PSP_SMUFW1_SUB2_FILE SmuFirmwarePCO.csbin +PSP_SMUFW2_SUB1_FILE SmuFirmware2RV2.csbin +PSP_SMUFW2_SUB2_FILE SmuFirmware2PCO.csbin +PSPSECUREOS_FILE psp_os_combined_prod_RV.sbin +PSP_SEC_DBG_KEY_FILE RavenSecureDebug_PublicKey.bin +PSP_SEC_DEBUG_FILE secure_unlock_prod_RV.sbin +PSP_ABL0_FILE AgesaBootloader0_prod_RV.csbin +PSP_ABL1_FILE AgesaBootloader1_prod_RV.csbin +PSP_ABL2_FILE AgesaBootloader2_prod_RV.csbin +PSP_ABL3_FILE AgesaBootloader3_prod_RV.csbin +PSP_ABL4_FILE AgesaBootloader4_prod_RV.csbin +PSP_ABL5_FILE AgesaBootloader5_prod_RV.csbin +PSP_ABL6_FILE AgesaBootloader6_prod_RV.csbin +PSP_ABL7_FILE AgesaBootloader7_prod_RV.csbin +PSP_IKEK_FILE PspIkekRV.bin +PSP_SECG1_FILE security_policy_RV2_FP5_AM4.sbin +PSP_SECG2_FILE security_policy_PCO_FP5_AM4.sbin +PSP_MP2FW1_FILE MP2I2CFWRV2.sbin +PSP_MP2FW2_FILE MP2I2CFWPCO.sbin +PSP_MP2CFG_FILE MP2FWConfig.sbin +PSP_DRIVERS_FILE drv_sys_prod_RV.sbin +# BDT +PSP_PMUI_FILE1 Appb_Rv_1D_Ddr4_Udimm_Imem.csbin +PSP_PMUI_FILE2 Appb_Rv_2D_Ddr4_Imem.csbin +PSP_PMUI_FILE3 Appb_Rv2_1D_ddr4_Udimm_Imem.csbin +PSP_PMUI_FILE4 Appb_Rv2_2D_ddr4_Udimm_Imem.csbin +PSP_PMUD_FILE1 Appb_Rv_1D_Ddr4_Udimm_Dmem.csbin +PSP_PMUD_FILE2 Appb_Rv_2D_Ddr4_Dmem.csbin +PSP_PMUD_FILE3 Appb_Rv2_1D_ddr4_Udimm_Dmem.csbin +PSP_PMUD_FILE4 Appb_Rv2_2D_ddr4_Udimm_Dmem.csbin diff --git a/src/soc/amd/stoneyridge/Kconfig b/src/soc/amd/stoneyridge/Kconfig index 2ef90eb..0e32005 100644 --- a/src/soc/amd/stoneyridge/Kconfig +++ b/src/soc/amd/stoneyridge/Kconfig @@ -190,12 +190,13 @@ string "GEC firmware path and filename" depends on STONEYRIDGE_GEC_FWM
-config AMD_PUBKEY_FILE - string "AMD public Key" +config AMDFW_CONFIG_FILE + string + string "AMD PSP Firmware config file" default "" if !USE_AMD_BLOBS - default "3rdparty/amd_blobs/stoneyridge/PSP/CZ/AmdPubKeyCZ.bin" if AMD_APU_MERLINFALCON - default "3rdparty/amd_blobs/stoneyridge/PSP/ST/AmdPubKeyST.bin" if AMD_APU_PRAIRIEFALCON - default "3rdparty/amd_blobs/stoneyridge/PSP/ST/AmdPubKeyST.bin" if AMD_APU_STONEYRIDGE + default "src/soc/amd/stoneyridge/fw_cz.cfg" if AMD_APU_MERLINFALCON + default "src/soc/amd/stoneyridge/fw_st.cfg" if AMD_APU_PRAIRIEFALCON + default "src/soc/amd/stoneyridge/fw_st.cfg" if AMD_APU_STONEYRIDGE
config STONEYRIDGE_SATA_MODE int "SATA Mode" diff --git a/src/soc/amd/stoneyridge/Makefile.inc b/src/soc/amd/stoneyridge/Makefile.inc index 16597e1..9211e81 100644 --- a/src/soc/amd/stoneyridge/Makefile.inc +++ b/src/soc/amd/stoneyridge/Makefile.inc @@ -101,7 +101,9 @@ 0x80000 $(CONFIG_AMD_FWM_POSITION_INDEX))) 0x20000 1)
### 0 -FIRMWARE_LOCATE=$(dir $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE))) + +FIRMWARE_LOCATE=$(shell grep -e FIRMWARE_LOCATE $(CONFIG_AMDFW_CONFIG_FILE) | awk '{print $$2}') + ifneq ($(FIRMWARE_LOCATE),)
ifeq ($(CONFIG_AMD_APU_STONEYRIDGE),y) @@ -119,134 +121,47 @@ endif # CONFIG_AMD_APU_MERLINFALCON endif # CONFIG_AMD_APU_STONEYRIDGE
-###5 -PUBSIGNEDKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/RtmPubSigned$(FIRMWARE_TYPE).key +add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), )
-###1 -PSPBTLDR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspBootLoader_prod_$(FIRMWARE_TYPE).sbin +OPT_STONEYRIDGE_XHCI_FWM_FILE=$(call add_opt_prefix, $(CONFIG_STONEYRIDGE_XHCI_FWM_FILE), --xhci) +OPT_STONEYRIDGE_GEC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_STONEYRIDGE_GEC_FWM_FILE), --gec)
-###3 -PSPRCVR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspRecoveryBootLoader_prod_$(FIRMWARE_TYPE).sbin +SMUFWM_FILE=$(top)/$(FIRMWARE_LOCATE)/$(shell awk '($$1=="PSP_SMUFW1_SUB0_FILE") {print $$2}' $(CONFIG_AMDFW_CONFIG_FILE)) +SMUFWM_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/$(shell awk '($$1=="PSP_SMUFW1_SUB1_FILE") {print $$2}' $(CONFIG_AMDFW_CONFIG_FILE))
-###4 -PSPNVRAM_FILE=$(top)/$(FIRMWARE_LOCATE)/PspNvram$(FIRMWARE_TYPE).bin - -###8 - Check for SMU firmware named either *.sbin or *.csbin. Both "signed" and -### "compressed signed" are used by generations supported by this file. -SMUFWM_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware_$(FIRMWARE_TYPE).csbin -SMUFWM_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware_$(FIRMWARE_TYPE)_FN.csbin -ifeq ("$(wildcard $(SMUFWM_FILE))","") -SMUFWM_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE).sbin -SMUFWM_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE)_FN.sbin -endif - -###95 -SMUSCS_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuScs$(FIRMWARE_TYPE).bin - -###9 -PSPSECUREDEBUG_FILE=$(top)/$(FIRMWARE_LOCATE)/PspSecureDebug$(FIRMWARE_TYPE).Key - -ifeq ($(CONFIG_USE_PSPSECUREOS),y) -###2 -PSPSECUREOS_FILE=$(top)/$(FIRMWARE_LOCATE)/PspSecureOs_prod_$(FIRMWARE_TYPE).csbin - -###12 -PSPTRUSTLETS_FILE=$(wildcard $(top)/$(FIRMWARE_LOCATE)/PspTrustlets*_prod_$(FIRMWARE_TYPE).cbin) - -###13 -TRUSTLETKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/TrustletKey_prod_$(FIRMWARE_TYPE).sbin -endif - -###18- Check for SMU firmware2 named either *.sbin or *.csbin -### TODO: Remove *.sbin section after the blobs repo is updated. -SMUFIRMWARE2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE).csbin -SMUFIRMWARE2_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE)_FN.csbin -ifeq ("$(wildcard $(SMUFIRMWARE2_FILE))","") -SMUFIRMWARE2_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE).sbin -SMUFIRMWARE2_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware2_prod_$(FIRMWARE_TYPE)_FN.sbin -endif +SMUFIRMWARE2_FILE=$(top)/$(FIRMWARE_LOCATE)/$(shell awk '($$1=="PSP_SMUFW2_SUB0_FILE") {print $$2}' $(CONFIG_AMDFW_CONFIG_FILE)) +SMUFIRMWARE2_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/$(shell awk '($$1=="PSP_SMUFW2_SUB1_FILE") {print $$2}' $(CONFIG_AMDFW_CONFIG_FILE))
ifeq ("$(wildcard $(SMUFWM_FN_FILE))","") SMUFWM_FN_FILE= SMUFIRMWARE2_FN_FILE= endif
-add_opt_prefix=$(if $(call strip_quotes, $(1)), $(2) $(call strip_quotes, $(1)), ) - -OPT_STONEYRIDGE_XHCI_FWM_FILE=$(call add_opt_prefix, $(CONFIG_STONEYRIDGE_XHCI_FWM_FILE), --xhci) -OPT_STONEYRIDGE_GEC_FWM_FILE=$(call add_opt_prefix, $(CONFIG_STONEYRIDGE_GEC_FWM_FILEddd), --gec) - -OPT_AMD_PUBKEY_FILE=$(call add_opt_prefix, $(CONFIG_AMD_PUBKEY_FILE), --pubkey) -OPT_PSPBTLDR_FILE=$(call add_opt_prefix, $(PSPBTLDR_FILE), --bootloader) -OPT_SMUFWM_FILE=$(call add_opt_prefix, $(SMUFWM_FILE), --smufirmware) -OPT_PSPRCVR_FILE=$(call add_opt_prefix, $(PSPRCVR_FILE), --recovery) -OPT_PUBSIGNEDKEY_FILE=$(call add_opt_prefix, $(PUBSIGNEDKEY_FILE), --rtmpubkey) -OPT_PSPNVRAM_FILE=$(call add_opt_prefix, $(PSPNVRAM_FILE), --nvram) -OPT_PSPSECUREDEBUG_FILE=$(call add_opt_prefix, $(PSPSECUREDEBUG_FILE), --securedebug) -ifeq ($(CONFIG_USE_PSPSECUREOS),y) -OPT_PSPSECUREOS_FILE=$(call add_opt_prefix, $(PSPSECUREOS_FILE), --secureos) -OPT_PSPTRUSTLETS_FILE=$(call add_opt_prefix, $(PSPTRUSTLETS_FILE), --trustlets) -OPT_TRUSTLETKEY_FILE=$(call add_opt_prefix, $(TRUSTLETKEY_FILE), --trustletkey) -endif -OPT_SMUFIRMWARE2_FILE=$(call add_opt_prefix, $(SMUFIRMWARE2_FILE), --smufirmware2) -OPT_SMUSCS_FILE=$(call add_opt_prefix, $(SMUSCS_FILE), --smuscs) -SUBPROG_FN_SMU_FW=1 -OPT_SMUFWM_FN_FILE=$(call add_opt_prefix, $(SMUFWM_FN_FILE), --subprogram $(SUBPROG_FN_SMU_FW) --smufirmware) -OPT_SMUFIRMWARE2_FN_FILE=$(call add_opt_prefix, $(SMUFIRMWARE2_FN_FILE), --subprogram $(SUBPROG_FN_SMU_FW) --smufirmware2) - ifeq ($(FIRMWARE_TYPE),ST) OPT_COMBOCAPABLE=--combo-capable endif
+ifeq ($(CONFIG_USE_PSPSECUREOS),y) +PSP_USE_PSPSECUREOS="--use-pspsecureos" +endif + +OPT_PSP_USE_PSPSECUREOS=$(call strip_quotes, $(PSP_USE_PSPSECUREOS)) + +# Add all the files listed in the config file +DEP_FILES=$(shell $(AMDFWTOOL) --config $(CONFIG_AMDFW_CONFIG_FILE) --depend) + $(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_STONEYRIDGE_XHCI_FWM_FILE)) \ $(call strip_quotes, $(CONFIG_STONEYRIDGE_GEC_FWM_FILE)) \ - $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \ - $(call strip_quotes, $(PUBSIGNEDKEY_FILE)) \ - $(call strip_quotes, $(PSPBTLDR_FILE)) \ - $(call strip_quotes, $(PSPRCVR_FILE)) \ - $(call strip_quotes, $(PSPSECUREOS_FILE)) \ - $(call strip_quotes, $(PSPNVRAM_FILE)) \ - $(call strip_quotes, $(SMUFWM_FILE)) \ - $(call strip_quotes, $(SMUFWM_FN_FILE)) \ - $(call strip_quotes, $(SMUSCS_FILE)) \ - $(call strip_quotes, $(PSPSECUREDEBUG_FILE)) \ - $(call strip_quotes, $(PSPTRUSTLETS_FILE)) \ - $(call strip_quotes, $(TRUSTLETKEY_FILE)) \ - $(call strip_quotes, $(SMUFIRMWARE2_FILE)) \ - $(call strip_quotes, $(SMUFIRMWARE2_FN_FILE)) \ + $(DEP_FILES) \ $(AMDFWTOOL) rm -f $@ @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" $(AMDFWTOOL) \ $(OPT_STONEYRIDGE_XHCI_FWM_FILE) \ $(OPT_STONEYRIDGE_GEC_FWM_FILE) \ - $(OPT_AMD_PUBKEY_FILE) \ - $(OPT_PSPBTLDR_FILE) \ - $(OPT_SMUFWM_FILE) \ - $(OPT_PSPRCVR_FILE) \ - $(OPT_PUBSIGNEDKEY_FILE) \ - $(OPT_PSPSECUREOS_FILE) \ - $(OPT_PSPNVRAM_FILE) \ - $(OPT_PSPSECUREDEBUG_FILE) \ - $(OPT_PSPTRUSTLETS_FILE) \ - $(OPT_TRUSTLETKEY_FILE) \ - $(OPT_SMUFIRMWARE2_FILE) \ - $(OPT_SMUSCS_FILE) \ - $(OPT_AMD_PUBKEY_FILE) \ - $(OPT_PSPBTLDR_FILE) \ - $(OPT_SMUFWM_FILE) \ - $(OPT_SMUFWM_FN_FILE) \ - $(OPT_PSPRCVR_FILE) \ - $(OPT_PUBSIGNEDKEY_FILE) \ - $(OPT_PSPSECUREOS_FILE) \ - $(OPT_PSPNVRAM_FILE) \ - $(OPT_PSPSECUREDEBUG_FILE) \ - $(OPT_PSPTRUSTLETS_FILE) \ - $(OPT_TRUSTLETKEY_FILE) \ - $(OPT_SMUFIRMWARE2_FILE) \ - $(OPT_SMUFIRMWARE2_FN_FILE) \ - $(OPT_SMUSCS_FILE) \ $(OPT_COMBOCAPABLE)\ + $(OPT_PSP_USE_PSPSECUREOS) \ + --config $(CONFIG_AMDFW_CONFIG_FILE) \ --flashsize $(CONFIG_ROM_SIZE) \ --location $(shell printf "0x%x" $(STONEYRIDGE_FWM_POSITION)) \ --output $@ diff --git a/src/soc/amd/stoneyridge/fw_cz.cfg b/src/soc/amd/stoneyridge/fw_cz.cfg new file mode 100644 index 0000000..acbf136 --- /dev/null +++ b/src/soc/amd/stoneyridge/fw_cz.cfg @@ -0,0 +1,18 @@ +# PSP fw config file + +FIRMWARE_LOCATE 3rdparty/amd_blobs/stoneyridge/PSP/CZ +#PSP +AMD_PUBKEY_FILE AmdPubKeyCZ.bin +PSPBTLDR_FILE PspBootLoader_prod_CZ.sbin +PSP_SMUFW1_SUB0_FILE SmuFirmwareCZ.sbin +#PSP_SMUFW1_SUB1_FILE SmuFirmware_CZ_FN.csbin +PSP_SMUFW2_SUB0_FILE SmuFirmware2_prod_CZ.sbin +#PSP_SMUFW2_SUB1_FILE SmuFirmware2_prod_CZ_FN.sbin +PSPRCVR_FILE PspRecoveryBootLoader_prod_CZ.sbin +PUBSIGNEDKEY_FILE RtmPubSignedCZ.key +PSPNVRAM_FILE PspNvramCZ.bin +PSPSECUREOS_FILE PspSecureOs_prod_CZ.csbin +SMUSCS_FILE SmuScsCZ.bin +PSPTRUSTLETS_FILE PspTrustlets_prod_CZ.cbin +TRUSTLETKEY_FILE TrustletKey_prod_CZ.sbin +PSPSECUREDEBUG_FILE PspSecureDebugCZ.Key diff --git a/src/soc/amd/stoneyridge/fw_st.cfg b/src/soc/amd/stoneyridge/fw_st.cfg new file mode 100644 index 0000000..aa02668 --- /dev/null +++ b/src/soc/amd/stoneyridge/fw_st.cfg @@ -0,0 +1,20 @@ +# PSP fw config file + +FIRMWARE_LOCATE 3rdparty/amd_blobs/stoneyridge/PSP/ST + +#XHCI_FWM_FILE xhci.bin +#PSP +AMD_PUBKEY_FILE AmdPubKeyST.bin +PSPBTLDR_FILE PspBootLoader_prod_ST.sbin +PSP_SMUFW1_SUB0_FILE SmuFirmware_ST.csbin +PSP_SMUFW1_SUB1_FILE SmuFirmware_ST_FN.csbin +PSP_SMUFW2_SUB0_FILE SmuFirmware2_prod_ST.csbin +PSP_SMUFW2_SUB1_FILE SmuFirmware2_prod_ST_FN.sbin +PSPRCVR_FILE PspRecoveryBootLoader_prod_ST.sbin +PUBSIGNEDKEY_FILE RtmPubSignedST.key +PSPNVRAM_FILE PspNvramST.bin +PSPSECUREOS_FILE PspSecureOs_prod_ST.csbin +SMUSCS_FILE SmuScsST.bin +PSPTRUSTLETS_FILE PspTrustlets_prod_ST.cbin +TRUSTLETKEY_FILE TrustletKey_prod_ST.sbin +PSPSECUREDEBUG_FILE PspSecureDebugST.Key diff --git a/src/southbridge/amd/pi/hudson/Kconfig b/src/southbridge/amd/pi/hudson/Kconfig index b569690..cfe85a1 100644 --- a/src/southbridge/amd/pi/hudson/Kconfig +++ b/src/southbridge/amd/pi/hudson/Kconfig @@ -63,6 +63,10 @@ bool default y if CPU_AMD_PI_00730F01 || CPU_AMD_PI_00660F01
+config AMDFW_CONFIG_FILE + string "AMD PSP Firmware config file" + default "src/southbridge/amd/pi/hudson/fw_avl.cfg" if CPU_AMD_PI_00730F01 + config HUDSON_XHCI_FWM_FILE string "XHCI firmware path and filename" default "3rdparty/blobs/southbridge/amd/avalon/xhci.bin" if SOUTHBRIDGE_AMD_PI_AVALON diff --git a/src/southbridge/amd/pi/hudson/Makefile.inc b/src/southbridge/amd/pi/hudson/Makefile.inc index 09bf1d6..c845f84 100644 --- a/src/southbridge/amd/pi/hudson/Makefile.inc +++ b/src/southbridge/amd/pi/hudson/Makefile.inc @@ -78,14 +78,9 @@ ifeq ($(CONFIG_HUDSON_PSP), y)
ifeq ($(CONFIG_CPU_AMD_PI_00730F01), y) -FIRMWARE_LOCATE=$(dir $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE))) +FIRMWARE_LOCATE=$(shell grep -e FIRMWARE_LOCATE $(CONFIG_AMDFW_CONFIG_FILE) | awk '{print $$2}') FIRMWARE_TYPE=
-PSPBTLDR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspBootLoader.Bypass.sbin -#PSPRCVR_FILE=$(top)/$(FIRMWARE_LOCATE)/PspRecovery.sbin -#PSPSECUREOS_FILE=$(top)/$(FIRMWARE_LOCATE)/PspSecureOs.sbin -#PSPTRUSTLETS_FILE=$(top)/$(FIRMWARE_LOCATE)/trustlets.bin -#TRUSTLETKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/Trustlet.tkn.cert endif
ifeq ($(CONFIG_CPU_AMD_PI_00660F01), y) @@ -102,9 +97,6 @@
#PUBSIGNEDKEY_FILE=$(top)/$(FIRMWARE_LOCATE)/RtmPubSigned$(FIRMWARE_TYPE).key #PSPNVRAM_FILE=$(top)/$(FIRMWARE_LOCATE)/PspNvram$(FIRMWARE_TYPE).bin -SMUFWM_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE).sbin -SMUFWM_FN_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuFirmware$(FIRMWARE_TYPE)_FN.sbin -SMUSCS_FILE=$(top)/$(FIRMWARE_LOCATE)/SmuScs$(FIRMWARE_TYPE).bin #PSPSECUREDEBUG_FILE=$(top)/$(FIRMWARE_LOCATE)/PspSecureDebug$(FIRMWARE_TYPE).Key
endif @@ -128,21 +120,12 @@ OPT_SMUFIRMWARE2_FILE=$(call add_opt_prefix, $(SMUFIRMWARE2_FILE), --smufirmware2) OPT_SMUSCS_FILE=$(call add_opt_prefix, $(SMUSCS_FILE), --smuscs)
+# Add all the files listed in the config file +DEP_FILES=$(shell $(AMDFWTOOL) --config $(CONFIG_AMDFW_CONFIG_FILE) --depend) + $(obj)/amdfw.rom: $(call strip_quotes, $(CONFIG_HUDSON_XHCI_FWM_FILE)) \ $(call strip_quotes, $(CONFIG_HUDSON_IMC_FWM_FILE)) \ $(call strip_quotes, $(CONFIG_HUDSON_GEC_FWM_FILE)) \ - $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)) \ - $(call strip_quotes, $(PUBSIGNEDKEY_FILE)) \ - $(call strip_quotes, $(PSPBTLDR_FILE)) \ - $(call strip_quotes, $(PSPRCVR_FILE)) \ - $(call strip_quotes, $(PSPSECUREOS_FILE)) \ - $(call strip_quotes, $(PSPNVRAM_FILE)) \ - $(call strip_quotes, $(SMUFWM_FILE)) \ - $(call strip_quotes, $(SMUSCS_FILE)) \ - $(call strip_quotes, $(PSPSECUREDEBUG_FILE)) \ - $(call strip_quotes, $(PSPTRUSTLETS_FILE)) \ - $(call strip_quotes, $(TRUSTLETKEY_FILE)) \ - $(call strip_quotes, $(SMUFIRMWARE2_FILE)) \ $(call strip_quotes, $(AMD_PUBKEY2_FILE)) \ $(call strip_quotes, $(PUBSIGNEDKEY2_FILE)) \ $(call strip_quotes, $(PSPBTLDR2_FILE)) \ @@ -157,6 +140,7 @@ $(call strip_quotes, $(TRUSTLETKEY2_FILE)) \ $(call strip_quotes, $(SMUFIRMWARE2_2_FILE)) \ $(call strip_quotes, $(SMUFIRMWARE2_2_FN_FILE)) \ + $(DEP_FILES) \ $(AMDFWTOOL) rm -f $@ @printf " AMDFWTOOL $(subst $(obj)/,,$(@))\n" @@ -164,18 +148,6 @@ $(OPT_HUDSON_XHCI_FWM_FILE) \ $(OPT_HUDSON_IMC_FWM_FILE) \ $(OPT_HUDSON_GEC_FWM_FILE) \ - $(OPT_AMD_PUBKEY_FILE) \ - $(OPT_PSPBTLDR_FILE) \ - $(OPT_SMUFWM_FILE) \ - $(OPT_PSPRCVR_FILE) \ - $(OPT_PUBSIGNEDKEY_FILE) \ - $(OPT_PSPSECUREOS_FILE) \ - $(OPT_PSPNVRAM_FILE) \ - $(OPT_PSPSECUREDEBUG_FILE) \ - $(OPT_PSPTRUSTLETS_FILE) \ - $(OPT_TRUSTLETKEY_FILE) \ - $(OPT_SMUFIRMWARE2_FILE) \ - $(OPT_SMUSCS_FILE) \ $(OPT_2AMD_PUBKEY_FILE) \ $(OPT_2PSPBTLDR_FILE) \ $(OPT_2SMUFWM_FILE) \ @@ -192,6 +164,7 @@ $(OPT_2SMUSCS_FILE) \ --flashsize $(CONFIG_ROM_SIZE) \ --location $(HUDSON_FWM_POSITION) \ + --config $(CONFIG_AMDFW_CONFIG_FILE) \ --output $@
ifeq ($(CONFIG_AMDFW_OUTSIDE_CBFS),y) diff --git a/src/southbridge/amd/pi/hudson/fw_avl.cfg b/src/southbridge/amd/pi/hudson/fw_avl.cfg new file mode 100644 index 0000000..f65d6b8 --- /dev/null +++ b/src/southbridge/amd/pi/hudson/fw_avl.cfg @@ -0,0 +1,8 @@ +# PSP fw config file + +FIRMWARE_LOCATE 3rdparty/blobs/southbridge/amd/avalon/PSP +#PSP +AMD_PUBKEY_FILE AmdPubKey.bin +PSPBTLDR_FILE PspBootLoader.Bypass.sbin +PSP_SMUFW1_SUB0_FILE SmuFirmware.sbin +SMUSCS_FILE SmuScs.bin diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile index 8f4208c..58606e3 100644 --- a/util/amdfwtool/Makefile +++ b/util/amdfwtool/Makefile @@ -2,7 +2,7 @@
HOSTCC ?= cc
-SRC = amdfwtool.c +SRC = amdfwtool.c data_parse.c OBJ = $(SRC:%.c=%.o) TARGET = amdfwtool CFLAGS=-O2 -Wall -Wextra -Wshadow diff --git a/util/amdfwtool/Makefile.inc b/util/amdfwtool/Makefile.inc index b1a2130..e794ed9 100644 --- a/util/amdfwtool/Makefile.inc +++ b/util/amdfwtool/Makefile.inc @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause
-amdfwtoolobj = amdfwtool.o +amdfwtoolobj = amdfwtool.o data_parse.o
AMDFWTOOLCFLAGS=-O2 -Wall -Wextra -Wshadow
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index f5030d3..561b511 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -56,6 +56,9 @@ #include <string.h> #include <stdlib.h> #include <getopt.h> +#include <libgen.h> + +#include "amdfwtool.h"
#define AMD_ROMSIG_OFFSET 0x20000 #define MIN_ROM_KB 256 @@ -94,13 +97,6 @@ */ #define PSP_COMBO 0
-#if defined(__GLIBC__) -typedef unsigned long long int uint64_t; -typedef unsigned int uint32_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -#endif - /* * Creates the OSI Fletcher checksum. See 8473-1, Appendix C, section C.3. * The checksum field of the passed PDU does not need to be reset to zero. @@ -165,39 +161,22 @@ printf("-A | --combo-capable Place PSP directory pointer at Embedded Firmware\n"); printf(" offset able to support combo directory\n"); printf("-M | --multilevel Generate primary and secondary tables\n"); - printf("-p | --pubkey <FILE> Add pubkey\n"); - printf("-b | --bootloader <FILE> Add bootloader\n"); - printf("-S | --subprogram <number> Sets subprogram field for the next firmware\n"); - printf("-s | --smufirmware <FILE> Add smufirmware\n"); - printf("-r | --recovery <FILE> Add recovery\n"); - printf("-k | --rtmpubkey <FILE> Add rtmpubkey\n"); - printf("-c | --secureos <FILE> Add secureos\n"); - printf("-n | --nvram <FILE> Add nvram\n"); - printf("-d | --securedebug <FILE> Add securedebug\n"); - printf("-t | --trustlets <FILE> Add trustlets\n"); - printf("-u | --trustletkey <FILE> Add trustletkey\n"); - printf("-w | --smufirmware2 <FILE> Add smufirmware2\n"); - printf("-m | --smuscs <FILE> Add smuscs\n"); - printf("-T | --soft-fuse <HEX_VAL> Override default soft fuse values\n"); - printf("-z | --abl-image <FILE> Add AGESA Binary\n"); - printf("-J | --sec-gasket <FILE> Add security gasket\n"); - printf("-B | --mp2-fw <FILE> Add MP2 firmware\n"); - printf("-N | --secdebug <FILE> Add secure unlock image\n"); - printf("-U | --token-unlock Reserve space for debug token\n"); - printf("-K | --drv-entry-pts <FILE> Add PSP driver entry points\n"); - printf("-L | --ikek <FILE> Add Wrapped iKEK\n"); - printf("-Y | --s0i3drv <FILE> Add s0i3 driver\n"); + printf("-n | --nvram <FILE> Add nvram binary\n"); + printf("-T | --soft-fuse Set soft fuse\n"); + printf("-U | --token-unlock Set token unlock\n"); + printf("-W | --whitelist Set if there is a whitelist\n"); + printf("-S | --use-pspsecureos Set if psp secure OS is needed\n"); + printf("-p | --load-mp2-fw Set if load MP2 firmware\n"); + printf("-L | --load-s0i3 Set if load s0i3 firmware\n"); printf("-Z | --verstage <FILE> Add verstage\n"); + printf("-E | --verstage_sig Add verstage signature"); printf("\nBIOS options:\n"); printf("-I | --instance <number> Sets instance field for the next BIOS firmware\n"); printf("-a | --apcb <FILE> Add AGESA PSP customization block\n"); printf("-Q | --apob-base <HEX_VAL> Destination for AGESA PSP output block\n"); printf("-F | --apob-nv-base <HEX_VAL> Location of S3 resume data\n"); printf("-H | --apob-nv-size <HEX_VAL> Size of S3 resume data\n"); - printf("-y | --pmu-inst <FILE> Add PMU firmware instruction portion\n"); - printf("-G | --pmu-data <FILE> Add PMU firmware data portion\n"); printf("-O | --ucode <FILE> Add microcode patch\n"); - printf("-X | --mp2-config <FILE> Add MP2 configuration\n"); printf("-V | --bios-bin <FILE> Add compressed image; auto source address\n"); printf("-e | --bios-bin-src <HEX_VAL> Address in flash of source if -V not used\n"); printf("-v | --bios-bin-dest <HEX_VAL> Destination for uncompressed BIOS\n"); @@ -236,93 +215,11 @@ printf(" 0x1 Micron parts are always used\n"); printf(" 0x2 Micron parts optional, this option is only\n"); printf(" supported with RN/LCN SOC\n"); + printf("-c | --config <config file> Config file\n"); + printf("-D | --depend List out the firmware files\n"); }
-typedef enum _amd_bios_type { - AMD_BIOS_APCB = 0x60, - AMD_BIOS_APOB = 0x61, - AMD_BIOS_BIN = 0x62, - AMD_BIOS_APOB_NV = 0x63, - AMD_BIOS_PMUI = 0x64, - AMD_BIOS_PMUD = 0x65, - AMD_BIOS_UCODE = 0x66, - AMD_BIOS_APCB_BK = 0x68, - AMD_BIOS_MP2_CFG = 0x6a, - AMD_BIOS_PSP_SHARED_MEM = 0x6b, - AMD_BIOS_L2_PTR = 0x70, - AMD_BIOS_INVALID, -} amd_bios_type; - -#define BDT_LVL1 0x1 -#define BDT_LVL2 0x2 -#define BDT_BOTH (BDT_LVL1 | BDT_LVL2) -typedef struct _amd_bios_entry { - amd_bios_type type; - int region_type; - int reset; - int copy; - int ro; - int zlib; - int inst; - int subpr; - uint64_t src; - uint64_t dest; - size_t size; - char *filename; - int level; -} amd_bios_entry; - -typedef enum _amd_fw_type { - AMD_FW_PSP_PUBKEY = 0, - AMD_FW_PSP_BOOTLOADER = 1, - AMD_FW_PSP_SMU_FIRMWARE = 8, - AMD_FW_PSP_RECOVERY = 3, - AMD_FW_PSP_RTM_PUBKEY = 5, - AMD_FW_PSP_SECURED_OS = 2, - AMD_FW_PSP_NVRAM = 4, - AMD_FW_PSP_SECURED_DEBUG = 9, - AMD_FW_PSP_TRUSTLETS = 12, - AMD_FW_PSP_TRUSTLETKEY = 13, - AMD_FW_PSP_SMU_FIRMWARE2 = 18, - AMD_PSP_FUSE_CHAIN = 11, - AMD_FW_PSP_SMUSCS = 95, - AMD_DEBUG_UNLOCK = 0x13, - AMD_WRAPPED_IKEK = 0x21, - AMD_TOKEN_UNLOCK = 0x22, - AMD_SEC_GASKET = 0x24, - AMD_MP2_FW = 0x25, - AMD_DRIVER_ENTRIES = 0x28, - AMD_S0I3_DRIVER = 0x2d, - AMD_ABL0 = 0x30, - AMD_ABL1 = 0x31, - AMD_ABL2 = 0x32, - AMD_ABL3 = 0x33, - AMD_ABL4 = 0x34, - AMD_ABL5 = 0x35, - AMD_ABL6 = 0x36, - AMD_ABL7 = 0x37, - AMD_FW_PSP_WHITELIST = 0x3a, - AMD_FW_L2_PTR = 0x40, - AMD_FW_PSP_VERSTAGE = 0x52, - AMD_FW_VERSTAGE_SIG = 0x53, - AMD_FW_IMC, - AMD_FW_GEC, - AMD_FW_XHCI, - AMD_FW_INVALID, -} amd_fw_type; - -#define PSP_LVL1 0x1 -#define PSP_LVL2 0x2 -#define PSP_BOTH (PSP_LVL1 | PSP_LVL2) -typedef struct _amd_fw_entry { - amd_fw_type type; - uint8_t subprog; - char *filename; - int level; - uint64_t other; -} amd_fw_entry; - -static amd_fw_entry amd_psp_fw_table[] = { +amd_fw_entry amd_psp_fw_table[] = { { .type = AMD_FW_PSP_PUBKEY, .level = PSP_BOTH }, { .type = AMD_FW_PSP_BOOTLOADER, .level = PSP_BOTH }, { .type = AMD_FW_PSP_SMU_FIRMWARE, .subprog = 0, .level = PSP_BOTH }, @@ -365,14 +262,14 @@ { .type = AMD_FW_INVALID }, };
-static amd_fw_entry amd_fw_table[] = { +amd_fw_entry amd_fw_table[] = { { .type = AMD_FW_XHCI }, { .type = AMD_FW_IMC }, { .type = AMD_FW_GEC }, { .type = AMD_FW_INVALID }, };
-static amd_bios_entry amd_bios_table[] = { +amd_bios_entry amd_bios_table[] = { { .type = AMD_BIOS_APCB, .inst = 0, .level = BDT_BOTH }, { .type = AMD_BIOS_APCB, .inst = 1, .level = BDT_BOTH }, { .type = AMD_BIOS_APCB, .inst = 2, .level = BDT_BOTH }, @@ -699,6 +596,33 @@ } }
+static void free_psp_firmware_filenames(amd_fw_entry *fw_table) +{ + amd_fw_entry *index; + + for (index = fw_table; index->type != AMD_FW_INVALID; index++) { + if (index->filename && + index->type != AMD_FW_VERSTAGE_SIG && + index->type != AMD_FW_PSP_VERSTAGE && + index->type != AMD_FW_PSP_WHITELIST) { + free(index->filename); + } + } +} + +static void free_bdt_firmware_filenames(amd_bios_entry *fw_table) +{ + amd_bios_entry *index; + + for (index = fw_table; index->type != AMD_BIOS_INVALID; index++) { + if (index->filename && + index->type != AMD_BIOS_APCB && + index->type != AMD_BIOS_BIN && + index->type != AMD_BIOS_APCB_BK) + free(index->filename); + } +} + static void integrate_psp_firmwares(context *ctx, psp_directory_table *pspdir, psp_directory_table *pspdir2, @@ -1083,8 +1007,9 @@ LONGOPT_SPI_MICRON_FLAG = 258, };
-// Unused values: D -static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:qR:P:C:E:"; +/* Unused values: BGJKNXYbdkmprstuwyz*/ +static const char *optstring = "x:i:g:AMn:T:SPLUW:I:a:Q:V:e:v:j:O:F:" + "H:o:f:l:hZ:qR:C:c:E:D";
static struct option long_options[] = { {"xhci", required_argument, 0, 'x' }, @@ -1093,29 +1018,13 @@ /* PSP Directory Table items */ {"combo-capable", no_argument, 0, 'A' }, {"multilevel", no_argument, 0, 'M' }, - {"subprogram", required_argument, 0, 'S' }, - {"pubkey", required_argument, 0, 'p' }, - {"bootloader", required_argument, 0, 'b' }, - {"smufirmware", required_argument, 0, 's' }, - {"recovery", required_argument, 0, 'r' }, - {"rtmpubkey", required_argument, 0, 'k' }, - {"secureos", required_argument, 0, 'c' }, {"nvram", required_argument, 0, 'n' }, - {"securedebug", required_argument, 0, 'd' }, - {"trustlets", required_argument, 0, 't' }, - {"trustletkey", required_argument, 0, 'u' }, - {"smufirmware2", required_argument, 0, 'w' }, - {"smuscs", required_argument, 0, 'm' }, {"soft-fuse", required_argument, 0, 'T' }, - {"abl-image", required_argument, 0, 'z' }, - {"sec-gasket", required_argument, 0, 'J' }, - {"mp2-fw", required_argument, 0, 'B' }, - {"drv-entry-pts", required_argument, 0, 'K' }, - {"ikek", required_argument, 0, 'L' }, - {"s0i3drv", required_argument, 0, 'Y' }, - {"secdebug", required_argument, 0, 'N' }, {"token-unlock", no_argument, 0, 'U' }, {"whitelist", required_argument, 0, 'W' }, + {"use-pspsecureos", no_argument, 0, 'S' }, + {"load-mp2-fw", no_argument, 0, 'p' }, + {"load-s0i3", no_argument, 0, 'L' }, {"verstage", required_argument, 0, 'Z' }, {"verstage_sig", required_argument, 0, 'E' }, /* BIOS Directory Table items */ @@ -1126,10 +1035,7 @@ {"bios-bin-src", required_argument, 0, 'e' }, {"bios-bin-dest", required_argument, 0, 'v' }, {"bios-uncomp-size", required_argument, 0, 'j' }, - {"pmu-inst", required_argument, 0, 'y' }, - {"pmu-data", required_argument, 0, 'G' }, {"ucode", required_argument, 0, 'O' }, - {"mp2-config", required_argument, 0, 'X' }, {"apob-nv-base", required_argument, 0, 'F' }, {"apob-nv-size", required_argument, 0, 'H' }, /* Embedded Firmware Structure items*/ @@ -1144,11 +1050,14 @@ {"sharedmem", required_argument, 0, 'R' }, {"sharedmem-size", required_argument, 0, 'P' }, {"soc-name", required_argument, 0, 'C' }, + + {"config", required_argument, 0, 'c' }, {"help", no_argument, 0, 'h' }, + {"depend", no_argument, 0, 'D' }, {NULL, 0, 0, 0 } };
-static void register_fw_fuse(char *str) +void register_fw_fuse(char *str) { uint32_t i;
@@ -1325,11 +1234,11 @@ int comboable = 0; int fuse_defined = 0; int targetfd; - char *output = NULL; + char *output = NULL, *config = NULL; + FILE *config_handle; context ctx = { 0 }; /* Values cleared after each firmware or parameter, regardless if N/A */ uint8_t sub = 0, instance = 0; - int abl_image = 0; uint32_t dir_location = 0; bool any_location = 0; uint32_t romsig_offset; @@ -1340,6 +1249,14 @@ uint8_t efs_spi_micron_flag = 0xff;
int multi = 0; + amd_cb_config cb_config; + int list_deps = 0; + + cb_config.have_whitelist = 0; + cb_config.unlock_secure = 0; + cb_config.use_secureos = 0; + cb_config.load_mp2_fw = 0; + cb_config.s0i3 = 0;
while (1) { int optindex = 0; @@ -1370,69 +1287,22 @@ break; case 'U': register_fw_token_unlock(); + cb_config.unlock_secure = 1; sub = instance = 0; break; case 'S': - sub = (uint8_t)strtoul(optarg, &tmp, 16); + cb_config.use_secureos = 1; break; case 'I': instance = strtoul(optarg, &tmp, 16); break; case 'p': - register_fw_filename(AMD_FW_PSP_PUBKEY, sub, optarg); - sub = instance = 0; - break; - case 'b': - register_fw_filename(AMD_FW_PSP_BOOTLOADER, - sub, optarg); - sub = instance = 0; - break; - case 's': - register_fw_filename(AMD_FW_PSP_SMU_FIRMWARE, - sub, optarg); - sub = instance = 0; - break; - case 'r': - register_fw_filename(AMD_FW_PSP_RECOVERY, sub, optarg); - sub = instance = 0; - break; - case 'k': - register_fw_filename(AMD_FW_PSP_RTM_PUBKEY, - sub, optarg); - sub = instance = 0; - break; - case 'c': - register_fw_filename(AMD_FW_PSP_SECURED_OS, - sub, optarg); - sub = instance = 0; + cb_config.load_mp2_fw = 1; break; case 'n': register_fw_filename(AMD_FW_PSP_NVRAM, sub, optarg); sub = instance = 0; break; - case 'd': - register_fw_filename(AMD_FW_PSP_SECURED_DEBUG, - sub, optarg); - sub = instance = 0; - break; - case 't': - register_fw_filename(AMD_FW_PSP_TRUSTLETS, sub, optarg); - sub = instance = 0; - break; - case 'u': - register_fw_filename(AMD_FW_PSP_TRUSTLETKEY, - sub, optarg); - sub = instance = 0; - break; - case 'w': - register_fw_filename(AMD_FW_PSP_SMU_FIRMWARE2, - sub, optarg); - sub = instance = 0; - break; - case 'm': - register_fw_filename(AMD_FW_PSP_SMUSCS, sub, optarg); - sub = instance = 0; - break; case 'T': register_fw_fuse(optarg); fuse_defined = 1; @@ -1478,56 +1348,18 @@ register_fw_addr(AMD_BIOS_BIN, 0, 0, optarg); sub = instance = 0; break; - case 'y': - register_bdt_data(AMD_BIOS_PMUI, sub, instance, optarg); - sub = instance = 0; - break; - case 'G': - register_bdt_data(AMD_BIOS_PMUD, sub, instance, optarg); - sub = instance = 0; - break; case 'O': register_bdt_data(AMD_BIOS_UCODE, sub, instance, optarg); sub = instance = 0; break; - case 'J': - register_fw_filename(AMD_SEC_GASKET, sub, optarg); - sub = instance = 0; - break; - case 'B': - register_fw_filename(AMD_MP2_FW, sub, optarg); - sub = instance = 0; - break; - case 'z': - register_fw_filename(AMD_ABL0 + abl_image++, - sub, optarg); - sub = instance = 0; - break; - case 'X': - register_bdt_data(AMD_BIOS_MP2_CFG, sub, - instance, optarg); - sub = instance = 0; - break; - case 'K': - register_fw_filename(AMD_DRIVER_ENTRIES, sub, optarg); - sub = instance = 0; - break; case 'L': - register_fw_filename(AMD_WRAPPED_IKEK, sub, optarg); - sub = instance = 0; - break; - case 'Y': - register_fw_filename(AMD_S0I3_DRIVER, sub, optarg); - sub = instance = 0; - break; - case 'N': - register_fw_filename(AMD_DEBUG_UNLOCK, sub, optarg); - sub = instance = 0; + cb_config.s0i3 = 1; break; case 'W': register_fw_filename(AMD_FW_PSP_WHITELIST, sub, optarg); sub = instance = 0; + cb_config.have_whitelist = 1; break; case 'Z': register_fw_filename(AMD_FW_PSP_VERSTAGE, sub, optarg); @@ -1590,30 +1422,50 @@ sub = instance = 0; break;
+ case 'c': + config = optarg; + break; case 'h': usage(); return 0; + case 'D': + list_deps = 1; + break; default: break; } }
+ if (config) { + config_handle = fopen(config, "r"); + if (config_handle == NULL) { + fprintf(stderr, "Can not open file %s for reading: %s\n", + config, strerror(errno)); + exit(1); + } + if (process_config(config_handle, &cb_config, list_deps) == 0) { + fprintf(stderr, "Configuration file %s parsing error\n", config); + fclose(config_handle); + exit(1); + } + fclose(config_handle); + } if (!fuse_defined) register_fw_fuse(DEFAULT_SOFT_FUSE_CHAIN);
- if (!output) { - printf("Error: Output value is not specified.\n\n"); + if (!output && !list_deps) { + fprintf(stderr, "Error: Output value is not specified.\n\n"); retval = 1; }
- if (ctx.rom_size % 1024 != 0) { - printf("Error: ROM Size (%d bytes) should be a multiple of" + if ((ctx.rom_size % 1024 != 0) && !list_deps) { + fprintf(stderr, "Error: ROM Size (%d bytes) should be a multiple of" " 1024 bytes.\n\n", ctx.rom_size); retval = 1; }
- if (ctx.rom_size < MIN_ROM_KB * 1024) { - printf("Error: ROM Size (%dKB) must be at least %dKB.\n\n", + if ((ctx.rom_size < MIN_ROM_KB * 1024) && !list_deps) { + fprintf(stderr, "Error: ROM Size (%dKB) must be at least %dKB.\n\n", ctx.rom_size / 1024, MIN_ROM_KB); retval = 1; } @@ -1623,6 +1475,10 @@ return retval; }
+ if (list_deps) { + return retval; + } + printf(" AMDFWTOOL Using ROM size of %dKB\n", ctx.rom_size / 1024);
rom_base_address = 0xFFFFFFFF - ctx.rom_size + 1; @@ -1745,6 +1601,10 @@ amd_romsig->bios1_entry = BUFF_TO_RUN(ctx, biosdir); }
+ /* Free the filename. */ + free_psp_firmware_filenames(amd_psp_fw_table); + free_bdt_firmware_filenames(amd_bios_table); + targetfd = open(output, O_RDWR | O_CREAT | O_TRUNC, 0666); if (targetfd >= 0) { ssize_t bytes; diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h new file mode 100644 index 0000000..198642c --- /dev/null +++ b/util/amdfwtool/amdfwtool.h @@ -0,0 +1,119 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _AMD_FW_TOOL_H_ +#define _AMD_FW_TOOL_H_ + +#if defined(__GLIBC__) +typedef unsigned long long int uint64_t; +typedef unsigned int uint32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +#endif + + +typedef enum _amd_fw_type { + AMD_FW_PSP_PUBKEY = 0, + AMD_FW_PSP_BOOTLOADER = 1, + AMD_FW_PSP_SMU_FIRMWARE = 8, + AMD_FW_PSP_RECOVERY = 3, + AMD_FW_PSP_RTM_PUBKEY = 5, + AMD_FW_PSP_SECURED_OS = 2, + AMD_FW_PSP_NVRAM = 4, + AMD_FW_PSP_SECURED_DEBUG = 9, + AMD_FW_PSP_TRUSTLETS = 12, + AMD_FW_PSP_TRUSTLETKEY = 13, + AMD_FW_PSP_SMU_FIRMWARE2 = 18, + AMD_PSP_FUSE_CHAIN = 11, + AMD_FW_PSP_SMUSCS = 95, + AMD_DEBUG_UNLOCK = 0x13, + AMD_WRAPPED_IKEK = 0x21, + AMD_TOKEN_UNLOCK = 0x22, + AMD_SEC_GASKET = 0x24, + AMD_MP2_FW = 0x25, + AMD_DRIVER_ENTRIES = 0x28, + AMD_S0I3_DRIVER = 0x2d, + AMD_ABL0 = 0x30, + AMD_ABL1 = 0x31, + AMD_ABL2 = 0x32, + AMD_ABL3 = 0x33, + AMD_ABL4 = 0x34, + AMD_ABL5 = 0x35, + AMD_ABL6 = 0x36, + AMD_ABL7 = 0x37, + AMD_FW_PSP_WHITELIST = 0x3a, + AMD_FW_L2_PTR = 0x40, + AMD_FW_PSP_VERSTAGE = 0x52, + AMD_FW_VERSTAGE_SIG = 0x53, + AMD_FW_IMC = 0x200, /* Large enough to be larger than the top BHD entry type. */ + AMD_FW_GEC, + AMD_FW_XHCI, + AMD_FW_INVALID, /* Real last one to detect the last entry in table. */ + AMD_FW_SKIP /* This is for non-applicable options. */ +} amd_fw_type; + +typedef enum _amd_bios_type { + AMD_BIOS_APCB = 0x60, + AMD_BIOS_APOB = 0x61, + AMD_BIOS_BIN = 0x62, + AMD_BIOS_APOB_NV = 0x63, + AMD_BIOS_PMUI = 0x64, + AMD_BIOS_PMUD = 0x65, + AMD_BIOS_UCODE = 0x66, + AMD_BIOS_APCB_BK = 0x68, + AMD_BIOS_MP2_CFG = 0x6a, + AMD_BIOS_PSP_SHARED_MEM = 0x6b, + AMD_BIOS_L2_PTR = 0x70, + AMD_BIOS_INVALID, + AMD_BIOS_SKIP +} amd_bios_type; + + +#define BDT_LVL1 0x1 +#define BDT_LVL2 0x2 +#define BDT_BOTH (BDT_LVL1 | BDT_LVL2) +typedef struct _amd_bios_entry { + amd_bios_type type; + char *filename; + int subpr; + int region_type; + int reset; + int copy; + int ro; + int zlib; + int inst; + uint64_t src; + uint64_t dest; + size_t size; + int level; +} amd_bios_entry; + + +#define PSP_LVL1 0x1 +#define PSP_LVL2 0x2 +#define PSP_BOTH (PSP_LVL1 | PSP_LVL2) +typedef struct _amd_fw_entry { + amd_fw_type type; + char *filename; + uint8_t subprog; + int level; + uint64_t other; +} amd_fw_entry; + +typedef struct _amd_cb_config { + uint8_t have_whitelist; + uint8_t unlock_secure; + uint8_t use_secureos; + uint8_t load_mp2_fw; + uint8_t s0i3; +} amd_cb_config; + +void register_fw_fuse(char *str); +uint8_t process_config(FILE *config, amd_cb_config *cb_config, uint8_t print_deps); + +#define OK 0 + +#define LINE_EOF (1) +#define LINE_TOO_LONG (2) + + +#endif /* _AMD_FW_TOOL_H_ */ diff --git a/util/amdfwtool/data_parse.c b/util/amdfwtool/data_parse.c new file mode 100644 index 0000000..bb616d3 --- /dev/null +++ b/util/amdfwtool/data_parse.c @@ -0,0 +1,418 @@ +#include <stdio.h> +#include <regex.h> +#include <string.h> +#include <stdlib.h> + +#include "amdfwtool.h" + +/* TODO: a empty line does not matched. */ +static const char blank_or_comment_regex[] = + /* a blank line */ + "(^[[:space:]]*$)" + "|" /* or ... */ + /* a line consisting of: optional whitespace followed by */ + "(^[[:space:]]*" + /* a '#' character and optionally, additional characters */ + "#.*$)"; +static regex_t blank_or_comment_expr; + +static const char entries_line_regex[] = + /* optional whitespace */ + "^[[:space:]]*" + /* followed by a chunk of nonwhitespace for macro field */ + "([^[:space:]]+)" + /* followed by one or more whitespace characters */ + "[[:space:]]+" + /* followed by a chunk of nonwhitespace for filename field */ + "([^[:space:]]+)" + /* followed by optional whitespace */ + "[[:space:]]*$"; +static regex_t entries_line_expr; + +void compile_reg_expr(int cflags, const char *expr, regex_t *reg) +{ + static const size_t ERROR_BUF_SIZE = 256; + char error_msg[ERROR_BUF_SIZE]; + int result; + + result = regcomp(reg, expr, cflags); + if (result != 0) { + regerror(result, reg, error_msg, ERROR_BUF_SIZE); + printf("%s\n", error_msg); + } +} + +extern amd_fw_entry amd_psp_fw_table[]; +extern amd_bios_entry amd_bios_table[]; + +static uint8_t find_register_fw_filename_psp_dir(char *fw_name, char *filename, + amd_cb_config *cb_config) +{ + amd_fw_type fw_type = AMD_FW_INVALID; + amd_fw_entry *psp_tableptr; + uint8_t subprog; + + if (strcmp(fw_name, "PSPBTLDR_WL_FILE") == 0) { + if (cb_config->have_whitelist == 1) { + fw_type = AMD_FW_PSP_BOOTLOADER; + subprog = 0; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "PSPBTLDR_FILE") == 0) { + if (cb_config->have_whitelist == 0) { + fw_type = AMD_FW_PSP_BOOTLOADER; + subprog = 0; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "AMD_PUBKEY_FILE") == 0) { + fw_type = AMD_FW_PSP_PUBKEY; + subprog = 0; + } else if (strcmp(fw_name, "PSPRCVR_FILE") == 0) { + fw_type = AMD_FW_PSP_RECOVERY; + subprog = 0; + } else if (strcmp(fw_name, "PUBSIGNEDKEY_FILE") == 0) { + fw_type = AMD_FW_PSP_RTM_PUBKEY; + subprog = 0; + } else if (strcmp(fw_name, "PSPNVRAM_FILE") == 0) { + fw_type = AMD_FW_PSP_NVRAM; + subprog = 0; + } else if (strcmp(fw_name, "SMUSCS_FILE") == 0) { + fw_type = AMD_FW_PSP_SMUSCS; + subprog = 0; + } else if (strcmp(fw_name, "PSPTRUSTLETS_FILE") == 0) { + fw_type = AMD_FW_PSP_TRUSTLETS; + subprog = 0; + } else if (strcmp(fw_name, "PSPSECUREDEBUG_FILE") == 0) { + fw_type = AMD_FW_PSP_SECURED_DEBUG; + subprog = 0; + } else if (strcmp(fw_name, "PSP_SMUFW1_SUB0_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE; + subprog = 0; + } else if (strcmp(fw_name, "PSP_SMUFW1_SUB1_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE; + subprog = 1; + } else if (strcmp(fw_name, "PSP_SMUFW1_SUB2_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE; + subprog = 2; + } else if (strcmp(fw_name, "PSP_SMUFW2_SUB0_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE2; + subprog = 0; + } else if (strcmp(fw_name, "PSP_SMUFW2_SUB1_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE2; + subprog = 1; + } else if (strcmp(fw_name, "PSP_SMUFW2_SUB2_FILE") == 0) { + fw_type = AMD_FW_PSP_SMU_FIRMWARE2; + subprog = 2; + } else if (strcmp(fw_name, "PSP_SEC_DBG_KEY_FILE") == 0) { + if (cb_config->unlock_secure == 1) { + fw_type = AMD_FW_PSP_SECURED_DEBUG; + subprog = 0; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "PSP_SEC_DEBUG_FILE") == 0) { + if (cb_config->unlock_secure == 1) { + fw_type = AMD_DEBUG_UNLOCK; + subprog = 0; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "PSP_ABL0_FILE") == 0) { + fw_type = AMD_ABL0; + subprog = 0; + } else if (strcmp(fw_name, "PSP_ABL1_FILE") == 0) { + fw_type = AMD_ABL1; + subprog = 0; + } else if (strcmp(fw_name, "PSP_ABL2_FILE") == 0) { + fw_type = AMD_ABL2; + subprog = 0; + } else if (strcmp(fw_name, "PSP_ABL3_FILE") == 0) { + fw_type = AMD_ABL3; + subprog = 0; + } else if (strcmp(fw_name, "PSP_ABL4_FILE") == 0) { + fw_type = AMD_ABL4; + subprog = 0; + } else if (strcmp(fw_name, "PSP_ABL5_FILE") == 0) { + fw_type = AMD_ABL5; + subprog = 0; + } else if (strcmp(fw_name, "PSP_ABL6_FILE") == 0) { + fw_type = AMD_ABL6; + subprog = 0; + } else if (strcmp(fw_name, "PSP_ABL7_FILE") == 0) { + fw_type = AMD_ABL7; + subprog = 0; + } else if (strcmp(fw_name, "PSPSECUREOS_FILE") == 0) { + if (cb_config->use_secureos == 1) { + fw_type = AMD_FW_PSP_SECURED_OS; + subprog = 0; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "PSPTRUSTLETS_FILE") == 0) { + if (cb_config->use_secureos) { + fw_type = AMD_FW_PSP_TRUSTLETS; + subprog = 0; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "TRUSTLETKEY_FILE") == 0) { + if (cb_config->use_secureos) { + fw_type = AMD_FW_PSP_TRUSTLETKEY; + subprog = 0; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "PSP_IKEK_FILE") == 0) { + fw_type = AMD_WRAPPED_IKEK; + subprog = 0; + } else if (strcmp(fw_name, "PSP_SECG1_FILE") == 0) { + fw_type = AMD_SEC_GASKET; + subprog = 1; + } else if (strcmp(fw_name, "PSP_SECG2_FILE") == 0) { + fw_type = AMD_SEC_GASKET; + subprog = 2; + } else if (strcmp(fw_name, "PSP_MP2FW1_FILE") == 0) { + if (cb_config->load_mp2_fw == 1) { + fw_type = AMD_MP2_FW; + subprog = 1; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "PSP_MP2FW2_FILE") == 0) { + if (cb_config->load_mp2_fw == 1) { + fw_type = AMD_MP2_FW; + subprog = 2; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "PSP_MP2CFG_FILE") == 0) { + if (cb_config->load_mp2_fw == 1) { + fw_type = AMD_BIOS_MP2_CFG; + subprog = 0; + } else { + fw_type = AMD_FW_SKIP; + } + } else if (strcmp(fw_name, "PSP_DRIVERS_FILE") == 0) { + fw_type = AMD_DRIVER_ENTRIES; + subprog = 0; + } else if (strcmp(fw_name, "PSP_S0I3_FILE") == 0) { + if (cb_config->s0i3 == 1) { + fw_type = AMD_S0I3_DRIVER; + subprog = 0; + } else { + fw_type = AMD_FW_SKIP; + } + } else { + fw_type = AMD_FW_INVALID; + /* TODO: Add more */ + } + /* Search and fill the filename */ + psp_tableptr = &amd_psp_fw_table[0]; + if (fw_type != AMD_FW_SKIP && fw_type != AMD_FW_INVALID) { + while (psp_tableptr->type != AMD_FW_INVALID) { + /* instance are not used in PSP table */ + if (psp_tableptr->type == fw_type && psp_tableptr->subprog == subprog) { + psp_tableptr->filename = filename; + break; + } + psp_tableptr++; + } + } + if (fw_type == AMD_FW_INVALID) + return 0; + else + return 1; +} + +static uint8_t find_register_fw_filename_bios_dir(char *fw_name, char *filename, + amd_cb_config *cb_config) +{ + amd_bios_type fw_type = AMD_BIOS_INVALID; + amd_bios_entry *bhd_tableptr; + uint8_t subprog, instance = 0; + + (void) (cb_config); /* Remove warning and reserved for future. */ + + if (strcmp(fw_name, "PSP_PMUI_FILE1") == 0) { + fw_type = AMD_BIOS_PMUI; + subprog = 0; + instance = 1; + } else if (strcmp(fw_name, "PSP_PMUI_FILE2") == 0) { + fw_type = AMD_BIOS_PMUI; + subprog = 0; + instance = 4; + } else if (strcmp(fw_name, "PSP_PMUI_FILE3") == 0) { + fw_type = AMD_BIOS_PMUI; + subprog = 1; + instance = 1; + } else if (strcmp(fw_name, "PSP_PMUI_FILE4") == 0) { + fw_type = AMD_BIOS_PMUI; + subprog = 1; + instance = 4; + } else if (strcmp(fw_name, "PSP_PMUD_FILE1") == 0) { + fw_type = AMD_BIOS_PMUD; + subprog = 0; + instance = 1; + } else if (strcmp(fw_name, "PSP_PMUD_FILE2") == 0) { + fw_type = AMD_BIOS_PMUD; + subprog = 0; + instance = 4; + } else if (strcmp(fw_name, "PSP_PMUD_FILE3") == 0) { + fw_type = AMD_BIOS_PMUD; + subprog = 1; + instance = 1; + } else if (strcmp(fw_name, "PSP_PMUD_FILE4") == 0) { + fw_type = AMD_BIOS_PMUD; + subprog = 1; + instance = 4; + } else { + fw_type = AMD_BIOS_INVALID; + } + + bhd_tableptr = amd_bios_table; + + if (fw_type != AMD_BIOS_INVALID && fw_type != AMD_BIOS_SKIP) { + while (bhd_tableptr->type != AMD_BIOS_INVALID) { + if (bhd_tableptr->type == fw_type && + bhd_tableptr->subpr == subprog && + bhd_tableptr->inst == instance) { + bhd_tableptr->filename = filename; + break; + } + bhd_tableptr++; + } + } + if (fw_type == AMD_BIOS_INVALID) + return 0; + else + return 1; +} + +#define MAX_LINE_SIZE 1024 + +int get_input_file_line(FILE *f, char line[], int line_buf_size) +{ + if (fgets(line, line_buf_size, f) == NULL) + return LINE_EOF; + + /* If the file contains a line that is too long, then it's best + * to let the user know right away rather than passing back a + * truncated result that will lead to problems later on. + */ + line[strlen(line) - 1] = '\0'; + + if (strlen(line) == ((size_t) (line_buf_size - 1))) { + printf("The line size in config file should be lower than %d bytes.\n", + MAX_LINE_SIZE); + exit(1); + } + + return OK; +} + +static int is_valid_entry(char *oneline, regmatch_t *match) +{ + int retval; + + if (regexec(&entries_line_expr, oneline, 3, match, 0) == 0) { + oneline[match[1].rm_eo] = '\0'; + oneline[match[2].rm_eo] = '\0'; + retval = 1; + } else + retval = 0; + + return retval; +} + +static int skip_comment_blank_line(char *oneline) +{ + int retval; + + if (regexec(&blank_or_comment_expr, oneline, 0, NULL, 0) == 0) { + /* skip comment and blank */ + retval = 1; + } else { + /* no match */ + retval = 0; + } + + return retval; +} + +#define N_MATCHES 4 +/* + return value: + 0: The config file can not be parsed correctly. + 1: The config file can be parsed correctly. + */ +uint8_t process_config(FILE *config, amd_cb_config *cb_config, uint8_t print_deps) +{ + char oneline[MAX_LINE_SIZE], *path_filename; + regmatch_t match[N_MATCHES]; + char dir[MAX_LINE_SIZE] = {'\0'}; + + compile_reg_expr(REG_EXTENDED | REG_NEWLINE, + blank_or_comment_regex, &blank_or_comment_expr); + compile_reg_expr(REG_EXTENDED | REG_NEWLINE, + entries_line_regex, &entries_line_expr); + + /* Get a line */ + /* Get FIRMWARE_LOCATE in the first loop */ + while (get_input_file_line(config, oneline, MAX_LINE_SIZE) == OK) { + /* get a line */ + if (skip_comment_blank_line(oneline)) + continue; + if (is_valid_entry(oneline, match)) { + if (strcmp(&(oneline[match[1].rm_so]), "FIRMWARE_LOCATE") == 0) { + strcpy(dir, &(oneline[match[2].rm_so])); + break; + } + } + } + + if (dir[0] == '\0') { + fprintf(stderr, "No line with FIRMWARE_LOCATION\n"); + return 0; + } + + fseek(config, 0, SEEK_SET); + /* Get a line */ + while (get_input_file_line(config, oneline, MAX_LINE_SIZE) == OK) { + /* get a line */ + if (skip_comment_blank_line(oneline)) + continue; + if (is_valid_entry(oneline, match)) { + if (strcmp(&(oneline[match[1].rm_so]), "FIRMWARE_LOCATE") == 0) { + continue; + } else { + path_filename = malloc(MAX_LINE_SIZE); + strcpy(path_filename, dir); + strcat(path_filename, "/"); + strcat(path_filename, &(oneline[match[2].rm_so])); + + if (find_register_fw_filename_psp_dir( + &(oneline[match[1].rm_so]), + path_filename, cb_config) == 0) { + if (find_register_fw_filename_bios_dir( + &(oneline[match[1].rm_so]), + path_filename, cb_config) == 0) { + fprintf(stderr, "Module's name "%s" is not valid\n", oneline); + return 0; /* Stop parsing. */ + } else { + if (print_deps) + printf(" %s ", path_filename); + } + } else { + if (print_deps) + printf(" %s ", path_filename); + } + } + } else { + fprintf(stderr, "AMDFWTOOL config file line can't be parsed "%s"\n", oneline); + return 0; + } + } + return 1; +}