NetBSD 7.0 has support for A20 and A31 SoCs. NetBSD -current adds support for A80 SoCs.

  1. Supported boards
  2. Supported hardware
  3. TODO
  4. Installation
    1. A20 / A31 based boards
    2. A80 based boards
  5. Big (endian) fun
  6. FEX scripts
  7. Framebuffer console
  8. HDMI audio
  9. MAC address

Supported boards

Supported hardware

TODO

Installation

A20 / A31 based boards

# gunzip armv7.img.gz
# dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1k seek=8 conv=notrunc
# dd if=armv7.img of=/dev/rsd0d bs=1m

boot.cmd

setenv kernel_addr      82000000
setenv kernel           netbsd.ub
setenv bootargs         "root=ld0a"

fatload mmc 0:1 ${kernel_addr} ${kernel}
bootm ${kernel_addr}

# mkubootimage -A arm -n armv7 -T script boot.cmd boot.scr

A80 based boards

# dd if=u-boot-spl.bin of=/dev/sdd bs=1k seek=8
# dd if=u-boot-sun9iw1p1.bin of=/dev/sdd bs=1k seek=19096

Big (endian) fun

You can run this boards with a little endian (this is the default and implied by above install instructions) or with a big endian kernel and userland. However, kernel and userland endianness needs to match.

To build a big endian release (or sets) use

./build.sh -m evbearmv7hf-eb

where -eb means endianness big, hf is hardware floating point support, and earm is the modern "extended" ABI for ARM CPUs, and finally v7 is version 7 of the supported instruction set.

FEX scripts

Board configuration scripts can be found here: https://github.com/linux-sunxi/sunxi-boards/blob/master/sys_config. You can compile them with the "fex2bin" tool found here: https://github.com/linux-sunxi/sunxi-tools.

To use, copy the compiled FEX to your MS-DOS partition, load it with U-Boot, and then tell the kernel where to find it with the "sysconfig=" boot option. For example, uEnv.txt on a Cubieboard2 might look like this:

uEnv.txt

bootargs=root=ld0a sysconfig=0x43000000
uenvcmd=mmc dev 0; mmc rescan; fatload mmc 0:1 43000000 cubieboard2.bin; fatload mmc 0:1 82000000 netbsd.ub; bootm 82000000

Some pre-compiled .bin files can be found here: http://ftp.netbsd.org/pub/NetBSD/misc/jmcneill/allwinner/fex/

Framebuffer console

To use HDMI for the console device, add console=fb to bootargs in uEnv.txt.

If the connected display does not let you disable overscan, you can add a margin to the framebuffer by with the fb.margin bootargs option. For example, to set a 25-pixel margin around the screen, add fb.margin=25 to uEnv.txt

HDMI audio

The default audio device is the analog audio codec. To change the default device, use the audiocfg command:

a31# audiocfg list
0: [*] audio0 @ awinac0: Allwinner CODEC A31, 2 playback channels
1: [ ] audio1 @ awinhdmiaudio0: Allwinner HDMI 1.4, 2 playback channels
a31# audiocfg default 1
setting default audio device to audio1
a31# audiocfg list
0: [ ] audio0 @ awinac0: Allwinner CODEC A31, 2 playback channels
1: [*] audio1 @ awinhdmiaudio0: Allwinner HDMI 1.4, 2 playback channels

MAC address

On boards where the ethernet MAC address cannot be determmined, a random MAC address will be generated every boot. You can override this behaviour by specifying a MAC address in uEnv.txt:

uEnv.txt

bootargs=root=ld0a awge0.mac-address=02:a0:3d:88:1a:1e

hello, in order to properly operate the cubietruck, I set up a fex/bin file to the root of my SD card. I tried without the script, with a script modified to display on a VGA screen, as well as an original script for display on HDMI display, but none work. I feel that the script is not even read it. the LED display does not do properly. However, I checked several times, I put exactly what was stated in the wiki.

Comment by Gilles Thursday afternoon, December 18th, 2014

I succeeded to connect via the serial port, but I have a first problems, the root partition exceeds the maximum capacity of the partition:

beagleboard# df -h Filesystem Size Used Avail %Cap Mounted on /dev/ld0a 434M 434M -21M 105% /

I could make some changes and I do not know if it came from there, but it is impossible to create user the database is apparently corrupt:

beagleboard# pwd_mkdb /etc/master.passwd pwd_mkdb: Cannot open `/etc/spwd.db.tmp': File exists

Comment by Gilles Thursday evening, December 18th, 2014

hi all,

is there any fine manual to install netbsd on banana pi? i've tried to follow above instruction, however my banana pi won't boot to netbsd...

thank you

Comment by tri Wednesday afternoon, December 2nd, 2015

Dear tri, I have just updated instructions regarding how to install NetBSD 7.0 on the AllWinner SoCs.

I have noticed that uenvcmd was not honored by U-Boot and so writing it is needed to have an U-Boot image script (that can be generated via mkubootimage(1)).

If you have further questions or you notice some problems feel free to ask and I will try to help you (like you I have a Banana Pi and tested all the updated instructions on a BPI)!

Good luck and happy hacking! Ciao, L.

Comment by leot early Thursday morning, December 10th, 2015
It's not obvious that one should add "console=fb" to the boot.cmd file when setting up a BPI board. Other than that these instructions worked perfectly. Thanks!
Comment by perseant Monday night, January 11th, 2016

Unfortunately I tried both 'console=fb' and 'setenv console fb', to no avail. I see the (presumably) sunxi boot on HDMI, but after the console switch there are virtual console that react to keypresses, but no login appears on them. The board even appears via DHCP on the network.

I guess I need to find some serial interface to talk to it?

Comment by a.krey late Saturday afternoon, January 16th, 2016
New sources have multiple kernels listed like netbsd-CUBIETRUCK.ub . Kernel wouldn't boot until I renamed it to netbsd.ub instead of just pointing to netbsd-CUBIETRUCK.ub.
Comment by Mr. Friday afternoon, January 22nd, 2016

I downloaded armv7.img from official FTP, dd'd u-boot-sunxi-with-spl.bin to it, made boot.cmd as per instructions and connected BPI to a Samsung LED TV via hdmi cable. I see the initial boot, however it fails with a black screen after "transferring control to NetBSD stage-2 loader (at address 40007800)". What am I doing wrong?

Here is the picture of boot-up: http://imgur.com/uMNI7ay

I initially thought it was a screen resolution problem, but I tried everything in uEnv.txt without success.

Comment by soxxxz Saturday night, February 20th, 2016

I have the following for my BPI

bpi# cat /boot/uEnv.txt
bootargs=root=wd0a -v c0nsole=fb fb.margin=60 armv7.dcache=1 aload_script=fatload mmc 0 0x43000000 bananapi/script.bin; aload_kernel=fatload mmc 0 0x48000000 netbsd.ub; bootm 0x48000000; uenvcmd=run aload_script aload_kernel bpi#

with this version of u-boot: U-Boot 2014.04-10693-gf954935 (Aug 06 2014 - 11:18:37) Allwinner Technology

Maybe this explains the boot problems people have seen. Any further problems please send-pr.

Comment by skrll early Wednesday morning, February 24th, 2016

This configuration is grossly complicated and adds extra configurations which does not make sense to use all. uEnv.txt? So, here is the simple breakdown for someone who just wants to get a working boot on cubietruck. The config files that come with the download seem made only for odroid with some sloppy config to look like it should work for others.

  1. gunzip armv7.img.gz
  2. dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1k seek=8 conv=notrunc
  3. dd if=armv7.img of=/dev/rsd0d bs=1m
  4. mount -t msdos /dev/sd0e /mnt
  5. cd /mnt
  6. mkdir old
  7. mv * old/
  8. mv old/netbsd-YOURKERNEL.ub ./netbsd.ub
  9. ---- boot.cmd ----
  10. setenv bootargs "root=ld0a console=fb"
  11. fatload mmc 0:1 82000000 netbsd.ub; bootm 82000000
  12. ---- EOF ----
  13. mkubootimage -A arm -n armv7 -T script boot.cmd boot.scr

Done and bootable now. If the screen goes black after boot, unplug and re-plugin the hdmi cable

Comment by Mr. in the wee hours of Saturday night, March 6th, 2016

There is a good chance there is a bug that causes us to not deal with the smaller block size of sd correctly.

  • A 2GB SD card fails in the BPI.
  • A 8GB SDHC card with the same image (dd'ed) works correctly in the same BPI.

I did not test 32GB or 64GB (SDXC).

Comment by cyber early Friday morning, December 2nd, 2016
Add a comment
Contact | Disclaimer | Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.
NetBSD® is a registered trademark of The NetBSD Foundation, Inc.