summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2011-10-12 13:36:23 -0700
committerVadim Bendebury <vbendeb@chromium.org>2011-10-12 16:05:25 -0700
commit217decb37c0a7904f08452a82285d44f98ecbb41 (patch)
tree300023be1f7ef5d50bba76fa6a1bed16a0b61d0a /lib
parent78d80b3be02932ac519d26c6b1eb0a47177133d8 (diff)
[PATCH1/2] mrc cache: Add MRC cache FMAP entry support.
Add code to retrieve the location of the MRC cache from the FMAP device tree definition. fdt_decode.c should be refactored (fmap_offset could be determined just once and used throughout without passing it as a parameter), will leave this for another day. BUG=chrome-os-partner:5808 TEST=manual . see test description in the second patch commit message. Change-Id: Ic4003d685609beb61d1dea324bd804a2838e471c Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/9961 Reviewed-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/chromeos/fdt_decode.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/chromeos/fdt_decode.c b/lib/chromeos/fdt_decode.c
index 5c93dcdf89..fbc44a320e 100644
--- a/lib/chromeos/fdt_decode.c
+++ b/lib/chromeos/fdt_decode.c
@@ -105,6 +105,21 @@ int decode_firmware_entry(const char *blob, int fmap_offset, const char *name,
return err;
}
+int fdt_get_mrc_cache_base(const char *blob, struct fmap_entry *fme)
+{
+ int fmap_offset;
+
+ fmap_offset = fdt_node_offset_by_compatible(blob, -1,
+ "chromeos,flashmap");
+ if (fmap_offset < 0) {
+ VBDEBUG(PREFIX "%s: chromeos,flashmap node is missing\n",
+ __func__);
+ return fmap_offset;
+ }
+
+ return decode_fmap_entry(blob, fmap_offset, "rw", "mrc-cache", fme);
+}
+
int fdt_decode_twostop_fmap(const void *blob, struct twostop_fmap *config)
{
int fmap_offset;