From f9f129a5dc47ec134197a9e934cf3b6dd824aee7 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Mon, 30 Nov 2020 10:44:42 +0100 Subject: mb/prodrive/hermes: Generalise `check_signature` function Allow to specify which signature is to be checked. Change-Id: Ica874b1c4283fdb8dbd702c34ccb3315a2cf160d Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/48147 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/mainboard/prodrive/hermes/eeprom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mainboard/prodrive/hermes/eeprom.c') diff --git a/src/mainboard/prodrive/hermes/eeprom.c b/src/mainboard/prodrive/hermes/eeprom.c index fee40a0783..25fde349e6 100644 --- a/src/mainboard/prodrive/hermes/eeprom.c +++ b/src/mainboard/prodrive/hermes/eeprom.c @@ -9,13 +9,13 @@ * Check Signature in EEPROM (M24C32-FMN6TP) * If signature is there we assume that that the content is valid */ -int check_signature(u8 addr) +int check_signature(u8 addr, const size_t offset, const uint64_t signature) { u8 blob[8] = {0}; - if (!read_write_config(addr, blob, EEPROM_OFFSET_FSP_SIGNATURE, 0, ARRAY_SIZE(blob))) { + if (!read_write_config(addr, blob, offset, 0, ARRAY_SIZE(blob))) { /* Check signature */ - if (*(uint64_t *)blob == FSP_UPD_SIGNATURE) { + if (*(uint64_t *)blob == signature) { printk(BIOS_DEBUG, "CFG EEPROM: Signature valid.\n"); return 1; } -- cgit v1.2.3