Kangheui Won has uploaded this change for review.

View Change

chromeec: introduce SSFC_OPTIONAL_IN_FW_CONFIG

When EC_GOOGLE_CHROMEEC_INCLUDE_SSFC_IN_FW_CONFIG is enabled and SSFC is
not set, all fw_config is invalidated. But for some platform this may
not be necessary, we can treat missing SSFC as zero and use other 32
bits of firmware config.

Add Kconfig option 'EC_GOOGLE_CHROMEEC_SSFC_OPTIONAL_IN_FW_CONFIG' to
make this possible.

BUG=b:184809649
TEST=build
BRANCH=zork

Signed-off-by: Kangheui Won <khwon@chromium.org>
Change-Id: I21c7b0d449a694d28ad7b3f14b035e3a5830030a
---
M src/ec/google/chromeec/Kconfig
M src/ec/google/chromeec/ec.c
2 files changed, 10 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/52205/1
diff --git a/src/ec/google/chromeec/Kconfig b/src/ec/google/chromeec/Kconfig
index 4bb0d65..d3a9faf 100644
--- a/src/ec/google/chromeec/Kconfig
+++ b/src/ec/google/chromeec/Kconfig
@@ -204,4 +204,11 @@
Fetch Second Source Factory Cache from CBI EEPROM and add it in the most significant
32 bits of firmware configuration.

+config EC_GOOGLE_CHROMEEC_SSFC_OPTIONAL_IN_FW_CONFIG
+ depends on EC_GOOGLE_CHROMEEC_INCLUDE_SSFC_IN_FW_CONFIG
+ bool
+ help
+ While adding Second Source Factory Cache to firmware configuration, ignore it if it
+ is not set properly instead of falling into UNDEFINED_FW_CONFIG.
+
source "src/ec/google/chromeec/*/Kconfig"
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index affe66e..f0d2d94 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -854,10 +854,11 @@
* 32 bits.
*/
if (CONFIG(EC_GOOGLE_CHROMEEC_INCLUDE_SSFC_IN_FW_CONFIG)) {
- uint32_t ssfc;
+ uint32_t ssfc = 0;

if (google_chromeec_cbi_get_ssfc(&ssfc))
- return -1;
+ if (!CONFIG(EC_GOOGLE_CHROMEEC_SSFC_OPTIONAL_IN_FW_CONFIG))
+ return -1;

*fw_config |= (uint64_t)ssfc << 32;
}

To view, visit change 52205. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I21c7b0d449a694d28ad7b3f14b035e3a5830030a
Gerrit-Change-Number: 52205
Gerrit-PatchSet: 1
Gerrit-Owner: Kangheui Won <khwon@chromium.org>
Gerrit-MessageType: newchange