Linux® Kernel - 5.4
Linux 5.4 for AT91 source code
The Linux® kernel for Microchip Arm®-based MPUs (aka AT91) is distributed as a GIT tree hosted on GitHub® as a fork of the official Linus Torvalds' git tree. The objective of the Microchip Linux team is to integrate all the AT91-related material in the official Linux Kernel.
Before completing this inclusion process, which can take time, this website provides the Linux4SAM Linux Kernel git tree for AT91 devices at:
https://github.com/linux4sam/linux-at91/tree/linux-5.4-at91
Tags
linux4sam-2020.10 tag
Enhancements are added on top of the official v5.4 Linux kernel tag, where most of the Microchip SoC features are already supported. Note as well that we re-integrate each and every stable kernel release on top of this Long Term Support (LTS) kernel revision. This means that each v5.4.x version is merged in our branch.
Here is a little summary of the main additional enhancements:
- Integration of stable kernel updates up to v5.4.81
- Update WILC driver and firmware to 15.4.1
- QSPI: big performance improvement by using enhanced memory accesses (~ 4 x read speed improvement)
- ISC / Camera sensor: align with Mainline
- KSZ8563: Fix number of ports and convert to phylink
- SAM9X60: support for different System-In-Package (SiP) identifications
- SAM9X60: align clock sub-system with Mainline and add fractional PLL support
- Fix CAN message SRAM configuration
- SAMA5D2: Fix securam accesses
linux4sam-2020.04 tag
Enhancements are added on top of the official v5.4 Linux kernel tag, where most of the Microchip SoC features are already supported. Note as well that we re-integrate each and every stable kernel release on top of this Long Term Support (LTS) kernel revision. This means that each v5.4.x version is merged in our branch.
Here is a little summary of the main additional enhancements:
- Integration of stable kernel updates up to v5.4.41
- Update WILC driver & firmware to 15.4
- Integration of SAMA5D2-ICP board in the release
- Implement the I2C bus recovery mechanism
- Allow using more than 4 GPIOs as CS in the atmel-spi driver
- Add support for phylink in the MACB driver
- Master clock register offset fixes for SAM9X60 in shutdown, reset controller and PM SoC drivers
- Improve power saving modes by disabling the CPU PLL for SAM9X60
- Add SAMA5D2-ADC additional software trigger support (for example, sysfs trigger)
- Add real real-time timer (RTT) driver for SAM9X60
- Fix fast drop of VDDCORE on shutdown operations for SAM9X60
- Refactor reset controller driver
- Switch the AES and TDES crypto drivers to the skcipher API. Clean the drivers and add various fixes.
- Mainline SAM9X60 HWRNG support
- Add support for SHA204A (I2C) random number generator
- DMA drivers locking improvement and deadlock fixes
- Fix possible MMIO window size overrun in QSPI driver
- USB device controller (gadget) driver cleanup and fix for Vbus disconnect DMA issue
- Add support for Micron®/Aptina® MT9V022 monochrome camera sensor for both ISC-based MPUs and ISI-based MPUs.
Getting Kernel sources
To get the source code, you have to clone the repository:
Cloning into 'linux-at91'...
remote: Enumerating objects: 50, done.
remote: Counting objects: 100% (50/50), done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 7282027 (delta 24), reused 17 (delta 6), pack-reused 7281977
Receiving objects: 100% (7282027/7282027), 2.09 GiB | 15.93 MiB/s, done.
Resolving deltas: 100% (6114478/6114478), done.
Checking out files: 100% (61813/61813), done.
$ cd linux-at91
The source code has been taken from the master branch, which is pointing to 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 update linux4sam
Fetching linux4sam
From git://github.com/linux4sam/linux-at91
* [new branch] linux-2.6.39-at91 -> linux4sam/linux-2.6.39-at91
* [new branch] linux-3.10-at91 -> linux4sam/linux-3.10-at91
* [new branch] linux-3.15-at91 -> linux4sam/linux-3.15-at91
* [new branch] linux-3.18-at91 -> linux4sam/linux-3.18-at91
* [new branch] linux-3.4.9-at91 -> linux4sam/linux-3.4.9-at91
* [new branch] linux-3.6.9-at91 -> linux4sam/linux-3.6.9-at91
* [new branch] linux-4.1-at91 -> linux4sam/linux-4.1-at91
* [new branch] linux-4.4-at91 -> linux4sam/linux-4.4-at91
* [new branch] linux-4.9-at91 -> linux4sam/linux-4.9-at91
* [new branch] linux-4.14-at91 -> linux4sam/linux-4.14-at91
* [new branch] linux-4.19-at91 -> linux4sam/linux-4.19-at91
* [new branch] linux-5.4-at91 -> linux4sam/linux-5.4-at91
* [new branch] master -> linux4sam/master
If you want to use another branch, you can list them and use one of them by doing this:
origin/HEAD -> origin/master
origin/linux-2.6.39-at91
origin/linux-3.10-at91
origin/linux-3.15-at91
origin/linux-3.18-at91
origin/linux-3.4.9-at91
origin/linux-3.6.9-at91
origin/linux-4.1-at91
origin/linux-4.4-at91
origin/linux-4.9-at91
origin/linux-4.14-at91
origin/linux-4.19-at91
origin/linux-5.4-at91
origin/master
$ git checkout origin/linux-5.4-at91 -b linux-5.4-at91
Branch linux-5.4-at91 set up to track remote branch linux-5.4-at91 from origin.
Switched to a new branch 'linux-5.4-at91'
Configure and Build the Linux kernel
Now you have to configure the Linux kernel according to your hardware. We have two default configurations for the AT91 SoC in arch/arm/configs
arch/arm/configs/sama5_defconfig
- at91_dt_defconfig: for SAM9 (ARM926) series chips
- sama5_defconfig: for SAMA5 series chips
Now we configure and build a kernel for the board:
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 the default configuration using the menuconfig
Now, in the menuconfig dialog, you can easily add or remove some features. Once done, move to <Exit> with the arrows and press this button, hitting the Enter key to exit from this screen.
Build the Linux kernel image. Before you build, you need to set up the cross-compile toolchain. Check this section.
[..]
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Now you have a usable compressed kernel image zImage.
If you need an uImage, you can run this additional step:
[..]
Kernel: arch/arm/boot/zImage is ready
UIMAGE arch/arm/boot/uImage
Image Name: Linux-4.1.0-linux4sam_5.3+
Created: Fri Sep 9 17:02:45 2016
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3441072 Bytes = 3360.42 kB = 3.28 MB
Load Address: 20008000
Entry Point: 20008000
Image arch/arm/boot/uImage is ready
[..]
DTC arch/arm/boot/dts/at91-kizbox2.dtb
DTC arch/arm/boot/dts/at91-nattis-2-natte-2.dtb
DTC arch/arm/boot/dts/at91-sama5d27_som1_ek.dtb
DTC arch/arm/boot/dts/at91-sama5d2_ptc_ek.dtb
DTC arch/arm/boot/dts/at91-sama5d2_xplained.dtb
DTC arch/arm/boot/dts/at91-sama5d3_xplained.dtb
DTC arch/arm/boot/dts/at91-tse850-3.dtb
DTC arch/arm/boot/dts/sama5d31ek.dtb
DTC arch/arm/boot/dts/sama5d33ek.dtb
DTC arch/arm/boot/dts/sama5d34ek.dtb
DTC arch/arm/boot/dts/sama5d35ek.dtb
DTC arch/arm/boot/dts/sama5d36ek.dtb
DTC arch/arm/boot/dts/sama5d36ek_cmp.dtb
DTC arch/arm/boot/dts/at91-sama5d4_ma5d4evk.dtb
DTC arch/arm/boot/dts/at91-sama5d4_xplained.dtb
DTC arch/arm/boot/dts/at91-sama5d4ek.dtb
DTC arch/arm/boot/dts/at91-sama5d4ek_isi.dtb
DTC arch/arm/boot/dts/at91-vinco.dtb
[..]
If the building process is successful, the final images can be found under arch/arm/boot/ directory.
Recent FAQ
- Crypto Hardware Acceleration
- Use of the AT91 ADC driver
- Image Sensor Controller White balance features
- Using ISC (Image Sensor Controller)
- Using ISI (Image Sensor Interface) in Linux4SAM 6.0 and later
- Using PTC (Peripheral Touch Controller)
- How to use Pulse Width Modulation driver
- Using the SAMA5D2-Compatible Resistive Touchscreen
- eMMC support for SAMA5D27 SOM1 EK board
- USB Gadget Configuration
- How to use the Atmel KMS/DRM LCD driver
- Using MaxTouch
- External Component on External Bus Interface