aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/google/chromeos/cros_vpd.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2014-02-21 16:21:00 +0800
committerMike Loptien <mike.loptien@se-eng.com>2014-10-07 23:37:07 +0200
commit6eaaafa2c32029bd9dc5fb4196fe2b22cb5b4d9b (patch)
treef716d30ddb516ac9b19581f6b99785b434572c5f /src/vendorcode/google/chromeos/cros_vpd.h
parentffda804b52768467ea7b3394a3e2fe9039f87362 (diff)
vendorcode: Add ChromeOS VPD parser.
Copied (and unmodified) the minimal bits from ChromeOS libVPD: https://chromium.googlesource.com/chromiumos/platform/vpd Old-Change-Id: Id75d1bfd16263ac1b94c22979f9892cf7908d5e6 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/187411 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> (cherry picked from commit a10ca23686299f3fd5b639631242cadaa2ca9e8a) vendorcode: Update ChromeOS VPD Parser. Merge recent changes in ChromeOS VPD that allows non-memory-mapped firmware to load VPD easier and faster (ref: https://chromium-review.googlesource.com/188134 ). Old-Change-Id: I3ee0b89c703f476f3d77cdde52cc7588724f7686 Reviewed-on: https://chromium-review.googlesource.com/188743 Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> (cherry picked from commit 03f4d521a7fa711b963b0e1822e92eac16a691b1) vendorcode: Access to ChromeOS VPD on default CBFS media. The new function "cros_vpd_gets(key, buf, size)" provides an easy and quick way to retrieve values in ChromeOS VPD section. Old-Change-Id: I38e50615e515707ffaecdc4c4fae65043541b687 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/187430 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> (cherry picked from commit bcd3832c06e8ed357c50f19396da21a218dc4b39) Squashed 3 related commits for a ChromeOS VPD parser. Change-Id: I4ba8fce16ea123c78d7b543c8353ab9bc1e2aa9f Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6959 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/vendorcode/google/chromeos/cros_vpd.h')
-rw-r--r--src/vendorcode/google/chromeos/cros_vpd.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/cros_vpd.h b/src/vendorcode/google/chromeos/cros_vpd.h
new file mode 100644
index 0000000000..674dbf65d9
--- /dev/null
+++ b/src/vendorcode/google/chromeos/cros_vpd.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __CROS_VPD_H__
+#define __CROS_VPD_H__
+
+/*
+ * Reads VPD string value by key.
+ *
+ * Reads in at most one less than size characters from VPD and stores them
+ * into buffer. A terminating null byte ('\0') is stored after the last
+ * character in the buffer.
+ *
+ * Returns NULL if key is not found, otherwise buffer.
+ */
+char *cros_vpd_gets(const char *key, char *buffer, int size);
+
+#endif /* __CROS_VPD_H__ */