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.

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).

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.

= 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, off)
 * sw0 (default: off)
 * Audio (supply "sw0")
 * aldo2 (default: 1.8 V, on)
 * Pin group G
 * Pin group M
 * Audio (supply "aldo2")
 * Wireless Ethernet/Bluetooth (supply 2)
 * aldo3 (default: 2.5 V, on)
 * Pin group A
 * Wired Ethernet (supply 1)
 * bldo1 (default: 1.8 V, on)
 * bldo2 (default: 0.9 V, on)
 * bldo3 (default: 1.2 V, off)
 * bldo4 (default: 1.1 V, on)
 * DWC HDMI Controller
 * cldo1 (default: 3.3 V, on)
 * Pin group L
 * cldo2 (default: 3.3 V, off)
 * Wireless Ethernet/Bluetooth supply 0
 * cldo3 (default: 3.3 V, off)
 * Wireless Ethernet/Bluetooth supply 1
 * Composite video output (GM7122)
 * Wired Ethernet (supply 0)
 * dcdc1 (default: 0.9 V, on)
 * 4 * ARM Cortex-A7 cores
 * dcdc2 (default: 1.5 V, on)
 * dcdc3 (default: 0.9 V, off)
 * DRAM RGX ?
 * dcdc4 (default: 0.9 V, on)
 * dcdc5 (default: 3.3 V, on)
 * Pin group B
 * Pin group C
 * Pin group D
 * Pin group E
 * Pin group F
 * Pin group H
 * Serial console port
 * SPDIF
 * OZ80120 switching mode regulator
 * output0 (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 (no external antenna)
 * Jesurun CS-Q8
 * Jesurun Maxone
 * Rikomagic (RKM) MK80/MK89LE
 * Tronsmart Draco AW80 Telos (SD card slot instead of micro-SD card slot)

= See also =

Manufacturer images
Tronsmart Draco_AW80_SDK3.0_151117 Android image

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

In the "Draco AW80_SDK3.0_151117" image (which can be unpacked using awutils), the file name is "COMMON _SYS_CONFIG100000". Note that the Ubuntu image made by Tronsmart does not contain a correct version of this file.

Once you have root, 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 partition for e.g. kernel images and the remaining part of the card above 24 MiB as root 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 partition is not important, however, so it need not be aligned.)