Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| flatteneddevicetree [2010/05/05 16:29] – RafalJaworowski | flatteneddevicetree [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, | + | system and their dependencies, |
| ====== Repository ====== | ====== Repository ====== | ||
| - | The official | + | 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 | ||
| ====== 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/ | The device tree source is a text file which describes hardware resources of a computer system in a human-readable form. See [[FlattenedDeviceTree/ | ||
| - | The default | + | The default |
| < | < | ||
| - | sys/boot/fdt/dts | + | sys/dts |
| + | sys/gnu/dts | ||
| </ | </ | ||
| Line 143: | Line 145: | ||
| </ | </ | ||
| - | Note the FDT_DTS_FILE parameter is a file name specified relative to the default | + | Note the FDT_DTS_FILE parameter is a file name specified relative to one of the default |
| < | < | ||
| - | sys/boot/fdt/dts | + | sys/dts |
| + | sys/gnu/dts | ||
| </ | </ | ||
| - | 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: | ||
| ... | ... | ||
| | | ||
| - | loader> | + | loader> |
| </ | </ | ||
| Line 221: | Line 224: | ||
| | | ||
| | | ||
| - | loader> | + | loader> |
| </ | </ | ||
| Line 264: | Line 267: | ||
| / | / | ||
| / | / | ||
| - | loader> | + | loader> |
| </ | </ | ||
| Line 302: | Line 305: | ||
| sec0 | sec0 | ||
| openpic0 | openpic0 | ||
| - | # | + | # |
| </ | </ | ||
| Line 317: | Line 320: | ||
| ranges = < | ranges = < | ||
| bus-frequency = < | bus-frequency = < | ||
| - | loader> | + | loader> |
| </ | </ | ||
| Line 487: | Line 490: | ||
| < | < | ||
| # 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 | ||
| # | # | ||
| - | 00 00 00 01 | + | 00 00 00 01 |
| # | # | ||
| - | 00 00 00 01 | + | 00 00 00 01 |
| device_type: | device_type: | ||
| - | 73 6f 63 00 | + | 73 6f 63 00 |
| ' | ' | ||
| compatible: | compatible: | ||
| - | 73 69 6d 70 6c 65 2d 62 75 73 00 | + | 73 69 6d 70 6c 65 2d 62 75 73 00 |
| ' | ' | ||
| 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 |
| - | # | + | # |
| </ | </ | ||
| Line 552: | Line 555: | ||
| Node 0xc063124c: ethernet@24000 | Node 0xc063124c: ethernet@24000 | ||
| # | # | ||
| - | 00 00 00 01 | + | 00 00 00 01 |
| # | # | ||
| - | 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 |
| ' | ' | ||
| model: | model: | ||
| - | 54 53 45 43 00 | + | 54 53 45 43 00 |
| ' | ' | ||
| compatible: | compatible: | ||
| - | 67 69 61 6e 66 61 72 00 | + | 67 69 61 6e 66 61 72 00 |
| ' | ' | ||
| 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 |
| - | # | + | # |
| + | </ | ||
| + | |||
| + | ===== Dump dts from loaded dtb ===== | ||
| + | |||
| + | There is another option in case you want to see the DTS you booted with: | ||
| + | |||
| + | < | ||
| + | # sysctl -b hw.fdt.dtb | dtc -I dtb | ||
| </ | </ | ||
| Line 630: | Line 641: | ||
| and asm output only) | and asm output only) | ||
| -R < | -R < | ||
| - | Make space for < | + | Make space for < |
| dtb and asm output only) | dtb and asm output only) | ||
| -S < | -S < | ||
| 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/ | ||
| + | * [[http:// | ||
| + | * [[http://www.bsdcan.org/ | ||
| [[http:// | [[http:// | ||
| Line 685: | Line 699: | ||
| [[http:// | [[http:// | ||
| - | |||
| - | [[http:// | ||
| - | |||
| - | [[http:// | ||
| [[http:// | [[http:// | ||
| [[http:// | [[http:// | ||
| + | |||
| + | ---- | ||
| + | |||
| + | {{tag> | ||