3.1.3 Building Kernel Image
Perform the following steps to build the kernel.
- Clone the linux4microchip GitHub
linux kernel repository by using the following command:
$ git clone https://github.com/linux4microchip/linux.git
- Move to the kernel directory and export the toolchain path by using the following
command:
export CROSS_COMPILE=arm-linux-gnueabi-
- Configure the kernel by using the
following
commands:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- sama5_defconfig
- Modify the default kernel configuration using the menuconfig. Use the following command
to
execute:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
- Select the ATWILC driver module, from the GUI selection window:
- Go to Device Drivers > Network device support > Wireless LAN.
- Press M to modularize WILC SDIO to include the module during run time.
- Save the configuration.
- Include the cfg80211 module as an inbuilt
module to kernel, from the GUI selection window:
- Go to Networking support > wireless.
- Press * to include the cfg80211 – wireless configuration API module to the kernel.
- Save the configuration.
- Build the kernel using the following
command:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage
zImage is available in the
arch/arm/boot
directory. - Build the modules using the following
command:
The file$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules
wilc-sdio.ko
will be available in thedriver/net/wireless/microchip/wilc1000
directory. - Build the
.dtb
file using the following command:
The$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- at91-sama5d2_xplained.dtb
at91-sama5d2_xplained.dtb
file is available in thearch/arm/boot/dts
folder.