Building Mainline Kernel
We will be assuming that you are cross compiling the kernel on a x86_64 machine.
Download the latest gcc from Linaro. As of writing, it is gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz.
Download or clone a Linux 4.13+ kernel.
Make the ARM64 defconfig via: PATH=PUT_GCC_PATH_HERE/bin:$PATH make -C "PUT_LINUX_PATH_HERE" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
If you are using our u-boot, we recommend adding built-in BTRFS support via sed -i "s/CONFIG\\_BTRFS\\_FS\\=m/CONFIG\\_BTRFS\\_FS\\=y/" .config
Compile the kernel, modules, and device tree blob via: PATH=PUT_GCC_PATH_HERE/bin:$PATH make -C "PUT_LINUX_PATH_HERE" ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j4 Image modules amlogic/meson-gxl-s905x-libretech-cc.dtb
Comments
Thanks for the instructions.
Once we have the dtb and Image, how do we package this up for use on the device?
I modified the configuration to have all drivers built in (instead of modules). I then built a uImage and copied both the uImage and dtb to the first partition of the SD card.
It did not come back. I did not have serial connected so I don't know what the failure was.
@joel, For any type for debugging on these boards, it is vital to have an 3.3V UART cable. It is a really great investment for a couple of bucks on Amazon.
I agree.
For others who are getting started with the board, it would be great to have instructions that explain how to get their own kernels booting. Are you able to confirm that
mkimage
line I used is correct?Hi Joel,
The necessity of that command is to address the deficiencies in Amlogic's uboot code. The Amlogic uboot uses 1080000 as the offset which causes issues with the mainline kernel as is. Otherwise, we wouldn't need that line at all. This will be fixed once this board is supported by mainline uboot next month.
Thank you for your explination. I assume the line I used is correct? I got it working.
I was then trying to boot my own kernel over the network. I normally use FIT images, and created a fit configuration as follows:
I built this with
mkimage -f pot.its /srv/tftp/pot
and then loaded it over tftp. When I attempt to boot, I get this output and then the system hangs:@joel what's your boot args?
ex: setenv bootargs root=/dev/mmcblk1p2 rootfstype=btrfs rootflags=subvol=@ rootwait console=ttyAML0,115200 no_console_suspend;
Hi Joel,
With the 4.14 release, we moved to mainline u-boot so it is much simpler now. You can interrupt the execution at startup.