Linux Kernel - 3.18

Last modified by Microchip on 2025/03/03 06:28

Linux 3.18 for AT91 source code

The Linux kernel for Atmel ARM-based SoC (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 Atmel 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-3.18-at91

Changes

  • Update atmel hlcdc driver to DRM driver.
  • Totally support devicetree. Remove the temperory code which not support devicetree.

2015.05

  • pioD is enabled in SAMA5D4, also add usart1, usart2 for SAMA5D4.
  • DRM driver fixes.

Tags

linux4sam_5.0-alpha7 tag

  • support for new SAMA5D2 SoC and the associated sama5d2 Xplained board
    • QSPI with DMA (disabled in Device Tree by default)
    • Flexcom with FIFO & DMA
      • USART interface
      • I2C interface
      • SPI interface
    • SD/MMC interface (SDHCI) + on-board eMMC
    • Audio using Class D amplifier
    • ISC
      • support YUV sensor output
      • support RGB output format
    • Crypto engines
      • AEAD support for IPSec
  • fix residue computation for HDMA
  • ISI: add RGB565, GREY, SGRBG, SBGGR (Bayer) support
  • runtime PM: added the ISI driver, modifications to the HLCD DRM driver

And the enhancements from linux4sam_4.7 tag below

linux4sam_4.7 tag

  • Based on 3.18 linux kernel
  • Update atmel hlcdc driver to DRM driver.
  • Totally support devicetree. Remove the temperory code which not support devicetree.
  • SAMA5 series boards support
  • HDMI driver for SiI902x component on SAMA5D4-EK and SAMA5D4 Xplained boards
  • add LCD driver entries in at91sam9x5 and at91sam9n12 DT (HLCD DRM driver)
  • Power management enhancements
  • Power management states on pin configuration (pinctrl OUTPUT configuration)
  • Power management pin states for: SPI, i2c, MMC, serial, LCD, SSC, IIO (ADC), ETH, NAND, CAN
  • Serial RX & TX DMA support
  • Serial fixes and enhancements
  • updated clock management for USB (OHCI and EHCI)

Getting Kernel sources

To get the source code, you have to clone the repository:

$ git clone git://github.com/linux4sam/linux-at91.git
Cloning into 'linux-at91'...
remote: Counting objects: 5239592, done.
remote: Compressing objects: 100% (764014/764014), done.
Receiving objects: 100% (5239592/5239592), 1018.56 MiB | 11.18 MiB/s, done.
remote: Total 5239592 (delta 4448248), reused 5218219 (delta 4427054)
Resolving deltas: 100% (4448248/4448248), done.
Checking out files: 100% (38567/38567), done.

The 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 linux4sam git://github.com/linux4sam/linux-at91.git
$ 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]                master     -> linux4sam/master

If you want to use an other branch, you can list them and use one of them by doing this:

$ git branch -r
  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/master
$ git checkout origin/linux-3.18-at91 -b linux-3.18-at91
Branch linux-3.18-at91 set up to track remote branch linux-3.18-at91 from origin.
Switched to a new branch 'linux-3.18-at91'

Setup ARM Cross Compiler

  • Ubuntu:
    In Ubuntu, you can install the ARM Cross Compiler by doing:
sudo apt-get install gcc-arm-linux-gnueabi
export CROSS_COMPILE=arm-linux-gnueabi-
   
  • Others:
    For others, you can download the Linaro cross compiler and setup the environment by doing:
wget -c https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabi/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz
tar xf gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz
export CROSS_COMPILE=`pwd`/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-
   

Configuration files for boards

3.18 (LINUX4SAM_5.0-ALPHA7 TAG)
BoardDescriptionBinaryDevice Tree Binary (DTB)Configuration file
sama5d2_xplainedlinux-3.18-at91 zImagezImage-sama5.binat91-sama5d2_xplained.dtb
at91-sama5d2_xplained_pda4.dtb
sama5d2_defconfighttps://www.linux4sam.org/pub/TWiki/TWikiDocGraphics/external-link.gif
3.18 (LINUX4SAM_4.7 TAG)
BoardDescriptionBinaryDevice Tree Binary (DTB)Configuration file
sama5d3xeklinux-3.18-at91 zImagezImage-sama5.binsama5d31ek.dtb
sama5d33ek.dtb
sama5d34ek.dtb
sama5d35ek.dtb
sama5d36ek.dtb
sama5_defconfighttps://www.linux4sam.org/pub/TWiki/TWikiDocGraphics/external-link.gif
sama5d3_xplainedat91-sama5d3_xplained.dtb
sama5d4ekat91-sama5d4ek.dtb
sama5d4_xplainedat91-sama5d4_xplained.dtb
at91sam9x5ekzImage-at91sam9.binat91sam9g15ek.dtb
at91sam9g25ek.dtb
at91sam9g35ek.dtb
at91sam9x25ek.dtb
at91sam9x35ek.dtb
at91_dt_defconfighttps://www.linux4sam.org/pub/TWiki/TWikiDocGraphics/external-link.gif
at91sam9n12ekat91sam9n12ek.dtb
at91sam9m10g45ekat91sam9m10g45ek.dtb

Configure and Build the Linux kernel

Now you have to configure the Linux kernel according to your hardware. We have two default configuration at91 SoC in arch/arm/configs

arch/arm/configs/at91_dt_defconfig
arch/arm/configs/sama5_defconfig
arch/arm/configs/sama5d2_defconfig
  • at91_dt_defconfig: for at91sam ARM926 series chips
  • sama5_defconfig: for SAMA5 series chips
  • sama5d2_defconfig: for SAMA5D2 chips

Now we Configure and Build kernel for board:

$ 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 menuconfig

And 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 ready

Now you have an usable compressed kernel image zImage.

If you need an uImage you can run this additional step:

make ARCH=arm uImage

[..]

  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-3.18.0-00020-g03329ca
Created:      Wed May  6 15:44:56 2015
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    3537576 Bytes = 3454.66 kB = 3.37 MB
Load Address: 20008000
Entry Point:  20008000
  Image arch/arm/boot/uImage is ready
make ARCH=arm dtbs

[..]

  DTC     arch/arm/boot/dts/at91sam9261ek.dtb
  DTC     arch/arm/boot/dts/at91sam9263ek.dtb
  DTC     arch/arm/boot/dts/at91sam9g20ek.dtb
  DTC     arch/arm/boot/dts/at91sam9g20ek_2mmc.dtb
  DTC     arch/arm/boot/dts/at91sam9m10g45ek.dtb
  DTC     arch/arm/boot/dts/at91sam9n12ek.dtb
  DTC     arch/arm/boot/dts/at91sam9rlek.dtb
  DTC     arch/arm/boot/dts/at91sam9g15ek.dtb
  DTC     arch/arm/boot/dts/at91sam9g25ek.dtb
  DTC     arch/arm/boot/dts/at91sam9g35ek.dtb
  DTC     arch/arm/boot/dts/at91sam9x25ek.dtb
  DTC     arch/arm/boot/dts/at91sam9x35ek.dtb
  DTC     arch/arm/boot/dts/at91-sama5d3_xplained.dtb
  DTC     arch/arm/boot/dts/at91-sama5d3_xplained_pda4.dtb
  DTC     arch/arm/boot/dts/at91-sama5d3_xplained_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d31ek.dtb
  DTC     arch/arm/boot/dts/sama5d31ek_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d31ek_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d31ek_revc.dtb
  DTC     arch/arm/boot/dts/sama5d31ek_revc_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d31ek_revc_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d33ek.dtb
  DTC     arch/arm/boot/dts/sama5d33ek_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d33ek_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d33ek_revc.dtb
  DTC     arch/arm/boot/dts/sama5d33ek_revc_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d33ek_revc_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d34ek.dtb
  DTC     arch/arm/boot/dts/sama5d34ek_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d34ek_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d34ek_revc.dtb
  DTC     arch/arm/boot/dts/sama5d34ek_revc_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d34ek_revc_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d35ek.dtb
  DTC     arch/arm/boot/dts/sama5d35ek_revc.dtb
  DTC     arch/arm/boot/dts/sama5d36ek.dtb
  DTC     arch/arm/boot/dts/sama5d36ek_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d36ek_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d36ek_revc.dtb
  DTC     arch/arm/boot/dts/sama5d36ek_revc_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d36ek_revc_pda7.dtb
  DTC     arch/arm/boot/dts/at91-sama5d2_xplained.dtb
  DTC     arch/arm/boot/dts/at91-sama5d2_xplained_pda4.dtb
  DTC     arch/arm/boot/dts/at91-sama5d4_xplained.dtb
  DTC     arch/arm/boot/dts/at91-sama5d4_xplained_hdmi.dtb
  DTC     arch/arm/boot/dts/at91-sama5d4_xplained_pda4.dtb
  DTC     arch/arm/boot/dts/at91-sama5d4ek.dtb

If the building process is successful, the final images can be found under arch/arm/boot/ directory.

Related Topics

• Using Max Touch
• Crypto hardware acceleration
•  How to use Pulse Width Modulation driver
• How to use the Atmel KMS/DRM LCD driver
• Use of the AT91 ADC driver
• Using ISI (Image Sensor Interface) in Linux4SAM 6.0 and later