[Midnightbsd-cvs] src [10213] trunk/sys/boot/arm: sync

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jun 2 10:12:53 EDT 2018


Revision: 10213
          http://svnweb.midnightbsd.org/src/?rev=10213
Author:   laffer1
Date:     2018-06-02 10:12:52 -0400 (Sat, 02 Jun 2018)
Log Message:
-----------
sync

Modified Paths:
--------------
    trunk/sys/boot/arm/Makefile
    trunk/sys/boot/arm/Makefile.inc
    trunk/sys/boot/arm/at91/Makefile
    trunk/sys/boot/arm/at91/Makefile.inc
    trunk/sys/boot/arm/at91/boot0/Makefile
    trunk/sys/boot/arm/at91/boot0/linker.cfg
    trunk/sys/boot/arm/at91/boot0/main.c
    trunk/sys/boot/arm/at91/boot0iic/Makefile
    trunk/sys/boot/arm/at91/boot0iic/main.c
    trunk/sys/boot/arm/at91/boot0spi/Makefile
    trunk/sys/boot/arm/at91/boot0spi/main.c
    trunk/sys/boot/arm/at91/boot2/Makefile
    trunk/sys/boot/arm/at91/boot2/board.h
    trunk/sys/boot/arm/at91/boot2/boot2.c
    trunk/sys/boot/arm/at91/boot2/bwct_board.c
    trunk/sys/boot/arm/at91/boot2/centipad_board.c
    trunk/sys/boot/arm/at91/boot2/kb920x_board.c
    trunk/sys/boot/arm/at91/bootiic/Makefile
    trunk/sys/boot/arm/at91/bootiic/README
    trunk/sys/boot/arm/at91/bootiic/env_vars.c
    trunk/sys/boot/arm/at91/bootiic/env_vars.h
    trunk/sys/boot/arm/at91/bootiic/loader_prompt.c
    trunk/sys/boot/arm/at91/bootiic/loader_prompt.h
    trunk/sys/boot/arm/at91/bootiic/main.c
    trunk/sys/boot/arm/at91/bootspi/Makefile
    trunk/sys/boot/arm/at91/bootspi/ee.c
    trunk/sys/boot/arm/at91/bootspi/ee.h
    trunk/sys/boot/arm/at91/bootspi/env_vars.c
    trunk/sys/boot/arm/at91/bootspi/env_vars.h
    trunk/sys/boot/arm/at91/bootspi/loader_prompt.c
    trunk/sys/boot/arm/at91/bootspi/loader_prompt.h
    trunk/sys/boot/arm/at91/bootspi/main.c
    trunk/sys/boot/arm/at91/libat91/Makefile
    trunk/sys/boot/arm/at91/libat91/arm_init.S
    trunk/sys/boot/arm/at91/libat91/at91rm9200.h
    trunk/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c
    trunk/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h
    trunk/sys/boot/arm/at91/libat91/delay.c
    trunk/sys/boot/arm/at91/libat91/eeprom.c
    trunk/sys/boot/arm/at91/libat91/emac.c
    trunk/sys/boot/arm/at91/libat91/emac.h
    trunk/sys/boot/arm/at91/libat91/emac_init.c
    trunk/sys/boot/arm/at91/libat91/getc.c
    trunk/sys/boot/arm/at91/libat91/lib.h
    trunk/sys/boot/arm/at91/libat91/lib_AT91RM9200.h
    trunk/sys/boot/arm/at91/libat91/mci_device.h
    trunk/sys/boot/arm/at91/libat91/memcmp.c
    trunk/sys/boot/arm/at91/libat91/memcpy.c
    trunk/sys/boot/arm/at91/libat91/memset.c
    trunk/sys/boot/arm/at91/libat91/p_string.c
    trunk/sys/boot/arm/at91/libat91/printf.c
    trunk/sys/boot/arm/at91/libat91/putchar.c
    trunk/sys/boot/arm/at91/libat91/reset.c
    trunk/sys/boot/arm/at91/libat91/sd-card.c
    trunk/sys/boot/arm/at91/libat91/sd-card.h
    trunk/sys/boot/arm/at91/libat91/spi_flash.c
    trunk/sys/boot/arm/at91/libat91/spi_flash.h
    trunk/sys/boot/arm/at91/libat91/strcmp.c
    trunk/sys/boot/arm/at91/libat91/strcpy.c
    trunk/sys/boot/arm/at91/libat91/strcvt.c
    trunk/sys/boot/arm/at91/libat91/strlen.c
    trunk/sys/boot/arm/at91/libat91/tag_list.c
    trunk/sys/boot/arm/at91/libat91/tag_list.h
    trunk/sys/boot/arm/at91/libat91/xmodem.c
    trunk/sys/boot/arm/at91/linker.cfg
    trunk/sys/boot/arm/ixp425/Makefile.inc
    trunk/sys/boot/arm/ixp425/boot2/Makefile
    trunk/sys/boot/arm/ixp425/boot2/arm_init.S
    trunk/sys/boot/arm/ixp425/boot2/boot2.c
    trunk/sys/boot/arm/ixp425/boot2/cf_ata.h
    trunk/sys/boot/arm/ixp425/boot2/ixp425_board.c
    trunk/sys/boot/arm/ixp425/boot2/lib.h
    trunk/sys/boot/arm/uboot/Makefile
    trunk/sys/boot/arm/uboot/conf.c
    trunk/sys/boot/arm/uboot/help.uboot
    trunk/sys/boot/arm/uboot/ldscript.arm
    trunk/sys/boot/arm/uboot/start.S
    trunk/sys/boot/arm/uboot/version

Added Paths:
-----------
    trunk/sys/boot/arm/uboot/loader.conf

Modified: trunk/sys/boot/arm/Makefile
===================================================================
--- trunk/sys/boot/arm/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/sys/boot/arm/Makefile 183878 2008-10-14 10:11:14Z raj $
 
 SUBDIR=		uboot
 

Modified: trunk/sys/boot/arm/Makefile.inc
===================================================================
--- trunk/sys/boot/arm/Makefile.inc	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/Makefile.inc	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,3 +1,4 @@
-# $MidnightBSD$ */
+# $MidnightBSD$
+# $FreeBSD: stable/10/sys/boot/arm/Makefile.inc 180012 2008-06-25 21:33:28Z ru $
 
 .include "../Makefile.inc"

Modified: trunk/sys/boot/arm/at91/Makefile
===================================================================
--- trunk/sys/boot/arm/at91/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/sys/boot/arm/at91/Makefile 164138 2006-11-09 20:45:22Z imp $
 
 SUBDIR=		libat91 boot0 boot0iic boot0spi boot2 bootiic bootspi
 

Modified: trunk/sys/boot/arm/at91/Makefile.inc
===================================================================
--- trunk/sys/boot/arm/at91/Makefile.inc	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/Makefile.inc	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/sys/boot/arm/at91/Makefile.inc 251250 2013-06-02 11:44:23Z tijl $
 
 .if !target(__at91_boot_Makefile.inc__)
 .PATH:	${.CURDIR}/../../../../libkern ${.CURDIR}/../../../../libkern/arm
@@ -21,7 +22,7 @@
 	-Wmissing-declarations 
 # -Wstrict-prototypes 
 
-CFLAGS+=-DBOOT_${BOOT_FLAVOR:U}
+CFLAGS+=-DBOOT_${BOOT_FLAVOR:tu}
 
 LIBAT91=${.OBJDIR}/../libat91/libat91.a
 

Modified: trunk/sys/boot/arm/at91/boot0/Makefile
===================================================================
--- trunk/sys/boot/arm/at91/boot0/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot0/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
 # $MidnightBSD$
+#  $FreeBSD: stable/10/sys/boot/arm/at91/boot0/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 .PATH:	${.CURDIR}/../libat91
 
@@ -5,7 +6,7 @@
 P=boot0
 FILES=${P}
 SRCS=arm_init.S main.c
-NO_MAN=
+MAN=
 LDFLAGS=-e 0 -T ${.CURDIR}/linker.cfg
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
 

Modified: trunk/sys/boot/arm/at91/boot0/linker.cfg
===================================================================
--- trunk/sys/boot/arm/at91/boot0/linker.cfg	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot0/linker.cfg	2018-06-02 14:12:52 UTC (rev 10213)
@@ -19,6 +19,7 @@
  * END_BLOCK
  *
  * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/boot0/linker.cfg 217663 2011-01-20 22:58:10Z imp $
  ******************************************************************************/
 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
 	      "elf32-littlearm")

Modified: trunk/sys/boot/arm/at91/boot0/main.c
===================================================================
--- trunk/sys/boot/arm/at91/boot0/main.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot0/main.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -22,7 +22,7 @@
  * (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$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/boot0/main.c 157926 2006-04-21 07:45:57Z imp $
  */
 
 #include "at91rm9200.h"

Modified: trunk/sys/boot/arm/at91/boot0iic/Makefile
===================================================================
--- trunk/sys/boot/arm/at91/boot0iic/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot0iic/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
-#  $MidnightBSD$
+# $MidnightBSD$
+#  $FreeBSD: stable/10/sys/boot/arm/at91/boot0iic/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 .PATH:	${.CURDIR}/../libat91
 
@@ -5,7 +6,7 @@
 P=boot0iic
 FILES=${P}
 SRCS=arm_init.S main.c
-NO_MAN=
+MAN=
 LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
 

Modified: trunk/sys/boot/arm/at91/boot0iic/main.c
===================================================================
--- trunk/sys/boot/arm/at91/boot0iic/main.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot0iic/main.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2006 M. Warner Losh.  All rights reserved.
  *
@@ -21,7 +22,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/boot0iic/main.c 164322 2006-11-16 00:49:50Z imp $
  */
 
 #include "at91rm9200.h"

Modified: trunk/sys/boot/arm/at91/boot0spi/Makefile
===================================================================
--- trunk/sys/boot/arm/at91/boot0spi/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot0spi/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
-#  $MidnightBSD$
+# $MidnightBSD$
+#  $FreeBSD: stable/10/sys/boot/arm/at91/boot0spi/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 .PATH:	${.CURDIR}/../libat91
 
@@ -5,7 +6,7 @@
 P=boot0spi
 FILES=${P}
 SRCS=arm_init.S main.c
-NO_MAN=
+MAN=
 LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
 

Modified: trunk/sys/boot/arm/at91/boot0spi/main.c
===================================================================
--- trunk/sys/boot/arm/at91/boot0spi/main.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot0spi/main.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2006 M. Warner Losh.  All rights reserved.
  *
@@ -21,7 +22,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/boot0spi/main.c 238188 2012-07-07 04:55:42Z imp $
  */
 
 #include "at91rm9200.h"
@@ -29,31 +30,26 @@
 #include "at91rm9200_lowlevel.h"
 #include "spi_flash.h"
 
-#define LOADER_OFFSET 0
-#define FPGA_OFFSET  (15 * FLASH_PAGE_SIZE)
-#define OFFSET FPGA_OFFSET
+#define OFFSET 0
 
-int
+void
 main(void)
 {
 	int len, i, j, off, sec;
 	char *addr = (char *)SDRAM_BASE + (1 << 20); /* download at + 1MB */
 	char *addr2 = (char *)SDRAM_BASE + (2 << 20); /* readback to + 2MB */
-	char *addr3 = (char *)SDRAM_BASE + (3 << 20); /* extra copy at + 3MB */
 
 	SPI_InitFlash();
 	printf("Waiting for data\n");
 	while ((len = xmodem_rx(addr)) == -1)
 		continue;
-	// Need extra copy at addr3
-	memcpy(addr3, addr, (len + FLASH_PAGE_SIZE - 1) / FLASH_PAGE_SIZE * FLASH_PAGE_SIZE);
-	printf("Writing %u bytes to flash at %u\n", len, OFFSET);
+	printf("Writing %u bytes at %u\n", len, OFFSET);
 	for (i = 0; i < len; i+= FLASH_PAGE_SIZE) {
+		off = i + OFFSET;
 		for (j = 0; j < 10; j++) {
-			off = i + OFFSET;
 			SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE);
 			SPI_ReadFlash(off, addr2 + i, FLASH_PAGE_SIZE);
-			if (p_memcmp(addr3 + i, addr2 + i, FLASH_PAGE_SIZE) == 0)
+			if (p_memcmp(addr + i, addr2 + i, FLASH_PAGE_SIZE) == 0)
 				break;
 		}
 		if (j >= 10)
@@ -64,5 +60,4 @@
 	    continue;
 	printf("Done\n");
 	reset();
-	return (1);
 }

Modified: trunk/sys/boot/arm/at91/boot2/Makefile
===================================================================
--- trunk/sys/boot/arm/at91/boot2/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot2/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,12 +1,12 @@
 # $MidnightBSD$
-#  $FreeBSD$
+#  $FreeBSD: stable/10/sys/boot/arm/at91/boot2/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 .PATH: ${.CURDIR}/../libat91 ${.CURDIR}/../bootspi
 
 P=boot2
 FILES=${P}
-SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:L}_board.c
-NO_MAN=
+SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c
+MAN=
 LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
 

Modified: trunk/sys/boot/arm/at91/boot2/board.h
===================================================================
--- trunk/sys/boot/arm/at91/boot2/board.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot2/board.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -22,7 +22,7 @@
  * (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$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/boot2/board.h 171426 2007-07-13 14:27:05Z imp $
  */
 
 void Update(void);

Modified: trunk/sys/boot/arm/at91/boot2/boot2.c
===================================================================
--- trunk/sys/boot/arm/at91/boot2/boot2.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot2/boot2.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,7 +1,7 @@
 /* $MidnightBSD$ */
 /*-
  * Copyright (c) 2008 John Hay
- * Copyright (c) 2006 Warner Losh
+ * Copyright (c) 2006 M Warner Losh <imp at freebsd.org>
  * Copyright (c) 1998 Robert Nordier
  * All rights reserved.
  *
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/boot2/boot2.c 295453 2016-02-09 22:32:24Z emaste $");
 
 #include <sys/param.h>
 #include <sys/disklabel.h>
@@ -31,43 +31,10 @@
 
 #include "lib.h"
 #include "board.h"
+#include "paths.h"
+#include "rbx.h"
 
-#define RBX_ASKNAME	0x0	/* -a */
-#define RBX_SINGLE	0x1	/* -s */
-/* 0x2 is reserved for log2(RB_NOSYNC). */
-/* 0x3 is reserved for log2(RB_HALT). */
-/* 0x4 is reserved for log2(RB_INITNAME). */
-#define RBX_DFLTROOT	0x5	/* -r */
-/* #define RBX_KDB 	0x6	   -d */
-/* 0x7 is reserved for log2(RB_RDONLY). */
-/* 0x8 is reserved for log2(RB_DUMP). */
-/* 0x9 is reserved for log2(RB_MINIROOT). */
-#define RBX_CONFIG	0xa	/* -c */
-#define RBX_VERBOSE	0xb	/* -v */
-/* #define RBX_SERIAL	0xc	   -h */
-/* #define RBX_CDROM	0xd	   -C */
-/* 0xe is reserved for log2(RB_POWEROFF). */
-#define RBX_GDB 	0xf	/* -g */
-/* #define RBX_MUTE	0x10	   -m */
-/* 0x11 is reserved for log2(RB_SELFTEST). */
-/* 0x12 is reserved for boot programs. */
-/* 0x13 is reserved for boot programs. */
-/* #define RBX_PAUSE	0x14	   -p */
-/* #define RBX_QUIET	0x15	   -q */
-#define RBX_NOINTR	0x1c	/* -n */
-/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */
-/* #define RBX_DUAL	0x1d	   -D */
-/* 0x1f is reserved for log2(RB_BOOTINFO). */
-
-/* pass: -a, -s, -r, -v, -g */
-#define RBX_MASK	(OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \
-			OPT_SET(RBX_DFLTROOT) | \
-			OPT_SET(RBX_VERBOSE) | \
-			OPT_SET(RBX_GDB))
-
-#define PATH_DOTCONFIG	"/boot.config"
-#define PATH_CONFIG	"/boot/config"
-//#define PATH_KERNEL	"/boot/kernel/kernel"
+#undef PATH_KERNEL
 #define PATH_KERNEL	"/boot/kernel/kernel.gz.tramp"
 
 extern uint32_t _end;
@@ -74,9 +41,6 @@
 
 #define NOPT		6
 
-#define OPT_SET(opt)	(1 << (opt))
-#define OPT_CHECK(opt)	((opts) & OPT_SET(opt))
-
 static const char optstr[NOPT] = "agnrsv";
 static const unsigned char flags[NOPT] = {
 	RBX_ASKNAME,
@@ -87,15 +51,15 @@
 	RBX_VERBOSE
 };
 
+unsigned board_id; /* board type to pass to kernel, if set by board_* code */
 unsigned dsk_start;
 static char cmd[512];
 static char kname[1024];
 static uint32_t opts;
-static int dsk_meta;
+static uint8_t dsk_meta;
 
 static void load(void);
 static int parse(void);
-static int xfsread(ino_t, void *, size_t);
 static int dskread(void *, unsigned, unsigned);
 #ifdef FIXUP_BOOT_DRV
 static void fixup_boot_drv(caddr_t, int, int, int);
@@ -111,7 +75,7 @@
 #endif
 
 static inline int
-xfsread(ino_t inode, void *buf, size_t nbyte)
+xfsread(ufs_ino_t inode, void *buf, size_t nbyte)
 {
 	if ((size_t)fsread(inode, buf, nbyte) != nbyte)
 		return -1;
@@ -154,7 +118,7 @@
 main(void)
 {
 	int autoboot, c = 0;
-	ino_t ino;
+	ufs_ino_t ino;
 
 	dmadat = (void *)(0x20000000 + (16 << 20));
 	board_init();
@@ -199,7 +163,7 @@
 	Elf32_Ehdr eh;
 	static Elf32_Phdr ep[2];
 	caddr_t p;
-	ino_t ino;
+	ufs_ino_t ino;
 	uint32_t addr;
 	int i, j;
 #ifdef FIXUP_BOOT_DRV
@@ -242,7 +206,7 @@
 #ifdef FIXUP_BOOT_DRV
 	fixup_boot_drv(staddr, klen, bootslice, bootpart);
 #endif
-	((void(*)(int))addr)(opts & RBX_MASK);
+	((void(*)(int, int, int, int))addr)(opts & RBX_MASK, board_id, 0, 0);
 }
 
 static int

Modified: trunk/sys/boot/arm/at91/boot2/bwct_board.c
===================================================================
--- trunk/sys/boot/arm/at91/boot2/bwct_board.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot2/bwct_board.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,6 +1,6 @@
 /* $MidnightBSD$ */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/boot2/bwct_board.c 204900 2010-03-09 00:50:58Z ticso $");
 
 #include <sys/param.h>
 

Modified: trunk/sys/boot/arm/at91/boot2/centipad_board.c
===================================================================
--- trunk/sys/boot/arm/at91/boot2/centipad_board.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot2/centipad_board.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/boot2/centipad_board.c 183635 2008-10-05 23:39:28Z imp $");
 
 #include <sys/param.h>
 

Modified: trunk/sys/boot/arm/at91/boot2/kb920x_board.c
===================================================================
--- trunk/sys/boot/arm/at91/boot2/kb920x_board.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/boot2/kb920x_board.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/boot2/kb920x_board.c 183635 2008-10-05 23:39:28Z imp $");
 
 #include <sys/param.h>
 

Modified: trunk/sys/boot/arm/at91/bootiic/Makefile
===================================================================
--- trunk/sys/boot/arm/at91/bootiic/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootiic/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
 # $MidnightBSD$
+#  $FreeBSD: stable/10/sys/boot/arm/at91/bootiic/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 .PATH:	${.CURDIR}/../libat91
 
@@ -5,7 +6,7 @@
 P=bootiic
 FILES=${P}
 SRCS=arm_init.S main.c loader_prompt.c env_vars.c
-NO_MAN=
+MAN=
 LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
 

Modified: trunk/sys/boot/arm/at91/bootiic/README
===================================================================
--- trunk/sys/boot/arm/at91/bootiic/README	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootiic/README	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
 $MidnightBSD$
+$FreeBSD: stable/10/sys/boot/arm/at91/bootiic/README 157873 2006-04-19 17:16:49Z imp $
 
 This image is intended to be programmed into boot EEPROM.  The image is nearly
 0x4000 so it will not fit in KB9200's 0x2000.  It is intended for KB9201 or

Modified: trunk/sys/boot/arm/at91/bootiic/env_vars.c
===================================================================
--- trunk/sys/boot/arm/at91/bootiic/env_vars.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootiic/env_vars.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootiic/env_vars.c 163596 2006-10-21 22:43:39Z imp $
  *****************************************************************************/
 
 #include "env_vars.h"

Modified: trunk/sys/boot/arm/at91/bootiic/env_vars.h
===================================================================
--- trunk/sys/boot/arm/at91/bootiic/env_vars.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootiic/env_vars.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootiic/env_vars.h 161202 2006-08-10 19:55:52Z imp $
  *****************************************************************************/
 
 #ifndef _ENV_VARS_H_

Modified: trunk/sys/boot/arm/at91/bootiic/loader_prompt.c
===================================================================
--- trunk/sys/boot/arm/at91/bootiic/loader_prompt.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootiic/loader_prompt.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -20,7 +20,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootiic/loader_prompt.c 163596 2006-10-21 22:43:39Z imp $
  *****************************************************************************/
 
 #include "at91rm9200_lowlevel.h"

Modified: trunk/sys/boot/arm/at91/bootiic/loader_prompt.h
===================================================================
--- trunk/sys/boot/arm/at91/bootiic/loader_prompt.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootiic/loader_prompt.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootiic/loader_prompt.h 161202 2006-08-10 19:55:52Z imp $
  *****************************************************************************/
 
 #ifndef _LOADER_PROMPT_H_

Modified: trunk/sys/boot/arm/at91/bootiic/main.c
===================================================================
--- trunk/sys/boot/arm/at91/bootiic/main.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootiic/main.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -20,7 +20,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootiic/main.c 161202 2006-08-10 19:55:52Z imp $
  ******************************************************************************/
 
 #include "env_vars.h"

Modified: trunk/sys/boot/arm/at91/bootspi/Makefile
===================================================================
--- trunk/sys/boot/arm/at91/bootspi/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootspi/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,5 +1,5 @@
 # $MidnightBSD$
-#  $FreeBSD$
+#  $FreeBSD: stable/10/sys/boot/arm/at91/bootspi/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 .PATH:	${.CURDIR}/../libat91
 
@@ -6,7 +6,7 @@
 P=bootspi
 FILES=${P}
 SRCS=arm_init.S main.c loader_prompt.c env_vars.c ee.c
-NO_MAN=
+MAN=
 LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg
 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
 

Modified: trunk/sys/boot/arm/at91/bootspi/ee.c
===================================================================
--- trunk/sys/boot/arm/at91/bootspi/ee.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootspi/ee.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -19,7 +19,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootspi/ee.c 238463 2012-07-15 05:35:14Z imp $
  *****************************************************************************/
 
 #include "at91rm9200_lowlevel.h"
@@ -60,11 +60,11 @@
 	AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA;
 	AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC;
 
-	pPio->PIO_ASR = AT91C_PA25_TWD | AT91C_PA26_TWCK;
-	pPio->PIO_PDR = AT91C_PA25_TWD | AT91C_PA26_TWCK;
+	pPio->PIO_ASR = AT91C_PIO_PA25 | AT91C_PIO_PA26;
+	pPio->PIO_PDR = AT91C_PIO_PA25 | AT91C_PIO_PA26;
 
-	pPio->PIO_MDDR = ~AT91C_PA25_TWD;
-	pPio->PIO_MDER = AT91C_PA25_TWD;
+	pPio->PIO_MDDR = ~AT91C_PIO_PA25;
+	pPio->PIO_MDER = AT91C_PIO_PA25;
 
 	pPMC->PMC_PCER = 1u << AT91C_ID_TWI;
 

Modified: trunk/sys/boot/arm/at91/bootspi/ee.h
===================================================================
--- trunk/sys/boot/arm/at91/bootspi/ee.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootspi/ee.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,5 +1,5 @@
 /* $MidnightBSD$ */
-/* $FreeBSD$ */
+/* $FreeBSD: stable/10/sys/boot/arm/at91/bootspi/ee.h 163598 2006-10-21 22:51:21Z imp $ */
 
 void EEInit(void);
 void EERead(unsigned ee_off, char *data_addr, unsigned size);

Modified: trunk/sys/boot/arm/at91/bootspi/env_vars.c
===================================================================
--- trunk/sys/boot/arm/at91/bootspi/env_vars.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootspi/env_vars.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootspi/env_vars.c 163597 2006-10-21 22:44:26Z imp $
  *****************************************************************************/
 
 #include "env_vars.h"

Modified: trunk/sys/boot/arm/at91/bootspi/env_vars.h
===================================================================
--- trunk/sys/boot/arm/at91/bootspi/env_vars.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootspi/env_vars.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootspi/env_vars.h 161370 2006-08-16 23:39:58Z imp $
  *****************************************************************************/
 
 #ifndef _ENV_VARS_H_

Modified: trunk/sys/boot/arm/at91/bootspi/loader_prompt.c
===================================================================
--- trunk/sys/boot/arm/at91/bootspi/loader_prompt.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootspi/loader_prompt.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -20,7 +20,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootspi/loader_prompt.c 167586 2007-03-15 03:31:49Z imp $
  *****************************************************************************/
 
 #include "at91rm9200_lowlevel.h"

Modified: trunk/sys/boot/arm/at91/bootspi/loader_prompt.h
===================================================================
--- trunk/sys/boot/arm/at91/bootspi/loader_prompt.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootspi/loader_prompt.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootspi/loader_prompt.h 161370 2006-08-16 23:39:58Z imp $
  *****************************************************************************/
 
 #ifndef _LOADER_PROMPT_H_

Modified: trunk/sys/boot/arm/at91/bootspi/main.c
===================================================================
--- trunk/sys/boot/arm/at91/bootspi/main.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/bootspi/main.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -32,7 +32,7 @@
  * owners.  This software is not copyrighted and is intended for reference
  * only.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/bootspi/main.c 163597 2006-10-21 22:44:26Z imp $
  */
 
 #include "env_vars.h"

Modified: trunk/sys/boot/arm/at91/libat91/Makefile
===================================================================
--- trunk/sys/boot/arm/at91/libat91/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,16 +1,18 @@
 # $MidnightBSD$
-#  $FreeBSD$
+#  $FreeBSD: stable/10/sys/boot/arm/at91/libat91/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 .include "${.CURDIR}/../Makefile.inc"
 
+SOC?=at91rm9200
+
 LIB=		at91
 INTERNALLIB=
-SRCS=at91rm9200_lowlevel.c delay.c eeprom.c emac.c emac_init.c getc.c \
+SRCS=${SOC}_lowlevel.c delay.c eeprom.c emac.c emac_init.c getc.c \
 	putchar.c printf.c reset.c spi_flash.c xmodem.c \
 	sd-card.c strcvt.c strlen.c strcmp.c memcpy.c strcpy.c \
 	memset.c memcmp.c
 SRCS+=ashldi3.c divsi3.S
-NO_MAN=
+MAN=
 
 .if ${MK_TAG_LIST} != "no"
 CFLAGS += -I${.CURDIR}/.. -DSUPPORT_TAG_LIST

Modified: trunk/sys/boot/arm/at91/libat91/arm_init.S
===================================================================
--- trunk/sys/boot/arm/at91/libat91/arm_init.S	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/arm_init.S	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*******************************************************************************
  *
  * Filename: arm_init.s
@@ -20,7 +21,7 @@
  * only.
  * END_BLOCK
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/arm_init.S 165397 2006-12-20 18:16:49Z imp $
  ******************************************************************************/
 
 	.equ	TWI_EEPROM_SIZE,	0x3000

Modified: trunk/sys/boot/arm/at91/libat91/at91rm9200.h
===================================================================
--- trunk/sys/boot/arm/at91/libat91/at91rm9200.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/at91rm9200.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -8,7 +8,7 @@
 //  fitness for any particular purpose, or against the infringements of
 //  intellectual property rights of others.
 // ----------------------------------------------------------------------------
-// $FreeBSD$
+// $FreeBSD: stable/10/sys/boot/arm/at91/libat91/at91rm9200.h 238463 2012-07-15 05:35:14Z imp $
 //
 // File Name           : AT91RM9200.h
 // Object              : AT91RM9200 definitions
@@ -42,6 +42,8 @@
 #ifndef AT91RM9200_H
 #define	AT91RM9200_H
 
+#define ATMEL_ENV
+
 typedef volatile unsigned int AT91_REG;// Hardware register definition
 
 // *****************************************************************************
@@ -2310,7 +2312,7 @@
 // ========== Register definition for BFC peripheral ========== 
 #define	AT91C_BFC_MR    ((AT91_REG *) 	0xFFFFFFC0) // (BFC) BFC Mode Register
 
-#include <at91/at91_pio_rm9200.h>
+#include <at91/at91_pioreg.h>
 
 // *****************************************************************************
 //               PERIPHERAL ID DEFINITIONS FOR AT91RM9200

Modified: trunk/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  * This software is derived from software provide by Kwikbyte who specifically
  * disclaimed copyright on the code.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c 238463 2012-07-15 05:35:14Z imp $
  */
 
 #include "at91rm9200.h"
@@ -189,8 +189,8 @@
 	AT91C_BASE_PIOC->PIO_PDR = 0xffff0000;
 #endif
 	// Configure DBGU -use local routine optimized for space
-	AT91C_BASE_PIOA->PIO_ASR = AT91C_PA31_DTXD | AT91C_PA30_DRXD;
-	AT91C_BASE_PIOA->PIO_PDR = AT91C_PA31_DTXD | AT91C_PA30_DRXD;
+	AT91C_BASE_PIOA->PIO_ASR = AT91C_PIO_PA31 | AT91C_PIO_PA30;
+	AT91C_BASE_PIOA->PIO_PDR = AT91C_PIO_PA31 | AT91C_PIO_PA30;
 	pUSART->US_IDR = (unsigned int) -1;
 	pUSART->US_CR =
 	    AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS;

Modified: trunk/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h
===================================================================
--- trunk/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -22,7 +22,7 @@
  * (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$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h 171426 2007-07-13 14:27:05Z imp $
  */
 
 #ifndef _AT91RM9200_LOWLEVEL_H_

Modified: trunk/sys/boot/arm/at91/libat91/delay.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/delay.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/delay.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  * This software is derived from software provide by Kwikbyte who specifically
  * disclaimed copyright on the code.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/delay.c 161370 2006-08-16 23:39:58Z imp $
  */
 
 #include "at91rm9200.h"

Modified: trunk/sys/boot/arm/at91/libat91/eeprom.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/eeprom.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/eeprom.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -19,7 +19,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/eeprom.c 238463 2012-07-15 05:35:14Z imp $
  *****************************************************************************/
 
 #include "at91rm9200_lowlevel.h"
@@ -59,11 +59,11 @@
 	AT91PS_PIO pPio = (AT91PS_PIO)AT91C_BASE_PIOA;
 	AT91PS_PMC pPMC = (AT91PS_PMC)AT91C_BASE_PMC;
 
-	pPio->PIO_ASR = AT91C_PA25_TWD | AT91C_PA26_TWCK;
-	pPio->PIO_PDR = AT91C_PA25_TWD | AT91C_PA26_TWCK;
+	pPio->PIO_ASR = AT91C_PIO_PA25 | AT91C_PIO_PA26;
+	pPio->PIO_PDR = AT91C_PIO_PA25 | AT91C_PIO_PA26;
 
-	pPio->PIO_MDDR = ~AT91C_PA25_TWD;
-	pPio->PIO_MDER = AT91C_PA25_TWD;
+	pPio->PIO_MDDR = ~AT91C_PIO_PA25;
+	pPio->PIO_MDER = AT91C_PIO_PA25;
 
 	pPMC->PMC_PCER = 1u << AT91C_ID_TWI;
 

Modified: trunk/sys/boot/arm/at91/libat91/emac.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/emac.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/emac.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -20,7 +20,7 @@
  * only.
  * END_BLOCK
  * 
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/emac.c 172991 2007-10-25 22:50:25Z cognet $
  ******************************************************************************/
 
 #include "at91rm9200.h"

Modified: trunk/sys/boot/arm/at91/libat91/emac.h
===================================================================
--- trunk/sys/boot/arm/at91/libat91/emac.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/emac.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/emac.h 171426 2007-07-13 14:27:05Z imp $
  *****************************************************************************/
 
 

Modified: trunk/sys/boot/arm/at91/libat91/emac_init.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/emac_init.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/emac_init.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  * This software is derived from software provide by Kwikbyte who specifically
  * disclaimed copyright on the code.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/emac_init.c 238463 2012-07-15 05:35:14Z imp $
  */
 
 /******************************************************************************
@@ -86,24 +86,24 @@
 
 	AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_EMAC;
 	AT91C_BASE_PIOA->PIO_ASR = 
-	  AT91C_PA14_ERXER | AT91C_PA12_ERX0 | AT91C_PA13_ERX1 |
-	  AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 |
-	  AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC |
-	  AT91C_PA7_ETXCK_EREFCK;
+	  AT91C_PIO_PA14 | AT91C_PIO_PA12 | AT91C_PIO_PA13 |
+	  AT91C_PIO_PA8 | AT91C_PIO_PA16 | AT91C_PIO_PA9 |
+	  AT91C_PIO_PA10 | AT91C_PIO_PA11 | AT91C_PIO_PA15 |
+	  AT91C_PIO_PA7;
 	AT91C_BASE_PIOA->PIO_PDR = 
-	  AT91C_PA14_ERXER | AT91C_PA12_ERX0 | AT91C_PA13_ERX1 |
-	  AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 |
-	  AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC |
-	  AT91C_PA7_ETXCK_EREFCK;
+	  AT91C_PIO_PA14 | AT91C_PIO_PA12 | AT91C_PIO_PA13 |
+	  AT91C_PIO_PA8 | AT91C_PIO_PA16 | AT91C_PIO_PA9 |
+	  AT91C_PIO_PA10 | AT91C_PIO_PA11 | AT91C_PIO_PA15 |
+	  AT91C_PIO_PA7;
 #if defined(BOOT_KB920X) | defined(BOOT_BWCT)	/* Really !RMII */
 	AT91C_BASE_PIOB->PIO_BSR =
-	  AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER |
-	  AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV |
-	  AT91C_PB18_ECOL | AT91C_PB19_ERXCK;
+	  AT91C_PIO_PB12 | AT91C_PIO_PB13 | AT91C_PIO_PB14 |
+	  AT91C_PIO_PB15 | AT91C_PIO_PB16 | AT91C_PIO_PB17 |
+	  AT91C_PIO_PB18 | AT91C_PIO_PB19;
 	AT91C_BASE_PIOB->PIO_PDR =
-	  AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER |
-	  AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV |
-	  AT91C_PB18_ECOL | AT91C_PB19_ERXCK;
+	  AT91C_PIO_PB12 | AT91C_PIO_PB13 | AT91C_PIO_PB14 |
+	  AT91C_PIO_PB15 | AT91C_PIO_PB16 | AT91C_PIO_PB17 |
+	  AT91C_PIO_PB18 | AT91C_PIO_PB19;
 #endif
 	pEmac->EMAC_CTL  = 0;
 

Modified: trunk/sys/boot/arm/at91/libat91/getc.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/getc.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/getc.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -32,7 +32,7 @@
  * owners.  This software is not copyrighted and is intended for reference
  * only.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/getc.c 168013 2007-03-28 22:40:37Z imp $
  */
 
 #include "at91rm9200.h"

Modified: trunk/sys/boot/arm/at91/libat91/lib.h
===================================================================
--- trunk/sys/boot/arm/at91/libat91/lib.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/lib.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -22,7 +22,7 @@
  * (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$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/lib.h 172991 2007-10-25 22:50:25Z cognet $
  */
 
 #ifndef ARM_BOOT_LIB_H

Modified: trunk/sys/boot/arm/at91/libat91/lib_AT91RM9200.h
===================================================================
--- trunk/sys/boot/arm/at91/libat91/lib_AT91RM9200.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/lib_AT91RM9200.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  * This software is derived from software provide by Kwikbyte who specifically
  * disclaimed copyright on the code.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/lib_AT91RM9200.h 238463 2012-07-15 05:35:14Z imp $
  */
 
 #ifndef __LIBAT91RM9200_H
@@ -135,17 +135,17 @@
 	// Configure PIO controllers to periph mode
 	AT91F_PIO_CfgPeriph(
 		AT91C_BASE_PIOA, // PIO controller base address
-		((unsigned int) AT91C_PA28_MCCDA   ) |
-		((unsigned int) AT91C_PA29_MCDA0   ) |
-		((unsigned int) AT91C_PA27_MCCK    ), // Peripheral A
+		((unsigned int) AT91C_PIO_PA28   ) |
+		((unsigned int) AT91C_PIO_PA29   ) |
+		((unsigned int) AT91C_PIO_PA27    ), // Peripheral A
 		0); // Peripheral B
 	// Configure PIO controllers to periph mode
 	AT91F_PIO_CfgPeriph(
 		AT91C_BASE_PIOB, // PIO controller base address
 		0, // Peripheral A
-		((unsigned int) AT91C_PB5_MCDA3   ) |
-		((unsigned int) AT91C_PB3_MCDA1   ) |
-		((unsigned int) AT91C_PB4_MCDA2   )); // Peripheral B
+		((unsigned int) AT91C_PIO_PB5   ) |
+		((unsigned int) AT91C_PIO_PB3   ) |
+		((unsigned int) AT91C_PIO_PB4   )); // Peripheral B
 }
 
 

Modified: trunk/sys/boot/arm/at91/libat91/mci_device.h
===================================================================
--- trunk/sys/boot/arm/at91/libat91/mci_device.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/mci_device.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  * This software is derived from software provide by Kwikbyte who specifically
  * disclaimed copyright on the code.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/mci_device.h 261455 2014-02-04 03:36:42Z eadler $
  */
 
 //*---------------------------------------------------------------------------
@@ -307,7 +307,7 @@
 #define AT91C_VDD_33_34					(1 << 21)
 #define AT91C_VDD_34_35					(1 << 22)
 #define AT91C_VDD_35_36					(1 << 23)
-#define AT91C_CARD_POWER_UP_BUSY		(1 << 31)
+#define AT91C_CARD_POWER_UP_BUSY		(1U << 31)
 
 #define AT91C_MMC_HOST_VOLTAGE_RANGE	(AT91C_VDD_27_28 | AT91C_VDD_28_29  | \
     AT91C_VDD_29_30 | AT91C_VDD_30_31 | AT91C_VDD_31_32 | AT91C_VDD_32_33)

Modified: trunk/sys/boot/arm/at91/libat91/memcmp.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/memcmp.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/memcmp.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/libat91/memcmp.c 168006 2007-03-28 21:15:50Z imp $");
 
 #include "lib.h"
 

Modified: trunk/sys/boot/arm/at91/libat91/memcpy.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/memcpy.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/memcpy.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/libat91/memcpy.c 164137 2006-11-09 20:32:36Z imp $");
 
 #include "lib.h"
 

Modified: trunk/sys/boot/arm/at91/libat91/memset.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/memset.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/memset.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/libat91/memset.c 164137 2006-11-09 20:32:36Z imp $");
 
 #include "lib.h"
 

Modified: trunk/sys/boot/arm/at91/libat91/p_string.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/p_string.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/p_string.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -21,7 +21,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/p_string.c 163533 2006-10-20 09:12:05Z imp $
  *****************************************************************************/
 
 #include "lib.h"

Modified: trunk/sys/boot/arm/at91/libat91/printf.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/printf.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/printf.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -15,7 +15,7 @@
  * warranties of merchantability and fitness for a particular
  * purpose.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/printf.c 163533 2006-10-20 09:12:05Z imp $
  */
 
 #include <stdarg.h>

Modified: trunk/sys/boot/arm/at91/libat91/putchar.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/putchar.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/putchar.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -32,7 +32,7 @@
  * owners.  This software is not copyrighted and is intended for reference
  * only.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/putchar.c 163533 2006-10-20 09:12:05Z imp $
  */
 
 #include "at91rm9200.h"

Modified: trunk/sys/boot/arm/at91/libat91/reset.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/reset.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/reset.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -22,7 +22,7 @@
  * (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$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/reset.c 161370 2006-08-16 23:39:58Z imp $
  */
 
 #include "at91rm9200.h"

Modified: trunk/sys/boot/arm/at91/libat91/sd-card.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/sd-card.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/sd-card.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  * This software is derived from software provide by Kwikbyte who specifically
  * disclaimed copyright on the code.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/sd-card.c 228471 2011-12-13 14:06:01Z ed $
  */
 
 //*----------------------------------------------------------------------------
@@ -95,7 +95,7 @@
 	}	// End of if AT91C_MCI_RXBUFF
 }
 
-inline static unsigned int
+static inline unsigned int
 swap(unsigned int a)
 {
     return (((a & 0xff) << 24) | ((a & 0xff00) << 8) | ((a & 0xff0000) >> 8)
@@ -102,7 +102,7 @@
       | ((a & 0xff000000) >> 24));
 }
 
-inline static void
+static inline void
 wait_ready()
 {
 	int status;

Modified: trunk/sys/boot/arm/at91/libat91/sd-card.h
===================================================================
--- trunk/sys/boot/arm/at91/libat91/sd-card.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/sd-card.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  * This software is derived from software provide by Kwikbyte who specifically
  * disclaimed copyright on the code.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/sd-card.h 161370 2006-08-16 23:39:58Z imp $
  */
 
 #ifndef __SD_CARD_H

Modified: trunk/sys/boot/arm/at91/libat91/spi_flash.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/spi_flash.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/spi_flash.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -20,7 +20,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/spi_flash.c 238463 2012-07-15 05:35:14Z imp $
  *****************************************************************************/
 
 #include "at91rm9200.h"
@@ -224,10 +224,10 @@
 
 	// enable CS0, CLK, MOSI, MISO
 	pPio = (AT91PS_PIO)AT91C_BASE_PIOA;
-	pPio->PIO_ASR = AT91C_PA3_NPCS0 | AT91C_PA1_MOSI | AT91C_PA0_MISO |
-	    AT91C_PA2_SPCK;
-	pPio->PIO_PDR = AT91C_PA3_NPCS0 | AT91C_PA1_MOSI | AT91C_PA0_MISO |
-	    AT91C_PA2_SPCK;
+	pPio->PIO_ASR = AT91C_PIO_PA3 | AT91C_PIO_PA1 | AT91C_PIO_PA0 |
+	    AT91C_PIO_PA2;
+	pPio->PIO_PDR = AT91C_PIO_PA3 | AT91C_PIO_PA1 | AT91C_PIO_PA0 |
+	    AT91C_PIO_PA2;
 
 	// enable clocks to SPI
 	AT91C_BASE_PMC->PMC_PCER = 1u << AT91C_ID_SPI;

Modified: trunk/sys/boot/arm/at91/libat91/spi_flash.h
===================================================================
--- trunk/sys/boot/arm/at91/libat91/spi_flash.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/spi_flash.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/spi_flash.h 165400 2006-12-20 18:25:16Z imp $
  ******************************************************************************/
 
 #ifndef _SPI_FLASH_H_

Modified: trunk/sys/boot/arm/at91/libat91/strcmp.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/strcmp.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/strcmp.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/libat91/strcmp.c 164137 2006-11-09 20:32:36Z imp $");
 
 #include "lib.h"
 

Modified: trunk/sys/boot/arm/at91/libat91/strcpy.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/strcpy.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/strcpy.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/libat91/strcpy.c 164137 2006-11-09 20:32:36Z imp $");
 
 #include "lib.h"
 

Modified: trunk/sys/boot/arm/at91/libat91/strcvt.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/strcvt.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/strcvt.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/libat91/strcvt.c 164137 2006-11-09 20:32:36Z imp $");
 
 /******************************************************************************
  *

Modified: trunk/sys/boot/arm/at91/libat91/strlen.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/strlen.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/strlen.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/at91/libat91/strlen.c 168005 2007-03-28 21:12:43Z imp $");
 
 /******************************************************************************
  *

Modified: trunk/sys/boot/arm/at91/libat91/tag_list.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/tag_list.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/tag_list.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/tag_list.c 157921 2006-04-21 07:19:22Z imp $
  *****************************************************************************/
 
 /******************************* GLOBALS *************************************/

Modified: trunk/sys/boot/arm/at91/libat91/tag_list.h
===================================================================
--- trunk/sys/boot/arm/at91/libat91/tag_list.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/tag_list.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -18,7 +18,7 @@
  * only.
  * END_BLOCK
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/tag_list.h 157918 2006-04-21 07:12:12Z imp $
  ****************************************************************************/
 
 #ifndef _TAG_LIST_H_

Modified: trunk/sys/boot/arm/at91/libat91/xmodem.c
===================================================================
--- trunk/sys/boot/arm/at91/libat91/xmodem.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/libat91/xmodem.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -26,7 +26,7 @@
  * disclaimed copyright on the code.  This version of xmodem has been nearly
  * completely rewritten, but the CRC is from the original.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/libat91/xmodem.c 161190 2006-08-10 17:54:51Z imp $
  */
 
 #include "lib.h"

Modified: trunk/sys/boot/arm/at91/linker.cfg
===================================================================
--- trunk/sys/boot/arm/at91/linker.cfg	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/at91/linker.cfg	2018-06-02 14:12:52 UTC (rev 10213)
@@ -19,6 +19,7 @@
  * END_BLOCK
  *
  * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/at91/linker.cfg 238186 2012-07-07 04:49:53Z imp $
  ******************************************************************************/
 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
 	      "elf32-littlearm")
@@ -31,220 +32,22 @@
   .text      :
   {
     *(.text)
-    *(.text.*)
-    *(.stub)
-    /* .gnu.warning sections are handled specially by elf32.em.  */
-    *(.gnu.warning)
-    *(.gnu.linkonce.t.*)
-    *(.glue_7t) *(.glue_7)
   }
-  .interp     : { *(.interp) 	}
-  .hash          : { *(.hash)		}
-  .dynsym        : { *(.dynsym)		}
-  .dynstr        : { *(.dynstr)		}
-  .gnu.version   : { *(.gnu.version)	}
-  .gnu.version_d   : { *(.gnu.version_d)	}
-  .gnu.version_r   : { *(.gnu.version_r)	}
-  .rel.init      : { *(.rel.init)	}
-  .rela.init     : { *(.rela.init)	}
-  .rel.text      :
-    {
-      *(.rel.text)
-      *(.rel.text.*)
-      *(.rel.gnu.linkonce.t.*)
-    }
-  .rela.text     :
-    {
-      *(.rela.text)
-      *(.rela.text.*)
-      *(.rela.gnu.linkonce.t.*)
-    }
-  .rel.fini      : { *(.rel.fini)	}
-  .rela.fini     : { *(.rela.fini)	}
-  .rel.rodata    :
-    {
-      *(.rel.rodata)
-      *(.rel.rodata.*)
-      *(.rel.gnu.linkonce.r.*)
-    }
-  .rela.rodata   :
-    {
-      *(.rela.rodata)
-      *(.rela.rodata.*)
-      *(.rela.gnu.linkonce.r.*)
-    }
-  .rel.data      :
-    {
-      *(.rel.data)
-      *(.rel.data.*)
-      *(.rel.gnu.linkonce.d.*)
-    }
-  .rela.data     :
-    {
-      *(.rela.data)
-      *(.rela.data.*)
-      *(.rela.gnu.linkonce.d.*)
-    }
-  .rel.ctors     : { *(.rel.ctors)	}
-  .rela.ctors    : { *(.rela.ctors)	}
-  .rel.dtors     : { *(.rel.dtors)	}
-  .rela.dtors    : { *(.rela.dtors)	}
-  .rel.got       : { *(.rel.got)		}
-  .rela.got      : { *(.rela.got)		}
-  .rel.sdata     :
-    {
-      *(.rel.sdata)
-      *(.rel.sdata.*)
-      *(.rel.gnu.linkonce.s.*)
-    }
-  .rela.sdata     :
-    {
-      *(.rela.sdata)
-      *(.rela.sdata.*)
-      *(.rela.gnu.linkonce.s.*)
-    }
-  .rel.sbss      :
-    { 
-      *(.rel.sbss)
-      *(.rel.sbss.*)
-      *(.rel.gnu.linkonce.sb.*)
-    }
-  .rela.sbss     :
-    {
-      *(.rela.sbss)
-      *(.rela.sbss.*)
-      *(.rel.gnu.linkonce.sb.*)
-    }
-  .rel.sdata2    : 
-    { 
-      *(.rel.sdata2)
-      *(.rel.sdata2.*)
-      *(.rel.gnu.linkonce.s2.*)
-    }
-  .rela.sdata2   : 
-    {
-      *(.rela.sdata2)
-      *(.rela.sdata2.*)
-      *(.rela.gnu.linkonce.s2.*)
-    }
-  .rel.sbss2     : 
-    { 
-      *(.rel.sbss2)	
-      *(.rel.sbss2.*)
-      *(.rel.gnu.linkonce.sb2.*)
-    }
-  .rela.sbss2    : 
-    { 
-      *(.rela.sbss2)	
-      *(.rela.sbss2.*)
-      *(.rela.gnu.linkonce.sb2.*)
-    }
-  .rel.bss       : 
-    { 
-      *(.rel.bss)
-      *(.rel.bss.*)
-      *(.rel.gnu.linkonce.b.*)
-    }
-  .rela.bss      : 
-    { 
-      *(.rela.bss)
-      *(.rela.bss.*)
-      *(.rela.gnu.linkonce.b.*)
-    }
-  .rel.plt       : { *(.rel.plt)		}
-  .rela.plt      : { *(.rela.plt)		}
-  .init          : 
-  { 
-    KEEP (*(.init))
-  } =0
-  .plt      : { *(.plt)	}
-  .fini      :
-  {
-    KEEP (*(.fini))
-  } =0
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
-  .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) }
-  .rodata1   : { *(.rodata1) }
-  .sdata2   : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }
-  .sbss2   : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }
   .data    :
   {
     __data_start = . ;
     *(.data)
-    *(.data.*)
-    *(.gnu.linkonce.d.*)
-    SORT(CONSTRUCTORS)
   }
-  .data1   : { *(.data1) }
-  . = 0x21200000;
-  .eh_frame : { KEEP (*(.eh_frame)) }
-  .gcc_except_table : { *(.gcc_except_table) }
-  .ctors   : 
-  {
-    /* gcc uses crtbegin.o to find the start of
-       the constructors, so we make sure it is
-       first.  Because this is a wildcard, it
-       doesn't matter if the user does not
-       actually link against crtbegin.o; the
-       linker won't look for a file to match a
-       wildcard.  The wildcard also means that it
-       doesn't matter which directory crtbegin.o
-       is in.  */
-    KEEP (*crtbegin.o(.ctors))
-    /* We don't want to include the .ctor section from
-       from the crtend.o file until after the sorted ctors.
-       The .ctor section from the crtend file contains the
-       end of ctors marker and it must be last */
-    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
-    KEEP (*(SORT(.ctors.*)))
-    KEEP (*(.ctors))
-  }
-   .dtors         :
-  {
-    KEEP (*crtbegin.o(.dtors))
-    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
-    KEEP (*(SORT(.dtors.*)))
-    KEEP (*(.dtors))
-  }
-  .got		  : { *(.got.plt) *(.got) }
-  .dynamic       : { *(.dynamic) }
-  /* We want the small data sections together, so single-instruction offsets
-     can access them all, and initialized data all before uninitialized, so
-     we can shorten the on-disk segment size.  */
-  .sdata     : 
-  {
-    *(.sdata) 
-    *(.sdata.*)
-    *(.gnu.linkonce.s.*)
-  }
   _edata = .;
   PROVIDE (edata = .);
   __bss_start = .;
   __bss_start__ = .;
-  .sbss      :
-  {
-    PROVIDE (__sbss_start = .);
-    PROVIDE (___sbss_start = .);
-    *(.dynsbss)
-    *(.sbss)
-    *(.sbss.*)
-    *(.gnu.linkonce.sb.*)
-    *(.scommon)
-    PROVIDE (__sbss_end = .);
-    PROVIDE (___sbss_end = .);
-  }
   .bss       :
   {
-   *(.dynbss)
    *(.bss)
-   *(.bss.*)
-   *(.gnu.linkonce.b.*)
-   *(COMMON)
-   /* Align here to ensure that the .bss section occupies space up to
-      _end.  Align after .bss to ensure correct alignment even if the
-      .bss section disappears because there are no input sections.  */
    . = ALIGN(32 / 8);
   }
   . = ALIGN(32 / 8);
@@ -251,38 +54,4 @@
   _end = .;
   _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
   PROVIDE (end = .);
-  /* Stabs debugging sections.  */
-  .stab 0 : { *(.stab) }
-  .stabstr 0 : { *(.stabstr) }
-  .stab.excl 0 : { *(.stab.excl) }
-  .stab.exclstr 0 : { *(.stab.exclstr) }
-  .stab.index 0 : { *(.stab.index) }
-  .stab.indexstr 0 : { *(.stab.indexstr) }
-  .comment 0 : { *(.comment) }
-  /* DWARF debug sections.
-     Symbols in the DWARF debugging sections are relative to the beginning
-     of the section so we begin them at 0.  */
-  /* DWARF 1 */
-  .debug          0 : { *(.debug) }
-  .line           0 : { *(.line) }
-  /* GNU DWARF 1 extensions */
-  .debug_srcinfo  0 : { *(.debug_srcinfo) }
-  .debug_sfnames  0 : { *(.debug_sfnames) }
-  /* DWARF 1.1 and DWARF 2 */
-  .debug_aranges  0 : { *(.debug_aranges) }
-  .debug_pubnames 0 : { *(.debug_pubnames) }
-  /* DWARF 2 */
-  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
-  .debug_abbrev   0 : { *(.debug_abbrev) }
-  .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
-  .debug_str      0 : { *(.debug_str) }
-  .debug_loc      0 : { *(.debug_loc) }
-  .debug_macinfo  0 : { *(.debug_macinfo) }
-  /* SGI/MIPS DWARF 2 extensions */
-  .debug_weaknames 0 : { *(.debug_weaknames) }
-  .debug_funcnames 0 : { *(.debug_funcnames) }
-  .debug_typenames 0 : { *(.debug_typenames) }
-  .debug_varnames  0 : { *(.debug_varnames) }
-  /* These must appear regardless of  .  */
 }

Modified: trunk/sys/boot/arm/ixp425/Makefile.inc
===================================================================
--- trunk/sys/boot/arm/ixp425/Makefile.inc	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/ixp425/Makefile.inc	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/sys/boot/arm/ixp425/Makefile.inc 251250 2013-06-02 11:44:23Z tijl $
 
 .if !target(__ixp425_boot_Makefile.inc__)
 .PATH:	${.CURDIR}/../../../../libkern ${.CURDIR}/../../../../libkern/arm
@@ -21,7 +22,7 @@
 
 # -Wstrict-prototypes 
 
-CFLAGS+=-DBOOT_${BOOT_FLAVOR:U}
+CFLAGS+=-DBOOT_${BOOT_FLAVOR:tu}
 
 LD ?= ld
 OBJCOPY ?= objcopy

Modified: trunk/sys/boot/arm/ixp425/boot2/Makefile
===================================================================
--- trunk/sys/boot/arm/ixp425/boot2/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/ixp425/boot2/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,5 +1,8 @@
-#  $MidnightBSD$
+# $MidnightBSD$
+#  $FreeBSD: stable/10/sys/boot/arm/ixp425/boot2/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
+.include <bsd.own.mk>
+
 # We get a lot of the std lib functions from here.
 .PATH: ${.CURDIR}/../../at91/libat91
 
@@ -12,10 +15,13 @@
 
 P=boot2
 FILES=${P}
-SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:L}_board.c
+SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c
 SRCS+=memchr.c memcmp.c memcpy.c memmem.c memset.c printf.c strcmp.c strcpy.c
 SRCS+=strlen.c ashldi3.c divsi3.S muldi3.c
-NO_MAN=
+.if ${MK_ARM_EABI} != "no"
+SRCS+=aeabi_unwind.c
+.endif
+MAN=
 
 KERNPHYSADDR=0x180000
 KERNVIRTADDR=${KERNPHYSADDR}

Modified: trunk/sys/boot/arm/ixp425/boot2/arm_init.S
===================================================================
--- trunk/sys/boot/arm/ixp425/boot2/arm_init.S	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/ixp425/boot2/arm_init.S	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2008 John Hay.  All rights reserved.
  *
@@ -21,7 +22,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/ixp425/boot2/arm_init.S 186352 2008-12-20 03:26:09Z sam $
  */
 
 #include <machine/asm.h>

Modified: trunk/sys/boot/arm/ixp425/boot2/boot2.c
===================================================================
--- trunk/sys/boot/arm/ixp425/boot2/boot2.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/ixp425/boot2/boot2.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -16,7 +16,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/ixp425/boot2/boot2.c 295453 2016-02-09 22:32:24Z emaste $");
 
 #include <sys/param.h>
 #include <sys/disklabel.h>
@@ -29,51 +29,13 @@
 #include <stdarg.h>
 
 #include "lib.h"
+#include "paths.h"
+#include "rbx.h"
 
-#define RBX_ASKNAME	0x0	/* -a */
-#define RBX_SINGLE	0x1	/* -s */
-/* 0x2 is reserved for log2(RB_NOSYNC). */
-/* 0x3 is reserved for log2(RB_HALT). */
-/* 0x4 is reserved for log2(RB_INITNAME). */
-#define RBX_DFLTROOT	0x5	/* -r */
-/* #define RBX_KDB 	0x6	   -d */
-/* 0x7 is reserved for log2(RB_RDONLY). */
-/* 0x8 is reserved for log2(RB_DUMP). */
-/* 0x9 is reserved for log2(RB_MINIROOT). */
-#define RBX_CONFIG	0xa	/* -c */
-#define RBX_VERBOSE	0xb	/* -v */
-/* #define RBX_SERIAL	0xc	   -h */
-/* #define RBX_CDROM	0xd	   -C */
-/* 0xe is reserved for log2(RB_POWEROFF). */
-#define RBX_GDB 	0xf	/* -g */
-/* #define RBX_MUTE	0x10	   -m */
-/* 0x11 is reserved for log2(RB_SELFTEST). */
-/* 0x12 is reserved for boot programs. */
-/* 0x13 is reserved for boot programs. */
-/* #define RBX_PAUSE	0x14	   -p */
-/* #define RBX_QUIET	0x15	   -q */
-#define RBX_NOINTR	0x1c	/* -n */
-/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */
-/* #define RBX_DUAL	0x1d	   -D */
-/* 0x1f is reserved for log2(RB_BOOTINFO). */
-
-/* pass: -a, -s, -r, -v, -g */
-#define RBX_MASK	(OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \
-			OPT_SET(RBX_DFLTROOT) | \
-			OPT_SET(RBX_VERBOSE) | \
-			OPT_SET(RBX_GDB))
-
-#define PATH_DOTCONFIG	"/boot.config"
-#define PATH_CONFIG	"/boot/config"
-#define PATH_KERNEL	"/boot/kernel/kernel"
-
 extern uint32_t _end;
 
 #define NOPT		6
 
-#define OPT_SET(opt)	(1 << (opt))
-#define OPT_CHECK(opt)	((opts) & OPT_SET(opt))
-
 static const char optstr[NOPT] = "agnrsv";
 static const unsigned char flags[NOPT] = {
 	RBX_ASKNAME,
@@ -99,7 +61,6 @@
 
 static void load(void);
 static int parse(void);
-static int xfsread(ino_t, void *, size_t);
 static int dskread(void *, unsigned, unsigned);
 static int drvread(void *, unsigned, unsigned);
 #ifdef FIXUP_BOOT_DRV
@@ -115,7 +76,7 @@
 #endif
 
 static inline int
-xfsread(ino_t inode, void *buf, size_t nbyte)
+xfsread(ufs_ino_t inode, void *buf, size_t nbyte)
 {
 	if ((size_t)fsread(inode, buf, nbyte) != nbyte)
 		return -1;
@@ -159,7 +120,7 @@
 {
 	const char *bt;
 	int autoboot, c = 0;
-	ino_t ino;
+	ufs_ino_t ino;
 
 	dmadat = (void *)(0x1c0000);
 	p_memset((char *)dmadat, 0, 32 * 1024);
@@ -208,7 +169,7 @@
 	Elf32_Ehdr eh;
 	static Elf32_Phdr ep[2];
 	caddr_t p;
-	ino_t ino;
+	ufs_ino_t ino;
 	uint32_t addr;
 	int i, j;
 #ifdef FIXUP_BOOT_DRV

Modified: trunk/sys/boot/arm/ixp425/boot2/cf_ata.h
===================================================================
--- trunk/sys/boot/arm/ixp425/boot2/cf_ata.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/ixp425/boot2/cf_ata.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -22,7 +22,7 @@
  * (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$
+ * $FreeBSD: stable/10/sys/boot/arm/ixp425/boot2/cf_ata.h 183651 2008-10-06 19:38:10Z jhay $
  */
 
 #ifndef ARM_BOOT_CF_ATA_H

Modified: trunk/sys/boot/arm/ixp425/boot2/ixp425_board.c
===================================================================
--- trunk/sys/boot/arm/ixp425/boot2/ixp425_board.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/ixp425/boot2/ixp425_board.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/ixp425/boot2/ixp425_board.c 215034 2010-11-09 10:59:09Z brucec $");
 #include <sys/param.h>
 #include <sys/ata.h>
 #include <sys/linker_set.h>

Modified: trunk/sys/boot/arm/ixp425/boot2/lib.h
===================================================================
--- trunk/sys/boot/arm/ixp425/boot2/lib.h	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/ixp425/boot2/lib.h	2018-06-02 14:12:52 UTC (rev 10213)
@@ -22,7 +22,7 @@
  * (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$
+ * $FreeBSD: stable/10/sys/boot/arm/ixp425/boot2/lib.h 186352 2008-12-20 03:26:09Z sam $
  */
 
 #ifndef ARM_BOOT_LIB_H

Modified: trunk/sys/boot/arm/uboot/Makefile
===================================================================
--- trunk/sys/boot/arm/uboot/Makefile	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/uboot/Makefile	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,16 +1,20 @@
 # $MidnightBSD$
-# $FreeBSD$
+# $FreeBSD: stable/10/sys/boot/arm/uboot/Makefile 314922 2017-03-08 22:39:45Z pfg $
 
 .include <bsd.own.mk>
 
-PROG=		ubldr
+FILES=		ubldr ubldr.bin
+
 NEWVERSWHAT=	"U-Boot loader" ${MACHINE_ARCH}
 BINDIR?=	/boot
 INSTALLFLAGS=	-b
 WARNS?=		1
+# Address at which ubldr will be loaded.
+# This varies for different boards and SOCs.
+UBLDR_LOADADDR?=	0x1000000
 
 # Architecture-specific loader code
-SRCS=		start.S conf.c vers.c
+SRCS=		start.S conf.c self_reloc.c vers.c
 
 .if !defined(LOADER_NO_DISK_SUPPORT)
 LOADER_DISK_SUPPORT?=	yes
@@ -20,6 +24,11 @@
 LOADER_UFS_SUPPORT?=	yes
 LOADER_CD9660_SUPPORT?=	no
 LOADER_EXT2FS_SUPPORT?=	no
+.if ${MK_NAND} != "no"
+LOADER_NANDFS_SUPPORT?= yes
+.else
+LOADER_NANDFS_SUPPORT?= no
+.endif
 LOADER_NET_SUPPORT?=	yes
 LOADER_NFS_SUPPORT?=	yes
 LOADER_TFTP_SUPPORT?=	no
@@ -43,6 +52,9 @@
 .if ${LOADER_EXT2FS_SUPPORT} == "yes"
 CFLAGS+=	-DLOADER_EXT2FS_SUPPORT
 .endif
+.if ${LOADER_NANDFS_SUPPORT} == "yes"
+CFLAGS+=	-DLOADER_NANDFS_SUPPORT
+.endif
 .if ${LOADER_GZIP_SUPPORT} == "yes"
 CFLAGS+=	-DLOADER_GZIP_SUPPORT
 .endif
@@ -62,13 +74,17 @@
 CFLAGS+=	-I${.CURDIR}/../../fdt
 CFLAGS+=	-I${.OBJDIR}/../../fdt
 CFLAGS+=	-DLOADER_FDT_SUPPORT
+LIBUBOOT_FDT=	${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a
 LIBFDT=		${.OBJDIR}/../../fdt/libfdt.a
 .endif
 
-.if !defined(NO_FORTH)
+CFLAGS+=	-DNETIF_OPEN_CLOSE_ONCE
+
+.if ${MK_FORTH} != "no"
 # Enable BootForth
 BOOT_FORTH=	yes
-CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/arm
+CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl
+CFLAGS+=	-I${.CURDIR}/../../ficl/arm
 LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
 .endif
 
@@ -80,7 +96,7 @@
 
 CLEANFILES+=	vers.c loader.help
 
-CFLAGS+=	-ffreestanding
+CFLAGS+=	-ffreestanding -msoft-float
 
 LDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
 
@@ -97,17 +113,49 @@
 # where to get libstand from
 CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
 
-DPADD=		${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND}
-LDADD=		${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand
+# clang doesn't understand %D as a specifier to printf
+NO_WERROR.clang=
 
+DPADD=		${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND}
+LDADD=		${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand
+
+OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
+
 vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
 	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
 
-loader.help: help.common help.uboot
+loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt
 	cat ${.ALLSRC} | \
 	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
 
+ldscript.abs:
+	echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET}
+
+ldscript.pie:
+	echo "UBLDR_LOADADDR = 0;" >${.TARGET}
+
+ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD}
+	${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \
+	    -o ${.TARGET} ${OBJS} ${LDADD}
+
+ubldr.pie: ${OBJS} ldscript.pie ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD}
+	${CC} ${CFLAGS} -T ldscript.pie ${LDFLAGS} -pie -Wl,-Bsymbolic \
+	    -o ${.TARGET} ${OBJS} ${LDADD}
+
+ubldr.bin: ubldr.pie
+	${OBJCOPY} -S -O binary ubldr.pie ${.TARGET}
+
+CLEANFILES+=	ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin
+
+.if !defined(LOADER_ONLY)
 .PATH: ${.CURDIR}/../../forth
-FILES=	loader.help
+.include	"${.CURDIR}/../../forth/Makefile.inc"
 
+# Install loader.rc.
+FILES+=	loader.rc
+# Put sample menu.rc on disk but don't enable it by default.
+FILES+=	menu.rc
+FILESNAME_menu.rc=	menu.rc.sample
+.endif
+
 .include <bsd.prog.mk>

Modified: trunk/sys/boot/arm/uboot/conf.c
===================================================================
--- trunk/sys/boot/arm/uboot/conf.c	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/uboot/conf.c	2018-06-02 14:12:52 UTC (rev 10213)
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/boot/arm/uboot/conf.c 235537 2012-05-17 10:11:18Z gber $");
 
 #include <stand.h>
 #include "bootstrap.h"
@@ -57,6 +57,9 @@
 #if defined(LOADER_EXT2FS_SUPPORT)
 	&ext2fs_fsops,
 #endif
+#if defined(LOADER_NANDFS_SUPPORT)
+	&nandfs_fsops,
+#endif
 #if defined(LOADER_NFS_SUPPORT)
 	&nfs_fsops,
 #endif

Modified: trunk/sys/boot/arm/uboot/help.uboot
===================================================================
--- trunk/sys/boot/arm/uboot/help.uboot	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/uboot/help.uboot	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1 +1,28 @@
 $MidnightBSD$
+$FreeBSD: stable/10/sys/boot/arm/uboot/help.uboot 273665 2014-10-26 02:53:23Z ian $
+
+###############################################################################
+# Tubenv DShow or import U-Boot environment variables
+
+	ubenv <import | show> [varname ...]
+
+	Display U-Boot environment variables, or import them into the
+	loader environment (which makes them available in the kernel).
+
+###############################################################################
+# Tubenv Simport DImport U-Boot env vars
+
+	ubenv import [varname ...]
+
+	If no variable names are specified, all U-Boot environment
+	variables are imported.  Each variable is prefixed with "uboot."
+	to avoid any possible conflicts with loader or kernel variables.
+
+###############################################################################
+# Tubenv Sshow DShow U-Boot env vars
+
+	ubenv show [varname ...]
+
+	If no variable names are specified, all U-Boot environment
+	variables are shown.
+

Modified: trunk/sys/boot/arm/uboot/ldscript.arm
===================================================================
--- trunk/sys/boot/arm/uboot/ldscript.arm	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/uboot/ldscript.arm	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,4 +1,5 @@
 /* $MidnightBSD$ */
+/* $FreeBSD: stable/10/sys/boot/arm/uboot/ldscript.arm 283505 2015-05-25 01:06:55Z ian $ */
 
 OUTPUT_ARCH(arm)
 ENTRY(_start)
@@ -5,7 +6,16 @@
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
-  . = 0x1000000 + SIZEOF_HEADERS;
+  . = UBLDR_LOADADDR + SIZEOF_HEADERS;
+  .text      :
+  {
+    *(.text)
+    /* .gnu.warning sections are handled specially by elf32.em.  */
+    *(.gnu.warning)
+    *(.gnu.linkonce.t*)
+  } =0
+  _etext = .;
+  PROVIDE (etext = .);
   .interp     : { *(.interp) 	}
   .hash          : { *(.hash)		}
   .dynsym        : { *(.dynsym)		}
@@ -32,15 +42,6 @@
   .rela.sbss     : { *(.rela.sbss)		}
   .rela.sdata2   : { *(.rela.sdata2)		}
   .rela.sbss2    : { *(.rela.sbss2)		}
-  .text      :
-  {
-    *(.text)
-    /* .gnu.warning sections are handled specially by elf32.em.  */
-    *(.gnu.warning)
-    *(.gnu.linkonce.t*)
-  } =0
-  _etext = .;
-  PROVIDE (etext = .);
   .init      : { *(.init)    } =0
   .fini      : { *(.fini)    } =0
   .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }

Added: trunk/sys/boot/arm/uboot/loader.conf
===================================================================
--- trunk/sys/boot/arm/uboot/loader.conf	                        (rev 0)
+++ trunk/sys/boot/arm/uboot/loader.conf	2018-06-02 14:12:52 UTC (rev 10213)
@@ -0,0 +1,14 @@
+# This is defaults/loader.conf for ARM, containing defaults for loader(8).
+# Do not modify the contents of this file, instead put your customizations
+# into /boot/loader.conf or /boot/loader.conf.local
+# $FreeBSD: stable/10/sys/boot/arm/uboot/loader.conf 278675 2015-02-13 15:16:55Z ian $
+# $MidnightBSD$
+
+autoboot_delay=10
+bootfile="kernel"      # Kernel name (possibly absolute path)
+kernel="kernel"        # /boot sub-directory containing kernel and modules
+loader_conf_files="/boot/loader.conf /boot/loader.conf.local"
+module_path="/boot/kernel;/boot/modules;/boot/dtb"
+nextboot_conf="/boot/nextboot.conf"
+nextboot_enable="NO"
+verbose_loading="NO"


Property changes on: trunk/sys/boot/arm/uboot/loader.conf
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/sys/boot/arm/uboot/start.S
===================================================================
--- trunk/sys/boot/arm/uboot/start.S	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/uboot/start.S	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2008 Semihalf, Rafal Czubak
  * All rights reserved.
@@ -23,54 +24,89 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/boot/arm/uboot/start.S 283505 2015-05-25 01:06:55Z ian $
  */
 
 #include <machine/asm.h>
+#include <machine/armreg.h>
 
+	.text
+	.extern	_C_LABEL(self_reloc), _C_LABEL(main)
+	.weak	_DYNAMIC
+
 /*
  * Entry point to the loader that U-Boot passes control to.
  */
-	.text
 	.globl	_start
 _start:
+
+#ifdef _ARM_ARCH_6
+	mrc     p15, 0, ip, c1, c0, 0
+	orr	ip, ip, #(CPU_CONTROL_UNAL_ENABLE)
+	orr	ip, ip, #(CPU_CONTROL_AFLT_ENABLE)
+	mcr     p15, 0, ip, c1, c0, 0
+#endif
+	/* 
+	 * Do self-relocation when the weak external symbol _DYNAMIC is non-NULL.
+	 * When linked as a dynamic relocatable file, the linker automatically
+	 * defines _DYNAMIC with a value that is the offset of the dynamic
+	 * relocation info section.
+	 * Note that we're still on u-boot's stack here, but the self_reloc 
+	 * code uses only a couple dozen bytes of stack space.
+	 */
+	adr	ip, .here_off		/* .here_off is a symbol whose value */
+	ldr	r0, [ip]		/* is its own offset in the text seg. */
+	sub	r0, ip, r0		/* Get its pc-relative address and */
+	ldr	r1, .dynamic_off	/* subtract its value and we get */
+	teq	r1, #0			/* r0 = physaddr we were loaded at. */
+	addne	r1, r1, r0		/* r1 = dynamic section physaddr. */
+	blne	_C_LABEL(self_reloc)	/* Do reloc if _DYNAMIC is non-NULL. */
+
 	/* Hint where to look for the API signature */
 	ldr	ip, =uboot_address
 	str	sp, [ip]
 
-	/* Save U-Boot's r8 */
+	/* Save U-Boot's r8 and r9 */
 	ldr	ip, =saved_regs
 	str	r8, [ip, #0]
+	str	r9, [ip, #4]
 
-	/* Start loader */
+	/* 
+	 * Start loader.  This is basically a tail-recursion call; if main()
+	 * returns, it returns to u-boot (which reports the value returned r0).
+	 */
 	b	main
 
+	/* 
+	 * Data for self-relocation, in the text segment for pc-rel access.
+	 */
+.here_off:
+	.word	.
+.dynamic_off:
+	.word	_DYNAMIC
+
 /*
  * syscall()
  */
 ENTRY(syscall)
-	/* Save caller's lr */
+	/* Save caller's lr, r8 and r9 */
 	ldr	ip, =saved_regs
-	str	lr, [ip, #4]
-	/* Save loader's r8 */
-	ldr	ip, =saved_regs
 	str	r8, [ip, #8]
-
-	/* Restore U-Boot's r8 */
-	ldr	ip, =saved_regs
+	str	r9, [ip, #12]
+	str	lr, [ip, #16]
+	/* Restore U-Boot's r8 and r9 */
 	ldr	r8, [ip, #0]
+	ldr	r9, [ip, #4]
 	/* Call into U-Boot */
 	ldr	lr, =return_from_syscall
 	ldr	ip, =syscall_ptr
 	ldr	pc, [ip]
-
 return_from_syscall:
-	/* Restore loader's r8 */
+	/* Restore loader's r8, r9 and lr */
 	ldr	ip, =saved_regs
+	ldr	lr, [ip, #16]
+	ldr	r9, [ip, #12]
 	ldr	r8, [ip, #8]
-	/* Restore caller's lr */
-	ldr	ip, =saved_regs
-	ldr	lr, [ip, #4]
 	/* Return to caller */
 	mov	pc, lr
 
@@ -89,5 +125,7 @@
 
 saved_regs:
 	.long	0	/* U-Boot's r8 */
+	.long	0	/* U-Boot's r9 */
 	.long	0	/* Loader's r8 */
+	.long	0	/* Loader's r9 */
 	.long	0	/* Loader's lr */

Modified: trunk/sys/boot/arm/uboot/version
===================================================================
--- trunk/sys/boot/arm/uboot/version	2018-06-02 14:09:31 UTC (rev 10212)
+++ trunk/sys/boot/arm/uboot/version	2018-06-02 14:12:52 UTC (rev 10213)
@@ -1,8 +1,10 @@
 $MidnightBSD$
+$FreeBSD: stable/10/sys/boot/arm/uboot/version 235537 2012-05-17 10:11:18Z gber $
 
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important.  Make sure the current version number is on line 6.
 
+1.2:	Extended with NAND FS support.
 1.1:	Flattened Device Tree blob support.
 1.0:	Added storage support. Booting from HDD, USB, etc. is now possible.
 0.5:	Initial U-Boot/arm version (netbooting only).



More information about the Midnightbsd-cvs mailing list