$ git clone https://github.com/linux4microchip/linux.git Cloning into 'linux'... remote: Enumerating objects: 8587836, done. remote: Total 8587836 (delta 0), reused 0 (delta 0), pack-reused 8587836 Receiving objects: 100% (8587836/8587836), 3.49 GiB | 13.44 MiB/s, done. Resolving deltas: 100% (7117887/7117887), done. Updating files: 100% (70687/70687), done. $ cd linuxThe source code has been taken from the master branch which is pointing on the latest branch we use. Note that you can also add this Linux4SAM repository as a remote GIT repository to your usual Linux git tree. It will save you a lot of bandwidth and download time:
$ git remote add linux4microchip https://github.com/linux4microchip/linux.git $ git remote update linux4microchip Fetching linux4microchip From https://github.com/linux4microchip/linux * [new branch] linux-6.1-mchp -> linux4microchip/linux-6.1-mchp * [new branch] linux-6.6-mchp -> linux4microchip/linux-6.6-mchp * [new branch] master -> linux4microchip/masterIf you want to use another branch, you can list them and use one of them by doing this:
$ git branch -r linux4microchip/linux-5.10-mchp linux4microchip/linux-5.15-mchp linux4microchip/linux-5.15-mchp+fpga linux4microchip/linux-6.1-mchp linux4microchip/linux-6.1-mchp+fpga linux4microchip/linux-6.6-mchp linux4microchip/linux-6.6-mchp+fpga linux4microchip/master $ git checkout -b linux-6.6-mchp --track remotes/linux4microchip/linux-6.6-mchp Branch linux-6.6-mchp set up to track remote branch linux-6.6-mchp from linux4microchip. Switched to a new branch 'linux-6.6-mchp'
wget -c https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz
tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz export CROSS_COMPILE=`pwd`/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-or
tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz export CROSS_COMPILE=arm-none-linux-gnueabihf- export PATH=$PATH:/YOUR/PATH/TO/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-linux-gnueabihf/bin/
export PATH=${PATH/':/YOUR/PATH/TO/arm-gnu-toolchain-VERSION-x86_64-arm-none-linux-gnueabihf/bin/'/}
arch/arm/configs
arch/arm/configs/at91_dt_defconfig arch/arm/configs/sama5_defconfig arch/arm/configs/sama7_defconfig
at91_dt_defconfig
: for SAM9 (ARM926) series chips
sama5_defconfig
: for SAMA5 series chips
sama7_defconfig
: for SAMA7 series chips
$ make ARCH=arm sama5_defconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf # # configuration written to .config #At this step, you can modify default configuration using the
menuconfig
$ make ARCH=arm menuconfigNow, in the menuconfig dialog, you can easily add or remove some features. Once done, Move to
<Exit>
with arrows and press this button hitting the Enter
key to exit from this screen.
Build the Linux kernel image, before you build you need set up the cross compile toolchain, check this section.
$ make ARCH=arm [..] Kernel: arch/arm/boot/Image is ready Kernel: arch/arm/boot/zImage is readyNow you have an usable compressed kernel image
zImage
.
If you need an uImage you can run this additional step:
make ARCH=arm uImage LOADADDR=0x20008000 [..] Kernel: arch/arm/boot/zImage is ready UIMAGE arch/arm/boot/uImage Image Name: Linux-6.6.23-linux4microchip-202 Created: Thu May 16 14:36:06 2024 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 5221704 Bytes = 5099.32 KiB = 4.98 MiB Load Address: 20008000 Entry Point: 20008000 Kernel: arch/arm/boot/uImage is ready
make ARCH=arm dtbs [..] DTC arch/arm/boot/dts/microchip/at91-sam9x60_curiosity.dtb DTC arch/arm/boot/dts/microchip/at91-sam9x60ek.dtb DTC arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dtb DTC arch/arm/boot/dts/microchip/at91-sam9x75eb.dtb DTC arch/arm/boot/dts/microchip/at91-sama5d27_som1_ek.dtb DTC arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dtb DTC arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dtb DTC arch/arm/boot/dts/microchip/at91-sama5d2_icp.dtb DTC arch/arm/boot/dts/microchip/at91-sama5d2_ptc_ek.dtb DTC arch/arm/boot/dts/microchip/at91-sama5d2_xplained.dtb DTC arch/arm/boot/dts/microchip/at91-sama7g5ek.dtb [..]If the building process is successful, the final images can be found under arch/arm/boot/ directory.
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Microchip and others, are registered trademarks or trademarks of Microchip Technology Inc. and its subsidiaries.
Arm® and others are registered trademarks or trademarks of Arm Limited (or its affiliates). Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.