Building Buildroot & linux on Allwinner F1C100S

Prepare the toolchain

Get & unpack the toolchain:

cd /opt
wget http://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabi/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi.tar.xz
tar xvJf gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi.tar.xz
export PATH="$PATH:/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin"

Compile u-Boot

Get U-Boot:

git clone https://github.com/Lichee-Pi/u-boot.git
cd u-boot
git checkout nano-v2018.01
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- licheepi_nano_spiflash_defconfig

Configure it:

make ARCH=arm menuconfig

And compile it:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4

Compile a standalone linux kernel

Clone the linux kernel repository

git clone --depth=1 -b f1c100s-480272lcd-test https://github.com/Icenowy/linux.git

Enable JFFS2 filesytem in the menu config

make ARCH = arm menuconfig

And build the kernel zImage

make ARCH = arm CROSS_COMPILE = arm-linux-gnueabi- -j4

Write compiled binaries to the SPI flash:

sunxi-fel -p spiflash-write 0 u-boot-sunxi-with-spl.bin
sunxi-fel -p spiflash-write 0x110000 suniv-f1c100s-licheepi-nano-with-lcd.dtb
sunxi-fel -p spiflash-write 0x110000 zImage
sunxi-fel -p spiflash-write 0x510000 rootfs.jffs2

SPI partitions (dtsi):

partitions {
        compatible = "fixed-partitions";
        #address-cells = <1>;
        #size-cells = <1>;

        partition@0 {
                label = "u-boot";
                reg = <0x000000 0x100000>;
                read-only;
        };

        partition@100000 {
                label = "dtb";
                reg = <0x100000 0x10000>;
                read-only;
        };

        partition@110000 {
                label = "kernel";
                reg = <0x110000 0x400000>;
                read-only;
        };

        partition@510000 {
                label = "rootfs";
                reg = <0x510000 0xAF0000>;
        };
};

Compile the system using Buildroot

Note

to-do: I am using Buildroot to compile and assemble the whole firmware image.