jonzhang@fb.com has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34634 )
Change subject: drivers/vpd: set bool type variable matching with key/value pair ......................................................................
Patch Set 4:
Patch Set 4:
I see, so the problem is to load VPD in romstage.
In that case I think the right thing to do is to refactor (or create a sub function) cbmem_add_cros_vpd so it can load and store vpd raw data in rom stage. Also, vpd_gets and other functions should call a function that returns pointer to loaded vpd data, which may be from CBMEM in ramstage, or a static pointer set previously in romstage.
If needed we may even create vpd_preram or vpd_romstage for that.
I suppose we want to preserve vpd_gets() and vpd_find() call interface as-is to ensure there is no impact to current callers in ramstage. What about: a. create a vpd_romstage_gets() and vpd_romstage_find() call interface for romstage callers. b. factor common code in vpd.c out to be used by both romstage library calls and ramstage library calls. Let me know if this aligns with your thinking.