summaryrefslogtreecommitdiffstats
path: root/sys/boot/common
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2008-10-14 10:11:14 +0000
committerraj <raj@FreeBSD.org>2008-10-14 10:11:14 +0000
commit745c5c702fbda516ce2ffc4ea5fab4733a300b08 (patch)
tree94686d1eac378d2739cca0ac82d224e003a620c6 /sys/boot/common
parent556a6465983a877b5787e9b340efce702299dc65 (diff)
downloadFreeBSD-src-745c5c702fbda516ce2ffc4ea5fab4733a300b08.zip
FreeBSD-src-745c5c702fbda516ce2ffc4ea5fab4733a300b08.tar.gz
Initial support of loader(8) for ARM machines running U-Boot.
This uses the common U-Boot support lib (sys/boot/uboot, already used on FreeBSD/powerpc), and assumes the underlying firmware has the modern API for stand-alone apps enabled in the config (CONFIG_API). Only netbooting is supported at the moment. Obtained from: Marvell, Semihalf
Diffstat (limited to 'sys/boot/common')
-rw-r--r--sys/boot/common/Makefile.inc2
-rw-r--r--sys/boot/common/load_elf.c11
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc
index 753d112..9ede386 100644
--- a/sys/boot/common/Makefile.inc
+++ b/sys/boot/common/Makefile.inc
@@ -9,7 +9,7 @@ SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c
.elif ${MACHINE} == "pc98"
SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
-.elif ${MACHINE_ARCH} == "powerpc"
+.elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm"
SRCS+= load_elf32.c reloc_elf32.c
.elif ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "ia64"
SRCS+= load_elf64.c reloc_elf64.c
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c
index eabc426..35b3f0b 100644
--- a/sys/boot/common/load_elf.c
+++ b/sys/boot/common/load_elf.c
@@ -289,7 +289,16 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
#ifdef ELF_VERBOSE
printf("Converted entry 0x%08x\n", ehdr->e_entry);
#endif
- } else
+ } else
+ off = 0;
+#elif defined(__arm__)
+ if (off & 0xf0000000u) {
+ off = -(off & 0xf0000000u);
+ ehdr->e_entry += off;
+#ifdef ELF_VERBOSE
+ printf("Converted entry 0x%08x\n", ehdr->e_entry);
+#endif
+ } else
off = 0;
#else
off = 0; /* other archs use direct mapped kernels */
OpenPOWER on IntegriCloud