You are visiting this site as:
You are here:
(revision 4) (raw view)
---+ Running Linux on ARM Development Platforms %TOC% ---++ Summary Describes stages to set-up and run Linux on ARM based platforms, from installing a boot loader, kernel and file system image. This document is not intended as an exhaustive guide on developing or building Linux systems. There is already considerable information available in the open source community for this. Open source discussion forums also provide a valuable source of information. Please refer to the ARM Linux Wiki site (www.linux-arm.org) or www.arm.com/linux for additional information. Whilst examples refer to ARM Ltd supplied development boards, esp. *%BLUE%RealView%ENDCOLOR%* boards, <br /> and the ARM Embedded Linux distribution from [[http://www.arm.com/products/os/linux_download.html][The ARM Ltd Linux Operating System Download Page]] <br /> the contents should be applicable to other ARM based boards with little or no change. ---++ INSTALLING PRE-BUILT IMAGES Images can be installed into flash using a debugger connected to the board via a JTAG run control device, such ARM *%BLUE%RealView%ENDCOLOR%* ICE units. * ARM *%BLUE%RealView%ENDCOLOR%* Integrator boards <br /> Use ARM Flash Utility (provided with the board) to program <br /> images (e.g. AFU.axf), running the utility from the debugger <br /> __AFU> program 1 u-boot c:/tmp/u-boot.bin__ <br /> _Lowest available flash at location 0x24440000 block B30_ <br /> _Programming Block B30_ * ARM *%BLUE%RealView%ENDCOLOR%* Versatile/(PB, AB)926EJ-S and later <br /> Run the !BootMonitor.axf program supplied with the board <br /> from the debugger to program images. There is a Flash menu with some options to <br /> program ELF or binary images. To run from flash you should program the ELF image into flash as: <br /> __FLASH> write image c:/tmp/u-boot.axf NAME u-boot__ <br /> An additional flash programming utility is provided with *%BLUE%RealView%ENDCOLOR%* boards called `Network Flash Utility` (NFU). <br /> This program enables programming of images into flash using an <br /> ethernet connection. To download and program a U-Boot image into flash from a server <br /> with IP address <192.168.0.1> for example, you can use the following sequence <br /> __manage dhcpc start__ <br /> __manage map n: 192.168.0.1__ <br /> __flash write image n:/u-boot.axf__ <br /> Please, refer to the documentation of your *%BLUE%RealView%ENDCOLOR%* Versatile Family CD <br /> for more information and the exact syntax. A similar process can be used to program other images (kernel and cramfs) into Flash. These should be programmed as binary files as they are not ELF images. For more information, please refer to the Firmware documentation supplied with the board. ---++ BOOT LOADER U-Boot is used as boot loader for *%BLUE%RealView%ENDCOLOR%* platforms. The source code and documentation for the main distribution are available http://www.denx.de/wiki/U-Boot/WebHome Source code for later *%BLUE%RealView%ENDCOLOR%* boards which have not yet reached the main tree are available at http://www.linux-arm.org/git u-boot-armdev project on the 090204_armdev branch. U-Boot is expected to run from 0x01000000 in memory on ARM boards (Later *%BLUE%RealView%ENDCOLOR%* boards 0x06000000). <br /> The AEL supplied images can be loaded and run from a debugger at this address. <br /> ( __readelf -h__ will show the entry point address) <br /> *%BLUE%RealView%ENDCOLOR%* Integrator: raw binaries (or ELF files) can be placed at the beginning of flash and executed as default image. *%BLUE%RealView%ENDCOLOR%* later boards: you should use the ELF file to execute directly from flash or load and run the raw binary from memory. To compile U-Boot, download the source distribution from the above sites. *%BLUE%RealView%ENDCOLOR%* Integrator and Versatile support has been added in the main U-Boot CVS/GIT repository. For later *%BLUE%RealView%ENDCOLOR%* boards use http://www.linux-arm.org/git . Once you have retrieved the sources, you need to configure and build the boot loader. You can consult the full list of targets from the top Makefile. To configure and compile the boot loader, you should execute the following commands: *%BLUE%RealView%ENDCOLOR%* Integrator/CP: make integratorcp_config make *%BLUE%RealView%ENDCOLOR%* Versatile AB: make versatileab_config make *%BLUE%RealView%ENDCOLOR%* Versatile PB: make versatileab_config make *Later %BLUE%RealView%ENDCOLOR%* boards make_realview_config make Resulting executables (binary and ELF) are located in the top level directory. Some macros are used to encode the default command line passed to a Linux kernel, the default boot sequence of the boot loader (i.e. dhcp/bootp, flash etc.). Some of these definitions can be changed interactively from the U-Boot command line using the __setenv__ command. Parameters used for ARM *%BLUE%RealView%ENDCOLOR%* boards can be found in the respective configuration file in the include/configs directory with macro definitions such as CONFIG_COMMANDS, CONFIG_BOOTARGS and CONFIG_BOOTCOMMAND. The Linux kernel is usually loaded at the address specified by CFG_LOAD_ADDR (0x7c0) and then executed from 0x8000 for an uncompressed Linux kernel image. These parameters are specified by the u-boot mkimage utility when converting a raw Linux kernel binary image to be loaded by u-boot. The mkimage utility is built when compiling u-boot. Later *%BLUE%RealView%ENDCOLOR%* boards allow kernel images to be loaded higher to make use of the full memory available. Note that when downloading a kernel image via Ethernet, you should configure your server to recognise the MAC address of your platform and the location of the image to download. ---+++ Booting from images in flash When adding the u-boot header to the Linux kernel binary image (for low loaded images), ensure that the load and execute addresses are both set to 0x8000. The boot command for a flashed image should be e.g <br /> IntegratorCP # __cp 0x 0x7fc0 0x__ <br /> IntegratorCP # __bootm__ <br /> ethernet loaded ( __bootp__, __tftpboot__) mkimage wrapped images will be loaded directly to the correct position. You can use the ‘help’ command with U-Boot to see the exact syntax of each command. ---+++ The command line The Linux kernel CMDLINE can be set from the U-Boot prompt using the ‘setenv’ command to alter the bootargs environment variable. The ‘printenv’ command can be used to list the current environment variables. When executing the Linux kernel from a boot loader, the kernel will use the command line which is in the block pointed at by , instead of any default built-in command line. The images provided allow you to save the environment into Flash memory. This can be done using the saveenv command. The U-Boot images available for download at http://www.arm.com/linux contain the command line used with the supplied U-Boot, kernel and filesystem images saved into flash, in that order, starting at the bottom of flash. ---++ LINUX KERNEL Sources of the kernel can be obtained and downloaded from www.kernel.org. Any additional patch should be applied to the base kernel source tree as follows: $ __cd linux-2.6.19/__ <br /> $ __patch –p 1 < patch-2.6.19-<revision>__ <br /> Configuration files are provided for each platform and pre-built images. The relevant configuration file should be copied into the kernel tree as _.config_ The kernel can then be configured running ‘make xconfig’ or equivalent commands ('make menuconfig' etc.). The following sequence of commands can be used to build the kernel: __$ make xconfig__ <br /> __$ make Image__ (produces a raw binary Image in arch/arm/boot/) A vmlinux file is also generated which contains debugging information associated to the kernel image which can be loaded by a debugger (assuming the kernel is compiled with '-g' flag). The boot loader also determines the platform identification. This information is stored in register . The platform number is needed by the kernel before starting its execution. When starting the kernel directly from a debugger, this register value needs to be set from within the debugger. ---++ FILESYSTEM Pre-built filesystem images provided in http://www.linux-arm.org/git ael.git can be use with ARM *%BLUE%RealView%ENDCOLOR%* boards. <br /> ( *%BLUE%RealView%ENDCOLOR%* Integrator boards may require minor changes to the images) These images contain a subset of system utilities, commands and applications as described in the associated README file. The filesystem can either be mounted via NFS or placed into Flash, depending on the platform settings and the command line passed to the kernel at boot time. The location of the filesystem should be specified in the kernel command line by the “root =…” option, either root=/dev/mtdblocki or root=/dev/nfs, where i is to be replaced by the appropriate partition number. On *%BLUE%RealView%ENDCOLOR%* platforms, the mtdpart option needs to be defined to indicate where images are located in flash. This is documented in the kernel driver/mtd/ sources. ---++ COMPILATION TOOLS ---+++ CROSS-COMPILATION An ARM cross-compilation tool chain need to be installed on the host system to produce Linux kernels or applications. By default, this document assumes a Linux based host development platform. Note that the pre-compiled tool chain which is available for download from http://www.codesourcery.com/sgpp/lite/arm/portal/release644 assumes that you have Glibc library version 2.3 installed on your system. Sources used to build the GCC tools can be downloaded from www.codesourcery.com or from the main GCC CVS repository. Discussion groups are also available on this site to discuss technical issues related to ARM GNU tools. Multiple targets can be built for the compiler: -arm-elf produces a flat or standalone binaries which are not tied to any operating system. arm-elf selects ELF support which shares much of its code with arm-linux. -arm-none-linux-gnueabi is the target you need for Linux and generates ELF support for Linux/ARM. The pre-built tool chain is produced using the arm-linux option and is produced against 2.3.6 version of Glibc. ---+++ ABI COMPATIBILITY The version of GCC used with the latest AEL release (i.e. GCC 4.3) defaults to the new ABI for the ARM Architecture. Linux kernel version 2.6.19 and later can be configured to support both, the new ABI for the ARM Architecture and old ABI. Packages provided with filesystem version AEL 2.2.0 and later were built for the new ABI, you should ensure that Linux kernel is configured to support this version of the ABI (Kernel Features:: CONFIG_AEABI). Older version of the ABI for the ARM Architecture can be used with Kernel Features:: CONFIG_OABI_COMPAT, however, this should be used in conjunction with a file system with binaries built for the old ABI (i.e. AEL 2.1.0). This is particularly important when using data structures such as those passed through ioctl() calls where types and alignment must be exactly the same from the kernel view as from the user view. An application note is available from ARM Support pages providing more information on how to use ARM *%BLUE%RealView%ENDCOLOR%* Compilation Tools with GNU Tools. This document can be found at: http://www.arm.com/pdfs/AN150B_Building_Linux_Applications_with_RVCT.zip ---++ UCLINUX The AEL example distribution provides pre-built images of uClinux kernels. The main repository and source of information on uClinux is accessible at http://www.uclinux.org and http://opensrc.sec.samsung.com/ for the initial ARM port created by Hyok S. Choi. As of 2005, MMUless support for ARM has started to be merged into mainline kernel and most of the MMUless kernel patches should be integrated into mainline kernel. The uClinux images available from this web page are generated using an EABI compliant tool chain and the kernel is compiled with the CONFIG_AEABI option enabled. However, there is not yet a full EABI compliance for uClinux (i.e. shared libraries etc.). The file system image provided is a collection of utilities and executables generated by the community which are not compiled with the EABI option. The kernel can handle both types of binaries assuming it has been configured to do so. uClinux uses a flat binary format for application binaries. This is a relatively simple format intended to contain the minimum needed to load and execute binaries. A special linker script is required to prepare an ELF file, as well as a utility called elf2flat. These are provided with GNU tools available from the uClinux community. ---++ ADDITIONAL NOTES Notes and Linux packages provided in the AEL distribution are intended as starting point for evaluation and validation with ARM development platforms. Please contact Linux distributors for complete Linux distributions. Some additional discussion forums are also available on public websites, Linux kernel mailing lists and GNU mailing lists. Other communities such as www.debian.org, www.openembedded.org, www.handhelds.org and http://www.celinuxforum.org/ also provide good resources which can be used with ARM platforms. ---++ Release AEL 3.0 Notes regarding the AEL 3.0 release can be placed here. -- Main.PeterPearse - 06 Mar 2009
ore topic actions
Topic revision: r4 - 06 Jan 2011 - 14:29:58 -
Create New Topic
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki?
zenweb1 : 0.09 secs