summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-06-07 00:27:28 -0700
committerGerrit <chrome-bot@google.com>2012-06-07 01:20:16 -0700
commit12eecc012ba5c0c37beafa03fe70f97fedf3e726 (patch)
treed390dfc4b73e86769ba7cc2fc688ceb5cddc39b5
parentc7f2e0246e8129aa179b09c5042d0265266e3a17 (diff)
downloadchrome-ec-12eecc012ba5c0c37beafa03fe70f97fedf3e726.tar.gz
Put correct RO_FRID, RW_FWID_A, RW_FWID_B entries in FMAP
BUG=chrome-os-partner:9495 TEST=manual Build image, run dump_fmap. Look for those entries. Change-Id: I6dfc38e00ce1e11ea24c8392d1691fab32a59d1f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/24696 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
-rw-r--r--common/fmap.c20
-rw-r--r--core/cortex-m/ec.lds.S1
-rw-r--r--include/version.h1
3 files changed, 16 insertions, 6 deletions
diff --git a/common/fmap.c b/common/fmap.c
index 2a2d288d5f..da139f7cc1 100644
--- a/common/fmap.c
+++ b/common/fmap.c
@@ -4,8 +4,10 @@
* found in the LICENSE file.
*/
+#include <stddef.h>
#include <stdint.h>
#include "config.h"
+#include "version.h"
/* FMAP structs. See http://code.google.com/p/flashmap/wiki/FmapSpec */
#define FMAP_NAMELEN 32
@@ -68,8 +70,10 @@ const struct _ec_fmap {
},
{
.area_name = "RO_FRID", /* FIXME: Where is it? */
- .area_offset = CONFIG_FW_RO_OFF,
- .area_size = 0,
+ .area_offset = CONFIG_FW_RO_OFF +
+ (uint32_t)__version_struct_offset +
+ offsetof(struct version_struct, version),
+ .area_size = sizeof(version_data.version),
.area_flags = FMAP_AREA_STATIC | FMAP_AREA_RO,
},
@@ -133,8 +137,10 @@ const struct _ec_fmap {
},
{
.area_name = "RW_FWID_A", /* FIXME: Where is it? */
- .area_offset = CONFIG_FW_A_OFF,
- .area_size = 0,
+ .area_offset = CONFIG_FW_A_OFF +
+ (uint32_t)__version_struct_offset +
+ offsetof(struct version_struct, version),
+ .area_size = sizeof(version_data.version),
.area_flags = FMAP_AREA_STATIC,
},
{
@@ -160,8 +166,10 @@ const struct _ec_fmap {
},
{
.area_name = "RW_FWID_B", /* FIXME: Where is it? */
- .area_offset = CONFIG_FW_B_OFF,
- .area_size = 0,
+ .area_offset = CONFIG_FW_B_OFF +
+ (uint32_t)__version_struct_offset +
+ offsetof(struct version_struct, version),
+ .area_size = sizeof(version_data.version),
.area_flags = FMAP_AREA_STATIC,
},
{
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 2b22a76809..2ef091e905 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -24,6 +24,7 @@ SECTIONS
.text : {
OUTDIR/core/CORE/init.o (.text.vecttable)
. = ALIGN(4);
+ __version_struct_offset = .;
*(.rodata.ver)
. = ALIGN(4);
OUTDIR/core/CORE/init.o (.text)
diff --git a/include/version.h b/include/version.h
index 0ded5513e1..d168c23490 100644
--- a/include/version.h
+++ b/include/version.h
@@ -25,5 +25,6 @@ struct version_struct {
extern const struct version_struct version_data;
extern const char build_info[];
+extern const char __version_struct_offset[];
#endif /* __CROS_EC_VERSION_H */