Way to GNU/Linux on ARM Xingda Zheng
Contents Brief history about ARM Mess in Linux on ARM Solutions to the mess Future development
What’s ARM ARM can be ARM Holdings ARM can also be ARM Architecture ARM = “Advanced RISC Machine” ARM 是一家公司,全称 “ARM Holdings”,总部位于英国剑桥,以出售 IP 核(知识产权核心)为商业模式,现今旗下有 Cortex 系列应用处理器核心, Mali 系列图形处理核心,PrimeCell 系列周边元件等多条 IP 核产品线。 ARM 也指一种处理器体系架构,全称“Advanced RISC Machine“,专利所有者为 ARM Holdings 公司。 运行 GNU/Linux 的 ARM,当然指ARM 这一处理器体系架构。
Brief History of ARM ARMv1 ARM1 ARMv2 ARM2 – Cloned by OpenCores now, called Amber ARM3 ARMv3 ARM6 (ARM610 used by Apple Newton) ARMv4T – T means Thumb ARM7TDMI – traditional SoC core, even used by GBA ARM 体系架构,首先是由 Acron 电脑公司设计的。 Acron 设计出的第一款 ARM 处理器为 ARM1(仅为样品),设计极为精简,但是在主流性能市场上未能给 Intel 带来任何冲击。 第一款流片生产的 ARM 处理器为 ARM2,目标为节电、精简(这也成为了后来 ARM 系列的主流)。(此时的指令集版本是 ARMv2) ARM2 被用于 BBC Micro 系列微型电脑。(从此之后,与 BBC 有关的多个项目使用了 ARM 架构的处理器) ARM 的下一个重要足迹是与 Apple 合作,开发下一代的轻量级微处理器——ARM6 系列。(指令集为 ARMv3) 著名的超前设备——Apple Newton PDA 便使用了ARM610处理器。 这次合作催生了独立的 Advanced RISC Machine 公司。
Brief History of ARM ARMv5TE – MMU introduced ARM9 – Traditional “Embedded Linux” Core ARMv6 – initial SIMD support ARM11 – Start of Thumb2 and Multiprocessor ARM 的下一个重要足迹是与 Apple 合作,开发下一代的轻量级微处理器——ARM6 系列。(指令集为 ARMv3) 著名的超前设备——Apple Newton PDA 便使用了ARM610处理器。 这次合作催生了独立的 Advanced RISC Machine 公司。
Brief History of ARM ARMv7A – “Cortex”ize Introduce VFPv3, NEON Cortex-A8 Cortex-A9 MPCore Cortex-A5 low-end solution Cortex-A7/15 – big.LITTLE, Virtualization
Brief History of ARM ARMv8A – 64-bit NEON now fully IEEE-754 complicant “big” core started to evolve fastly Cortex-A57, A72, A73...
Brief History of ARM Linux 1.0.x – Early trial by Acron on Acron A5000. Built on RISC OS with its compiler. Kernel tree largely modified to suite RISC OS. Impossible to merge back. 1.1.59 – Elegant ARM support in Linux kernel because the support of ARM in GCC/Binutils. Acron 公司曾经尝试移植一个 1.0.x 的内核到 Acron A5000 机器。虽然他们成功了,但是他们的结果一坨糟,根本没有可能 Merge 回 Linux 主线。(因为那时 GCC/Binutils/Linux 都还没有考虑 non-x86 架构) 之后 1.1.59 的时候,Linux 内核终于有了干净的 ARM 支持(因为那时 GCC 和 Binutils 引入了 ARM 支持)。
Brief History of ARM Linux ARMv4T can run uClinux ARMv5TE is suitable for running full Linux Currently the most old cores supported by Debian. “Embedded Linux” on ARMv5TE Birth of Android 之后,Linux 并没有在 ARM 处理器上掀起太大波浪。用户还是更多选择 RISC OS。 直到 ARMv5 时代。ARMv5 的效能已经足以运行起 Linux 内核和简单的 Linux 用户环境。 Linux 内核,作为一个可以裁剪的跨架构操作系统内核,成为了很多 ARMv5 嵌入式厂商的选择。
Brief History of ARM Linux ARMv6 OMAP2 (with ARM11) is chosen by Nokia for Maemo ARMv7A A High-optimized instruction set. “armhf” in Debian. ARMv8A 64-bit. “arch/arm64/” instead of “arch/arm/” in kernel ABI revolution. Considered as a new architecture. ARMv6 的时代,Linux 继续被用在部分设备上。值得一提的是基于 ARM11 的 Raspberry Pi。(这是 BBC 与 ARM 的又一次碰撞) ARMv7 的时代,由于 Android 的彻底流行,使得 Linux 成为了 ARMv7 芯片厂商(Apple 除外)的标配操作系统内核。
Mess: What’s a SoC SoC – System on Chip. IP core model. Cortex series is just IP core. So do Mali series and PrimeCell series.
Mess: Boot On IBM/PC: Power Up → BIOS/UEFI → GRUB → Linux kernel Standard interface On ARM: No such standard interface widely accepted now
Mess: Boot Allwinner A33 SoC: Power Up → Internal BROM (mask ROM) → Boot0 → U-Boot → Linux kernel Qualcomm APQ8016 SoC: Power Up → PBL (on DSP) → SBL → LK → Linux kernel Broadcom BCM2836 SoC: Power Up → Proprietary Bootloader (on GPU!) → Unknown loader (on ARM core) → Linux kernel
Mess: Boot Problems: No generic Bootloader. No generic kernel storage standard.
Mess: SoC and board Multiple boards per SoC Early kernel uses a .c file per board A zImage/uImage per board – Disaster to distributions A machine ID per board – complex Source modify and kernel recompilation when board changed
Mess: SoC and board Why? Innumerable Buses AMBA inside SoC I2C, SPI outside SoC Lack of standard On x86, DSDT table in ACPI solved the difference
Mess: Out-of-mainline source Low quality of BSPs Lots of BSPs are for Android Dirty and unmainlineable code Lower quality of Vendor sources For example, Huawei Android problem Some Android drivers keep to be unmainlined Android does not require higher kernel version (3.4 for Marshmallow is also allowed)
Mess: Lines out-of-mainline table Phone Manufacturer SoC Vendor Lines out-of-mainline G3 LG Qualcomm 2.616M Galaxy 4 Samsung 1.795M Galaxy S5 Samsung Exynos 1.100M Xperia Z3 Sony 1.794M Xperia C MediaTek 1.935M E2 Acer 1.411M Zenfone 6 Asus Intel Atom 2.163M P6 Huawei HiSilicon 2.659M 表格来源:http://elinux.org/CE_Workgroup_Device_Mainlining_Project
Mess: LINUS IS ANGRY https://lkml.org/lkml/2011/3/17/492 “Gaah. Guys, this whole ARM thing is a f*cking pain in the ass.”
Solution: Device Tree Originated from Sun Open Firmware, then abstracted by Linux. Used by Embedded PowerPC with OF. Chosen to be used on ARM.
Solution: Device Tree What’s Device Tree Device description Like a tree Structured Can be “flatten” to storage
Solution: Device Tree Example of the opportunity of DT: AOSC OS armel sunxi boot Provided 2 kernels for more than 6 SoCs, 20 boards. Raspberry Pi DT Overlay Easy to adapt add-ons
Solution: Device Tree DT structure: Really like a tree Everything starts at a “/” Device nodes can be embedded to bus nodes, when the device is connected to the bus.
Solution by another kernel Windows NT on ARM Force UEFI and ACPI Use DSDT for device structure Use HAL Extension for special devices
Future ARM officially choose UEFI Server standard is introduced Standard interface for communication between ARM kernel and firmware, for power, regulators, etc
Now you can point out problems and wait for further improvement by us! Thanks! Now you can point out problems and wait for further improvement by us!