Your SlideShare is downloading. ×
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Porting linux on ARM
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Porting linux on ARM

3,851

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,851
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
287
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ARM Linux & GNU Philippe Robin June 2004 1 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd Outline Open source model Architecture and platforms support Linux 2.4 kernel Linux 2.6 kernel GNU GCC tool chain Debugging Cooperation Linux resources 2 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 2. ARM Architecture Evolution 2004 ARMv7 2003 ARMv6Z– TrustZone™, IEM* 2003 ARMv6T2– Thumb-2 ISA 2002 ARMv6 – SIMD Media ISA 2000 ARMv5TEJ – Jazelle® Java Acceleration 1998 ARMv5TE – DSP Instructions 1995 ARMv4T – Thumb ISA® ISA 3 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd Linux and Architecture Support ARM ARCHITECTURES TrustZone Intelligent Energy Controller (IEC) Jazelle (option) V4 V5TE V5TEJ V6 V7 Linux 2.4 kernel Linux Kernel Linux 2.6 kernel Linux 2.7 kernel Preemtion, 0(1) scheduler, New Posix Thread Library (NPTL), Power Management etc… 4 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 3. Open Source Model Other organisations -Embedded Linux Consortium -Embedix Commercial Linux -CELF Gatekeepers Providers Open Source Repository www.kernel.org Other Contributors: ARM Source Tree -Platforms (Zaurus, iPaq…) Architecture & Platform -Debian Support -Etc… ARM Linux Open Source Tree http://www.arm.linux.org.uk 5 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd ARM and Open Source Projects ARM Contribute Architectural support to the Linux kernel and related GNU projects – For ARM cores and specific technology • ARMv6, ARMv7... – Promote standardization initiatives • New ARM ABI Early contribution to promote adoption from the community – Cooperation with partners and gatekeepers Promote active participation and contributions to the open source 6 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 4. Architectural Support ARM uses Linux kernel internally to validate new ARM cores and technology – Used with simulation models, FPGA and Cores Contribute architectural support to GNU GCC – Currently GCC is needed to compile kernel and applications – New ARM ABI will allow more choices and inter- operability between tool chains 7 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd ARM Development Platforms Integrator Family Versatile Family Compact Platform Versatile Platform Baseboard Logic Modules Core Modules Interface Modules Analyzer Tile Logic Tile 8 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 5. ARM Cores and Platform Support Currently Linux has support for: – ARM720T, ARM92x, ARM102x and ARM11 cores ARM development platforms – ARM Integrator family – Versatile board BSP availability – ARM (early access) – Open source (www.kernel.org) • availability usually coincide with hardware availability 9 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd Linux 2.4 kernel Stable version – Feature freeze • Only bug fixes are now being integrated Current 2.4.21 includes support for: – ARM cores up to ARMv6 • Legacy mode, not optimised – Integrator AP and CP – Versatile PB • Patch available from ARM 10 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 6. Linux 2.6 kernel 2.6.6 is the current development version Version 2.6.6 includes support for: – ARM cores up to architecture v6 including: • ASIDS, • Atomic instructions, • physically tagged cache, • CPS instructions – Integrator AP, CP and Versatile Platforms • Including the following Primecell peripherals: Serial, Timers, Interrupt controller, KMI, Ethernet, VGA/LCD Peripherals being added in 04Q2 – AACI, VIC, VFP9 – MMC, RTC, I2C USB (Transdimension), DoC (M-Systems) 11 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd Hardware Floating Point Need compiler support – Now available in GCC 3.4 Linux kernel support currently being added to 2.6 kernel – Validated on Versatile platform using VFP9 Availability – 2004Q2 12 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 7. ARM Linux – SMP Support Linux kernel already has SMP support for multiple architectures Implications on development tool chain – Multi-threading (TLS) – Debugging tools ARMv6 architecture + extensions – Physically indexed, physically tagged coherent data cache – Write allocation in Write-Back regions – 64-bit non-bus locking LDRDEX/STRDEX – Thread context registers – Weakly ordered memory model, with memory barriers and sequential consistency for certain memory regions Initial validation on modified ARM926EJ-S cores with Linux on ARM Integrator CP – Need hardware support for cache coherency, synchronization 13 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd ARM Linux – MPCore Platform Configurable ARMv6 architectural core – Implement between 1 and 4 processors – Provides up to 2600 DMIPS performance – Integral interrupt distribution and control unit Flexible software support – Symmetric multiprocessing (SMP) • OS dynamically shares task across multiple CPU • Coherent and consistent view of memory – Asymmetric multiprocessing (AMP) • Programmer statically assigns tasks to CPU • Isolate tasks from each other SoC system compatibility – AMBA AXI bus inter-connect – RealView® development tools – PrimeCell™ L220 L2 cache controller 14 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 8. ARM Intelligent Energy Management (IEM) Controlling run-time voltage reduces energy consumed from battery when maximum performance is not required. Reducing energy consumed, – Extends battery life or – Enables additional functionality for same battery – Reduces battery size for same functionality Greater user benefits and/or lower mfg. cost Reducing frequency reduces average power consumption and associated heating – Can also help to reduce packaging costs 15 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd ARM Linux - IEM Current prototype developed on Linux kernel – Used as technology demonstrator – Complementary to other existing technologies such as Montavista Dynamic Power Management (DPM) – Works along hardware components (IEC) Participate to CELF Power Management Group – Define common kernel interface to power management Availability – Mid-2004 IEM documentation – http://www.arm.com/products/CPUs/cpu-arch-IEM.html 16 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 9. Future Architectural Support ARM1176JZ-S support – Planned for 04Q3 Thumb2 support planned for 05Q4 ARMv7 (Tiger) scheduled for 2006 17 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd ARM GNU Tools 18 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 10. ARM GNU Tools Follow evolution of the ARM Architecture – Recently added ARMv6 support Adoption of the new ARM ABI – Initial ARM ABI support for GCC end 2004 – Inter-operability between tool chains Publicly available – Bi-annual source and binary releases • Snapshots and binary packages • Open source mailing lists – Cooperation with www.codesourcery.com 19 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd ARM GNU Tools Currently support up to ARMv6 Architecture – ARMv6 instructions (supported by compiler) – Hardware VFP – BE8 (new ARM ABI) – ARM1176JZ-S CPU support – ARMv6 interrupt instructions 20 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 11. ARM GNU Tools – Planned Work Next release planned for 2004Q4 – New ARM ABI support • Enables interlink with ARM Compiler 2005 Q4 – Thumb2 support – CPU support for ARM1156T2(F)-S 2006 Q2 – Tiger CPU support 21 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd ARM GNU GCC Adoption of the new ABI for the ARM Architecture – Better portability of binary code – Allows greater interoperability between proprietary tool chains (RVCT, etc.) http://www.arm.com/products/DevTools/ABI.html Open access of pre-built GNU binaries – Facilitate access to ARM development environment – Enable early adoption of new architectural features http://www.codesourcery.com 22 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 12. Linux and GNU roadmap ARMv6 and VFP binutils support ABI v1.0 ARMv6 GCC support ABI v1.2 Thumb 2 support ARMv7 support - VFP GCC support GCC roadmap 2.5.70 SMP (CP/CM916) ARM1136 SMP 2.6 kernel (ARMv6, Integrator CP, AP) 2.6 kernel: - Versatile PB926 + VFP 2.5.70 kernel - ARMv6 - ARMv6 (ASIDS, CPS, GCC / ARM ABI Thumb2 ARMv7 LDREX/STREX, Cache) IEM, TrustZone Linux 2.6.x roadmap 03/Q4 04/Q1 04/Q2 04/Q3 04/Q4 05/Q1 05/Q2 05/Q3 05/Q4 06/Q1 06/Q2 06/Q3 06/Q4 23 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd Linux - Debugging Architectural support added for new cores – Currently ARMv6 support GDB Multi-thread debug – Ensure working debug functionality in GDB for multi-threaded applications ARM RealView Linux Debug – Debug Linux kernels using ARM RealView Debugger – HSD for kernel and loadable modules – Plan for RSD with running kernels 24 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 13. Cooperation Commercial Linux distributions – Montavista (http://www.mvista.com/) – Metrowerks (http://www.metrowerks.com) – LynuxWorks (http://www.lynuxworks.com/) – Lineo (http://www.lineo.co.jp) –… Consumer Electronic Linux Forum (CELF) – ARM is Associate Member – Participate to Working Groups to improve ARM/Linux support for Embedded platforms 25 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd ARM Linux – Building Blocks Compilation tool chain Boot Loader Kernel distribution and patches Filesystem and applications Debug and Validation tools Additional links 26 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 14. ARM Linux – Tool Chain arm-linux build of the GNU compiler – Cross-compilation from Unix (Linux or Solaris) or Windows host – Snapshots available at http://www.codesourcery.com/ Choice of C library – Glibc – standard GNU C library – uCLibc • http://www.uclibc.org – Newlib – smaller library • http://sources.redhat.com/newlib/ – Decide on which library to use when building the cross compilation tool chain 27 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd Linux - Boot Loader Needed to initialise platform, – Load and run the Linux kernel • Can download kernel using tftp/bootp • Access from flash if kernel resides in Flash – Setup various initialisation parameters: • command line: root=/dev/nfs …. • Platform ID (stored in r1) Available boot loaders for ARM platforms: – U-Boot (http://sourceforge.net/projects/u-boot) – RedBoot (http://www.ecoscentric.com/ecos/redboot.shtml) 28 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 15. Building Linux Kernels Download reference kernel – http://www.kernel.org Download and apply associated ARM patch – http://www.arm.linux.org.uk/developer/ – This is applied on unpacked base kernel – Add additional patches as appropriate Configure the kernel (make xconfig) – Choose architecture, development platform, devices and functionality needed Build the kernel – Ensure the right link is set in main Makefile to point at the cross compiler location 29 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd Running Linux kernels Built image is in arch/arm/boot directory Loading and running the image on the target: – Use BootLoader • Either via network (tftp/bootp) or from flash – Use Debugger • Load image as raw binary (i.e. @0x8000 for uncompressed Image) • Set platform ID in r1 and initialise r0, r2 • Disable semihosting and vector catch • Set pc=0x8000 and run the kernel 30 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 16. Linux Filesystem Contains system utilities and applications – Busybox for base utilities (http://www.busybox.net/) – Need C library – either Glibc or Newlib – Additional utilities such as: • Sysvinit, shells, ftpd, telnet… – Graphical windowing system and applications: • X11 environment: http://www.xfree86.org/ • Microwindows: http://www.microwindows.org/ • Qt/Qtopia: http://www.trolltech.com Access from Flash or via NFS – From Flash can use cramfs, romfs… 31 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd Linux – Debugging Kernel debug – With JTAG connection use commercial debugger for early kernel bring up – Use Kgdb to debug kernel – Commercial debuggers offer additional features to debug and profile the Linux kernel: • Choice of halted/running system debug • Profiling Application debug – Use GDB over serial or networking link • Either natively or in cross-debug environment • Choice over graphical front-end used – Use commercial debuggers for debugging over JTAG 32 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd
  • 17. Additional open source links Gnu Debugger - http://www.gnu.org/software/gdb/gdb.html Linux Test Project - http://ltp.sourceforge.net/ – Test coverage of the kernel Linux Trace Toolkit - http://www.opersys.com/LTT/ – Acquire and display kernel trace information Guide to porting Linux on new ARM hardware – http://vega.soi.city.ac.uk/~es728/pdf/aleph.pdf Guide to building Linux system from scratch – http://www.opersys.com/quickref.html Other useful resources – http://www.debian.org – http://www.handhelds.org/ 33 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright © ARM Ltd

×