Porting Linux on an ARM Board
Total Page:16
File Type:pdf, Size:1020Kb
Captronic Porting Linux on an ARM board Bootlin [email protected] © Copyright 2004-2018, Bootlin. embedded Linux and kernel engineering Creative Commons BY-SA 3.0 license. Corrections, suggestions, contributions and translations are welcome! - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 1/220 Alexandre Belloni I Embedded Linux engineer at Bootlin I Embedded Linux expertise I Development, consulting and training I Strong open-source focus I Open-source contributor I Maintainer for the Linux kernel RTC subsystem I Co-Maintainer of kernel support for Atmel ARM processors I Contributing to kernel support for Marvell ARM (Berlin) processors embedded Linux and kernel engineering - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 2/220 Bootlin Mission - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 3/220 Bootlin at a glance I Engineering company created in 2004 (not a training company!) I Locations: Orange, Toulouse, Lyon (France) I Serving customers all around the world See http://bootlin.com/company/customers/ I Head count: 9 Only Free Software enthusiasts! I Focus: Embedded Linux, Linux kernel, Android Free Software / Open Source for embedded and real-time systems. I Activities: development, training, consulting, technical support. I Added value: get the best of the user and development community and the resources it offers. - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 4/220 Bootlin on-line resources I All our training materials: http://bootlin.com/docs/ I Technical blog: http://bootlin.com/blog/ I News and discussions (Google +): https://plus.google.com/+Bootlin I News and discussions (LinkedIn): https://www.linkedin.com/groups/4501089 I Quick news (Twitter): http://twitter.com/bootlincom I Linux Cross Reference - browse Linux kernel sources on-line: http://lxr.bootlin.com - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 5/220 Captronic Course content Bootlin [email protected] © Copyright 2004-2018, Bootlin. embedded Linux and kernel engineering Creative Commons BY-SA 3.0 license. Corrections, suggestions, contributions and translations are welcome! - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 6/220 Porting linux Porting Linux includes a number of steps, starting even before software is involved: I SoC selection I SoM, SBC selection or board conception I Bootloader selection I Bootloader port I Linux kernel version selection I Linux port I Root filesystem integration - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 7/220 Captronic ARM Ecosystem Bootlin [email protected] © Copyright 2004-2018, Bootlin. embedded Linux and kernel engineering Creative Commons BY-SA 3.0 license. Corrections, suggestions, contributions and translations are welcome! - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 8/220 ARM Ecosystem ARM SoCs - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 9/220 ARM platforms I ARM (the company) designs CPU cores: instruction set, MMU, caches, etc. I They don’t sell any hardware I Silicon vendors buy the CPU core design from ARM, and around it add a number of peripherals, either designed internally or bought from third parties I Texas Instruments, Atmel, Marvell, Freescale, Qualcomm, Nvidia, etc. I They sell System-on-chip or SoCs I System makers design an actual board, with one or several processors, and a number of on-board peripherals - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 10/220 Schematic view of an ARM platform - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 11/220 System on Chip A System on Chip is typically composed of: TST0-TST1 Reset and NRST Test ARM920T Core TSYNC TCLK ICE JTAGSEL ETM TDI PIO TPS0 - TPS2 TDO JTAG Scan Instruction Cache MMU Data Cache TPK0 - TPK15 TMS 16K bytes 16K bytes TCK NTRST BMS D0-D15 FIQ A0/NBS0 AIC Fast SRAM Address A1/NBS2/NWR2 I PIO IRQ0-IRQ6 16K bytes Decoder EBI A2-A15/A18-A22 One or multiple CPU cores A16/BA0 PCK0-PCK3 CompactFlash A17/BA1 Abort NAND Flash NCS0/BFCS PLLRCB PLLB Status SmartMedia NCS1/SDCS Fast ROM NCS2 PLLRCA PLLA NCS3/SMCS I 128K bytes Misalignment NRD/NOE/CFOE XIN A bus PMC Detector NWR0/NWE/CFWE OSC NWR1/NBS1/CFIOR XOUT NWR3/NBS3/CFIOW Peripheral Bus SDCK Bridge Arbiter SDCKE SDRAM RAS-CAS I Controller SDWE System SDA10 Oscillators and PLL Timer Peripheral BFRDY/SMOE DMA BFCK Controller Memory Burst BFAVD Controller BFBAA/SMWE XIN32 Flash BFOE I OSC RTC Controller BFWE XOUT32 PIO A23-A24 Timers A25/CFRNW Static NWAIT DRXD NCS4/CFCS DBGU Memory NCS5/CFCE1 DTXD PDC Controller NCS6/CFCE2 NCS7 I PIO D16-D31 Memory controller PIOA/PIOB/PIOC/PIOD Controller HDMA DMA FIFO HDPA FIFO USB Host I HDMB Interrupt controller DDM Transceiver HDPB DDP USB Device Transceiver DMA FIFO ETXCK-ERXCK-EREFCK I ETXEN-ETXER MCCK ECRS-ECOL Multiple peripherals: MCCDA ERXER-ERXDV MCDA0-MCDA3 MCI MCCDB Ethernet MAC 10/100 ERX0-ERX3 MCDB0-MCDB3 ETX0-ETX3 PDC EMDC I EMDIO UART RXD0 EF100 TXD0 APB TF0 SCK0 USART0 TK0 RTS0 TD0 I CTS0 PDC SSC0 RD0 RTC RK0 RXD1 RF0 TXD1 PDC SCK1 TF1 I RTS1 TK1 CTS1 USART1 TD1 SPI DSR1 SSC1 RD1 DTR1 PIO PIO RK1 DCD1 PIO RF1 I RI1 PDC PDC TF2 I2C RXD2 TK2 TXD2 TD2 SCK2 USART2 SSC2 RD2 RTS2 RK2 I CTS2 PDC ADC PDC RF2 RXD3 TCLK0 TXD3 Timer Counter - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com SCK3 USART3 TCLK1 12/220 I RTS3 TCLK2 CTS3 PDC TIOA0 USB controller TC0 TIOB0 TIOA1 NPCS0 TC1 TIOB1 NPCS1 TIOA2 I NPCS2 TC2 TIOB2 ... NPCS3 SPI MISO TCLK3 MOSI Timer Counter TCLK4 SPCK PDC TCLK5 TIOA3 TC3 TIOB3 TWD TIOA4 TWI TC4 TIOB4 TWCK TIOA5 TC5 TIOB5 ARM cores The Linux kernel supports a wide range of ARM based architectures, starting with ARMv4T: ARM family ARM architecture ARM Core ARM7T ARMv4T ARM7TDMI ARM720T ARM740T ARM9T ARMv4T ARM9TDMI ARM920T ARM922T ARM925T ARM926T ARM940T ARM9E ARMv5TE ARM946E-S ARM10E ARMv5TE ARM1020T ARM1020E ARM1022E ARMv5TEJ ARM1026EJ-S ARM11 ARMv6Z ARM1176JZF-S ARMv6K ARM11MPCore Cortex-M ARMv7-M Cortex-M3, Cortex-M4, Cortex-M7 Cortex-A (32-bit) ARMv7-A Cortex-A5, Cortex-A7 Cortex-A8, Cortex-A9, Cortex-A12, Cortex-A15, Cortex-A17 Cortex-A (64-bit) ARMv8-A Cortex-A53, Cortex-A57, Cortex-A72 - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 13/220 ARM cores Third parties can also license the instruction set and create their own cores: ARM ISA Third party core ARMv4 Faraday FA256, StrongARM SA-110, SA-1100 ARMv5TE Xscale ARMv5 Marvell PJ1, Feroceon ARMv7-A Broadcom Brahma-B15, Marvell PJ4, PJ4B, Qualcomm Krait, Scorpion ARMv8-A Cavium Thunder, Nvidia Denver, Qualcomm Kryo - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 14/220 ARM SoCs To create an SoC, the silicon vendor integrates: I one or multiple ARM cores (not necessarily homogeneous, big.LITTLE configurations exist) I its own peripherals I third party peripherals (usually from DesignWare, Cadence, PowerVR, Vivante, ...) I ROM and ROM code I sometimes one or multiple DSP, FPGA, micro-controller cores - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 15/220 ARM SoCs vendors ARM SoC vendors with good mainline kernel support include: I Allwinner I Atmel I Freescale I Marvell I Rockchip I Samsung I ST Micro I TI (sitara and OMAP families) I Xilinx However, be careful when needing certain features like GPU acceleration. - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 16/220 ARM SoMs System on Module manufacturer then create modules integrating: I an SoC I RAM I Storage I sometimes the PHYs for some interfaces like Ethernet, HDMI,... I a connector for the baseboard They also often manufacture Single-board computers (SBC) based on those SoM. - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 17/220 ARM SoMs manufacturers I ACME I Boundary Devices I Congatec I DataModul I Olimex I Phytec I Seco I Toradex I Variscite - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 18/220 Community boards A good way to create a prototype is to use a community board which is usually inexpensive and has expansion headers: Examples include: I BeagleBone Black I Sama5dx Xplained I OLinuXino boards - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 19/220 Captronic Choices Bootlin [email protected] © Copyright 2004-2018, Bootlin. embedded Linux and kernel engineering Creative Commons BY-SA 3.0 license. Corrections, suggestions, contributions and translations are welcome! - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 20/220 Choices Hardware - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 21/220 Choosing the right hardware parts When choosing the hardware, existing software support should be considered.