summaryrefslogtreecommitdiffstats
path: root/sys/arm
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/arm
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/arm')
-rw-r--r--sys/arm/arm/locore.S9
-rw-r--r--sys/arm/include/bootinfo.h72
-rw-r--r--sys/arm/include/metadata.h2
3 files changed, 82 insertions, 1 deletions
diff --git a/sys/arm/arm/locore.S b/sys/arm/arm/locore.S
index d972474..b465edc 100644
--- a/sys/arm/arm/locore.S
+++ b/sys/arm/arm/locore.S
@@ -66,6 +66,13 @@ __FBSDID("$FreeBSD$");
ENTRY_NP(btext)
ASENTRY_NP(_start)
+
+/*
+ * Move metadata ptr to r12 (ip)
+ */
+
+ mov ip, r0
+
#if defined (FLASHADDR) && defined(LOADERRAMADDR)
/* Check if we're running from flash. */
ldr r7, =FLASHADDR
@@ -170,6 +177,8 @@ mmu_done:
ldr pc, .Lvirt_done
virt_done:
+ mov r0, ip /* Load argument: metadata ptr */
+
mov fp, #0 /* trace back starts here */
bl _C_LABEL(initarm) /* Off we go */
diff --git a/sys/arm/include/bootinfo.h b/sys/arm/include/bootinfo.h
new file mode 100644
index 0000000..a7f6fbd
--- /dev/null
+++ b/sys/arm/include/bootinfo.h
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (C) 2006-2008 Semihalf, Marian Balakowicz <m8@semihalf.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_BOOTINFO_H_
+#define _MACHINE_BOOTINFO_H_
+
+#if !defined(LOCORE)
+
+/* Platform hardware spec, received from loader(8) */
+
+#define BI_VERSION 1
+
+struct bi_mem_region {
+ vm_paddr_t mem_base;
+ vm_size_t mem_size;
+};
+
+struct bi_eth_addr {
+ u_int8_t mac_addr[6];
+ u_int8_t padding[2];
+};
+
+struct bootinfo {
+ u_int32_t bi_version;
+ vm_offset_t bi_bar_base;
+ u_int32_t bi_cpu_clk;
+ u_int32_t bi_bus_clk;
+ u_int8_t bi_mem_reg_no;
+ u_int8_t bi_eth_addr_no;
+ u_int8_t padding[2];
+
+ u_int8_t bi_data[1];
+ /*
+ * The bi_data container is allocated in run time and has the
+ * following layout:
+ *
+ * - bi_mem_reg_no elements of struct bi_mem_region
+ * - bi_eth_addr_no elements of struct bi_eth_addr
+ */
+};
+
+extern struct bootinfo *bootinfo;
+
+struct bi_mem_region *bootinfo_mr(void);
+struct bi_eth_addr *bootinfo_eth(void);
+#endif
+
+#endif /* _MACHINE_BOOTINFO_H_ */
diff --git a/sys/arm/include/metadata.h b/sys/arm/include/metadata.h
index 84e6f87..5180834 100644
--- a/sys/arm/include/metadata.h
+++ b/sys/arm/include/metadata.h
@@ -29,6 +29,6 @@
#ifndef _MACHINE_METADATA_H_
#define _MACHINE_METADATA_H_
-#define MODINFOMD_SMAP 0x1001
+#define MODINFOMD_BOOTINFO 0x1001
#endif /* !_MACHINE_METADATA_H_ */
OpenPOWER on IntegriCloud