Allwinner Sun4i/5i/6i/7i (sunxi)

Various vendors are offering development boards / single-board computer based on the Allwinner SoCs. These are running various flavors of the A1x/A20 SoCs, with different buildouts. The mach is called "sunxi".

Supported Versions

Model Version Launch Date OpenWrt Version Supported Model Specific Notes
A10 - trunk Single Cortex-A8
A10s - trunk Single Cortex-A8
A13 - trunk Single Cortex-A8
A20 - trunk Dual Cortex-A7
A23 - none Dual Cortex-A7
A31 - none Quad Cortex-A7
A80 - none 8-core big.LITTLE (4x A15 + 4x A7)

Hardware Highlights

Model SoC Memory Flash/NAND Network USB Serial JTAG UEXT Other
Olimex A10-OLinuXino-LIME A10 512MB μSD 10/100 Mbps ethernet 2x USB2 yes n/a yes HDMI, SATA
Olimex A13-OLinuXino-WIFI A13 512MB μSD, 4GB NAND RTL WiFi 3x USB2 yes n/a yes VGA
Olimex A20-OLinuXino-MICRO A20 1024GB SD, μSD, 4GB NAND 10/100 Mbps ethernet 2x USB2 yes n/a yes HDMI, SATA, audio
Cubieboard A10 1024MB μSD, 4GB NAND 10/100 Mbps ethernet 2x USB2 yes n/a yes HDMI, SATA, audio
Cubieboard2 A20 1024MB μSD, 4GB NAND 10/100 Mbps ethernet 2x USB2 yes n/a yes HDMI, SATA, audio
Cubietruck A20 2048MB μSD, 8GB NAND BCM WiFi, 10/100/1000 Mbps ethernet 2x USB2 yes n/a yes HDMI, VGA, SATA, audio, IR, TOSlink
pcDuino A20 1024MB μSD, 2GB NAND 10/100 Mbps ethernet 2x USB2 yes n/a yes HDMI

UEXT is an open standard port to provide serial, I2C and SPI expansion ports.

Installation

This section details what is required to install and upgrade OpenWrt. The generic procedure is described here: generic.flashing; this devices don't have a flash chip soldered to the PCB but an SD-Card slot.

Status

Patches have been back-ported from the http://linux-sunxi.org/ community, including device trees, clocks, timers, PIO, ethernet, USB, and, MMC. These patches are currently being mainlined - eta. Linux 3.14 and 3.15 - by the community.

  • SPL: done
  • u-boot: done
  • kernel: done
  • rootfs: done

You have the option to boot the board from initramfs, SD card (recommended), USB storage, or NFS.

Working

  • SD/MMC
  • USB EHCI
  • EMAC (100/100 Mbps)
  • Clocks
  • Timers
  • A20 GMAC (10/100/1000 Mbps)

Being worked on

  • SMP on A20 doesn't work yet
  • USB OHCI
  • NAND (have some snippets already)

Not being worked on

  • Sound

Installation process

SD layout

SD layout with 512 byte blocks:

NAME start block size
MBR 0 1 block
u-boot-with-spl.bin 16 (8 KB) ~250 KB
FAT 2048 (1 MB) 15 MB
EXT4 32768 (16 MB) rest

SD preparation

We assume /dev/mmcblk0 is the SD card and Cubietruck is the board.

  • Partition the SD card. Two partitions are created. The first is the boot partition, /dev/mmcblk0p1. The second is the root partition, /dev/mmcblk0p2.


# fdisk /dev/mmcblk0

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-15523839, default 2048): 2048
Last sector, +sectors or +size{K,M,G} (2048-15523839, default 15523839): +15M 

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p    
Partition number (1-4, default 2): 2
First sector (32768-15523839, default 32768): 32768
Last sector, +sectors or +size{K,M,G} (32768-15523839, default 15523839): +240M

Command (m for help): p

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x17002d14

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048       32767       15360   83  Linux
/dev/mmcblk0p2           32768      524287      245760   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

  • Re-read the new partition table layout (e.g. by removing and re-inserting the SD card).
  • Copy the SPL + U-boot image to the card


# dd if=bin/sunxi/uboot-sunxi-Cubietruck/openwrt-sunxi-Cubietruck-u-boot-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8

  • Create a boot (FAT32) partition.


# mkfs.vfat /dev/mmcblk0p1

  • Mount the boot partition.


# mount -t vfat /dev/mmcblkp1 /mnt

  • Copy the U-Boot environment file uEnv.txt to the boot partition.


# cp bin/sunxi/uboot-sunxi-Cubietruck/openwrt-sunxi-Cubietruck-uEnv.txt /mnt/uEnv.txt

  • Copy the device tree data to the boot partition.


# cp bin/sunxi/sun7i-a20-cubietruck.dtb /mnt/dtb

  • Copy the kernel image to the boot partition.


# cp bin/sunxi/openwrt-sunxi-uImage /mnt/uImage

  • Resize the root filesystem image to match the partition size.


# resize2fs bin/sunxi/openwrt-sunxi-root.ext4 240M

  • Create the root filesystem.


# dd if=bin/sunxi/openwrt-sunxi-root.ext4 of=/dev/mmcblk0p2 bs=128k

  • Wrap up (flush buffers and unmount boot partition).


# sync
# umount /mnt

Upgrading OpenWrt

generic.sysupgrade

*WiP*

If you have already installed OpenWrt and like to reflash for e.g. upgrading to a new OpenWrt version you can upgrade using the mtd command line tool. It is important that you put the firmware image into the ramdisk (/tmp) before you start flashing.

Links

For further information about the SoCs, go to http://linux-sunxi.org/Main_Page

Tags

Back to top

doc/hardware/soc/soc.allwinner.sunxi.txt · Last modified: 2014/02/21 18:13 by patapovich