diff options
author | Zheng Bao <fishbaozi@gmail.com> | 2021-10-14 15:09:09 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-10-29 14:26:22 +0000 |
commit | eb0404e8bf57779036a3867c1a7797c9f7ef93c3 (patch) | |
tree | 7f51522deeb3f5877ca9e51b82b9e038d40619cf /util | |
parent | 1bfabb0bc07fdd2bf70b6bdbede519c6f138397a (diff) |
amdfwtool: Add PSP ID for combo and ISH header for A/B recovery
Nobody calls the function until combo or A/B is added, so suppress the
warning for now.
Test=Majolica (Cezanne)
Change-Id: I3082b850fb3fd2d7ae83a1c4dfd89eb7e1bd0f97
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55551
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'util')
-rw-r--r-- | util/amdfwtool/Makefile | 2 | ||||
-rw-r--r-- | util/amdfwtool/Makefile.inc | 2 | ||||
-rw-r--r-- | util/amdfwtool/amdfwtool.c | 53 |
3 files changed, 42 insertions, 15 deletions
diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile index 7b7793535a..18054593f5 100644 --- a/util/amdfwtool/Makefile +++ b/util/amdfwtool/Makefile @@ -5,7 +5,7 @@ HOSTCC ?= cc SRC = amdfwtool.c data_parse.c OBJ = $(SRC:%.c=%.o) TARGET = amdfwtool -WERROR=-Werror +WERROR=-Werror -Wno-unused-function CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR} all: $(TARGET) diff --git a/util/amdfwtool/Makefile.inc b/util/amdfwtool/Makefile.inc index 4b7db76e4d..f7722992ae 100644 --- a/util/amdfwtool/Makefile.inc +++ b/util/amdfwtool/Makefile.inc @@ -2,7 +2,7 @@ amdfwtoolobj = amdfwtool.o data_parse.o -AMDFWTOOLCFLAGS=-O2 -Wall -Wextra -Wshadow -Werror +AMDFWTOOLCFLAGS=-O2 -Wall -Wextra -Wshadow -Werror -Wno-unused-function $(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c # $(HEADER) $(HOSTCC) $(AMDFWTOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 9ad913e6f1..d088179265 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -490,6 +490,45 @@ static ssize_t copy_blob(void *dest, const char *src_file, size_t room) return bytes; } +enum platform { + PLATFORM_UNKNOWN, + PLATFORM_STONEYRIDGE, + PLATFORM_RAVEN, + PLATFORM_PICASSO, + PLATFORM_RENOIR, + PLATFORM_CEZANNE, + PLATFORM_MENDOCINO, + PLATFORM_LUCIENNE, +}; + +static uint32_t get_psp_id(enum platform soc_id) +{ + uint32_t psp_id; + switch (soc_id) { + case PLATFORM_RAVEN: + case PLATFORM_PICASSO: + psp_id = 0xBC0A0000; + break; + case PLATFORM_RENOIR: + case PLATFORM_LUCIENNE: + psp_id = 0xBC0C0000; + break; + case PLATFORM_CEZANNE: + psp_id = 0xBC0C0140; + break; + case PLATFORM_MENDOCINO: + psp_id = 0xBC0D0900; + break; + case PLATFORM_STONEYRIDGE: + psp_id = 0x10220B00; + break; + default: + psp_id = 0; + break; + } + return psp_id; +} + static void integrate_firmwares(context *ctx, embedded_firmware *romsig, amd_fw_entry *fw_table) @@ -1143,17 +1182,6 @@ static void register_fw_addr(amd_bios_type type, char *src_str, } } -enum platform { - PLATFORM_UNKNOWN, - PLATFORM_STONEYRIDGE, - PLATFORM_RAVEN, - PLATFORM_PICASSO, - PLATFORM_RENOIR, - PLATFORM_CEZANNE, - PLATFORM_MENDOCINO, - PLATFORM_LUCIENNE, -}; - static int set_efs_table(uint8_t soc_id, embedded_firmware *amd_romsig, uint8_t efs_spi_readmode, uint8_t efs_spi_speed, uint8_t efs_spi_micron_flag) @@ -1596,8 +1624,7 @@ int main(int argc, char **argv) amd_romsig->combo_psp_directory = BUFF_TO_RUN(ctx, combo_dir); /* 0 -Compare PSP ID, 1 -Compare chip family ID */ combo_dir->entries[0].id_sel = 0; - /* TODO: PSP ID. Documentation is needed. */ - combo_dir->entries[0].id = 0x10220B00; + combo_dir->entries[0].id = get_psp_id(soc_id); combo_dir->entries[0].lvl2_addr = BUFF_TO_RUN(ctx, pspdir); combo_dir->header.lookup = 1; |