Arm device tree linux

ARM Device Trees

This page outlines the implementation details and progress for the device trees on ARM work. At present it’s just to document what I’m up to, we could merge this with the mobile-lucid-arm-device-tree-support spec. Contact Jeremy Kerr for comments/questions/etc.

Objectives

  • Reduce time & effort required for ARM OEM bringup work
    • Most designs may only require a new DT, rather than new code
    • Vendors’ code drops should become smaller and more manageable
    • Only the platforms we care about can be device-tree-ised, others can remain as existing

    Implementation Plan

    My currently plan is to use the qemu ‘versatilepb’ platform as a testing environment for the early boot code, then continue on an iMX51 (babbage 2.0) board for device support. This should involve the following:

    Boot interface

    Rather than pass the device tree pointer in ATAGS, nico has suggested that we should pass the pointer directly in r2 on boot, removing the need for ATAGS on device tree platforms.

    The draft boot interface has been published here: http://devicetree.org/Boot_Environment

    dtbImage wrapper

    It is now possible to «embed» a device tree blob in a kernel image, forming a single bootable file (dtbImage) that includes the device tree for a specific machine.

    This is used to boot with a device tree with bootloaders that do not have device tree support.

    The dtbImage consists of three components: a kernel zImage, a device tree blob, and a small ASM wrapper. The ASM wrapper is executed first, adding a pointer to the device tree blob in r2, and then executes the zImage. Boot proceeds as per usual, as if the bootloader has passed the DTB to the kernel.

    dtbImage support is in the ‘dtbimage’ branch of the kernel git tree below. To use the dtbImage infrastructure, set CONFIG_ARM_EMBEDDED_DTB to the path to a .dtb file, and ‘make dtbImage’. The resulting file will be in arch/arm/boot/dtbImage.

    If you’re using a dtbImage, the kernel command line and memory configuration will need to be correct in the .dts file you compiled (as opposed to using qemu, where these properties are updated at boot time).

    Code

    • qemu with initial DT support: http://kernel.ubuntu.com/git?p=jk/dt/qemu.git;a=summary / git://kernel.ubuntu.com/jk/dt/qemu.git
    • kernel: http://kernel.ubuntu.com/git?p=jk/dt/linux-2.6.git;a=summary / git://kernel.ubuntu.com/jk/dt/linux-2.6.git
    • kernel (devicetree infrastructure): http://git.secretlab.ca/?p=linux-2.6.git;a=summary (see the test-devicetree and experimental-devicetree branches)

    These trees are in active development, and will be rebased frequently.

    Development details

    First, grab the device tree compiler from git://git.jdl.com/software/dtc.git. Compile and install to a local —prefix.

    Next, compile the qemu tree above, specifying the paths to dtc’s install prefix:

    ./configure --target-list=arm-softmmu --audio-drv-list="alsa pa" \ --enable-fdt \ --extra-cflags=-I/include \ --extra-ldflags=-L/lib

    Devices

    Versatile

    The ‘versatile’ branch of the kernel git tree above contains support for booting the versatile platform with a device tree.

    The branch contains a ‘device tree source’ (.dts) file, which can be compiled to provide the device tree blob (.dtb). The dts file is in arch/arm/boot/dts/versatile.dts. Compile this to a device tree blob:

    dtc -O dtb -o versatilepb.dtb versatilepb.dts

    And place the .dtb file in the pc-bios/ directory of your qemu build tree.

    Build the ‘versatile’ branch of the kernel tree above, with the linux-versatile-dt.config config file.

    From your qemu build tree, boot the zImage:

    ./arm-softmmu/qemu-system-arm -M versatilepb \ -kernel /arch/arm/boot/zImage \ -nographic -append "console=ttyAMA0 debug"

    Add any -initrd or -hda arguments as necessary.

    mx51

    mx51 support is currently under development, using the mx51 branch of the kernel tree. This support is based on Robert Herring’s initial mx51 patch, and I’m currently working to move more of the device discovery and setup to DT-based methods.

    The DTS file for mx51 is in arch/arm/boot/dts/mx51_babbage.dts. Kernel .config: linux-mx51-dt.config.

    Since there is no bootloader support for device trees, you’ll need to boot a dtbImage (a zImage with an embedded device tree blob). To create a dtbImage, set CONFIG_ARM_EMBEDDED_DTB to the path to your compiled dtb, and ‘make dtbImage’.

    Potential Issues

    Early boot requirements

    • Do a little initial early parsing (in asm or C) before the full parse; only need to extract a few properties for early boot (phys_io and io_pg_offset?).
    • Do what powerpc does: make very early debug output non-portable (ie, depend on a compile-time IO address), bring up platform-independent debug code ASAP. Very early debug should only be needed for a small subset of problems, like MMU setup.

    Upstream acceptance

    For this work to be of value, we’d need to have it accepted by the ARM community. According to gcl, rmk is not convinced of the merits of DT for ARM, and would need to see benefits before accepting upstream. Work is in progress to demonstrate full platform support for device tree boot on mx51.

    Kernel/Dev/ARMDeviceTrees (последним исправлял пользователь 193 2010-07-20 06:16:21)

    The material on this wiki is available under a free license, see Copyright / License for details.

    Источник

    Читайте также:  Adobe linux standalone flash player
Оцените статью
Adblock
detector