1: [[!meta title="NetBSD/evbarm on Allwinner Technology SoCs"]]
2:
3: [[!toc levels=2]]
4:
5: # Supported boards
6: - [Banana Pi](http://www.bananapi.org/p/product.html) (BPI)
7: - Cubieboard 2 (CUBIEBOARD)
8: - Cubietruck (CUBIETRUCK)
9: - [Merrii Hummingbird A31](http://www.merrii.com/en/pla_d.asp?id=172) (HUMMINGBIRD_A31)
10:
11: # Supported hardware
12: - SoCs
13: - Cortex-A7: A20 (2-core), A31 (4-core)
14: - SD/MMC controller (DMA)
15: - DMA controller
16: - GPIO
17: - Configuration using FEX scripts is supported
18: - UART
19: - I2C
20: - P2WI (A31)
21: - PMU
22: - AXP209 (A20)
23: - AXP221 (A31)
24: - Watchdog timer
25: - RTC
26: - Audio codec
27: - USB host
28: - OHCI
29: - EHCI
30: - OTG (not yet working on A31)
31: - SATA (A10/A20)
32: - Gigabit Ethernet (GMAC)
33: - HDMI (A20/A31)
34: - DDC / EDID mode detection
35: - Audio support
36: - Framebuffer
37: - IR (A31)
38:
39: # TODO
40: - SoCs
41: - Cortex-A8: A10
42: - Cortex-A7/A15: A80
43: - OTG (A31)
44: - USB device mode
45: - Bluetooth / WiFi (Cubietruck, Hummingbird A31)
46: - 3G (Hummingbird A31)
47: - SD/MMC UHS-I support (needs sdmmc(4) changes)
48: - TV input (Hummingbird A31)
49: - NAND
50: - Fast Ethernet (EMAC)
51: - IR (A20)
52:
53: # Installation
54:
55: ## A10 / A20 based boards
56:
57: * Start with an ARMv7 image from *evbarm-earmv7hf/binary/gzimg/* such as *beaglebone.img*
58: * Download a U-Boot build for your board from the linux-sunxi web site <http://dl.linux-sunxi.org/nightly/u-boot-sunxi/u-boot-sunxi/u-boot-sunxi-latest/>
59: * Write the *u-boot-sunxi-with-spl.bin* loader to the base image:
60: [[!template id=programlisting text="""
61: # dd if=u-boot-sunxi-with-spl.bin of=beaglebone.img bs=1k seek=8 conv=notrunc
62: """]]
63: * Write the image to an SD card.
64: * Copy the kernel (netbsd.ub) for your board to the root of the MS-DOS partition.
65: * Create or edit uEnv.txt on the MS-DOS partition:
66: [[!template id=programlisting text="""
67: bootargs=root=ld0a
68: uenvcmd=mmc dev 0; mmc rescan; fatload mmc 0:1 82000000 netbsd.ub; bootm 82000000
69: """]]
70:
71: ## A31 based boards
72:
73: TBD.
74:
75: # Big (endian) fun
76:
77: You can run this boards with a little endian (this is the default and implied by above install instructions)
78: or with a big endian kernel and userland. However, kernel and userland endianness needs to match.
79:
80: To build a big endian release (or sets) use
81: [[!template id=programlisting text="""
82: ./build.sh -m evbearmv7hf-eb
83: """]]
84: 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.
85:
86: # FEX scripts
87:
88: 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>.
89:
90: 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:
91:
92: [[!template id=programlisting text="""
93: bootargs=root=ld0a sysconfig=0x43000000
94: uenvcmd=mmc dev 0; mmc rescan; fatload mmc 0:1 43000000 cubieboard2.bin; fatload mmc 0:1 82000000 netbsd.ub; bootm 82000000
95: """]]
96:
97: Some pre-compiled .bin files can be found here: <http://ftp.netbsd.org/pub/NetBSD/misc/jmcneill/allwinner/fex/>
98:
99: # Framebuffer console
100:
101: To use HDMI for the console device, add *console=fb* to bootargs in uEnv.txt.
102:
103: 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
104:
105: # HDMI audio
106:
107: The default audio device is the analog audio codec. To change the default device, use the *audiocfg* command:
108:
109: [[!template id=programlisting text="""
110: a31# audiocfg list
111: 0: [*] audio0 @ awinac0: Allwinner CODEC A31, 2 playback channels
112: 1: [ ] audio1 @ awinhdmiaudio0: Allwinner HDMI 1.4, 2 playback channels
113: a31# audiocfg default 1
114: setting default audio device to audio1
115: a31# audiocfg list
116: 0: [ ] audio0 @ awinac0: Allwinner CODEC A31, 2 playback channels
117: 1: [*] audio1 @ awinhdmiaudio0: Allwinner HDMI 1.4, 2 playback channels
118: """]]
119:
120: # Board specific notes
121:
122: ## Merrii Hummingbird A31
123:
124: There doesn't appear to be a meaningful way to generate a MAC address on these boards. U-Boot from the A31 SDK and from the u-boot-sunxi tree both lack GMAC support, and the Security ID registers (at 0x01c23800) appear to be empty.
125:
126: To overcome this, you can specify your own MAC address in *uEnv.txt*:
127: [[!template id=programlisting text="""
128: bootargs=root=ld0a awge0.mac-address=02:a0:3d:88:1a:1e
129: """]]
CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb