Annotation of wikisrc/ports/evbarm/allwinner.mdwn, revision 1.52

1.1       wiki        1: [[!meta title="NetBSD/evbarm on Allwinner Technology SoCs"]]
                      2: 
1.52    ! wiki        3: NetBSD 7.0 has support for A20 and A31 SoCs. NetBSD -current adds support for A80 SoCs.
1.49      wiki        4: 
1.18      wiki        5: [[!toc levels=2]]
                      6: 
1.1       wiki        7: # Supported boards
1.11      wiki        8:  - [Banana Pi](http://www.bananapi.org/p/product.html) (BPI)
1.31      wiki        9:  - Cubieboard 2 (CUBIEBOARD)
1.38      wiki       10:  - [Cubieboard 4](http://cubieboard.org/model/cb4/) (ALLWINNER_A80) *NetBSD-current*
1.1       wiki       11:  - Cubietruck (CUBIETRUCK)
1.10      wiki       12:  - [Merrii Hummingbird A31](http://www.merrii.com/en/pla_d.asp?id=172) (HUMMINGBIRD_A31)
1.1       wiki       13: 
                     14: # Supported hardware
                     15:  - SoCs
1.35      wiki       16:    - Cortex-A7: A20 (2-core), A31 (4-core), A80
                     17:    - Cortex-A7/A15: A80 (4-core A7 + 4-core A15)
1.14      wiki       18:  - SD/MMC controller (DMA)
1.1       wiki       19:  - DMA controller
                     20:  - GPIO
1.20      wiki       21:    - Configuration using FEX scripts is supported
1.1       wiki       22:  - UART
                     23:  - I2C
1.36      wiki       24:  - P2WI (A31) / RSB (A80)
1.1       wiki       25:  - PMU
1.36      wiki       26:    - AXP209 (A20)
1.1       wiki       27:    - AXP221 (A31)
1.36      wiki       28:    - AXP806 (A80)
                     29:    - AXP809 (A80)
1.1       wiki       30:  - Watchdog timer
                     31:  - RTC
1.37      wiki       32:    - A20/A31: integrated RTC, PCF8563
                     33:    - A80: AC100
                     34:  - Audio codec (A20/A31)
1.14      wiki       35:  - USB host
1.1       wiki       36:    - OHCI
                     37:    - EHCI
1.37      wiki       38:    - OTG (A20)
1.1       wiki       39:  - SATA (A10/A20)
                     40:  - Gigabit Ethernet (GMAC)
1.45      wiki       41:  - HDMI
                     42:    - DDC / EDID mode detection (A20/A31)
                     43:    - Audio support (A20/A31)
                     44:  - Framebuffer (A20/A31/A80)
1.39      wiki       45:  - IR receiver (A20/A31/A80)
1.2       wiki       46: 
1.14      wiki       47: # TODO
1.40      wiki       48:  - A10
                     49:    - Interrupt controller
                     50:    - EMAC
                     51:  - A31
                     52:    - OTG
                     53:    - IR transmitter
                     54:    - 3G module
                     55:    - TV input
                     56:  - A80
                     57:    - MP
                     58:    - big.LITTLE support
                     59:    - USB3 (OTG and XHCI)
                     60:    - IR transmitter
1.45      wiki       61:    - HDMI (DDC and mode setting; currently relies on U-Boot for setup)
1.40      wiki       62:    - Audio codec
                     63:  - All
                     64:    - USB device mode
                     65:    - SD/MMC UHS-I support (needs sdmmc(4) changes)
                     66:    - SDIO (Bluetooth / WiFi)
                     67:    - NAND
1.44      wiki       68:    - VGA (Cubietruck, Hummingbird A31, Cubieboard4)
1.14      wiki       69: 
1.2       wiki       70: # Installation
                     71: 
1.52    ! wiki       72: ## A20 / A31 based boards
1.2       wiki       73: 
1.51      wiki       74: * Start with an ARMv7 image from *evbarm-earmv7hf/binary/gzimg/* such as *beagleboard.img* from netbsd-7, or *armv7.img* from HEAD
1.34      wiki       75: * Download a U-Boot build for your board
1.48      wiki       76:   * Download the correct build from the linux-sunxi web site <http://dl.linux-sunxi.org/nightly/u-boot-sunxi/u-boot-sunxi-mainline/u-boot-sunxi-mainline-latest/>.
1.43      mrg        77: * Write the *u-boot-sunxi-with-spl.bin* loader to the empty space at the start of the base image:
1.2       wiki       78: [[!template  id=programlisting text="""
1.33      snj        79: # dd if=u-boot-sunxi-with-spl.bin of=beagleboard.img bs=1k seek=8 conv=notrunc
1.2       wiki       80: """]]
                     81: * Write the image to an SD card.
1.43      mrg        82: * Copy the kernel (netbsd.ub) for your board to the root of the MS-DOS partition on the SD card.
1.12      wiz        83: * Create or edit uEnv.txt on the MS-DOS partition:
1.2       wiki       84: [[!template  id=programlisting text="""
                     85: bootargs=root=ld0a
                     86: uenvcmd=mmc dev 0; mmc rescan; fatload mmc 0:1 82000000 netbsd.ub; bootm 82000000
                     87: """]]
                     88: 
1.35      wiki       89: ## A80 based boards
                     90: 
1.50      wiki       91: * Cubieboard 4 U-Boot for SD card: <http://ftp.netbsd.org/pub/NetBSD/misc/jmcneill/allwinner/a80/cubieboard4-uboot.tgz>
1.35      wiki       92: [[!template  id=programlisting text="""
1.50      wiki       93: # dd if=u-boot-spl.bin of=/dev/sdd bs=1k seek=8
                     94: # dd if=u-boot-sun9iw1p1.bin of=/dev/sdd bs=1k seek=19096
1.35      wiki       95: """]]
1.50      wiki       96: * First partition needs to be at +20MB offset. Format it as MSDOS, copy 'netbsd.ub' to it as 'uImage'.
1.35      wiki       97: 
1.7       wiki       98: # Big (endian) fun
1.5       wiki       99: 
                    100: You can run this boards with a little endian (this is the default and implied by above install instructions)
1.12      wiz       101: or with a big endian kernel and userland. However, kernel and userland endianness needs to match.
1.5       wiki      102: 
                    103: To build a big endian release (or sets) use 
                    104: [[!template  id=programlisting text="""
                    105: ./build.sh -m evbearmv7hf-eb 
                    106: """]]
1.12      wiz       107: 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.
1.17      wiki      108: 
1.21      wiki      109: # FEX scripts
                    110: 
                    111: 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>.
                    112: 
                    113: 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:
                    114: 
                    115: [[!template  id=programlisting text="""
                    116: bootargs=root=ld0a sysconfig=0x43000000
                    117: uenvcmd=mmc dev 0; mmc rescan; fatload mmc 0:1 43000000 cubieboard2.bin; fatload mmc 0:1 82000000 netbsd.ub; bootm 82000000
                    118: """]]
                    119: 
1.22      wiki      120: Some pre-compiled .bin files can be found here: <http://ftp.netbsd.org/pub/NetBSD/misc/jmcneill/allwinner/fex/>
                    121: 
1.25      wiki      122: # Framebuffer console
                    123: 
                    124: To use HDMI for the console device, add *console=fb* to bootargs in uEnv.txt.
                    125: 
1.29      wiki      126: 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
                    127: 
1.27      wiki      128: # HDMI audio
                    129: 
                    130: The default audio device is the analog audio codec. To change the default device, use the *audiocfg* command:
                    131: 
                    132: [[!template  id=programlisting text="""
                    133: a31# audiocfg list
                    134: 0: [*] audio0 @ awinac0: Allwinner CODEC A31, 2 playback channels
                    135: 1: [ ] audio1 @ awinhdmiaudio0: Allwinner HDMI 1.4, 2 playback channels
                    136: a31# audiocfg default 1
                    137: setting default audio device to audio1
                    138: a31# audiocfg list
                    139: 0: [ ] audio0 @ awinac0: Allwinner CODEC A31, 2 playback channels
                    140: 1: [*] audio1 @ awinhdmiaudio0: Allwinner HDMI 1.4, 2 playback channels
                    141: """]]
                    142: 
1.42      wiki      143: # MAC address
1.17      wiki      144: 
1.42      wiki      145: 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*:
1.17      wiki      146: [[!template  id=programlisting text="""
                    147: bootargs=root=ld0a awge0.mac-address=02:a0:3d:88:1a:1e
                    148: """]]

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb