Sunchip CX-A99

This board is used in at least five similar Android TV box products. So far all known products with this board use eMMC as storage, but the board is prepared for use of NAND flash instead of eMMC.

= Identification =

In FEL mode, the device show up as "1f3a:efe8 Onda (unverified) V972 tablet in flashing mode" in lsusb.

In android, under Settings->About Tablet, you will find:
 * Model Number: 
 * Build Number: 

After opening the case, a sticker with the text CX-A99 becomes visible on the Ethernet connector. The main PCB has "A99-V1.1" and "2014-12-15" printed on it next to the Ethernet connector.

= Sunxi support =

Sunxi/Legacy kernel and U-Boot
Like all A80 based devices, there is no support in u-boot-sunxi. Like all A80 based devices, there is no support in our sunxi kernel.

Mainline kernel and U-Boot
Device Tree file and some of the missing drivers are in progress. See below for patches. The multi_v7_defconfig should get you a working (although rather large) kernel, except that you need to enable CONFIG_MFD_AC100 and CONFIG_RTC_DRV_AC100 yourself.

Kernel 4.9 and 4.10-rc series warning: You must apply this patch to avoid damage to the DRAM chips through overvoltage. There was a bug in the axp20x driver causing the wrong regulator to be accessed. Hopefully the patch will appear in the 4.9.7 and 4.10-rc6 releases.


 * 2016-08-19
 * Kernel patch v4 with support for eMMC/SD storage, USB 2.0 ports, SATA port, AC100 real-time clock, UART (serial console header) and OZ80120 voltage regulator.


 * 2016-08-14
 * Kernel patch v2 with support for eMMC/SD storage, USB 2.0 ports, SATA port, AC100 real-time clock, UART (serial console header) and OZ80120 voltage regulator.

Manual build
= Tips, Tricks, Caveats =

FEL mode
The button on the underside of the board triggers FEL mode. This button can be accessed through a hole in the bottom of the case (i.e. without disassembling the device). See vendor instructions.

Use the file FES    _FES_1-0000000000 from the manufacturer image for SPL/boot0 when booting over USB.

Note: To turn off power to the board, you will need to unplug the cable from the USB OTG port in addition to disconnecting the 12 V supply. Otherwise, the board may well continue to run on just the 5 V supplied through the USB connector.

Device disassembly
Unscrew each of the four screws under the rubber pad in each corner of the bottom of the case. The case can now be opened carefully.

Unscrew the screw holding the small board with red/blue led and IR receiver to the top part of the case.

Unscrew the screw holding the ground wire to the top part of the case.

Unscrew the four screws holding the main PCB to the top part of the case.

Carefully unplug the antenna cable from the main PCB. The main PCB can now be removed from the case.

Locating the UART (serial console port)
Opposite of the SD or micro-SD card slot, there is a 5-pin header, with a small, white triangle pointing to pin 1. The pinout is:


 * 1	Ground.
 * 2	Ground.
 * 3	+3.3 V.
 * 4	UART0 RX input (GPIO pin PH13) with 3.3 V levels.
 * 5	UART0 TX output (GPIO pin PH12) with 3.3 V levels.

TIP: When logged into the console, use the stty command to set a terminal size that matches that of your terminal window, e.g. "stty columns 262 rows 78", so your screen will not become messed up.

Wifi firmware
You need firmware and a data file for the firmware. The data file is on the Android root partition:

# mkdir --parents /mnt/android-root # mkdir --parents /lib/firmware/brcm # mount --read-only /dev/disk/by-path/platform-1c11000.mmc-part7 /mnt/android-root # cp -p /mnt/android-root/vendor/modules/nvram_ap6335.txt /lib/firmware/brcm/brcmfmac4339-sdio.txt # umount /mnt/android-root

The firmware can be downloaded from the kernel.org firmware repository:

# cd /lib/firmware/brcm # curl --xattr --remote-time --remote-name https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/brcm/brcmfmac4339-sdio.bin or # wget --timestamping https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/brcm/brcmfmac4339-sdio.bin

= Hardware details =

Power routing
Default voltages are taken from sys_config1.fex, which also provides most of the information in this section.


 * 12 V from DC input jack
 * SATA connector 12 V
 * NX5AA ? 5 V switching mode regulator (always on)
 * SATA connector 5 V
 * 3 * AT6280B switch
 * 3 * USB connector
 * X-Powers AXP808 switching mode (dcdcN) and linear (XldoN) regulators
 * aldo1 (default: 3.0 V, on)
 * aldo2 (default: 1.8 V, on)
 * Pin group G
 * Pin group M
 * Audio (supply "aldo2")
 * Wireless Ethernet/Bluetooth I/O (supply 2)
 * aldo3 (default: 2.5 V, on)
 * Pin group A
 * Wired Ethernet (supply 1)
 * bldo1 (default: 1.8 V, on)
 * DLLs and PLLs? (system hangs if turned off)
 * bldo2 (default: 0.9 V, on)
 * CPUS? (system hangs if turned off)
 * bldo3 (default: 1.2 V, off)
 * USB HSIC port
 * bldo4 (default: 1.1 V, on)
 * DWC HDMI Controller
 * cldo1 (default: 3.3 V, on)
 * Pin group L (controls regulators for USB 2.0 ports and Cortex-A15 cores)
 * LEDs
 * cldo2 (default: 3.3 V, off) (wired in parallel with cldo3)
 * Wireless Ethernet/Bluetooth supply 0
 * cldo3 (default: 3.3 V, off) (wired in parallel with cldo2)
 * Wireless Ethernet/Bluetooth supply 1
 * dcdca (default: 0.9 V, on)
 * 4 * ARM Cortex-A7 cores
 * dcdcb (default: 1.5 V, on)
 * DRAM
 * dcdcc (default: 0.9 V, off)
 * PowerVR GPU?
 * dcdcd (default: 0.9 V, on)
 * SYS? (system hangs immediately if turned off)
 * dcdce (default: 3.3 V, on)
 * Pin group B
 * Pin group C
 * Pin group D
 * Pin group E
 * Pin group F
 * Pin group H
 * eMMC
 * SD card slot power pin
 * Serial console port power pin
 * SPDIF
 * sw0 (default: off)
 * Audio (supply "sw0")
 * Composite video output (GM7122)
 * Wired Ethernet (supply 0)
 * OZ80120 switching mode regulator (default: 0.9 V, on)
 * 4 * ARM Cortex-A15 cores
 * AMS1117 3.3 V linear regulator (always on) (Datasheet link but site down as of 2016-07-04)
 * JM20329 pins 5 VCCO, 10 AVDDH, 16 AVDDH, 18 AVDDH, 42 VCCO.
 * JM20329 pin 9 AVREG output (internal 1.8 V regulator) connected to pins 23 AVDDL, 36 VCCK, 44 VCCK.

A80 pins
= Pictures =

= Also known as =

Products using eMMC as storage:


 * Instabox Fantasy A8 (site down as of 2016-08-09) (no external antenna)
 * Jesurun CS-Q8 (ships with larger remote control)
 * Jesurun Maxone
 * Rikomagic (RKM) MK80/MK80LE
 * Tronsmart Draco AW80 Meta/Telos

= See also =

Manufacturer images
The archives can be extraced with e.g. The Unarchiver. You can then use awimage from awutils to unpack the image.

Extracting sys_config.fex
(Note: This is only of interest if you want to construct a Device Tree file for e.g. mainline U-Boot and mainline kernel.)

It is easy to extract it from one of the manufacturer images. Note that the Ubuntu image made by Tronsmart does not contain a correct version of this file.

Once you have root on the Android system, you can also extract the file from eMMC card partition 10:

sed -n -e '/;A80 PAD/ s/.*;A80 PAD/;A80 PAD/' -e '/^;A80 PAD/,/^cpu7/ p' /dev/mmcblk2p10 >sys_config.fex

Booting from (micro)SD card
The A80 Boot ROM will look for a boot loader at offset 8 kB into the card, load 32 kB of that into memory and execute it. You can install a boot loader from the files in a manufacturer image file. Replace $1 in the commands below with the device which holds your SD card - consider using /dev/disks/by-id to avoid mistakes.

dd bs=1024 seek=8 if='12345678_1234567890BOOT_0' of="$1" dd bs=1024 seek=19096 if='12345678_UBOOT_0000000000' of="$1"

This requires your partitions to stay clear of the two areas above, and you should also keep the legacy and mainline U-Boot card layout in mind. You can create a suitable partition table with GNU Parted:

parted --script "$1" -- mklabel msdos mkpart primary fat32 1024kiB 19096kiB mkpart primary ext2 24MiB -1s quit

This gives you a 17 MB /boot</tt> partition for e.g. kernel images and the remaining part of the card above 24 MiB as root</tt> partition.

(Partitions should be aligned to an SD card allocation unit for good write speed. 24 MB will work for allocation units of 1 MB, 2 MB, 3 MB, 4 MB, 6 MB, 8 MB, 12 MB and 24 MB. Write speed on the /boot</tt> partition is not important, however, so it need not be aligned.)