Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Rename beagleboard.img to armv7.img. The new image includes ...
details: https://anonhg.NetBSD.org/src/rev/585c5bf85424
branches: trunk
changeset: 337279:585c5bf85424
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Thu Apr 09 10:55:23 2015 +0000
description:
Rename beagleboard.img to armv7.img. The new image includes the same
kernels as beagleboard.img plus support for Raspberry Pi 2, ODROID-C1,
Cubieboard2, Cubietruck, Hummingbird A31, and Banana Pi.
diffstat:
distrib/utils/embedded/conf/armv7.conf | 126 +++++++++++++++++++++++++++
distrib/utils/embedded/conf/beagleboard.conf | 67 --------------
etc/etc.evbarm/Makefile.inc | 20 +--
3 files changed, 135 insertions(+), 78 deletions(-)
diffs (250 lines):
diff -r 4e958a58ab78 -r 585c5bf85424 distrib/utils/embedded/conf/armv7.conf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/utils/embedded/conf/armv7.conf Thu Apr 09 10:55:23 2015 +0000
@@ -0,0 +1,126 @@
+# $NetBSD: armv7.conf,v 1.1 2015/04/09 10:55:23 jmcneill Exp $
+# ARMv7 customization script used by mkimage
+#
+board=armv7
+console=fb
+
+. ${DIR}/conf/evbarm.conf
+
+kernels_beagle="BEAGLEBOARD BEAGLEBONE"
+kernels_awin="BPI CUBIEBOARD CUBIETRUCK HUMMINGBIRD_A31"
+kernels_rpi="RPI2"
+kernels_amlogic="ODROID-C1"
+
+make_filesystems() {
+ make_filesystems_evbarm
+}
+
+make_label() {
+ make_label_evbarm
+}
+
+make_fstab() {
+ make_fstab_evbarm
+}
+
+customize() {
+ customize_evbarm
+ cat >> ${mnt}/etc/rc.conf << EOF
+mdnsd=YES
+wscons=YES
+devpubd=YES
+EOF
+}
+
+populate_beagle() {
+ bboard_kernelimg=netbsd-BEAGLEBOARD.ub
+ bboard_loadaddr=81000000
+ bbone_kernelimg=netbsd-BEAGLEBONE.ub
+ bbone_loadaddr=82000000
+
+ # Create a uEnv.txt to auto boot the correct kernel
+ cat >> ${mnt}/boot/uEnv.txt << EOF
+loaduimage=if test \$board = am335x; then fatload mmc 0 ${bbone_loadaddr} ${bbone_kernelimg}; bootm ${bbone_loadaddr} root=ld0a; else fatload mmc 0 ${bboard_loadaddr} ${bboard_kernelimg}; bootm
${bboard_loadaddr} root=ld0a; fi
+EOF
+}
+
+populate_awin() {
+ cat >> ${mnt}/boot/uEnv.txt << EOF
+bootargs=root=ld0a console=${console}
+uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD2.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel
netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub;
fi; fatload mmc 0:1 82000000 ${kernel}; bootm 82000000
+EOF
+}
+
+populate_rpi() {
+ firmwaredir=${src}/external/broadcom/rpi-firmware/dist
+ firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
+
+ # RPI2 kernel needs to be installed as kernel7.img
+ if [ -f "${mnt}/boot/netbsd-RPI2.bin" ]; then
+ echo "${bar} renaming netbsd-RPI2.bin to kernel7.img ${bar}"
+ mv "${mnt}/boot/netbsd-RPI2.bin" "${mnt}/boot/kernel7.img"
+
+ cat > ${mnt}/boot/cmdline.txt << EOF
+root=ld0a console=${console}
+#fb=1280x1024 # to select a mode, otherwise try EDID
+#fb=disable # to disable fb completely
+EOF
+
+ echo "${bar} installing firmware files ${bar}"
+ (cd ${mnt}/boot &&
+ for f in ${firmwarefiles}; do
+ echo " $f"
+ cp ${firmwaredir}/${f} .
+ done
+ )
+
+ fi
+}
+
+populate_amlogic() {
+ odroidc1_kernelimg=netbsd-ODROID-C1.ub
+
+ # Create a boot.ini for Amlogic U-Boot
+ cat >> ${mnt}/boot/boot.ini << EOF
+ODROIDC-UBOOT-CONFIG
+
+setenv bootargs "root=ld0f awge0.mac-address=\${ethaddr} console=${console}"
+setenv bootcmd "fatload mmc 0:1 0x21000000 ${odroidc1_kernelimg}; bootm 0x21000000"
+run bootcmd
+EOF
+}
+
+populate() {
+ echo "${bar} looking for kernels in ${kernel} ${bar}"
+ kernels=""
+ # .ub kernels
+ for k in $kernels_beagle $kernels_awin $kernels_amlogic; do
+ f="${kernel}/netbsd-${k}.ub.gz"
+ test -f "${f}" && kernels="${kernels} ${f}"
+ done
+ # .bin kernels
+ for k in $kernels_rpi; do
+ f="${kernel}/netbsd-${k}.bin.gz"
+ test -f "${f}" && kernels="${kernels} ${f}"
+ done
+
+ # install kernels to /boot partition
+ for k in ${kernels}; do
+ tgt="$(basename ${k} | sed 's/\.gz$//')"
+ echo "${bar} installing ${k} to /boot/${tgt} ${bar}"
+ case "${k}" in
+ *.gz)
+ ${GZIP_CMD} -dc "${k}" > "${mnt}/boot/${tgt}"
+ ;;
+ *)
+ cp "${k}" "${mnt}/boot/${tgt}"
+ ;;
+ esac
+ done
+
+ # board specific configuration
+ populate_beagle
+ populate_awin
+ populate_rpi
+ populate_amlogic
+}
diff -r 4e958a58ab78 -r 585c5bf85424 distrib/utils/embedded/conf/beagleboard.conf
--- a/distrib/utils/embedded/conf/beagleboard.conf Thu Apr 09 06:03:43 2015 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-# $NetBSD: beagleboard.conf,v 1.18 2014/09/29 17:54:13 jmcneill Exp $
-# BeagleBoard customization script used by mkimage
-#
-board=beagleboard
-
-. ${DIR}/conf/evbarm.conf
-
-bboard_kernelimg=bboard.ub
-bboard_loadaddr=81000000
-bbone_kernelimg=bbone.ub
-bbone_loadaddr=82000000
-
-make_filesystems() {
- make_filesystems_evbarm
-}
-
-make_label() {
- make_label_evbarm
-}
-
-make_fstab() {
- make_fstab_evbarm
-}
-
-customize() {
- customize_evbarm
- cat >> ${mnt}/etc/rc.conf << EOF
-mdnsd=YES
-EOF
-}
-
-populate() {
- bboard_kernel="$kernel"
- bbone_kernel="$(echo $bboard_kernel | sed 's/BEAGLEBOARD/BEAGLEBONE/g')"
-
- cat > ${mnt}/boot/uEnv.txt << EOF
-loaduimage=if test \$board = am335x; then fatload mmc 0 ${bbone_loadaddr} ${bbone_kernelimg}; bootm ${bbone_loadaddr} root=ld0a; else fatload mmc 0 ${bboard_loadaddr} ${bboard_kernelimg}; bootm
${bboard_loadaddr} root=ld0a; fi
-EOF
- if [ ! -f "${bboard_kernel}" ]; then
- echo ${PROG}: Missing ${bboard_kernel} 1>&2
- exit 1
- fi
- if [ ! -f "${bbone_kernel}" ]; then
- echo ${PROG}: Missing ${bbone_kernel} 1>&2
- exit 1
- fi
-
- echo "${bar} installing ${bboard_kernel} to /boot/${bboard_kernelimg} ${bar}"
- case "${bboard_kernel}" in
- *.gz)
- ${GZIP_CMD} -dc "${bboard_kernel}" > "${mnt}/boot/${bboard_kernelimg}"
- ;;
- *)
- cp "${bboard_kernel}" "${mnt}/boot/${bboard_kernelimg}"
- ;;
- esac
-
- echo "${bar} installing ${bbone_kernel} to /boot/${bbone_kernelimg} ${bar}"
- case "${bbone_kernel}" in
- *.gz)
- ${GZIP_CMD} -dc "${bbone_kernel}" > "${mnt}/boot/${bbone_kernelimg}"
- ;;
- *)
- cp "${bbone_kernel}" "${mnt}/boot/${bbone_kernelimg}"
- ;;
- esac
-}
diff -r 4e958a58ab78 -r 585c5bf85424 etc/etc.evbarm/Makefile.inc
--- a/etc/etc.evbarm/Makefile.inc Thu Apr 09 06:03:43 2015 +0000
+++ b/etc/etc.evbarm/Makefile.inc Thu Apr 09 10:55:23 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.71 2015/03/16 22:18:14 jmcneill Exp $
+# $NetBSD: Makefile.inc,v 1.72 2015/04/09 10:55:23 jmcneill Exp $
#
# etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
#
@@ -133,7 +133,7 @@
TOOL_MTREE=${TOOL_MTREE} \
HOST_SH=${HOST_SH} \
${HOST_SH} ${MKIMAGE} -x -h ${.TARGET:S/smp_//} -D ${DESTDIR} \
- -K ${.ALLSRC} -S ${NETBSDSRCDIR} ${MKI_OPTS.${.TARGET}} \
+ -S ${NETBSDSRCDIR} ${MKI_OPTS.${.TARGET}} \
${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz
ARCHES.arm= armv4 xscale armv5t armv6 armv7
@@ -162,23 +162,21 @@
KERNEL_SETS+= ${KERNEL_SETS.${arch}}
.endfor
-.if !empty(KERNEL_SETS:MBEAGLEBOARD) && !empty(KERNEL_SETS:MBEAGLEBONE)
-smp_beagleboard: ${IMAGE.kern}/netbsd-BEAGLEBOARD.ub.gz __mkimage
-# XXX ${IMAGE.kern}/netbsd-BEAGLEBONE.ub.gz
-.if empty(ALL_KERNELS) || (!empty(ALL_KERNELS:MBEAGLEBOARD) && !empty(ALL_KERNELS:MBEAGLEBONE))
-SNAP_MD_POST_DEPS+= smp_beagleboard
-.endif
+.if !empty(MACHINE_ARCH:M*armv7*) && empty(ALL_KERNELS)
+smp_armv7: __mkimage
+MKI_OPTS.smp_armv7= -K ${IMAGE.kern}
+SNAP_MD_POST_DEPS+= smp_armv7
.endif
.if !empty(KERNEL_SETS:MRPI)
-smp_rpi: ${IMAGE.kern}/netbsd-RPI.bin.gz __mkimage
-# XXX ${IMAGE.kern}/netbsd-RPI2.bin.gz
+smp_rpi: __mkimage
.if empty(ALL_KERNELS) || !empty(ALL_KERNELS:MRPI)
+MKI_OPTS.smp_rpi= -K ${IMAGE.kern}/netbsd-RPI.bin.gz
SNAP_MD_POST_DEPS+= smp_rpi
.endif
-MKI_OPTS.smp_rpi_inst="-b"
smp_rpi_inst: ${IMAGE.instk}/netbsd-RPI_INSTALL.bin.gz __mkimage
.if empty(ALL_KERNELS) || !empty(ALL_KERNELS:MRPI_INSTALL)
+MKI_OPTS.smp_rpi_inst= -b -K ${IMAGE.instk}/netbsd-RPI_INSTALL.bin.gz
SNAP_MD_POST_DEPS+= smp_rpi_inst
.endif
.endif
Home |
Main Index |
Thread Index |
Old Index