File:  [NetBSD Developer Wiki] / wikisrc / ports / evbarm / allwinner.mdwn
Revision 1.37: download - view: text, annotated - select for diffs
Sun Dec 7 14:28:37 2014 UTC (6 years, 5 months ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by jmcneill: Note A80 RTC support, audio codec not supported on A80, OTG only on A20, framebuffer only for A20/A31

    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:  - Cubieboard 4 (ALLWINNER_A80) *NetBSD-current*
    9:  - Cubietruck (CUBIETRUCK)
   10:  - [Merrii Hummingbird A31](http://www.merrii.com/en/pla_d.asp?id=172) (HUMMINGBIRD_A31)
   11: 
   12: # Supported hardware
   13:  - SoCs
   14:    - Cortex-A7: A20 (2-core), A31 (4-core), A80
   15:    - Cortex-A7/A15: A80 (4-core A7 + 4-core A15)
   16:  - SD/MMC controller (DMA)
   17:  - DMA controller
   18:  - GPIO
   19:    - Configuration using FEX scripts is supported
   20:  - UART
   21:  - I2C
   22:  - P2WI (A31) / RSB (A80)
   23:  - PMU
   24:    - AXP209 (A20)
   25:    - AXP221 (A31)
   26:    - AXP806 (A80)
   27:    - AXP809 (A80)
   28:  - Watchdog timer
   29:  - RTC
   30:    - A20/A31: integrated RTC, PCF8563
   31:    - A80: AC100
   32:  - Audio codec (A20/A31)
   33:  - USB host
   34:    - OHCI
   35:    - EHCI
   36:    - OTG (A20)
   37:  - SATA (A10/A20)
   38:  - Gigabit Ethernet (GMAC)
   39:  - HDMI (A20/A31)
   40:    - DDC / EDID mode detection
   41:    - Audio support
   42:  - Framebuffer (A20/A31)
   43:  - IR receiver (A20/A31)
   44: 
   45: # TODO
   46:  - SoCs
   47:    - Cortex-A8: A10
   48:    - Cortex-A7/A15: A80 SMP
   49:  - OTG (A31)
   50:  - USB device mode
   51:  - Bluetooth / WiFi (Cubietruck, Hummingbird A31)
   52:  - 3G (Hummingbird A31)
   53:  - SD/MMC UHS-I support (needs sdmmc(4) changes)
   54:  - TV input (Hummingbird A31)
   55:  - NAND
   56:  - Fast Ethernet (EMAC)
   57:  - IR transmitter (A20)
   58: 
   59: # Installation
   60: 
   61: ## A10 / A20 / A31 based boards
   62: 
   63: * Start with an ARMv7 image from *evbarm-earmv7hf/binary/gzimg/* such as *beagleboard.img*
   64: * Download a U-Boot build for your board
   65:   * A10/A20: Download from the linux-sunxi web site <http://dl.linux-sunxi.org/nightly/u-boot-sunxi/u-boot-sunxi/u-boot-sunxi-latest/>
   66:   * A31: The standard u-boot-sunxi tree doesn't support A31 yet. Until sun6i support is merged, a build is available at <http://dis.invisible.ca/allwinner/a31/> 
   67: * Write the *u-boot-sunxi-with-spl.bin* loader to the base image:
   68: [[!template  id=programlisting text="""
   69: # dd if=u-boot-sunxi-with-spl.bin of=beagleboard.img bs=1k seek=8 conv=notrunc
   70: """]]
   71: * Write the image to an SD card.
   72: * Copy the kernel (netbsd.ub) for your board to the root of the MS-DOS partition.
   73: * Create or edit uEnv.txt on the MS-DOS partition:
   74: [[!template  id=programlisting text="""
   75: bootargs=root=ld0a
   76: uenvcmd=mmc dev 0; mmc rescan; fatload mmc 0:1 82000000 netbsd.ub; bootm 82000000
   77: """]]
   78: 
   79: ## A80 based boards
   80: 
   81: * Cubieboard 4 SDK (lubuntu) U-Boot env:
   82: [[!template  id=programlisting text="""
   83: baudrate=115200
   84: boot_normal=fatload mmc 0:1 20007800 uimage;bootm 20007800
   85: bootcmd=run setargs_cubie boot_normal
   86: bootdelay=3
   87: console=ttyS0,115200
   88: console1=tty1
   89: init=/init
   90: loglevel=8
   91: mmc_root=/dev/mmcblk0p2
   92: setargs_cubie=setenv bootargs console=${console1} console=${console} root=${mmc_root} loglevel=${loglevel}
   93: stderr=serial
   94: stdin=serial
   95: stdout=serial
   96: """]]
   97: 
   98: # Big (endian) fun
   99: 
  100: You can run this boards with a little endian (this is the default and implied by above install instructions)
  101: or with a big endian kernel and userland. However, kernel and userland endianness needs to match.
  102: 
  103: To build a big endian release (or sets) use 
  104: [[!template  id=programlisting text="""
  105: ./build.sh -m evbearmv7hf-eb 
  106: """]]
  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.
  108: 
  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: 
  120: Some pre-compiled .bin files can be found here: <http://ftp.netbsd.org/pub/NetBSD/misc/jmcneill/allwinner/fex/>
  121: 
  122: # Framebuffer console
  123: 
  124: To use HDMI for the console device, add *console=fb* to bootargs in uEnv.txt.
  125: 
  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: 
  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: 
  143: # Board specific notes
  144: 
  145: ## Merrii Hummingbird A31
  146: 
  147: 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.
  148: 
  149: To overcome this, you can specify your own MAC address in *uEnv.txt*:
  150: [[!template  id=programlisting text="""
  151: bootargs=root=ld0a awge0.mac-address=02:a0:3d:88:1a:1e
  152: """]]

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