SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
Список вопросов Печать| RemiZOffAlex Создано: 2016-12-12 20:37:55.380058 Обновлено: 2016-12-12 20:37:55.380058 |
|---|
|
This page describe how the stock firmware(a livesuite image) of A10 products boots. A10 boot overviewA10 is a quite 'closed chip'. There is a brom in the chip, which can not be modified. This brom will load program from external storage(nand, mmc), which is called boot0 in allwinner. Brom will check the header of boot0, and get hardware information from boot0. The hardware information is in a config file called sys_config.fex. A pc tools will read the config file, and write the hardware information to the head of boot0. After boot0 is booted up, it will continue to load another loader boot1, boot1 init all other hardware and provides hardware abstracts and services. According to the boot OS, boot1 loads an arm elf program, boot.axf. For booting linux, boot.axf loads the u-boot and jumps to the u-boot. Then u-boot will take over. So, the whole boot process is: brom -> boot0 -> boot1 -> boot.axf -> u-boot -> kernel BROMBrom in A10 is at the address 0xFFFF0000, After power up, arm core will fetch the first instruction at 0xFFFF0000 and execute it. The brom code contains two parts, one is the normal boot, the other is a block of code called FEL, which is mainly a USB communication program with host pc. Steps of brom boot:
boot.axfThe closed-source boot.axf bootloader that is included by default on the Android firmwares reads its configuration from the first NAND partition (boot). It can boot both u-boot and a stripped Linux kernel called bImage by the build scripts, which can be obtained by running:
The default structure of a BOOT partition is the following one:
The booting configuration is defined by the file linux/linux.ini:
The params file contains the kernel boot parameters, which is loaded to the indicated memory location. Also, the script_info specifies where in memory to copy script.bin, which contains the board configuration. The recovery.ini and paramsr files contain the same information but with the kernel that is loaded for recovery. Recovery access is triggered, at least on the Ainol Novo7 that was used for testing, by pressing Volume+ and On keys at the same time. Note that the boot partition is usually 16mb in NAND, even though the kernel reports it as being 128mb size. Don't try to copy anything big to it (i.e a new bImage), as that will cause the FAT to overflow and mess things up. boot.axf also boots to FEL when a special combination is triggered to access FEL to flash a new firmware. On the Novo, this is done by:
boot.axf can also "chainload" u-boot, replacing the bImage portion by:
This is what is done on ICS firmwares on tablets, where what is booted is an Android boot.img by u-boot. ToolsThere is a tool mksunxiboot to make the binary code can be loaded by brom.
so the u-boot on the sdcard can be loaded and run. Forcing FEL boot mode without bsp/recovery/usbboot buttonIt's also possible to boot into FEL mode by using a specifically prepared SD-Card. Download http://www.hno.se/code/A10/fel-boot.sunxi and write it to the A10 boot sector of an sdcard
The source to this file can be found in the sunxi-tools package. |