Attention is currently required from: Dinesh Gehlot, Eric Lai, Jayvik Desai, Kun Liu, Nick Vaccaro, Rui Zhou.
Subrata Banik has posted comments on this change by Rui Zhou. ( https://review.coreboot.org/c/coreboot/+/85875?usp=email )
Change subject: mb/google/nissa/var/rull: Match VBT with SSFC ......................................................................
Patch Set 2:
(1 comment)
File src/mainboard/google/brya/variants/rull/variant.c:
https://review.coreboot.org/c/coreboot/+/85875/comment/501835a5_c759e9ff?usp... : PS2, Line 47: : static int get_ssfc(uint32_t *val) : { : static uint32_t known_value; : static enum { : SSFC_NOT_READ, : SSFC_AVAILABLE, : } ssfc_state = SSFC_NOT_READ; : : if (ssfc_state == SSFC_AVAILABLE) { : *val = known_value; : return 0; : } : : /* : * If SSFC field is not in the CBI then the value of SSFC will be 0 for : * further processing later since 0 of each bits group means default : * component in a variant. For more detail, please refer to cbi_ssfc.h. : */ : if (google_chromeec_cbi_get_ssfc(&known_value) != 0) { : printk(BIOS_DEBUG, "SSFC not set in CBI\n"); : return -1; : } : : ssfc_state = SSFC_AVAILABLE; : *val = known_value; : printk(BIOS_INFO, "SSFC 0x%x.\n", known_value); : return 0; : }
Looking at the use case of the new function, I am wondering why we are not using `google_chromeec_cbi_get_ssfc()` instead of `get_ssfc()`?
`get_ssfc` is just a wrapper around `google_chromeec_cbi_get_ssfc` that ensures to avoid calling into `google_chromeec_cbi_get_ssfc` multiple time and return cached value after checking the erroneous cases