diff options
author | Tom Wai-Hong Tam <waihong@chromium.org> | 2012-06-29 17:24:27 +0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-07-02 06:19:39 -0700 |
commit | d808a43d357371451c8ca4b4ad1a38f2251155c4 (patch) | |
tree | f4f60a9620c4a9b94c7858090d52c9a0fa540b14 | |
parent | dc6b642b47168a09fa1702092961595ab0674c03 (diff) | |
download | vboot-d808a43d357371451c8ca4b4ad1a38f2251155c4.tar.gz |
crossystem: Add the ddr_type field on crossystem for querying DDR RAM type
Samsung want to know what memory type on the device. So this CL adds a
new field ddr_type to crossystem utility in order to query this info.
It is only available on ARM platform so far.
BUG=chrome-os-partner:10857
TEST=Built and boot on Snow successfuly. On userspace, query the field via:
localhost ~ # crossystem ddr_type
ddr3
Change-Id: I01d1dec412fe4052e1ea6cfe2e53830da97a710b
Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26411
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | host/arch/arm/lib/crossystem_arch.c | 2 | ||||
-rw-r--r-- | host/lib/crossystem.c | 4 | ||||
-rw-r--r-- | utility/crossystem_main.c | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c index a4d08af7..7895badb 100644 --- a/host/arch/arm/lib/crossystem_arch.c +++ b/host/arch/arm/lib/crossystem_arch.c @@ -379,6 +379,8 @@ const char* VbGetArchPropertyString(const char* name, char* dest, int size) { prop = "firmware-type"; else if (!strcasecmp(name, "ecfw_act")) prop = "active-ec-firmware"; + else if (!strcasecmp(name, "ddr_type")) + prop = "ddr-type"; if (prop) str = ReadFdtString(prop); diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index 80a3d3c2..1515ecf3 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -404,6 +404,8 @@ int VbGetSystemPropertyInt(const char* name) { const char* VbGetSystemPropertyString(const char* name, char* dest, int size) { + static const char unknown_string[] = "unknown"; + /* Check architecture-dependent properties first */ if (VbGetArchPropertyString(name, dest, size)) return dest; @@ -425,6 +427,8 @@ const char* VbGetSystemPropertyString(const char* name, char* dest, int size) { return GetVdatString(dest, size, VDAT_STRING_LOAD_FIRMWARE_DEBUG); } else if (!strcasecmp(name, "vdat_lkdebug")) { return GetVdatString(dest, size, VDAT_STRING_LOAD_KERNEL_DEBUG); + } else if (!strcasecmp(name, "ddr_type")) { + return unknown_string; } return NULL; diff --git a/utility/crossystem_main.c b/utility/crossystem_main.c index e7320c99..ecd1e4f8 100644 --- a/utility/crossystem_main.c +++ b/utility/crossystem_main.c @@ -37,6 +37,7 @@ const Param sys_param_list[] = { {"arch", IS_STRING, "Platform architecture"}, {"cros_debug", 0, "OS should allow debug features"}, {"dbg_reset", CAN_WRITE, "Debug reset mode request (writable)"}, + {"ddr_type", IS_STRING, "Type of DDR RAM"}, {"disable_dev_request", CAN_WRITE, "Disable virtual dev-mode on next boot"}, {"dev_boot_usb", CAN_WRITE, "Enable developer mode boot from USB/SD (writable)"}, |