summaryrefslogtreecommitdiffstats
path: root/sys/boot/uboot/common
diff options
context:
space:
mode:
authorgonzo <gonzo@FreeBSD.org>2012-11-30 03:15:50 +0000
committergonzo <gonzo@FreeBSD.org>2012-11-30 03:15:50 +0000
commite9a6dd0099d4e0e6f29bd9acfdba4596e6cff8c0 (patch)
tree8badf4cffd59109679f8f867ce307dc34e2d830f /sys/boot/uboot/common
parentc099a6d04f3ab2d73a3a47a0feddc48a3645a076 (diff)
downloadFreeBSD-src-e9a6dd0099d4e0e6f29bd9acfdba4596e6cff8c0.zip
FreeBSD-src-e9a6dd0099d4e0e6f29bd9acfdba4596e6cff8c0.tar.gz
- Implement "fdt mres" sub-command that prints reserved memory regions
- Add "fdt addr" subcommand that lets you specify preloaded blob address - Do not pre-initialize blob for "fdt addr" - Do not try to load dtb every time fdt subcommand is issued, do it only once - Change the way DTB is passed to kernel. With introduction of "fdt addr" actual blob address can be not virtual but physical or reside in area higher then 64Mb. ubldr should create copy of it in kernel area and pass pointer to this newly allocated buffer which is guaranteed to work in kernel after switching on MMU. - Convert memreserv FDT info to "memreserv" property of root node FDT uses /memreserve/ data to notify OS about reserved memory areas. Technically it's not real property, it's just data blob, sequence of <start, size> pairs where both start and size are 64-bit integers. It doesn't fit nicely with OF API we use in kernel, so in order to unify thing ubldr converts this data to "memreserve" property using the same format for addresses and sizes as /memory node.
Diffstat (limited to 'sys/boot/uboot/common')
-rw-r--r--sys/boot/uboot/common/metadata.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/boot/uboot/common/metadata.c b/sys/boot/uboot/common/metadata.c
index 40accc0..74497a9 100644
--- a/sys/boot/uboot/common/metadata.c
+++ b/sys/boot/uboot/common/metadata.c
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#include "glue.h"
#if defined(LOADER_FDT_SUPPORT)
-extern vm_offset_t fdt_fixup(void);
+extern int fdt_copy(vm_offset_t);
#endif
/*
@@ -279,7 +279,10 @@ md_load(char *args, vm_offset_t *modulep)
vm_offset_t envp;
vm_offset_t size;
vm_offset_t vaddr;
+#if defined(LOADER_FDT_SUPPORT)
vm_offset_t dtbp;
+ int dtb_size;
+#endif
char *rootdevname;
int howto;
int i;
@@ -325,6 +328,16 @@ md_load(char *args, vm_offset_t *modulep)
/* Pad to a page boundary */
addr = roundup(addr, PAGE_SIZE);
+#if defined(LOADER_FDT_SUPPORT)
+ /* Handle device tree blob */
+ dtbp = addr;
+ dtb_size = fdt_copy(addr);
+
+ /* Pad to a page boundary */
+ if (dtb_size)
+ addr += roundup(dtb_size, PAGE_SIZE);
+#endif
+
kernend = 0;
kfp = file_findfile(NULL, "elf32 kernel");
if (kfp == NULL)
@@ -335,9 +348,7 @@ md_load(char *args, vm_offset_t *modulep)
file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp);
#if defined(LOADER_FDT_SUPPORT)
- /* Handle device tree blob */
- dtbp = fdt_fixup();
- if (dtbp != 0)
+ if (dtb_size)
file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp);
else
pager_output("WARNING! Trying to fire up the kernel, but no "
OpenPOWER on IntegriCloud