xref: /haiku/docs/develop/kernel/arch/arm/allwinner_a10.rst (revision 46b7da1f4f40f7157d74fc7fb26ff9ec7f2416f2)
1a5061eceSAdrien DestuguesAllwinner A10 hardware notes
2a5061eceSAdrien Destugues############################
3a5061eceSAdrien Destugues
4a5061eceSAdrien Destugues-  http://linux-sunxi.org
5a5061eceSAdrien Destugues
6a5061eceSAdrien DestuguesHardware Information
7a5061eceSAdrien Destugues====================
8a5061eceSAdrien Destugues
9a5061eceSAdrien DestuguesThe A10 is a system-on chip. There are many devices based on it, for
10a5061eceSAdrien Destuguesexample the CubieBoard and the Rikomagic mk802 (versions I and II).
11a5061eceSAdrien Destugues
12a5061eceSAdrien Destugues-  ARMv7 Architecture (Cortex-A8)
13a5061eceSAdrien Destugues-  Mali 400MP GPU
14a5061eceSAdrien Destugues-  CedarX VPU
15a5061eceSAdrien Destugues-  SD Card Storage
16a5061eceSAdrien Destugues-  1GB RAM (DDR)
17a5061eceSAdrien Destugues-  4GB NAND Flash
18a5061eceSAdrien Destugues-  Video Outputs
19a5061eceSAdrien Destugues
20a5061eceSAdrien Destugues   -  HDMI Video Output
21a5061eceSAdrien Destugues
22a5061eceSAdrien Destugues-  Ethernet
23a5061eceSAdrien Destugues-  USB
24a5061eceSAdrien Destugues
25a5061eceSAdrien DestuguesSetting up the Haiku SD card
26a5061eceSAdrien Destugues============================
27a5061eceSAdrien Destugues
28a5061eceSAdrien DestuguesNot so fun layout here. The A10 boot ROM reads raw blocks from the SD
29a5061eceSAdrien Destuguescard (MBR style), so the bootloader can’t just be dropped in a FAT32
30a5061eceSAdrien Destuguespartition.
31a5061eceSAdrien Destugues
32a5061eceSAdrien Destugues-  8KB partition table
33a5061eceSAdrien Destugues-  24KB SPL loader
34a5061eceSAdrien Destugues-  512KB u-boot
35a5061eceSAdrien Destugues-  128KB u-boot environment variables
36a5061eceSAdrien Destugues-  352KB unused
37a5061eceSAdrien Destugues-  partition 1 – FAT32 or ext2 (anything u-boot can read is fine)
38a5061eceSAdrien Destugues-  partition 2 – BeFS, Haiku filesystem, type ‘eb’
39a5061eceSAdrien Destugues
40a5061eceSAdrien DestuguesNote this layout can be a bit different depending on the u-boot version
41a5061eceSAdrien Destuguesused, some versions will store the environment in uEnv.txt in the FAT32
42a5061eceSAdrien Destuguespartition instead. Since everything is loaded from the SD Card, we are
43a5061eceSAdrien Destuguesfree to customize the u-boot or even remove it and get haiku_loader
44a5061eceSAdrien Destuguesbooting directly.
45a5061eceSAdrien Destugues
46a5061eceSAdrien DestuguesBoot Partition
47a5061eceSAdrien Destugues--------------
48a5061eceSAdrien Destugues
49a5061eceSAdrien DestuguesRequired Files
50a5061eceSAdrien Destugues~~~~~~~~~~~~~~
51a5061eceSAdrien Destugues
52a5061eceSAdrien Destugues-  haiku_loader: Haiku Loader
53a5061eceSAdrien Destugues-  haiku-floppyboot.tgz: Compressed image with Haiku kernel
54a5061eceSAdrien Destugues
55a5061eceSAdrien DestuguesBooting
56a5061eceSAdrien Destugues=======
57a5061eceSAdrien Destugues
58a5061eceSAdrien Destugues1. SOC load SPL
59a5061eceSAdrien Destugues2. SPL loads u-boot
60a5061eceSAdrien Destugues3. u-boot loads and run the kernel
61a5061eceSAdrien Destugues
62a5061eceSAdrien DestuguesSPL is a small binary (24K) loaded from a fixed location on the SD card.
63a5061eceSAdrien DestuguesIt does minimal hardware initializations, then loads u-boot, also from
64a5061eceSAdrien Destuguesthe SD card. From there on things go as usual.
65a5061eceSAdrien Destugues
66a5061eceSAdrien DestuguesIn the long term, we can make haiku_loader be an SPL executable on this
67a5061eceSAdrien Destuguesplatform, if it fits the 24K size limit, or have a custom stage1 that
68a5061eceSAdrien Destuguesloads it. For now, u-boot can be an useful debugging tool.
69a5061eceSAdrien Destugues
70a5061eceSAdrien DestuguesScript.bin
71a5061eceSAdrien Destugues----------
72a5061eceSAdrien Destugues
73a5061eceSAdrien DestuguesIn order to work on different devices (RAM timings, PIO configs, …), the
74a5061eceSAdrien DestuguesLinux kernels for Allwinner chips use a “script.bin” file. This is
75a5061eceSAdrien Destuguesloaded to RAM at a fixed address by u-boot, then the Kernel parses it
76a5061eceSAdrien Destuguesand uses it to configure the hardware (similar to FDT).
77a5061eceSAdrien Destugues
78a5061eceSAdrien DestuguesWe should probably NOT use this, and convert the script.bin file to an
79a5061eceSAdrien DestuguesFDT instead. The format is known and there are tools to convert the
80a5061eceSAdrien Destuguesbinary file to an editable text version and back (bin2fex and fex2bin).
81a5061eceSAdrien Destugues
82a5061eceSAdrien DestuguesThis FEX stuff isn’t merged in mainline Linux, and lives on as Allwinner
83a5061eceSAdrien Destuguespatches. The mainline Linux kernel has some A10 support, rewritten to
84a5061eceSAdrien Destuguesuse FDT. We may use the FDT files from there for the most common boards.
85a5061eceSAdrien Destugues
86a5061eceSAdrien DestuguesEmulation support
87a5061eceSAdrien Destugues=================
88a5061eceSAdrien Destugues
89a5061eceSAdrien Destuguesqemu 1.0 has a Cubieoard target which emulates this chip.
90a5061eceSAdrien Destugues
91a5061eceSAdrien DestuguesUseful links
92a5061eceSAdrien Destugues============
93a5061eceSAdrien Destugues
94a5061eceSAdrien DestuguesArch Linux instructions on creating a bootable SD card (partition
95a5061eceSAdrien Destugueslayout, etc)
96a5061eceSAdrien Destugueshttp://archlinuxarm.org/platforms/armv7/allwinner/cubieboard#qt-platform_tabs-ui-tabs2
97a5061eceSAdrien Destugues
98a5061eceSAdrien DestuguesLinux SunXi: mainline Linux support for the Allwinner chips. Lots of
99*7b7cc294SAdrien Destuguesdocs on the hardware. https://linux-sunxi.org/
100