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.

View Change

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iebdba59419a555147fc40391cf17cc6879d9e1b2
Gerrit-Change-Number: 34634
Gerrit-PatchSet: 4
Gerrit-Owner: jonzhang@fb.com
Gerrit-Reviewer: Andrey Petrov <andrey.petrov@gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Huang Jin <huang.jin@intel.com>
Gerrit-Reviewer: Hung-Te Lin <hungte@chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Reviewer: jonzhang@fb.com
Gerrit-Reviewer: Ɓukasz Siudut
Gerrit-Comment-Date: Sun, 04 Aug 2019 01:58:13 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment