summaryrefslogtreecommitdiff
path: root/common/system.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-01-31 22:13:13 -0800
committerVadim Bendebury <vbendeb@chromium.org>2017-02-01 06:36:18 +0000
commit11704ae6e9c35889ed1ec97bdaa9d42652397867 (patch)
tree12f7d873426f43c5c3d8ed84e7b7b7f1d20b199d /common/system.c
parent9fc399a0aaa4a12591907b498d4826a35fe4a806 (diff)
downloadchrome-ec-11704ae6e9c35889ed1ec97bdaa9d42652397867.tar.gz
Revert "version: Store image size data in version struct"
This is a dependency of the uderlyaing patch which breaks header composition of g chip based boards. This reverts commit 7cbb815732d7434f5985d3b50a869aa71ba5c507. Change-Id: I4d94647cf5cb09fd338e5a581c956df6b5d83081 Reviewed-on: https://chromium-review.googlesource.com/435551 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r--common/system.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/system.c b/common/system.c
index 28d846c0c5..ddabe3aa3c 100644
--- a/common/system.c
+++ b/common/system.c
@@ -616,14 +616,14 @@ int system_run_image_copy(enum system_image_copy_t copy)
__attribute__((weak)) /* Weird chips may need their own implementations */
const char *system_get_version(enum system_image_copy_t copy)
{
- static struct image_data data;
+ static struct version_struct v;
uintptr_t addr;
enum system_image_copy_t active_copy = system_get_image_copy();
/* Handle version of current image */
if (copy == active_copy || copy == SYSTEM_IMAGE_UNKNOWN)
- return &current_image_data.version[0];
+ return &version_data.version[0];
if (active_copy == SYSTEM_IMAGE_UNKNOWN)
return "";
@@ -632,7 +632,7 @@ const char *system_get_version(enum system_image_copy_t copy)
* The version string is always located after the reset vectors, so
* it's the same offset as in the current image. Find that offset.
*/
- addr = ((uintptr_t)&current_image_data -
+ addr = ((uintptr_t)&version_data -
get_program_memory_addr(active_copy));
/*
@@ -646,19 +646,19 @@ const char *system_get_version(enum system_image_copy_t copy)
#ifdef CONFIG_MAPPED_STORAGE
addr += CONFIG_MAPPED_STORAGE_BASE;
flash_lock_mapped_storage(1);
- memcpy(&data, (const void *)addr, sizeof(data));
+ memcpy(&v, (const void *)addr, sizeof(v));
flash_lock_mapped_storage(0);
#else
/* Read the version struct from flash into a buffer. */
- if (flash_read(addr, sizeof(data), (char *)&data))
+ if (flash_read(addr, sizeof(v), (char *)&v))
return "";
#endif
/* Make sure the version struct cookies match before returning the
* version string. */
- if (data.cookie1 == current_image_data.cookie1 &&
- data.cookie2 == current_image_data.cookie2)
- return data.version;
+ if (v.cookie1 == version_data.cookie1 &&
+ v.cookie2 == version_data.cookie2)
+ return v.version;
return "";
}