2
Overview
• Definition of “Linux on ARM”• Transitioning from Embedded to Servers & Desktops• Pushing the limits
‒ in general
‒ for embedded
Linux On ARM
4
Quick Introduction
• Architecture by ARM Ltd. / ARM Holdings plc (UK)‒ ARM7, ARM9 used in embedded devices “for ages”
‒ ARMv7 with Cortex-A8, etc. also popular with hobbyists
‒ ARMv8 offers 64-bit AArch64 mode, attractive for servers
• Development boards (for ARMv7) abundant‒ Reminder: Android is based on the Linux kernel, but
‒ Too often unofficial “downstream” kernel forks are used
• Goal: Get support for ARM boards into the official kernel.org Linux tree (“mainline” or “upstream”)‒ To run a standard userspace distribution, e.g. openSUSE
From Embedded And MobileTo Desktop And Servers
6
From Embedded To Desktop & Servers
• Traditionally used in resource-constrained devices‒ Cross-built with configuration optimized for target device
‒ Device drivers built into kernel (e.g., exynos_defconfig)
• Multi-platform support allows to build support for multiple chip platforms into a single kernel‒ Allows for generic kernel with most drivers as modules
‒ Less tested, some build failures caught via randconfig
‒ Occasional runtime failures only found when testing on device!
‒ Requires such devices to be supported by one kernel source
7
The openSUSE Kernel
linux.git
linux-stable.git
kernel-source.git
kernel.git
Kernel:HEAD
Kernel:stable
openSUSE:FactoryopenSUSE:Factory:ARM
Pushing The Limits
9
Where Are Limits Being Pushed?
• New ARM IP‒ Handled by ARM themselves (except for Mali graphics)
• New chip vendors‒ Linaro can help ARM licensees get started properly
• New chips, new boards‒ Vendors often distribute a Board Support Package (BSP)
including Linux kernel but don't submit their patches‒ Little or no security fixes, no new upstream features
• Old chips and boards people didn't need Linux on yet
10
Simplest: Board Support
• Prereq.: SoC (platform and drivers) supported• Device Tree (.dts) is used as hardware description
‒ Either supplied to firmware (U-Boot), or by firmware (UEFI)
• ACPI upcoming as alternative hardware description‒ Supplied by firmware (UEFI)
• No .dts file for your board? Then add it yourself!‒ Peek at downstream .dts and/or similar upstream .dts files
‒ Read schematics, if available; fallback: trial-and-error
‒ Examples: exynos5250-spring.dts, zynq-parallella.dts
11
Advanced: System-On-Chip Support
• Prereq.: SoC family already supported• .dtsi file will reference at least one new driver• Technical Reference Manual or vendor tree needed
‒ Compare chip-specific bits to those of one already supported
‒ Peek at earlier and later .dtsi files and drivers? (Careful!)
• Example: Samsung Exynos 5410
12
Expert: New System-on-Chip Support
• Prereq.: CPU architecture already supported (ARM)• Technical Reference Manual really needed
‒ Serial console driver – to get output
‒ Clocksource driver(s) – for timers
‒ Clock driver
‒ Reset driver?
‒ Memory controller?
• Example: STM32 F4
13
“Some things have to be done just because they are possible.Not because they make sense.”
- SUSE Hackweek T-Shirt
14
The Final Frontier (1/2)
Cortex-A8Cortex-A9
Cortex-A5Cortex-A7
Cortex-A15
Cortex-A17
Cortex-A12
Cortex-A53
Cortex-A57Cortex-A72
ARM11ARM9
ARM7
BCM2835OMAP3xxx……
15
The Final Frontier (2/2)
Cortex-M3Cortex-M1
Cortex-M0
Cortex-M4
Cortex-M7
Cortex-M0+
EFM32 GG
LPC18xx
STM32 F4
16
Address Size Usage
08000000 16 KB Bootloader
08004000 16 KB Device Tree
08008000 16 KB Kernel
0800c000 16 KB
08010000 64 KB
08020000 128 KB
08040000 128 KB
08060000 128 KB
08080000 128 KB
080a0000 128 KB
080c0000 128 KB
080e0000 128 KB
08100000 16 KB
08104000 16 KB
08108000 16 KB
0810c000 16 KB
08110000 64 KB
08120000 128 KB
08140000 128 KB Root filesystem
... ...
STM32 F429 – Flash Layout
• Custom bootloader (1.6 / 16 KB)‒ github.com/afaerber/afboot-stm32
‒ Compare: U-Boot ~75 KB / 128 KB
• Device Tree (2.9 / 16 KB)• Kernel (1235.5 / 1248 KB)
‒ Execute-in-place (XIP) image‒ Me: clk, clocksource, serial, fbdev
‒ Maxime: clocksource, reset, serial, pinc.
‒ Daniel: clk
• romfs (293.1 / 768 KB)
17
Bootloader tasks on ARMv7-M
• Usually runs from flash, using SRAM• Initializes clocks• Configures pins• Sets up serial port (for debug output)• Sets up memory controller for SDRAM or PSRAM
• If necessary, takes timers out of reset• Jumps to the kernel entry point
‒ Start of xipImage plus 1 for THUMB mode
18
Summary
• ARMv7-A chips usually well supported these days‒ But boards not always!
• ARMv7-M chips often not supported by vendors• What ARMv7-M boards may be able to run Linux:
‒ 4+ MB of SDRAM/PSRAM‒ Chip needs some external memory interface to enable it
‒ 1+ MB of flash‒ Memory-mapped flash allows execution in place, saves RAM
‒ Secondary storage needed?‒ SPI, MMC, network, …
One More Thing …
20
Spansion FM4 – StatusAddress Size Usage
00000000 8 KB Bootloader
00002000 8 KB Device Tree
00004000 8 KB Kernel
8 KB
32 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
64 KB
8 KB
... ...
• OpenOCD 0.9.0‒ But no working flash driver yet
• Custom bootloader (1.5 / 8 KB)‒ github.com/afaerber/afboot-fm4
• Device Tree (0.8 / 8 KB)• Kernel (1070 / 2032 KB)
‒ clocksource (WIP)
• 2 MB of on-chip flash available
21
Infineon XMC4500 – Status
Address Size Usage
0c000000 16 KB Bootloader
0c004000 16 KB Device Tree
0c008000 Kernel
• OpenOCD 0.9.0‒ Flash driver by Jeff Ciesielsky
• Custom bootloader (2.4 / 16 KB)‒ github.com/afaerber/afboot-xmc4000
• Device Tree (3.7 / 16 KB)• Kernel (~986.6 / 992 KB)
‒ clk, clocksource, reset, pinctrl, serial, sdhci drivers
• 1 MB of on-chip flash available only
Questions?
24
Have a Lot of Fun, and Join Us At:www.opensuse.org
General DisclaimerThis document is not to be construed as a promise by any participating organisation to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. openSUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for openSUSE products remains at the sole discretion of openSUSE. Further, openSUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All openSUSE marks referenced in this presentation are trademarks or registered trademarks of SUSE LLC, in the United States and other countries. All third-party trademarks are the property of their respective owners.
LicenseThis slide deck is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license. It can be shared and adapted for any purpose (even commercially) as long as Attribution is given and any derivative work is distributed under the same license.
Details can be found at https://creativecommons.org/licenses/by-sa/4.0/
Credits
TemplateRichard Brown [email protected]
Design & InspirationopenSUSE Design Teamhttp://opensuse.github.io/branding-guidelines/