aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub/grub/0001-fdt-add-grub_fdt_create_empty_tree-function.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2014-01-06 12:01:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-06 16:30:00 +0000
commitb4e28912af0618755ce75d0cc27d53fa9d745b30 (patch)
tree0474b8c96a3de93763fbcfe04151fe145c378666 /meta/recipes-bsp/grub/grub/0001-fdt-add-grub_fdt_create_empty_tree-function.patch
parentd0e52b125a58c0556087fcdf1673920e63573e7b (diff)
downloadopenembedded-core-contrib-b4e28912af0618755ce75d0cc27d53fa9d745b30.tar.gz
grub: add git version
Recently grub git gained support for ARM builds (using u-boot or EFI as first stage loader) and with 2 extra patches we get support for 64-bit ARM as well. Buildtested for genericarmv7a, genericarmv8 and qemux86. The genericarmv8 build fails in do_package/strip due to a binutils problem. Signed-off-by: Koen Kooi <koen.kooi@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/grub/grub/0001-fdt-add-grub_fdt_create_empty_tree-function.patch')
-rw-r--r--meta/recipes-bsp/grub/grub/0001-fdt-add-grub_fdt_create_empty_tree-function.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/grub/0001-fdt-add-grub_fdt_create_empty_tree-function.patch b/meta/recipes-bsp/grub/grub/0001-fdt-add-grub_fdt_create_empty_tree-function.patch
new file mode 100644
index 0000000000..341457488d
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub/0001-fdt-add-grub_fdt_create_empty_tree-function.patch
@@ -0,0 +1,73 @@
+From b3417ec69ff7d52379a8f2cb291dbecccdab684f Mon Sep 17 00:00:00 2001
+From: Leif Lindholm <leif.lindholm@linaro.org>
+Date: Wed, 4 Dec 2013 13:09:21 +0000
+Subject: [PATCH 1/2] fdt: add grub_fdt_create_empty_tree() function
+
+Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
+---
+ grub-core/lib/fdt.c | 39 +++++++++++++++++++++++++++++++++++++++
+ include/grub/fdt.h | 1 +
+ 2 files changed, 40 insertions(+)
+
+diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c
+index 9f34dc7..581a118 100644
+--- a/grub-core/lib/fdt.c
++++ b/grub-core/lib/fdt.c
+@@ -423,3 +423,42 @@ int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name,
+ grub_memcpy (prop + 3, val, len);
+ return 0;
+ }
++
++struct empty_tree {
++ grub_fdt_header_t header;
++ grub_uint64_t empty_rsvmap[2];
++ struct {
++ grub_uint32_t prop_start;
++ grub_uint8_t name[1];
++ grub_uint32_t prop_end;
++ grub_uint32_t node_end;
++ } empty_node;
++};
++
++int
++grub_fdt_create_empty_tree (void *fdt, unsigned int size)
++{
++ struct empty_tree *et;
++
++ if (size < sizeof (struct empty_tree))
++ return -1;
++
++ grub_memset (fdt, 0, size);
++ et = fdt;
++
++ et->empty_node.node_end = grub_cpu_to_be32 (FDT_END);
++ et->empty_node.prop_end = grub_cpu_to_be32 (FDT_END_NODE);
++ et->empty_node.prop_start = grub_cpu_to_be32 (FDT_BEGIN_NODE);
++ ((struct empty_tree *) fdt)->header.off_mem_rsvmap =
++ grub_cpu_to_be32 (ALIGN_UP (sizeof (grub_fdt_header_t), 8));
++
++ grub_fdt_set_off_dt_strings (fdt, sizeof (struct empty_tree));
++ grub_fdt_set_off_dt_struct (fdt, sizeof (grub_fdt_header_t) + 16);
++ grub_fdt_set_version (fdt, FDT_SUPPORTED_VERSION);
++ grub_fdt_set_last_comp_version (fdt, FDT_SUPPORTED_VERSION);
++ grub_fdt_set_size_dt_struct (fdt, sizeof (et->empty_node));
++ grub_fdt_set_totalsize (fdt, size);
++ grub_fdt_set_magic (fdt, FDT_MAGIC);
++
++ return 0;
++}
+diff --git a/include/grub/fdt.h b/include/grub/fdt.h
+index 2ad0536..06eec19 100644
+--- a/include/grub/fdt.h
++++ b/include/grub/fdt.h
+@@ -82,6 +82,7 @@ typedef struct {
+ #define grub_fdt_set_size_dt_struct(fdt, value) \
+ grub_fdt_set_header(fdt, size_dt_struct, value)
+
++int grub_fdt_create_empty_tree (void *fdt, unsigned int size);
+ int grub_fdt_check_header (void *fdt, unsigned int size);
+ int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset,
+ const char *name);
+--
+1.8.4.2
+