Thu Nov 22 21:11:37 2018 UTC ()
Make armv7.img boot on the DE0 Nano SoC. Requires u-boot from -current pkgsrc.


(aymeric)
diff -r1.26 -r1.27 src/distrib/utils/embedded/conf/armv7.conf
diff -r1.8 -r1.9 src/distrib/utils/embedded/files/armv7_boot.cmd

cvs diff -r1.26 -r1.27 src/distrib/utils/embedded/conf/armv7.conf (expand / switch to unified diff)

--- src/distrib/utils/embedded/conf/armv7.conf 2018/11/01 11:05:24 1.26
+++ src/distrib/utils/embedded/conf/armv7.conf 2018/11/22 21:11:37 1.27
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
1# $NetBSD: armv7.conf,v 1.26 2018/11/01 11:05:24 skrll Exp $ 1# $NetBSD: armv7.conf,v 1.27 2018/11/22 21:11:37 aymeric Exp $
2# ARMv7 customization script used by mkimage 2# ARMv7 customization script used by mkimage
3# 3#
4board=armv7 4board=armv7
5console=fb 5console=fb
6resize=true 6resize=true
7 7
8. ${DIR}/conf/evbarm.conf 8. ${DIR}/conf/evbarm.conf
9 9
10# exynos, sunxi, tegra 10# altera, exynos, sunxi, tegra
11kernels_generic="GENERIC" 11kernels_generic="GENERIC"
12# non-FDTised / special kernels 12# non-FDTised / special kernels
13kernels_amlogic="ODROID-C1" 13kernels_amlogic="ODROID-C1"
14kernels_beagle="BEAGLEBOARD BEAGLEBONE" 14kernels_beagle="BEAGLEBOARD BEAGLEBONE"
15kernels_rpi="RPI2" 15kernels_rpi="RPI2"
16 16
17make_label() { 17make_label() {
18 make_label_evbarm 18 make_label_evbarm
19} 19}
20 20
21make_fstab() { 21make_fstab() {
22 make_fstab_evbarm 22 make_fstab_evbarm
23} 23}
@@ -80,26 +80,30 @@ EOF @@ -80,26 +80,30 @@ EOF
80 cat >> ${mnt}/etc/rc.local << EOF 80 cat >> ${mnt}/etc/rc.local << EOF
81if /sbin/sysctl -q machdep.cpu.frequency.max; then 81if /sbin/sysctl -q machdep.cpu.frequency.max; then
82 cpufreq_max=\$(/sbin/sysctl -n machdep.cpu.frequency.max) 82 cpufreq_max=\$(/sbin/sysctl -n machdep.cpu.frequency.max)
83 cpufreq_cur=\$(/sbin/sysctl -n machdep.cpu.frequency.current) 83 cpufreq_cur=\$(/sbin/sysctl -n machdep.cpu.frequency.current)
84 if [ ! "\$cpufreq_max" = "\$cpufreq_cur" ]; then 84 if [ ! "\$cpufreq_max" = "\$cpufreq_cur" ]; then
85 /sbin/sysctl -w machdep.cpu.frequency.target=\$cpufreq_max 85 /sbin/sysctl -w machdep.cpu.frequency.target=\$cpufreq_max
86 fi 86 fi
87fi 87fi
88EOF 88EOF
89 echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" \ 89 echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" \
90 >> "$tmp/selected_sets" 90 >> "$tmp/selected_sets"
91} 91}
92 92
 93populate_altera() {
 94 :
 95}
 96
93populate_amlogic() { 97populate_amlogic() {
94 odroidc1_kernelimg=netbsd-ODROID-C1.ub 98 odroidc1_kernelimg=netbsd-ODROID-C1.ub
95 99
96 # Create a boot.ini for Amlogic U-Boot 100 # Create a boot.ini for Amlogic U-Boot
97 cat >> "${mnt}/boot/boot.ini" << EOF 101 cat >> "${mnt}/boot/boot.ini" << EOF
98ODROIDC-UBOOT-CONFIG 102ODROIDC-UBOOT-CONFIG
99 103
100setenv bootargs "root=ld0a awge0.mac-address=\${ethaddr} console=${console}" 104setenv bootargs "root=ld0a awge0.mac-address=\${ethaddr} console=${console}"
101setenv bootcmd "fatload mmc 0:1 0x21000000 ${odroidc1_kernelimg}; fatload mmc 0:1 0x20000000 meson8b-odroidc1.dtb; bootm 0x21000000 - 0x20000000" 105setenv bootcmd "fatload mmc 0:1 0x21000000 ${odroidc1_kernelimg}; fatload mmc 0:1 0x20000000 meson8b-odroidc1.dtb; bootm 0x21000000 - 0x20000000"
102run bootcmd 106run bootcmd
103EOF 107EOF
104} 108}
105 109
@@ -143,22 +147,23 @@ populate() { @@ -143,22 +147,23 @@ populate() {
143 echo "${bar} installing ${k} to /boot/${tgt} ${bar}" 147 echo "${bar} installing ${k} to /boot/${tgt} ${bar}"
144 case "${k}" in 148 case "${k}" in
145 *.gz) 149 *.gz)
146 ${GZIP_CMD} -dc "${k}" > "${mnt}/boot/${tgt}" 150 ${GZIP_CMD} -dc "${k}" > "${mnt}/boot/${tgt}"
147 ;; 151 ;;
148 *) 152 *)
149 cp "${k}" "${mnt}/boot/${tgt}" 153 cp "${k}" "${mnt}/boot/${tgt}"
150 ;; 154 ;;
151 esac || 155 esac ||
152 fail "Copy of ${k} to ${mnt}/boot/${tgt} failed" 156 fail "Copy of ${k} to ${mnt}/boot/${tgt} failed"
153 done 157 done
154 158
155 # board specific configuration 159 # board specific configuration
 160 populate_altera
156 populate_amlogic 161 populate_amlogic
157 populate_beagle 162 populate_beagle
158 populate_rpi 163 populate_rpi
159 populate_sunxi 164 populate_sunxi
160 populate_tegra 165 populate_tegra
161 166
162 # common configuration 167 # common configuration
163 populate_common 168 populate_common
164} 169}

cvs diff -r1.8 -r1.9 src/distrib/utils/embedded/files/armv7_boot.cmd (expand / switch to unified diff)

--- src/distrib/utils/embedded/files/armv7_boot.cmd 2018/11/01 11:05:24 1.8
+++ src/distrib/utils/embedded/files/armv7_boot.cmd 2018/11/22 21:11:37 1.9
@@ -1,18 +1,25 @@ @@ -1,18 +1,25 @@
1if test "${board}" = "am335x" ; then 1if test "${board}" = "am335x" ; then
2 setenv kernel netbsd-BEAGLEBONE.ub 2 setenv kernel netbsd-BEAGLEBONE.ub
3 setenv mmcpart 0:1 3 setenv mmcpart 0:1
4 setenv bootargs root=ld0a 4 setenv bootargs root=ld0a
5fi 5fi
 6if test "${board}" = "de0-nano-soc" ; then
 7 setenv kernel netbsd-GENERIC.ub
 8 setenv bootargs 'root=ld0a'
 9 setenv mmcpart 0:1
 10 setenv use_fdt 1
 11 setenv fdtfile socfpga_cyclone5_de0_sockit.dtb
 12fi
6if test "${soc}" = "exynos" ; then 13if test "${soc}" = "exynos" ; then
7 setenv kernel netbsd-GENERIC.ub 14 setenv kernel netbsd-GENERIC.ub
8 setenv bootargs 'root=ld1a' 15 setenv bootargs 'root=ld1a'
9 setenv mmcpart 0:1 16 setenv mmcpart 0:1
10 setenv use_fdt 1 17 setenv use_fdt 1
11fi 18fi
12if test "${soc}" = "sunxi" ; then 19if test "${soc}" = "sunxi" ; then
13 setenv kernel netbsd-GENERIC.ub 20 setenv kernel netbsd-GENERIC.ub
14 setenv bootargs 'root=ld0a' 21 setenv bootargs 'root=ld0a'
15 setenv mmcpart 0:1 22 setenv mmcpart 0:1
16 setenv use_fdt 1 23 setenv use_fdt 1
17fi 24fi
18if test "${soc}" = "tegra" ; then 25if test "${soc}" = "tegra" ; then