Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add installboot(8) support for evbarm (and, in the future, o...



details:   https://anonhg.NetBSD.org/src/rev/24d516ea7652
branches:  trunk
changeset: 451122:24d516ea7652
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue May 07 05:02:41 2019 +0000

description:
Add installboot(8) support for evbarm (and, in the future, other evb*)
boards that use u-boot.  A known board database lists boards and their
respective u-boot packages.  u-boot packages are discovered at run-time
(in /usr/pkg/share/u-boot, by default).  These packages contain board
database overlays that describe u-boot installation procedure that's
specific for that board.

Support this as a native tool and as a host tool.  The native tool
will attempt to determine the running board type using OpenFirmware
calls.  Host tool and native tool alike may also specify a board type
directly using the "-o board=xxx option" or have installboot(8) determine
the board type from a device tree blob using "-o dtb=/path/to/board.dtb".
A "-o media=xxx" option is provided for boards that have different u-boot
binaries and/or installation procedures for different media types (e.g.
SDMMC, eMMC, or USB).

This is trivial to extend to other evb* platforms that use u-boot, even if
they don't use FDT for autoconfiguration.

diffstat:

 distrib/sets/lists/base/mi            |     5 +-
 etc/mtree/NetBSD.dist.base            |     4 +-
 share/Makefile                        |     4 +-
 share/installboot/Makefile            |     9 +
 share/installboot/evbarm/Makefile     |    12 +
 share/installboot/evbarm/boards.plist |   337 ++++++
 tools/installboot/Makefile            |    31 +-
 usr.sbin/installboot/Makefile         |    45 +-
 usr.sbin/installboot/arch/evbarm.c    |   119 ++
 usr.sbin/installboot/evboards.c       |  1655 +++++++++++++++++++++++++++++++++
 usr.sbin/installboot/evboards.h       |    65 +
 usr.sbin/installboot/installboot.8    |   120 ++-
 usr.sbin/installboot/installboot.c    |    56 +-
 usr.sbin/installboot/installboot.h    |    22 +-
 usr.sbin/installboot/machines.c       |     6 +-
 15 files changed, 2463 insertions(+), 27 deletions(-)

diffs (truncated from 2806 to 300 lines):

diff -r 9fe3ad052d69 -r 24d516ea7652 distrib/sets/lists/base/mi
--- a/distrib/sets/lists/base/mi        Tue May 07 04:35:31 2019 +0000
+++ b/distrib/sets/lists/base/mi        Tue May 07 05:02:41 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1203 2019/04/18 03:50:12 rin Exp $
+# $NetBSD: mi,v 1.1204 2019/05/07 05:02:41 thorpej Exp $
 #
 # Note:        Don't delete entries from here - mark them as "obsolete" instead,
 #      unless otherwise stated below.
@@ -3054,6 +3054,9 @@
 ./usr/share/i18n/iconv                         base-sysutil-share
 ./usr/share/i18n/iconv/iconv.dir               base-sysutil-share      nls
 ./usr/share/info                               base-texinfo-share
+./usr/share/installboot                                base-sysutil-share
+./usr/share/installboot/evbarm                 base-sysutil-share
+./usr/share/installboot/evbarm/boards.plist    base-sysutil-share
 ./usr/share/keymaps                            base-sys-share
 ./usr/share/keymaps/amiga                      base-sys-share
 ./usr/share/keymaps/atari                      base-sys-share
diff -r 9fe3ad052d69 -r 24d516ea7652 etc/mtree/NetBSD.dist.base
--- a/etc/mtree/NetBSD.dist.base        Tue May 07 04:35:31 2019 +0000
+++ b/etc/mtree/NetBSD.dist.base        Tue May 07 05:02:41 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.base,v 1.196 2019/04/18 03:50:12 rin Exp $
+#      $NetBSD: NetBSD.dist.base,v 1.197 2019/05/07 05:02:42 thorpej Exp $
 #      @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -472,6 +472,8 @@
 ./usr/share/i18n/esdb/UTF
 ./usr/share/i18n/iconv
 ./usr/share/info
+./usr/share/installboot
+./usr/share/installboot/evbarm
 ./usr/share/keymaps
 ./usr/share/keymaps/amiga
 ./usr/share/keymaps/atari
diff -r 9fe3ad052d69 -r 24d516ea7652 share/Makefile
--- a/share/Makefile    Tue May 07 04:35:31 2019 +0000
+++ b/share/Makefile    Tue May 07 05:02:41 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.35 2018/06/10 17:55:11 christos Exp $
+#      $NetBSD: Makefile,v 1.36 2019/05/07 05:02:42 thorpej Exp $
 #      from @(#)Makefile       8.1 (Berkeley) 6/5/93
 
 # Missing:  ms
@@ -7,7 +7,7 @@
 
 .if ${MKSHARE} != "no" || \
        make(clean) || make(cleandir) || make(distclean) || make(obj)
-SUBDIR=        dict examples legal man me misc mk \
+SUBDIR=        dict examples installboot legal man me misc mk \
        tabset terminfo tmac wscons xml
 
 .if ${MKGROFF} != "no"
diff -r 9fe3ad052d69 -r 24d516ea7652 share/installboot/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/installboot/Makefile        Tue May 07 05:02:41 2019 +0000
@@ -0,0 +1,9 @@
+#      $NetBSD: Makefile,v 1.1 2019/05/07 05:02:42 thorpej Exp $
+
+.include <bsd.own.mk>
+
+.if ${MKSHARE} != "no"
+SUBDIR=        evbarm
+.endif
+
+.include <bsd.subdir.mk>
diff -r 9fe3ad052d69 -r 24d516ea7652 share/installboot/evbarm/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/installboot/evbarm/Makefile Tue May 07 05:02:41 2019 +0000
@@ -0,0 +1,12 @@
+#      $NetBSD: Makefile,v 1.1 2019/05/07 05:02:42 thorpej Exp $
+
+NOOBJ=         # defined
+
+.include <bsd.own.mk>
+
+.if ${MKSHARE} != "no"
+FILES=         boards.plist
+FILESDIR=      /usr/share/installboot/evbarm
+.endif
+
+.include <bsd.prog.mk>
diff -r 9fe3ad052d69 -r 24d516ea7652 share/installboot/evbarm/boards.plist
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/installboot/evbarm/boards.plist     Tue May 07 05:02:41 2019 +0000
@@ -0,0 +1,337 @@
+<!-- $NetBSD: boards.plist,v 1.1 2019/05/07 05:02:42 thorpej Exp $ -->
+<!--
+  Copyright (c) 2019 The NetBSD Foundation, Inc.
+  All rights reserved.
+ 
+  This code is derived from software contributed to The NetBSD Foundation
+  by Jason R. Thorpe.
+ 
+  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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+  ``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 FOUNDATION OR CONTRIBUTORS
+  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.
+-->
+<plist>
+<dict>
+       <!--
+         -- amlogic boards
+         -->
+       <key>hardkernel,odroid-c2</key>
+       <dict>
+               <key>description</key>
+               <string>Hardkernel ODROID-C2</string>
+               <key>u-boot-pkg</key>
+               <string>odroid-c2</string>
+       </dict>
+       <key>libretech,cc</key>
+       <dict>
+               <key>description</key>
+               <string>Libre Computer Board AML-S905X-CC</string>
+               <key>u-boot-pkg</key>
+               <string>libretech-cc</string>
+       </dict>
+
+       <!--
+         -- exynos boards
+         -->
+       <key>hardkernel,odroid-xu3</key>
+       <dict>
+               <key>description</key>
+               <string>Hardkernel Odroid XU3</string>
+               <key>u-boot-pkg</key>
+               <string>odroid-xu3</string>
+       </dict>
+
+       <!--
+         -- rockchip boards
+         -->
+       <key>pine64,rockpro64</key>
+       <dict>
+               <key>description</key>
+               <string>Pine64 RockPro64</string>
+               <key>u-boot-pkg</key>
+               <string>rockpro64</string>
+       </dict>
+
+       <!--
+        -- mediatek boards
+        -->
+       <key>bananapi,bpi-r2</key>
+       <dict>
+               <key>description</key>
+               <string>Bananapi BPI-R2</string>
+               <key>u-boot-pkg</key>
+               <string>bananapi-r2</string>
+       </dict>
+
+       <!--
+         -- nvidia boards
+         -->
+       <key>nvidia,jetson-tk1</key>
+       <dict>
+               <key>description</key>
+               <string>NVIDIA Tegra124 Jetson TK1</string>
+               <key>u-boot-pkg</key>
+               <string>jetson-tk1</string>
+       </dict>
+       <key>nvidia,p2371-2180</key>
+       <dict>
+               <key>description</key>
+               <string>NVIDIA Jetson TX1 Developer Kit</string>
+               <key>u-boot-pkg</key>
+               <string>jetson-tx1</string>
+       </dict>
+       <key>nvidia,p2771-0000</key>
+       <dict>
+               <key>description</key>
+               <string>NVIDIA Tegra186 P2771-0000 Development Board</string>
+               <key>u-boot-pkg</key>
+               <string>jetson-tx2</string>
+       </dict>
+
+       <!--
+         -- omap boards
+         -->
+       <key>ti,omap3-beagle</key>
+       <dict>
+               <key>description</key>
+               <string>TI OMAP3 BeagleBoard</string>
+               <key>u-boot-pkg</key>
+               <string>beagleboard</string>
+       </dict>
+       <key>ti,am335x-bone</key>
+       <dict>
+               <key>description</key>
+               <string>TI AM335x BeagleBone</string>
+               <key>u-boot-pkg</key>
+               <string>beaglebonewhite</string>
+       </dict>
+       <key>ti,am335x-bone-black</key>
+       <dict>
+               <key>description</key>
+               <string>TI AM335x BeagleBone Black</string>
+               <key>u-boot-pkg</key>
+               <string>beagleboneblack</string>
+       </dict>
+
+       <!--
+         -- sunxi boards
+         -->
+       <!-- Banana Pi-branded board "compatible" strings are a mess.
+            We will just keep them all together here.  -->
+       <key>lemaker,bananapi</key>
+       <dict>
+               <key>description</key>
+               <string>LeMaker Banana Pi</string>
+               <key>u-boot-pkg</key>
+               <string>bananapi</string>
+       </dict>
+       <key>sinovoip,bpi-m3</key>
+       <dict>
+               <key>description</key>
+               <string>Banana Pi BPI-M3</string>
+               <key>u-boot-pkg</key>
+               <string>bananapi-m3</string>
+       </dict>
+
+       <key>cubietech,cubieboard2</key>
+       <dict>
+               <key>description</key>
+               <string>Cubietech Cubieboard2</string>
+               <key>u-boot-pkg</key>
+               <string>cubieboard2</string>
+       </dict>
+       <key>cubietech,a80-cubieboard4</key>
+       <dict>
+               <key>description</key>
+               <string>Cubietech Cubieboard4</string>
+               <key>u-boot-pkg</key>
+               <string>cubieboard4</string>
+       </dict>
+       <key>cubietech,cubietruck</key>
+       <dict>
+               <key>description</key>
+               <string>Cubietech Cubietruck</string>
+               <key>u-boot-pkg</key>
+               <string>cubietruck</string>
+       </dict>
+       <key>cubietech,cubietruck-plus</key>
+       <dict>
+               <key>description</key>
+               <string>Cubietech Cubietruck Plus</string>
+               <key>u-boot-pkg</key>
+               <string>cubietruck_plus</string>
+       </dict>
+
+       <key>friendlyarm,nanopi-m1</key>
+       <dict>
+               <key>description</key>
+               <string>FriendlyArm NanoPi M1</string>
+               <key>u-boot-pkg</key>
+               <string>nanopi-m1</string>
+       </dict>
+       <key>friendlyarm,nanopi-neo</key>
+       <dict>
+               <key>description</key>
+               <string>FriendlyARM NanoPi NEO</string>
+               <key>u-boot-pkg</key>
+               <string>nanopi-neo</string>
+       </dict>
+       <key>friendlyarm,nanopi-neo-plus2</key>
+       <dict>
+               <key>description</key>
+               <string>FriendlyARM NanoPi NEO Plus2</string>
+               <key>u-boot-pkg</key>
+               <string>nanopi-neo-plus2</string>
+       </dict>
+       <key>friendlyarm,nanopi-neo2</key>
+       <dict>
+               <key>description</key>
+               <string>FriendlyARM NanoPi NEO 2</string>
+               <key>u-boot-pkg</key>
+               <string>nanopi-neo2</string>
+       </dict>
+
+       <key>merrii,a31-hummingbird</key>
+       <dict>



Home | Main Index | Thread Index | Old Index