Weitere Àhnliche Inhalte
Ăhnlich wie Porting linux on ARM (20)
Mehr von Satpal Parmar (6)
KĂŒrzlich hochgeladen (20)
Porting linux on ARM
- 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