aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/vpd/vpd.h
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2020-05-26 19:03:31 -0700
committerPatrick Georgi <pgeorgi@google.com>2020-05-28 09:46:17 +0000
commit5f17458cfbe90171bf6d20d9c36470ebbfb3842f (patch)
treeb711f3d50410500df9be7141529dd43b6140652d /src/drivers/vpd/vpd.h
parent4cabf789fd7615318cd0552e490c252ba0f142a6 (diff)
drivers/vpd: Fix VPD speed regressions on non-x86 devices
CB:34634 expanded the VPD code to also be usable from romstage, shuffling a few things around and adding some extra infrastructure in the process. Unfortunately, the changes seem to have only been written with x86 devices in mind and make coreboot always load the whole VPD FMAP section (not just the used part) on devices where rdev_mmap() is not a no-op. This patch rewrites the VPD code to be based on region_device structures that only represent the VPD area actually used (rather than the whole FMAP section), and that only get mapped when accessed. (It would be even better to pull this concept into the VPD decoder itself, but since that is taken from third-party code and accesses in early stages aren't very common, let's not go there for now.) It also moves the copying into CBMEM to romstage so that late romstage accesses can already benefit from it, and makes early decoding available in all stages because at this point, why not. Also fix a long-standing bug where the 'consumed' counter was not reset between vpd_decode_string() calls to the RO and the RW VPD. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I55a103180b290c1563e35a25496188b6a82e49ff Reviewed-on: https://review.coreboot.org/c/coreboot/+/41757 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'src/drivers/vpd/vpd.h')
-rw-r--r--src/drivers/vpd/vpd.h23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/drivers/vpd/vpd.h b/src/drivers/vpd/vpd.h
index a78662579a..d54cef8df1 100644
--- a/src/drivers/vpd/vpd.h
+++ b/src/drivers/vpd/vpd.h
@@ -13,29 +13,6 @@ enum vpd_region {
VPD_RW = 2
};
-/* VPD 2.0 data blob structure */
-struct vpd_blob {
- bool initialized;
- uint8_t *ro_base;
- uint32_t ro_size;
- uint8_t *rw_base;
- uint32_t rw_size;
-};
-extern struct vpd_blob g_vpd_blob;
-
-/*
- * This function loads g_vpd_blob global variable.
- * The variable is initialized if it was not.
- */
-const struct vpd_blob *vpd_load_blob(void);
-
-/*
- * This function gets the base address and size of
- * buffers for RO_VPD/RW_VPD binary blobs, and sets
- * the struct.
- */
-void vpd_get_buffers(struct vpd_blob *blob);
-
/*
* Reads VPD string value by key.
*