summaryrefslogtreecommitdiff
path: root/include/chromeos
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2011-08-02 21:45:02 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:22 -0700
commitf2dd80ae0a4e4f3b9b22e03a3ca1de91c95114aa (patch)
tree99a90d586620e789a3fe9e68f9ee288af2f3bc37 /include/chromeos
parent4cf39fdb7dda7e76b6d8c55e990c2234c648bb51 (diff)
Make the chromeos FMAP data structures more generic and in their own files.
This change separates out the FMAP data structures from the FDT decode functions and renames them to more neutral names. These structures don't intrinsically have to be loaded from the FDT, and their new names and location remove the implied dependency. BUG=chrome-os-partner:5248 TEST=Built for x86-alex and tegra2_kaen. Installed on Kaen and booted to chromeos login. Change-Id: I5680a3f3aaa52efe44c2060d0b6db9ad47a547ec Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/5231 Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'include/chromeos')
-rw-r--r--include/chromeos/fdt_decode.h33
-rw-r--r--include/chromeos/firmware_storage.h2
-rw-r--r--include/chromeos/fmap.h45
3 files changed, 49 insertions, 31 deletions
diff --git a/include/chromeos/fdt_decode.h b/include/chromeos/fdt_decode.h
index 4585b9a62dc..dcb98cbbf11 100644
--- a/include/chromeos/fdt_decode.h
+++ b/include/chromeos/fdt_decode.h
@@ -11,38 +11,11 @@
#ifndef CHROMEOS_FDT_DECODE_H_
#define CHROMEOS_FDT_DECODE_H_
-/* Decode Chrome OS specific configuration from fdt */
-
-struct fdt_fmap_entry {
- uint32_t offset;
- uint32_t length;
-};
-
-struct fdt_firmware_entry {
- struct fdt_fmap_entry boot; /* U-Boot */
- struct fdt_fmap_entry vblock;
- struct fdt_fmap_entry firmware_id;
- uint64_t block_lba;
-};
-
-/*
- * Only sections that are used during booting are put here. More sections will
- * be added if required.
- */
-struct fdt_twostop_fmap {
- struct {
- struct fdt_fmap_entry fmap;
- struct fdt_fmap_entry gbb;
- struct fdt_fmap_entry firmware_id;
- } readonly;
+#include <chromeos/fmap.h>
- struct fdt_firmware_entry readwrite_a;
- struct fdt_firmware_entry readwrite_b;
-};
-
-int fdt_decode_twostop_fmap(const void *fdt, struct fdt_twostop_fmap *config);
+/* Decode Chrome OS specific configuration from fdt */
-void dump_fmap(struct fdt_twostop_fmap *config);
+int fdt_decode_twostop_fmap(const void *fdt, struct twostop_fmap *config);
/**
* This checks whether a property exists.
diff --git a/include/chromeos/firmware_storage.h b/include/chromeos/firmware_storage.h
index 8e82aaa7d6c..2ef6e2b0348 100644
--- a/include/chromeos/firmware_storage.h
+++ b/include/chromeos/firmware_storage.h
@@ -44,6 +44,6 @@ typedef struct firmware_storage_t {
int firmware_storage_open_spi(firmware_storage_t *file);
int firmware_storage_open_twostop(firmware_storage_t *file,
- struct fdt_twostop_fmap *fmap);
+ struct twostop_fmap *fmap);
#endif /* CHROMEOS_FIRMWARE_STORAGE_H_ */
diff --git a/include/chromeos/fmap.h b/include/chromeos/fmap.h
new file mode 100644
index 00000000000..37efc4b1284
--- /dev/null
+++ b/include/chromeos/fmap.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011 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.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ */
+
+#ifndef CHROMEOS_FMAP_H_
+#define CHROMEOS_FMAP_H_
+
+/* Structures to hold Chrome OS specific configuration from the FMAP. */
+
+struct fmap_entry {
+ uint32_t offset;
+ uint32_t length;
+};
+
+struct fmap_firmware_entry {
+ struct fmap_entry boot; /* U-Boot */
+ struct fmap_entry vblock;
+ struct fmap_entry firmware_id;
+ uint64_t block_lba;
+};
+
+/*
+ * Only sections that are used during booting are put here. More sections will
+ * be added if required.
+ */
+struct twostop_fmap {
+ struct {
+ struct fmap_entry fmap;
+ struct fmap_entry gbb;
+ struct fmap_entry firmware_id;
+ } readonly;
+
+ struct fmap_firmware_entry readwrite_a;
+ struct fmap_firmware_entry readwrite_b;
+};
+
+void dump_fmap(struct twostop_fmap *config);
+
+#endif /* CHROMEOS_FMAP_H_ */