Linux mainlining effort

The purpose of this page is to try and define sub-goals and milestones for the mainlining effort, containing goals and sub-goals with milestones for adding Allwinner support in the upstream mainline Linux Kernel.

It is very important to note that this is intended as a rough set of minimal goals - it is not meant to collide with the huge effort of rewriting major drivers!

=Overview= The idea is to submit the code needed to run the Linux kernel on Allwinner SoCs upstream, ie. to the official Linux kernel.

This can be achieved by following the concept outlined in the Your new ARM SoC Linux support check-list! article published by Thomas Petazzoni from Free Electrons.

Where relevant, I have attempted to include who is currently working on an item, mostly separate from any particular mainlining goal.

=Status=

Merged into 3.8

 * Initial support for Allwinner SoCs (commit)
 * Timer (commit)
 * UART
 * Device Tree
 * Interrupt controller (commit)

Related merges: ,

Added board support: Cubieboard, A13-OLinuXino

Merged into 3.9

 * PINCTRL driver
 * GPIO-lib based driver

Related merges:

Added Board Support: Hackberry

Merged into 3.10

 * LED support
 * Clock driver
 * Complete UART support

Related merges:, ,

Added Board Support: Pineriver_H24

Merged into 3.11

 * IRQ support for the PIO
 * I2C Driver
 * EMAC Driver
 * A10s support

Related merges:, , , , ,

Added board support: A10S-OLinuXino

Merged into 3.12

 * A31 support
 * Basic SoC + GPIO
 * Clock support
 * A20 support
 * Basic SoC + GPIO
 * Clock support
 * A10s clocks
 * Clock Source and Clock Event rework
 * Watchdog driver

Related merges:, , , , ,

Added board support: A31 EVB, A20-OLinuXino-Micro, Cubieboard2, Mele A1000

Merged into 3.13

 * SID Driver
 * I2C for A20
 * sunxi_defconfig
 * Bug fixes

Added board support: Cubietruck

Merged into 3.14

 * A31
 * Reset Controller Support
 * SMP
 * A20
 * SMP (via PSCI)
 * External clock outputs
 * High Speed Timers
 * RTC driver
 * RTP (DT only)
 * GMAC support in stmmac driver
 * AP6210 WiFi (BCM43362) support in brcmfmac driver

Related merges:, , , ,

Added board support: Olimex A13-OLinuXino-Micro

Merged into 3.15

 * All SoCs
 * SPI
 * A10/A10s/A13/A20
 * OHCI
 * EHCI
 * A10/A20
 * AHCI
 * A20/A31
 * NMI controller
 * A20
 * GMAC
 * A31
 * I2C

Related merges:, , , , ,

Added board support: Sparkfun_pcduino, Inet 97F, A10-OLinuXino-LIME

Core Stuff

 * A31/A23 DMAengine driver (WiP: Maxime Ripard (mripard))
 * Currently in A23 SDK there AW driver for DMAEngine, it should be adapted to device tree, cleaned for mainline
 * The A23 shares the DMA controller with the A31, only the number of channels differ (the A31 has 16 channels, while the A23 only has 8 of them)


 * AXP209 driver (WiP: Carlo Caione (ccaione))

Major drivers

 * SDIO Driver (WiP: Hans De Goede, David Lanzendörfer)
 * NAND Driver (WiP: Boris Brezillon (bbrezillon))
 * A31 Audio Codec driver (WiP: Maxime Ripard (mripard))
 * A31 PLL2 and module 1 clocks
 * Cyclic DMA transfers
 * ASoC driver
 * Much more complex and signficantly different from the other audio codecs IPs found in the other Allwinner SoCs (A23 included)

Minor drivers

 * IIO LRADC driver (WiP: Carlo Caione (n01)) Input LRADC driver (WiP: Hans de Goede (hansg))
 * Touchpanel driver (WiP: Hans de Goede (hansg))
 * PWM Driver (WiP: Alexandre Belloni)

Timeouts ? (No code has ever been submitted to mainline, current status unknown)

 * IR driver (WiP: Alexsey Shestacov (wingrime))
 * USB OTG Driver (WiP CHen-Yu Tsai (wens))
 * It seems to actually be a Mentor Graphics Inventra USB Controller (musb), that already support for it in mainline kernel, so it only needs a thin layer to adapt it to sunxi. Moreover, it's already supporting the PIO mode, so we could avoid relying on DMA to merge it. (Thanks to Arnd Bergmann for noticing)
 * irc user jukivili works on getting this driver to work with sunxi-3.4
 * Status 2013-10-02:
 * OTG requires more work. Mode detection is working, but have not yet figured out how to reset MUSB core and hardware from host-mode to peripheral and other way around.
 * Mode detection/USB-PHY stuff probably needs to be moved to new USB-PHY driver as is done with other MUSB hardware drivers.
 * Transport Stream (WiP: woprr)
 * Security System (Crypto Engine) (WiP: Corentin Labbe (Montjoie))
 * Hardware Pseudo Random Number Generator
 * Checksumming (MD5, SHA1)
 * Crypto (AES, DES, 3DES)
 * CAN (WiP: Peter Chen )

Achievable

 * DMAengine driver (sun4i/sun5i/sun7i)
 * DMAengine driver handles slave dma clients including SPI, EMAC, USB, I2S, HDMI audio, and NAND
 * Implementing slave SG transfers is the priority (for SPI to start), with cyclic transfers (for audio clients) following that
 * The A20 and earlier SoCs have two mode of operations: Normal and Dedicated. The dedicated mode looks a lot like how the A31 DMA controller works, only it supports only mem2dev transfers
 * Audio A23 SDK has aSoC drivers for the first three:
 * Audio Codec
 * IIS/I2S (Audio transport)
 * SPDIF (Audio transport)
 * AC97 Interface
 * We first need to support cyclic DMA transfers
 * CSI (Camera Input)
 * PS/2 (Keyboard/Mouse)
 * Smart Card Reader
 * Keypad
 * One wire (A31, A23)

Hard

 * Display (KMS)
 * G2D/Mixer
 * VPU (See CedarX/Reverse_Engineering)
 * Video Engine
 * Audio Engine
 * Audio Video Sync

Troublesome

 * Memory Stick (has anybody actually got this hardware connected and a memory stick?)
 * TV Decoder (Analog in, no driver, no datasheet)
 * PATA (Old tech, while still interesting for Compact Flash, possibly removed from A20, though A20 memory map still mentions it)
 * GPS backend IP (Only A10, not much interesting, as all modern GPS recivers have MCU with UART output, no documentation)

Needing major rework
These drivers need major rework AND lack documentation other than existing source pile.


 * Display driver (libv, techn also might be interested)

Unlikely
These are too far off the track third party drivers making it unlikely they will ever get accepted mainline.


 * Mali driver (will not happen unless libv gets a proper lima driver out)

Related but separate

 * Device-specific drivers

=References=

= See also =
 * Mainline Kernel Howto
 * Possible setups for hacking on mainline
 * Linux Kernel
 * Toolchain

=External Links=
 * kernel.org - Official website for the Linux Kernel
 * http://github.com/torvalds/linux - Linus Torvalds' GitHub account with the upstream Linux kernel
 * Linux Kernel documentation index
 * Linux Kernel man pages
 * Kernel Newbies Site - Excellent source of information for people new to kernel
 * Linus' kernel tree for 2.6
 * Kernel bugzilla - Regressions for each of recent versions
 * Linux-libre project - Maintains and distributes fully free kernel
 * LinGrok, Linux kernel source code cross-reference
 * Free Electrons LXR (Linux Cross Reference)
 * linux-arm-kernel - Mailing list archive

How to upstream

 * Your new ARM SoC Linux support check-list! by Thomas Petazzoni of Free Electrons
 * Linux Kernel Upstreaming How-To (CNXSoft - Embedded Software Development)
 * Matt Porter's YouTube video talk on “Upstreaming 101" (LCA14-111)
 * Matt Porter's presentation slides for “Upstreaming 101" (LCA14-111)
 * Matt Porter's YouTube video talk on “Upstreaming 201" (LCA14-112)
 * Matt Porter's presentation slides for “Upstreaming 201" (LCA14-112)
 * How to Write and Submit a Linux Kernel Patch (CNXSoft - Embedded Software Development)
 * YouTube Video- Write and Submit your first Linux kernel Patch
 * Greg Kroah-­Hartman Kernel Tutorial Write and Submit your first Linux Kernel Patch
 * Linaro resources page from LCA (Linaro Connect Asia) 2014