flatteneddevicetree

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
flatteneddevicetree [2010/05/05 16:29] – RafalJaworowskiflatteneddevicetree [2022/06/27 16:24] (current) – Add a noted that you can dump the DTB by sysctl and pipe it into dtc to get dts out again ... BjoernZeeb
Line 4: Line 4:
 ====== Abstract ====== ====== Abstract ======
 The objective of this project is to provide %%FreeBSD%% with the ability to use flattened device trees for description of hardware resources of a computer The objective of this project is to provide %%FreeBSD%% with the ability to use flattened device trees for description of hardware resources of a computer
-system and their dependencies, in a platform-neutral and portable way. The primary consumer of this functionality are embedded systems (based on [[FreeBSD/arm|ARM]], AVR32, [[FreeBSD/mips|MIPS]], [[powerpc|PowerPC]]), but the mechanism can be used in all cases when hardware resources cannot be self-enumerated (as such could be seen as a future replacement for [[http://www.FreeBSD.org/cgi/man.cgi?query=device.hints&apropos=0&sektion=0&manpath=FreeBSD+8-current&format=html|device.hints]] used in the legacy PC world).+system and their dependencies, in a platform-neutral and portable way. The primary consumer of this functionality are embedded systems (based on [[arm|ARM]], AVR32, [[FreeBSD/mips|MIPS]], [[powerpc|PowerPC]]), but the mechanism can be used in all cases when hardware resources cannot be self-enumerated (as such could be seen as a future replacement for [[http://www.FreeBSD.org/cgi/man.cgi?query=device.hints&apropos=0&sektion=0&manpath=FreeBSD+8-current&format=html|device.hints]] used in the legacy PC world).
  
 ====== Repository ====== ====== Repository ======
-The official project [[http://p4db.freebsd.org/changeList.cgi?FSPC=//depot/projects/fdt/...|branch]] in P4.+The code has been committed to the %%FreeBSD%% SVN repository as of r210053, and all development is now supposed to happen in the SVN HEAD. 
 +The obsolete, no longer maintained original project development P4 branch can be found [[http://p4db.freebsd.org/changeList.cgi?FSPC=//depot/projects/fdt/...|here]].
  
 ====== Introduction ====== ====== Introduction ======
Line 74: Line 75:
 The device tree source is a text file which describes hardware resources of a computer system in a human-readable form. See [[FlattenedDeviceTree/example.dts|example snippets]] of a device tree source (DTS) featuring description of all major components (CPU, memory, system-on-chip peripherals, IRQ assignments etc.) as device tree nodes and their properties. The device tree source is a text file which describes hardware resources of a computer system in a human-readable form. See [[FlattenedDeviceTree/example.dts|example snippets]] of a device tree source (DTS) featuring description of all major components (CPU, memory, system-on-chip peripherals, IRQ assignments etc.) as device tree nodes and their properties.
  
-The default location of DTS files is the following subdirectory of the %%FreeBSD%% source repository:+The default locations of DTS files are the following subdirectories of the %%FreeBSD%% source repository:
  
 <code> <code>
-sys/boot/fdt/dts+sys/dts 
 +sys/gnu/dts
 </code> </code>
  
Line 143: Line 145:
 </code> </code>
  
-Note the FDT_DTS_FILE parameter is a file name specified relative to the default directory:+Note the FDT_DTS_FILE parameter is a file name specified relative to one of the default directories:
  
 <code> <code>
-sys/boot/fdt/dts +sys/dts 
 +sys/gnu/dts
 </code> </code>
  
-Currently the build system can accept DTS files only from this location.+Currently the build system can accept DTS files only from these locations.
  
 ===== Stand-alone DTB ===== ===== Stand-alone DTB =====
Line 202: Line 205:
  ...  ...
  0x162f92c: boot/mpc8555cds.dtb (dtb, 0x1eb2)  0x162f92c: boot/mpc8555cds.dtb (dtb, 0x1eb2)
-loader> +loader>
 </code> </code>
  
Line 221: Line 224:
  size_dt_strings         = 518  size_dt_strings         = 518
  size_dt_struct          = 6260  size_dt_struct          = 6260
-loader> +loader>
 </code> </code>
  
Line 264: Line 267:
 /pci@e0008000/i8259@19000 /pci@e0008000/i8259@19000
 /pci@e0009000 /pci@e0009000
-loader> +loader>
 </code> </code>
  
Line 302: Line 305:
       sec0       sec0
       openpic0       openpic0
-# +#
 </code> </code>
  
Line 317: Line 320:
 ranges = <0x00000000 0xe0000000 0x00100000> ranges = <0x00000000 0xe0000000 0x00100000>
 bus-frequency = <0x00000000> bus-frequency = <0x00000000>
-loader> +loader>
 </code> </code>
  
Line 487: Line 490:
 <code> <code>
 # ofwdump -a # ofwdump -a
-Node 0xc06309a0: +Node 0xc06309a0:
   Node 0xc0630a04: aliases   Node 0xc0630a04: aliases
   Node 0xc0630b04: cpus   Node 0xc0630b04: cpus
Line 532: Line 535:
 Node 0xc0630c24: soc8555@e0000000 Node 0xc0630c24: soc8555@e0000000
   #address-cells:   #address-cells:
-    00 00 00 01 +    00 00 00 01
   #size-cells:   #size-cells:
-    00 00 00 01 +    00 00 00 01
   device_type:   device_type:
-    73 6f 63 00 +    73 6f 63 00
     'soc'     'soc'
   compatible:   compatible:
-    73 69 6d 70 6c 65 2d 62 75 73 00 +    73 69 6d 70 6c 65 2d 62 75 73 00
     'simple-bus'     'simple-bus'
   ranges:   ranges:
-    00 00 00 00 e0 00 00 00 00 10 00 00 +    00 00 00 00 e0 00 00 00 00 10 00 00
   bus-frequency:   bus-frequency:
-    00 00 00 00  +    00 00 00 00 
-# +#
 </code> </code>
  
Line 552: Line 555:
 Node 0xc063124c: ethernet@24000 Node 0xc063124c: ethernet@24000
   #address-cells:   #address-cells:
-    00 00 00 01 +    00 00 00 01
   #size-cells:   #size-cells:
-    00 00 00 01 +    00 00 00 01
   cell-index:   cell-index:
-    00 00 00 00 +    00 00 00 00
   device_type:   device_type:
-    6e 65 74 77 6f 72 6b 00 +    6e 65 74 77 6f 72 6b 00
     'network'     'network'
   model:   model:
-    54 53 45 43 00 +    54 53 45 43 00
     'TSEC'     'TSEC'
   compatible:   compatible:
-    67 69 61 6e 66 61 72 00 +    67 69 61 6e 66 61 72 00
     'gianfar'     'gianfar'
   reg:   reg:
-    00 02 40 00 00 00 10 00 +    00 02 40 00 00 00 10 00
   ranges:   ranges:
-    00 00 00 00 00 02 40 00 00 00 10 00 +    00 00 00 00 00 02 40 00 00 00 10 00
   local-mac-address:   local-mac-address:
-    00 00 00 00 00 00 +    00 00 00 00 00 00
   interrupts:   interrupts:
-    00 00 00 1d 00 00 00 02 00 00 00 1e 00 00 00 02 00 00 00 22  +    00 00 00 1d 00 00 00 02 00 00 00 1e 00 00 00 02 00 00 00 22 
-    00 00 00 02 +    00 00 00 02
   interrupt-parent:   interrupt-parent:
-    00 00 00 02 +    00 00 00 02
   tbi-handle:   tbi-handle:
-    00 00 00 03 +    00 00 00 03
   phy-handle:   phy-handle:
-    00 00 00 04  +    00 00 00 04 
-# +# 
 +</code> 
 + 
 +===== Dump dts from loaded dtb ===== 
 + 
 +There is another option in case you want to see the DTS you booted with: 
 + 
 +<code> 
 +# sysctl -b hw.fdt.dtb | dtc -I dtb
 </code> </code>
  
Line 630: Line 641:
  and asm output only)  and asm output only)
  -R <number>  -R <number>
- Make space for <number> reserve map entries (relevant for + Make space for <number> reserve map entries (relevant for
  dtb and asm output only)  dtb and asm output only)
  -S <bytes>  -S <bytes>
Line 678: Line 689:
  
 ====== References ====== ====== References ======
-[[http://ols.fedoraproject.org/OLS/Reprints-2008/likely2-reprint.pdf|A Symphony of Flavours: Using the device tree to describe embedded hardware.]]+ 
 +[[http://www.bsdcan.org/2010/schedule/events/171.en.html|Flattened Device Trees for Embedded FreeBSD.]] 
 +  * [[http://www.bsdcan.org/2010/schedule/attachments/143_FreeBSD_FDT-paper.pdf|Paper]] 
 +  * [[http://www.bsdcan.org/2010/schedule/attachments/136_FreeBSD_FDT-slides.pdf|Slides]]
  
 [[http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf|Embedded Power Architecture Platform Requirements (ePAPR)]] [[http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf|Embedded Power Architecture Platform Requirements (ePAPR)]]
Line 685: Line 699:
  
 [[http://ozlabs.org/~dgibson/papers/dtc-paper.pdf|Device trees everywhere]] [[http://ozlabs.org/~dgibson/papers/dtc-paper.pdf|Device trees everywhere]]
- 
-[[http://git.jdl.com/gitweb/?p=dtc.git;a=summary|The Device Tree Compiler]] 
- 
-[[http://fdt.secretlab.ca|FDT bindings definitions]] 
  
 [[http://lists.ozlabs.org/pipermail/devicetree-discuss/|Archives of the devicetree-discuss mailing list]] [[http://lists.ozlabs.org/pipermail/devicetree-discuss/|Archives of the devicetree-discuss mailing list]]
  
 [[http://elinux.org/Device_Trees|eLinux Device Trees wiki]] [[http://elinux.org/Device_Trees|eLinux Device Trees wiki]]
 +
 +----
 +
 +{{tag>Project}}
  
  • flatteneddevicetree.1273076970.txt.gz
  • Last modified: 2010/05/05 16:29
  • by RafalJaworowski