Professional Documents
Culture Documents
This page provides instructions for the legacy unmaintained Allwinner BSP.
It is only here for historical reasons. Please follow the Mainline U-Boot / Mainline Kernel
Howto.
This page describes the process to combine Allwinners binary boot0, an SDK U-Boot, an SDK
linux kernel and other bits together to create a useful SD-card from scratch, the basis for further
hacking.
This page is only suited for H3 based devices, please look under See also for other manual build
howtos.
We of course do not build a whole distribution, we only build U-Boot, the kernel and a handful of
tools, and then use an existing rootfs to get a useful system. Depending on the rootfs size, you might
want to use a 2GB or larger SD Card. SD-card partitioning and formatting will be taken care of
later.
Contents
It is only here for historical reasons. Please follow the Mainline U-Boot / Mainline Kernel
Howto.
SDKs only ship a binary version of boot0. This is a pristine version, and needs to be seeded with
information such as the debug UART, DRAM clock rates, NAND/MMC ports. Normally this is
done during the packing process. This section goes through the process manually. There are 2
flavors of boot0: 1 for NAND, and 1 for SD/MMC. One will not work with the other, as boot0 loads
the next stage bootloader (U-Boot) from the respective supported storage. The boot0 binary can be
found under
lichee/tools/pack/chips/sun8iw7p1/bin/
The following is a series of commands (ELF 64-bit) to properly prepare boot0 for usage.
# Using sun8iw7p1 "dolphin-p1" Board as an example
# Under lichee/tools/pack
# Copy boot0
cp -fv chips/sun8iw7p1/bin/boot0_sdcard_sun8iw7p1.bin out/boot0_sdcard.fex
For compiling The fex file it's preferable to use fex2bin (fexc) from sunxi-tools
# Compile fex file with fex2bin (sunxi-tools)
fex2bin out/sys_config.fex out/sys_config.bin
This will give you some errors, but they are simple to fix.
Continue with commands from SDK:
# Patch sdcard boot0
pctools/linux/mod_update/update_boot0 out/boot0_sdcard.fex out/sys_config.bin
SDMMC_CARD
You can then dd the boot0 image onto an SD card. See below for instructions.
Building u-boot
This page provides instructions for the legacy unmaintained Allwinner BSP.
It is only here for historical reasons. Please follow the Mainline U-Boot / Mainline Kernel
Howto.
Building U-Boot is fairly straightforward. But before building check env settings in: brandy/u-boot-
2011.09/include/configs/sun8iw7p1.h -> #define CONFIG_EXTRA_ENV_SETTINGS
Then build the U-Boot binary:
lichee$ cd brandy/u-boot-2011.09
u-boot-2011.09$ make
[...]
arm-linux-gnueabi-objcopy --gap-fill=0xff -O binary u-boot u-boot.bin
'u-boot-sun8iw7p1.bin' -> '../../tools/pack/chips/sun8iw7p1/bin/u-boot-
sun8iw7p1.bin'
The last line shows the U-Boot binary being copied to the packing directory. This is because the
binary still needs to be seeded with information from the fex file.
The following is an example to manually patch u-boot with sys_config.bin. See the boot0 section
how to prepare it:
# Under lichee/tools/pack
# Copy U-Boot
cp -fv chips/sun8iw7p1/bin/u-boot-sun8iw7p1.bin out/u-boot.fex
# Patch U-Boot
pctools/linux/mod_update/update_uboot out/u-boot.fex out/sys_config.bin
You can then dd the updated u-boot.fex (u-boot.bin) image onto an SD card. See below for
instructions.
# write u-boot
dd if=u-boot.fex of=/dev/sdX bs=1k seek=16400
The SDK default config for u-boot only supports FAT filesystems, so you will need have a small
FAT boot partition to store your kernel and other boot files.
It is only here for historical reasons. Please follow the Mainline U-Boot / Mainline Kernel
Howto.
cp rootfs.cpio.gz output/
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- sun8iw7p1smp_min_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=output
modules_install
Now you can copy the generated uImage and modules to your SD card.
(Replace <PATH_TO_KERNEL_TREE> with the directory you have built your kernel in as
described above.)
Boot!
Now you should be able to unmount your SDCard filesystems, and you should be able to boot your
brand new installation.
See also
We have Manual build howtos for all SoCs:
H3 Manual build howto
Manual build howto
Categories:
• Tutorial
• Manual build howto
• Create account
• Log in
• Page
• Discussion
• Read
• View source
• View history
Navigation
• Main page
• Community portal
• Recent changes
• Random page
• Help
Tools
• What links here
• Related changes
• Special pages
• Printable version
• Permanent link
• This page was last modified on 25 January 2017, at 10:31.
• This page has been accessed 65,026 times.
• Content is available under Creative Commons Attribution unless otherwise noted.
• Privacy policy
• About linux-sunxi.org
• Disclaimers
•
•