Vous êtes sur la page 1sur 17

ARM Linux & GNU

Philippe Robin

June 2004

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

ARM Architecture Evolution


2004 2003 2003 2002 2000 1998 1995

ARMv7 ARMv6Z TrustZone, IEM*

ARMv6T2 Thumb-2 ISA ARMv6 SIMD Media ISA

ARMv5TEJ Jazelle Java Acceleration ARMv5TE DSP Instructions

ARMv4T Thumb ISA ISA

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

Open Source Model


Other organisations -Embedded Linux Consortium -Embedix -CELF

Commercial Linux Providers

Gatekeepers

Open Source Repository www.kernel.org Other Contributors: -Platforms (Zaurus, iPaq) -Debian -Etc

ARM Source Tree Architecture & Platform Support ARM Linux Open Source Tree http://www.arm.linux.org.uk

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


THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

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 interoperability between tool chains

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

ARM Development Platforms


Integrator Family
Compact Platform Logic Modules

Versatile Family
Versatile Platform Baseboard

Core Modules Interface Modules

Logic Tile

Analyzer Tile

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

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

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
THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

10

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)
THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

11

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

12

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
THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

13

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)

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

Asymmetric multiprocessing (AMP)

OS dynamically shares task across multiple CPU Coherent and consistent view of memory

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

14

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
THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

15

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
THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

16

Future Architectural Support


ARM1176JZ-S support
Planned for 04Q3

Thumb2 support planned for 05Q4 ARMv7 (Tiger) scheduled for 2006

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

17

ARM GNU Tools

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

18

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

19

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

20

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

21

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

22

Linux and GNU roadmap


ARMv6 and VFP binutils support ARMv6 GCC support - VFP GCC support ABI v1.0 ABI v1.2 Thumb 2 support ARMv7 support

GCC roadmap
2.5.70 SMP (CP/CM916) 2.6 kernel (ARMv6, Integrator CP, AP) ARM1136 SMP

2.5.70 kernel - ARMv6 (ASIDS, CPS, LDREX/STREX, Cache)

2.6 kernel: - Versatile PB926 + VFP - ARMv6 IEM, TrustZone

GCC / ARM ABI

Thumb2

ARMv7

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

23

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
THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

24

Cooperation
Commercial Linux distributions
Montavista Metrowerks LynuxWorks Lineo
(http://www.mvista.com/) (http://www.metrowerks.com) (http://www.lynuxworks.com/) (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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

25

ARM Linux Building Blocks


Compilation tool chain Boot Loader Kernel distribution and patches Filesystem and applications Debug and Validation tools Additional links

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

26

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

27

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)
THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

28

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

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

29

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
THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

30

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
THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

31

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


THE ARCHITECTURE FOR THE DIGITAL WORLD Copyright ARM Ltd

32

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/

THE ARCHITECTURE FOR THE DIGITAL WORLD

Copyright ARM Ltd

33

Vous aimerez peut-être aussi