Linux Kernel - 4.1


Linux 4.1 for AT91 source code

The Linux kernel for Atmel | SMART Processor Based PMUs (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-4.1-at91

Tags

linux4sam_5.3 tag

  • add the drm bridge driver for HDMI encoder silicon image: sii902x that is present on SAMA5D4 Xplained board
  • several LCD enhancements:
    • extended timings rage for SAMA5D2 and SAMA5D4
    • optimize AHB master DMA interface by choosing the less used one for a particular overlay
    • add access to GEM for using overlay for video decoding via gstreamer
  • QSPI: add support for FLASH >16MiB : 4byte address mode
  • QSPI: add support for Macronix mx25l25635e that is present on sama5d2 Xplained board
  • fixes for QSPI, PMIC drivers
  • Regulator/SDHCI: strengthen support for SD card insertion/removal

linux4sam_5.2 tag

  • SAMA5D4 Demo updated together with the other Xplained board demos
  • SAMA5D4 Video Decoder driver
  • Move to the Ultra-Low-Power mode ULP1 for suspend/resume power management
    • for more information on this mode, read chapter "62.5.3: Ultra Low-power (ULP) Mode" and the corresponding table "Table 62.5 Low-power Mode Configuration Summary"
    • suspend/resume ULP1 mode wake-up sources are wakeup button and RTC
    • gain better consumption numbers due to the stop of most of the clocks while entering this mode
    • fast resume time
  • WIFI WILC1000 driver integrated from the latest source code submitted to the Linux Mainline staging directory

linux4sam_5.1 tag

  • Addition of PDA inc 4.3" and 7" screens: TM430x and TM7000/7000B
  • New Pulse Density Modulation Interface Controller (PDMIC) for SAMA5D2 PDM microphone interface
  • New SAMA5D2 ADC driver: using the IIO sub-system, software trigger supported
  • fixes for: QSPI, XDMA, RTC for suspend/resume, phy interface for suspend/resume, SHA driver

linux4sam_5.0 tag

As a updated kernel revision this branch contains all the enhancements already found on the the Atmel linux-3.18-at91 branch.

Here is a little summary of the enhancements added on top of the official v4.1 Linux kernel tag:

  • all Atmel material included in the following 4.2 kernel:
    • addition of newer AT91 boards
    • AT91SAM9x5: pwm0 pinctrl definition
    • SAMA5D4: more peripherals: usarts, uarts, spi, pioD access
    • SAMA5D3: phy address for gmac
    • regulator additions for the SD/MMC
    • rtc node for AT91SAM9RL/AT91SAM9RL-EK
  • addition of the new SAMA5D2 SoC and associated SAMA5D2 Xplained board
  • DMA: interleaved, memset and scatter-gathered memset offload operations
  • flexcom: serial, I2C and SPI: new FIFO and DMA modes for SAMA5D2
  • SDHCI driver (SD/MMC) for SAMA5D2
  • ClassD audio output driver for SAMA5D2
  • Image Sensor:
    • ISC: support YUV sensor output ; support RGB output format
    • ISI enhancement: add RGB565, GREY, SGRBG, SBGGR (Bayer) support
  • new shutdown controller driver for SAMA5D2
  • new I2S controller driver for audio on SAMA5D2
  • CAN controller for SAMA5D2
  • new watchdog driver for SAMA5D4 & SAMA5D2 SoCs
  • generated and audio PLL clocks for SAMA5D2
  • support for act8865 PMIC
  • LCD specification to the at91sam9x5 series and associated boards
  • fixes for USB, AES dma configuration

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.

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

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

  • at91_dt_defconfig: for at91sam ARM926 series chips
  • sama5_defconfig: for SAMA5 series 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-4.1.0
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/at91-kizbox2.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-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_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d31ek_revc_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d31ek_revc.dtb
  DTC     arch/arm/boot/dts/sama5d33ek.dtb
  DTC     arch/arm/boot/dts/sama5d33ek_pda7.dtb
  DTC     arch/arm/boot/dts/sama5d33ek_pda4.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_pda4.dtb
  DTC     arch/arm/boot/dts/sama5d36ek.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-sama5d4_xplained.dtb
  DTC     arch/arm/boot/dts/at91-sama5d4_xplained_pda4.dtb
  DTC     arch/arm/boot/dts/at91-sama5d4_xplained_hdmi.dtb
  DTC     arch/arm/boot/dts/at91-sama5d4_xplained_pda7.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.

Recent FAQ

linux-4.1-at91

Using Atmel DRMDriver: Using Atmel KMS/DRM LCD driver. (Sama7d65Curiosity, Sama5d29Curiosity, Sam9x75Curiosity, Sam9x60Curiosity, Sam9x60EK, Sama5d27WLSom1EK, Sama5d27Som1EK, Sama5d2PtcEK, Sama5d2Xplained, Sama5d4Xplained, Sama5d4ek, Sama5d3Xplained, Sama5d3xek)
Using Max Touch: Introduction for how to use maxTouch. (Sama5d29Curiosity, Sam9x75Curiosity, Sam9x60Curiosity)
Crypto Config: How to configure Crypto driver. (Sama5d29Curiosity, Sam9x75Curiosity, Sam9x60Curiosity, Sama5d2-icp, Sam9x60EK, Sama5d27WLSom1EK, Sama5d27Som1EK, Sama5d2PtcEK, Sama5d2Xplained, Sama5d4Xplained, Sama5d4ek, Sama5d3Xplained, Sama5d3xek)
Pwm Faq: PWM Driver. (Sama5d29Curiosity, Sam9x75Curiosity, Sam9x60Curiosity, Sam9x60EK, Sama5d27WLSom1EK, Sama5d27Som1EK, Sama5d2PtcEK, Sama5d2Xplained, Sama5d4Xplained, Sama5d3Xplained, Sama5d3xek)
Iio Adc Driver: Adc IIO driver introduction. (Sama5d4Xplained, Sama5d4ek, Sama5d3Xplained, Sama5d3xek, AT91sam9x5-ek, other AT91SAM9 boards)
Using Ultra Low Power Mode 1: Using Ultra Low Power mode 1 (ULP1). (Sama5d2-icp, Sama5d27WLSom1EK, Sama5d27Som1EK, Sama5d2PtcEK, Sama5d2Xplained)
PDMICAudio Record: Using the PDMIC to record audio stream. (Sama5d2Xplained)
Using Isi: How to use the Image Sensor Interface. (Sama5d4Xplained, Sama5d4ek, Sama5d3Xplained, Sama5d3xek)