1

How can I convert platform specific file to device tree?.

I know theoretically about device tree. Please explain how its works in raspberry pi board or any other boards.

TheCodeArtist
  • 21,479
  • 4
  • 69
  • 130
  • Learn more about [udev](http://en.wikipedia.org/wiki/Udev) – Basile Starynkevitch Aug 27 '13 at 10:05
  • 1
    What is *platform specific file*? You mean the actual kernel platform data specific to each board or a custom vendor-specific file somehow describing your platform? Either you write a script to automate this or you do it manually (which should be faster). We won't explain *how it works* here... read the [device tree usage](http://www.devicetree.org/Device_Tree_Usage) and learn how it's used in the kernel (API in `drivers/of` and lots of device trees in `arch/arm/boot/dts` and `arch/powerpc/boot/dts`). – eepp Aug 27 '13 at 14:37
  • Maybe if you provide which file your looking to "convert" we can give you some hints. – Benjamin Leinweber Aug 27 '13 at 14:50
  • ARM Linux kernels contain a lot of non-enumerable hardware and tend to have a board-file that does this programmatically. – marko Aug 29 '13 at 13:31

1 Answers1

6

A device-tree is simply a data structure for describing the hardware present on a system. In the absence of device-tree, systems rely on "board-files". These are C files with plenty of structures, each describing every individual hardware present on the system and also how they are connected.

Porting of code from legacy "board-files" to device-tree dts files is currently an ongoing process across several platforms/devices based on the ARM architecture.

To do this one requires proper understanding of the

  • platform/device hardware.
  • structure of the board-file.
  • structure of the dts file.

This answer should help you get started in preparing a device-tree dts.

Also there is an ongoing effort to migrate the raspberry-pi Linux-kernel to use device-tree. Take a look at the source and booting instructions.

Community
  • 1
  • 1
TheCodeArtist
  • 21,479
  • 4
  • 69
  • 130