porting linux on arm

Download Porting linux on ARM

If you can't read please download the document

Upload: satpal-parmar

Post on 11-May-2015

3.840 views

Category:

Technology


3 download

TRANSCRIPT

  • 1.ARM Linux & GNUPhilippe Robin June 20041 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd OutlineOpen source modelArchitecture and platforms supportLinux 2.4 kernelLinux 2.6 kernelGNU GCC tool chainDebuggingCooperationLinux resources2 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

2. ARM Architecture Evolution 2004 ARMv72003 ARMv6Z TrustZone, IEM*2003ARMv6T2 Thumb-2 ISA 2002ARMv6 SIMD Media ISA2000ARMv5TEJ Jazelle Java Acceleration1998 ARMv5TE DSP Instructions 1995 ARMv4T Thumb ISA ISA3 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd Linux and Architecture Support ARM ARCHITECTURESTrustZone Intelligent Energy Controller (IEC)Jazelle (option)V4V5TEV5TEJV6V7 Linux 2.4 kernel Linux KernelLinux 2.6 kernel Linux 2.7 kernelPreemtion, 0(1) scheduler, New Posix Thread Library (NPTL),Power Management etc4 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd 3. Open Source ModelOther organisations-Embedded Linux Consortium-EmbedixCommercial Linux-CELF Gatekeepers ProvidersOpen Source Repository www.kernel.org Other Contributors:ARM Source Tree-Platforms (Zaurus, iPaq) Architecture & Platform -Debian Support -EtcARM Linux Open Source Treehttp://www.arm.linux.org.uk5THE ARCHITECTURE FOR THE DIGITAL WORLDCopyright ARM Ltd ARM and Open Source ProjectsARM Contribute Architectural support to theLinux kernel and related GNU projects For ARM cores and specific technology ARMv6, ARMv7... Promote standardization initiatives New ARM ABIEarly contribution to promote adoption from thecommunity Cooperation with partners and gatekeepersPromote active participation and contributionsto the open source6THE ARCHITECTURE FOR THE DIGITAL WORLDCopyright ARM Ltd 4. Architectural Support ARM uses Linux kernel internally to validatenew ARM cores and technology Used with simulation models, FPGA and CoresContribute 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 chains7 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd ARM Development PlatformsIntegrator FamilyVersatile Family Compact PlatformVersatile Platform BaseboardLogic Modules Core Modules Interface ModulesAnalyzer TileLogic Tile 8 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd 5. ARM Cores and Platform SupportCurrently Linux has support for: ARM720T, ARM92x, ARM102x and ARM11 coresARM development platforms ARM Integrator family Versatile boardBSP availability ARM (early access) Open source (www.kernel.org) availability usually coincide with hardwareavailability 9THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd Linux 2.4 kernel Stable version Feature freeze Only bug fixes are now being integratedCurrent 2.4.21 includes support for: ARM cores up to ARMv6 Legacy mode, not optimised Integrator AP and CP Versatile PB Patch available from ARM10THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd 6. Linux 2.6 kernel2.6.6 is the current development versionVersion 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/LCDPeripherals being added in 04Q2 AACI, VIC, VFP9 MMC, RTC, I2CUSB (Transdimension), DoC (M-Systems)11THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd Hardware Floating PointNeed compiler support Now available in GCC 3.4Linux kernel support currently being addedto 2.6 kernel Validated on Versatile platform using VFP9Availability 2004Q212THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd 7. ARM Linux SMP SupportLinux kernel already has SMP support for multiple architecturesImplications on development tool chain Multi-threading (TLS) Debugging toolsARMv6 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 regionsInitial validation on modified ARM926EJ-S cores with Linux onARM Integrator CP Need hardware support for cache coherency, synchronization13 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd ARM Linux MPCore PlatformConfigurable ARMv6 architectural core Implement between 1 and 4 processors Provides up to 2600 DMIPS performance Integral interrupt distribution and control unitFlexible 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 otherSoC system compatibility AMBA AXI bus inter-connect RealView development tools PrimeCell L220 L2 cache controller14 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd 8. ARM Intelligent Energy Management (IEM)Controlling run-time voltage reduces energyconsumed from battery when maximumperformance 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. costReducing frequency reduces average powerconsumption and associated heating Can also help to reduce packaging costs 15 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd ARM Linux - IEMCurrent 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 managementAvailability Mid-2004IEM 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 04Q3Thumb2 support planned for 05Q4ARMv7 (Tiger) scheduled for 2006 17THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd ARM GNU Tools 18THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd 10. ARM GNU ToolsFollow evolution of the ARM Architecture Recently added ARMv6 supportAdoption of the new ARM ABI Initial ARM ABI support for GCC end 2004 Inter-operability between tool chainsPublicly available Bi-annual source and binary releases Snapshots and binary packages Open source mailing lists Cooperation with www.codesourcery.com19 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 instructions20 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 Compiler2005 Q4 Thumb2 support CPU support for ARM1156T2(F)-S2006 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 betweenproprietary 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 supportABI v1.2 Thumb 2 supportARMv7 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 ABIThumb2ARMv7 LDREX/STREX, Cache) IEM, TrustZone Linux 2.6.x roadmap03/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 23THE ARCHITECTURE FOR THE DIGITAL WORLDCopyright ARM Ltd Linux - DebuggingArchitectural support added for new cores Currently ARMv6 supportGDB Multi-thread debug Ensure working debug functionality in GDB for multi-threaded applicationsARM RealView Linux Debug Debug Linux kernels using ARM RealView Debugger HSD for kernel and loadable modules Plan for RSD with running kernels24THE ARCHITECTURE FOR THE DIGITAL WORLDCopyright ARM Ltd 13. CooperationCommercial 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 improveARM/Linux support for Embedded platforms 25THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd ARM Linux Building BlocksCompilation tool chainBoot LoaderKernel distribution and patchesFilesystem and applicationsDebug and Validation toolsAdditional links 26THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd 14. ARM Linux Tool Chainarm-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 chain27 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 KernelsDownload reference kernel http://www.kernel.orgDownload and apply associated ARM patch http://www.arm.linux.org.uk/developer/ This is applied on unpacked base kernel Add additional patches as appropriateConfigure the kernel (make xconfig) Choose architecture, development platform, devices and functionality neededBuild the kernel Ensure the right link is set in main Makefile to point at the cross compiler location29 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd Running Linux kernels Built image is in arch/arm/boot directoryLoading 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 kernel30 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd 16. Linux FilesystemContains 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.comAccess from Flash or via NFS From Flash can use cramfs, romfs 31 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd Linux DebuggingKernel debug With JTAG connection use commercial debugger for earlykernel bring up Use Kgdb to debug kernel Commercial debuggers offer additional features to debugand profile the Linux kernel: Choice of halted/running system debug ProfilingApplication 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 JTAG32 THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd 17. Additional open source linksGnu Debugger - http://www.gnu.org/software/gdb/gdb.htmlLinux Test Project - http://ltp.sourceforge.net/ Test coverage of the kernelLinux Trace Toolkit - http://www.opersys.com/LTT/ Acquire and display kernel trace informationGuide to porting Linux on new ARM hardware http://vega.soi.city.ac.uk/~es728/pdf/aleph.pdfGuide to building Linux system from scratch http://www.opersys.com/quickref.htmlOther useful resources http://www.debian.org http://www.handhelds.org/33THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd