Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39039 )
Change subject: mainboard/google/dedede: Migrate onto get fw_config helper ......................................................................
mainboard/google/dedede: Migrate onto get fw_config helper
Fix the FIXME.
BUG=b:149348474 BRANCH=none TEST=only tested on hatch
Change-Id: Ic84ffb6188d1f98b076142829fe49afd38c528bc Signed-off-by: Edward O'Callaghan quasisec@google.com --- M src/ec/google/chromeec/ec.c M src/ec/google/chromeec/ec.h M src/ec/google/chromeec/ec_boardid.c M src/mainboard/google/dedede/board_info.c 4 files changed, 13 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/39039/1
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 4bf41ac..c97b3ab 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -889,6 +889,17 @@
int google_chromeec_cbi_get_fw_config(uint32_t *fw_config) { + uint32_t sku_id = google_chromeec_get_board_sku(); + + /* + * FW_CONFIG can potentially have all the bits set. So check the + * sku_id to ensure that the CBI is provisioned before reading the + * FW_CONFIG. + */ + if ((sku_id == SKU_UNKNOWN) || + (sku_id > CONFIG_EC_GOOGLE_CHROMEEC_SKU_ID_MAX)) + return -1; + return cbi_get_uint32(fw_config, CBI_TAG_FW_CONFIG); }
diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index f5c2e1a..16ecf88 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -88,6 +88,8 @@ int google_chromeec_cbi_get_dram_part_num(char *buf, size_t bufsize); int google_chromeec_cbi_get_oem_name(char *buf, size_t bufsize);
+#define SKU_UNKNOWN 0xFFFFFFFF + uint32_t google_chromeec_get_board_sku(void); const char *google_chromeec_smbios_system_sku(void);
diff --git a/src/ec/google/chromeec/ec_boardid.c b/src/ec/google/chromeec/ec_boardid.c index 41d9959..bc33007 100644 --- a/src/ec/google/chromeec/ec_boardid.c +++ b/src/ec/google/chromeec/ec_boardid.c @@ -30,8 +30,6 @@ return id; }
-#define SKU_UNKNOWN 0xFFFFFFFF - uint32_t google_chromeec_get_board_sku(void) { static uint32_t sku_id = SKU_UNKNOWN; diff --git a/src/mainboard/google/dedede/board_info.c b/src/mainboard/google/dedede/board_info.c index f9ed44d..7b10b23 100644 --- a/src/mainboard/google/dedede/board_info.c +++ b/src/mainboard/google/dedede/board_info.c @@ -38,19 +38,5 @@
int board_info_get_fw_config(uint32_t *fw_config) { - uint32_t sku_id = google_chromeec_get_board_sku(); - - /* FIXME: Move get_fw_config() in with rest of sku id helpers */ -#define SKU_UNKNOWN 0xffffffff -#define SKU_MAX 0x7fffffff - - /* - * FW_CONFIG can potentially have all the bits set. So check the - * sku_id to ensure that the CBI is provisioned before reading the - * FW_CONFIG. - */ - if (sku_id == SKU_UNKNOWN || sku_id > SKU_MAX) - return -1; - return google_chromeec_cbi_get_fw_config(fw_config); }
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39039
to look at the new patch set (#2).
Change subject: mainboard/google/dedede: Migrate onto get fw_config helper ......................................................................
mainboard/google/dedede: Migrate onto get fw_config helper
Fix the FIXME.
BUG=b:149348474 BRANCH=none TEST=only tested on hatch
Change-Id: Ic84ffb6188d1f98b076142829fe49afd38c528bc Signed-off-by: Edward O'Callaghan quasisec@google.com --- M src/ec/google/chromeec/ec.c M src/ec/google/chromeec/ec.h M src/mainboard/google/dedede/board_info.c 3 files changed, 13 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/39039/2
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39039
to look at the new patch set (#4).
Change subject: mainboard/google/dedede: Migrate onto get fw_config helper ......................................................................
mainboard/google/dedede: Migrate onto get fw_config helper
Fix the FIXME.
BUG=b:149348474 BRANCH=none TEST=only tested on hatch
Change-Id: Ic84ffb6188d1f98b076142829fe49afd38c528bc Signed-off-by: Edward O'Callaghan quasisec@google.com --- M src/mainboard/google/dedede/board_info.c 1 file changed, 0 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/39039/4
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39039 )
Change subject: mainboard/google/dedede: Migrate onto get fw_config helper ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39039/11/src/mainboard/google/deded... File src/mainboard/google/dedede/board_info.c:
https://review.coreboot.org/c/coreboot/+/39039/11/src/mainboard/google/deded... PS11, Line 53: return -1; Not quite clear why the check is removed. There is a good possibility that FW_CONFIG might not be provisioned during the early stages of the program and there is no way to differentiate the provisioned and non-provisioned scenario without checking the SKU.
Jett Rink has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39039 )
Change subject: mainboard/google/dedede: Migrate onto get fw_config helper ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39039/11/src/mainboard/google/deded... File src/mainboard/google/dedede/board_info.c:
https://review.coreboot.org/c/coreboot/+/39039/11/src/mainboard/google/deded... PS11, Line 53: return -1;
Not quite clear why the check is removed. […]
google_chromeec_cbi_get_fw_config will return an error if the field wasn't there in the unprovisioned case, so maybe we don't need the check after all.
Edward O'Callaghan has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/39039 )
Change subject: mainboard/google/dedede: Migrate onto get fw_config helper ......................................................................
Abandoned
squashed into previous