diff options
Diffstat (limited to 'src/lib/fw_config.c')
-rw-r--r-- | src/lib/fw_config.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/lib/fw_config.c b/src/lib/fw_config.c index 8e45c004fb..3546736b7b 100644 --- a/src/lib/fw_config.c +++ b/src/lib/fw_config.c @@ -21,30 +21,29 @@ uint64_t fw_config_get(void) if (fw_config_value_initialized) return fw_config_value; fw_config_value_initialized = true; + fw_config_value = UNDEFINED_FW_CONFIG; + + /* Read the value from EC CBI. */ + if (CONFIG(FW_CONFIG_SOURCE_CHROMEEC_CBI)) { + if (google_chromeec_cbi_get_fw_config(&fw_config_value)) + printk(BIOS_WARNING, "%s: Could not get fw_config from CBI\n", + __func__); + else + printk(BIOS_INFO, "FW_CONFIG value from CBI is 0x%" PRIx64 "\n", + fw_config_value); + } /* Look in CBFS to allow override of value. */ - if (CONFIG(FW_CONFIG_SOURCE_CBFS)) { + if (CONFIG(FW_CONFIG_SOURCE_CBFS) && fw_config_value == UNDEFINED_FW_CONFIG) { if (cbfs_load(CONFIG_CBFS_PREFIX "/fw_config", &fw_config_value, - sizeof(fw_config_value)) != sizeof(fw_config_value)) { + sizeof(fw_config_value)) != sizeof(fw_config_value)) printk(BIOS_WARNING, "%s: Could not get fw_config from CBFS\n", - __func__); - fw_config_value = UNDEFINED_FW_CONFIG; - } else { + __func__); + else printk(BIOS_INFO, "FW_CONFIG value from CBFS is 0x%" PRIx64 "\n", - fw_config_value); - return fw_config_value; - } - } - - /* Read the value from EC CBI. */ - if (CONFIG(FW_CONFIG_SOURCE_CHROMEEC_CBI)) { - if (google_chromeec_cbi_get_fw_config(&fw_config_value)) { - printk(BIOS_WARNING, "%s: Could not get fw_config from EC\n", __func__); - fw_config_value = UNDEFINED_FW_CONFIG; - } + fw_config_value); } - printk(BIOS_INFO, "FW_CONFIG value is 0x%" PRIx64 "\n", fw_config_value); return fw_config_value; } |