Build from source - Kernel

MACCHIATObin board currently supports Linux kernel version 4.4.52. To build the kernel binary for MACCHIATObin, first we need to make the directory into which we will clone the kernel (e.g. /home/mcbin/kernel/4.4.52/) and position into that directory:

mcbin@buildserver:~$ mkdir -p kernel/4.4.52
mcbin@buildserver:~$ cd kernel/4.4.52/

and there we clone linux-marvell repository with:

mcbin@buildserver:~/kernel/4.4.52$ git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell .

and the repo contents will be cloned inside your current directory. Now we checkout the proper branch for MACCHIATObin(linux-4.4.52-armada-17.06):

mcbin@buildserver:~/kernel/4.4.52$ git checkout linux-4.4.52-armada-17.06
Branch linux-4.4.52-armada-17.06 set up to track remote branch linux-4.4.52-armada-17.06 from origin.
Switched to a new branch 'linux-4.4.52-armada-17.06'

Next thing we need to do in order to enable building images for MACCHIATObin is to set correct definitions for ARCH and CROSS_COMPILE:

mcbin@buildserver:~/kernel/4.4.52$ export ARCH=arm64
mcbin@buildserver:~/kernel/4.4.52$ export CROSS_COMPILE=aarch64-linux-gnu-

Next we create a default ./.config file using the default values from arch/$ARCH/configs/${PLATFORM}_defconfig (in this case from arch/arm64/configs/mvebu_v8_lsp_defconfig):

mcbin@buildserver:~/kernel/4.4.52$ make mvebu_v8_lsp_defconfig

and finally start the build with:

mcbin@buildserver:~/kernel/4.4.52$ make -j4

After the build process finishes successfully, you can find the Image (named Image) in arch/arm64/boot/:

mcbin@buildserver:~/kernel/4.4.52$ ls arch/arm64/boot/
dts  Image  Image.gz  install.sh  Makefile

and the device tree blob for MACCHIATObin (named armada-8040-mcbin.dtb) can be found in arch/arm64/boot/dts/marvell/ directory.