Difference between revisions of "Unit DeviceTree"
Line 18: | Line 18: | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB signature''' <code> DTB_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DTB_MAGIC = $D00DFEED;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB version''' <code> DTB_VERSION_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DTB_VERSION_17 = 17;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>DTB_VERSION_16 = 16;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>DTB_VERSION_CURRENT = DTB_VERSION_17;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DTB_VERSION_COMPATIBLE = DTB_VERSION_16;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB token''' <code> DTB_*_NODE </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DTB_BEGIN_NODE = $00000001;</code> | ||
+ | | The FDT_BEGIN_NODE token marks the beginning of a node’s representation, followed by the node’s unit name as extra data. | ||
+ | |- | ||
+ | | <code>DTB_END_NODE = $00000002;</code> | ||
+ | | The FDT_END_NODE token marks the end of a node’s representation | ||
+ | |- | ||
+ | | <code>DTB_PROP = $00000003;</code> | ||
+ | | The FDT_PROP token marks the beginning of the representation of one property, followed by extra data describing the property. | ||
+ | |- | ||
+ | | <code>DTB_NOP = $00000004;</code> | ||
+ | | The FDT_NOP token will be ignored by any program parsing the device tree | ||
+ | |- | ||
+ | | <code>DTB_END = $00000009;</code> | ||
+ | | The FDT_END token marks the end of the structure block | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB offset''' <code> DTB_*_OFFSET </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DTB_NODE_OFFSET = 4;</code> | ||
+ | | Token | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_OFFSET = 12;</code> | ||
+ | | Token + Value Length + Name Offset | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB alignment''' <code> DTB_*_ALIGNMENT </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DTB_STRUCTURE_ALIGNMENT = 4;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>DTB_RESERVATION_ALIGNMENT = 8;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB node''' <code> DTB_NODE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Standard nodes | ||
+ | |- | ||
+ | | <code>DTB_NODE_ROOT = '/';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>DTB_NODE_CPUS = 'cpus';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DTB_NODE_MEMORY = 'memory';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DTB_NODE_CHOSEN = 'chosen';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DTB_NODE_ALIASES = 'aliases';</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|Other nodes | ||
+ | |- | ||
+ | | <code>DTB_NODE_SYMBOLS = '__symbols__';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DTB_NODE_OVERRIDES = '__overrides__';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB path''' <code> DTB_PATH_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DTB_PATH_SEPARATOR = '/';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB type''' <code> DTB_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DTB_TYPE_UNKNOWN = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DTB_TYPE_EMPTY = 1;</code> | ||
+ | | Value is empty. Used for conveying true-false information. | ||
+ | |- | ||
+ | | <code>DTB_TYPE_U32 = 2;</code> | ||
+ | | A 32-bit integer in big-endian format | ||
+ | |- | ||
+ | | <code>DTB_TYPE_U64 = 3;</code> | ||
+ | | Represents a 64-bit integer in big-endian format | ||
+ | |- | ||
+ | | <code>DTB_TYPE_STRING = 4;</code> | ||
+ | | Strings are printable and null-terminated | ||
+ | |- | ||
+ | | <code>DTB_TYPE_ENCODED_ARRAY = 5;</code> | ||
+ | | Format is specific to the property. See the property definition. | ||
+ | |- | ||
+ | | <code>DTB_TYPE_PHANDLE = 6;</code> | ||
+ | | A <u32> value. A phandle value is a way to reference another node in the devicetree. | ||
+ | |- | ||
+ | | <code>DTB_TYPE_STRINGLIST = 7;</code> | ||
+ | | A list of <string> values concatenated together | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB properties''' <code> DTB_PROPERTY_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Standard properties | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_COMPATIBLE = 'compatible';</code> | ||
+ | | The compatible property value consists of one or more strings that define the specific programming model for the device (Type: <stringlist>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_MODEL = 'model';</code> | ||
+ | | The model property value specifies the manufacturer’s model number of the device (Type: <string>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_PHANDLE = 'phandle';</code> | ||
+ | | The phandle property specifies a numerical identifier for a node that is unique within the devicetree (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_STATUS = 'status';</code> | ||
+ | | The status property indicates the operational status of a device (Type: <string>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_ADDRESS_CELLS = '#address-cells';</code> | ||
+ | | Specifies the number of <u32> cells to represent the address in the reg property (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_SIZE_CELLS = '#size-cells';</code> | ||
+ | | Specifies the number of <u32> cells to represent the size in the reg property (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_REG = 'reg';</code> | ||
+ | | The reg property describes the address of the device’s resources within the address space defined by its parent bus (Type: <prop-encoded-array>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_VIRTUAL_REG = 'virtual-reg';</code> | ||
+ | | The virtual-reg property specifies an effective address that maps to the first physical address specified in the reg property of the device node (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_RANGES = 'ranges';</code> | ||
+ | | The ranges property provides a means of defining a mapping or translation between address spaces (Type: <empty> or <prop-encoded-array>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_DMA_RANGES = 'dma-ranges';</code> | ||
+ | | The dma-ranges property is used to describe the direct memory access (DMA) structure of a memory-mapped bus (Type: <empty> or <prop-encoded-array>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_NAME = 'name';</code> | ||
+ | | The name property is a string specifying the name of the node (Type: <string>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_DEVICE_TYPE = 'device_type';</code> | ||
+ | | The device_type property was used in IEEE 1275 to describe the device (Type: <string>) | ||
+ | |- | ||
+ | |colspan="2"|Additional properties for Interrupt Generating Devices | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INTERRUPTS = 'interrupts';</code> | ||
+ | | The interrupts property defines the interrupt or interrupts that are generated by the device (Type: <prop-encoded-array>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INTERRUPT_PARENT = 'interrupt-parent';</code> | ||
+ | | The interrupt-parent property provides an explicit definition of an interrupt parent (Type: <phandle>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INTERRUPTS_EXTENDED = 'interrupts-extended';</code> | ||
+ | | The interrupts-extended property lists the interrupt(s) generated by a device (Type: <phandle> <prop-encoded-array>) | ||
+ | |- | ||
+ | |colspan="2"|Additional properties for Interrupt Controllers | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INTERRUPT_CELLS = '#interrupt-cells';</code> | ||
+ | | The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INTERRUPT_CONTROLLER = 'interrupt-controller';</code> | ||
+ | | The presence of an interrupt-controller property defines a node as an interrupt controller node (Type: <empty>) | ||
+ | |- | ||
+ | |colspan="2"|Additional Interrupt Nexus properties | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INTERRUPT_MAP = 'interrupt-map';</code> | ||
+ | | An interrupt-map is a property on a nexus node that bridges an interrupt domain to a parent domain (Type: <prop-encoded-array>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INTERRUPT_MAP_MASK = 'interrupt-map-mask';</code> | ||
+ | | An interrupt-map-mask property is specified for a nexus node in the interrupt tree (Type: <prop-encoded-array>) | ||
+ | |- | ||
+ | |colspan="2"|Additional Memory Node properties | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INITIAL_MAPPED_AREA = 'initial-mapped-area';</code> | ||
+ | | Specifies the address and size of the Initial Mapped Area (Type: <prop-encoded-array>) | ||
+ | |- | ||
+ | |colspan="2"|Additional Chosen Node properties | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_BOOTARGS = 'bootargs';</code> | ||
+ | | A string that specifies the boot arguments for the client program (Type: <string>>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_STDOUT_PATH = 'stdout-path';</code> | ||
+ | | A string that specifies the full path to the node representing the device to be used for boot console output (Type: <string>>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_STDIN_PATH = 'stdin-path';</code> | ||
+ | | A string that specifies the full path to the node representing the device to be used for boot console input (Type: <string>>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INITRD_START = 'initrd-start';</code> | ||
+ | | The starting address of the initial ram disk (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_INITRD_END = 'initrd-end';</code> | ||
+ | | The ending address of the initial ram disk (Type: <u32>) | ||
+ | |- | ||
+ | |colspan="2"|Additional CPUs Node properties | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CLOCK_FREQUENCY = 'clock-frequency';</code> | ||
+ | | Specifies the current clock speed of the CPU in Hertz (Type: <prop-encoded-array>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_TIMEBASE_FREQUENCY = 'timebase-frequency';</code> | ||
+ | | Specifies the current frequency at which the timebase and decrementer registers are updated (Type: <propencoded-array>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_ENABLE_METHOD = 'enable-method';</code> | ||
+ | | Describes the method by which a CPU in a disabled state is enabled (Type: <stringlist>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CPU_RELEASE_ADDR = 'cpu-release-addr';</code> | ||
+ | | The cpu-release-addr property is required for cpu nodes that have an enable-method property value of "spin-table" (Type: <u64>) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_POWER_ISA_VERSION = 'power-isa-version';</code> | ||
+ | | A string that specifies the numerical portion of the Power ISA version string (Type: <string>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CACHE_OP_BLOCK_SIZE = 'cache-op-block-size';</code> | ||
+ | | The block size in bytes upon which cache block instructions operate (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_RESERVATION_GRANULE_SIZE = 'reservation-granule-size';</code> | ||
+ | | The reservation granule size supported by this processor in bytes (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_MMU_TYPE = 'mmu-type';</code> | ||
+ | | Specifies the CPU’s MMU type (Type: <string>) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_TLB_SPLIT = 'tlb-split';</code> | ||
+ | | Specifies that the TLB has a split configuration (Type: <empty>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_TLB_SIZE = 'tlb-size';</code> | ||
+ | | Specifies the number of entries in the TLB (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_TLB_SETS = 'tlb-sets';</code> | ||
+ | | Specifies the number of associativity sets inthe TLB (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_D_TLB_SIZE = 'd-tlb-size';</code> | ||
+ | | Specifies the number of entries in the data TLB (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_D_TLB_SETS = 'd-tlb-sets';</code> | ||
+ | | Specifies the number of associativity sets in the data TLB (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_I_TLB_SIZE = 'i-tlb-size';</code> | ||
+ | | Specifies the number of entries in the instruction TLB (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_I_TLB_SETS = 'i-tlb-sets';</code> | ||
+ | | Specifies the number of associativity sets in the instruction TLB (Type: <u32>) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CACHE_UNIFIED = 'cache-unified';</code> | ||
+ | | Specifies the cache has a unified organization (Type: <empty>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CACHE_SIZE = 'cache-size';</code> | ||
+ | | Specifies the size in bytes of a unified cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CACHE_SETS = 'cache-sets';</code> | ||
+ | | Specifies the number of associativity sets in a unified cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CACHE_BLOCK_SIZE = 'cache-block-size';</code> | ||
+ | | Specifies the block size in bytes of a unified cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CACHE_LINE_SIZE = 'cache-line-size';</code> | ||
+ | | Specifies the line size in bytes of a unified cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_I_CACHE_SIZE = 'i-cache-size';</code> | ||
+ | | Specifies the size in bytes of the instruction cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_I_CACHE_SETS = 'i-cache-sets';</code> | ||
+ | | Specifies the number of associativity sets in the instruction cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_I_CACHE_BLOCK_SIZE = 'i-cache-block-size';</code> | ||
+ | | Specifies the block size in bytes of the instruction cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_I_CACHE_LINE_SIZE = 'i-cache-line-size';</code> | ||
+ | | Specifies the line size in bytes of the instruction cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_D_CACHE_SIZE = 'd-cache-size';</code> | ||
+ | | Specifies the size in bytes of the data cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_D_CACHE_SETS = 'd-cache-sets';</code> | ||
+ | | Specifies the number of associativity sets in the data cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_D_CACHE_BLOCK_SIZE = 'd-cache-block-size';</code> | ||
+ | | Specifies the block size in bytes of the data cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_D_CACHE_LINE_SIZE = 'd-cache-line-size';</code> | ||
+ | | Specifies the line size in bytes of the data cache (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_NEXT_LEVEL_CACHE = 'next-level-cache';</code> | ||
+ | | If present, indicates that another level of cache exists. (Type: <phandle>) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CACHE_LEVEL = 'cache-level';</code> | ||
+ | | Specifies the level in the cache hierarchy (Type: <u32>) | ||
+ | |- | ||
+ | |colspan="2"|Other Additional properties | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_SERIAL_NUMBER = 'serial-number';</code> | ||
+ | | Serial Number (Type: <string>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_ALLOC_RANGES = 'alloc-ranges';</code> | ||
+ | | Allocated Ranges (Type: <prop-encoded-array>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_RESETS = 'resets';</code> | ||
+ | | Resets (Type: <prop-encoded-array>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_CLOCK_CELLS = '#clock-cells';</code> | ||
+ | | Number of clock cells (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_LINUX_INITRD_START = 'linux,initrd-start';</code> | ||
+ | | The starting address of the initial ram disk (Type: <u32>) | ||
+ | |- | ||
+ | | <code>DTB_PROPERTY_LINUX_INITRD_END = 'linux,initrd-end';</code> | ||
+ | | The ending address of the initial ram disk (Type: <u32>) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DTB property type''' <code> DTB_*_PROPERTY_TYPE* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DTB_MAX_PROPERTY_TYPE = 60;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === |
Revision as of 03:55, 17 November 2021
Return to Unit Reference
Contents
[hide]Description
Ultibo Flattened Device Tree (DTB) interface unit
Using Device Tree Blob (DTB) files for passing configuration information to the Linux kernel is now widely accepted as the standard method of providing platform specific information without it needing to be hard coded into the kernel at build time.
With this adoption of device tree by Linux it is becoming increasingly common for the only source of information about the runtime configuration of specific hardware to be found in the blob loaded and configured during startup by the firmware and passed to the kernel at the beginning of the boot process.
While Ultibo targets a much smaller range of devices than Linux and does not need the generic kernel model it still requires detailed configuration information in order to be able to interface with the full range of available devices.
It can also benefit from the ability to adapt to the runtime environment by checking for known device tree parameters while registering and initializing hardware and devices. Use of device tree is considered optional and Ultibo will operate correctly with or without the information provided, however some devices may be forced to operate in a fall back or default mode without the complete configuration.
Constants
DTB_*
DTB_VERSION_*
DTB_*_NODE
DTB_*_OFFSET
DTB_*_ALIGNMENT
DTB_NODE_*
DTB_PATH_*
DTB_TYPE_*
DTB_PROPERTY_*
DTB_*_PROPERTY_TYPE*
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
Device tree functions
function DeviceTreeValidate(Address:PtrUInt; var Size:LongWord):Boolean;
function DeviceTreeNextNode(Parent,Previous:THandle):THandle;
function DeviceTreeNextProperty(Node,Previous:THandle):THandle;
function DeviceTreeGetNode(const Path:String; Parent:THandle):THandle;
function DeviceTreeGetProperty(Node:THandle; const Name:String):THandle;
function DeviceTreeGetNodeName(Handle:THandle):String;
procedure DeviceTreeSplitNodeName(Handle:THandle; var NodeName,UnitAddress:String);
function DeviceTreeGetNodeParent(Handle:THandle):THandle;
function DeviceTreeGetNodeRegCells(Handle:THandle; var Address,Size:LongWord):Boolean;
function DeviceTreeGetNodeRangeCells(Handle:THandle; var ParentAddress,NodeAddress,NodeSize:LongWord):Boolean;
function DeviceTreeGetPropertyName(Handle:THandle):String;
procedure DeviceTreeSplitPropertyName(Handle:THandle; var UniquePrefix,PropertyName:String);
function DeviceTreeGetPropertyValue(Handle:THandle):Pointer;
function DeviceTreeGetPropertyLength(Handle:THandle):LongWord;
function DeviceTreeGetPropertyString(Handle:THandle):String;
function DeviceTreeGetPropertyLongWord(Handle:THandle):LongWord;
function DeviceTreeGetPropertyQuadWord(Handle:THandle):UInt64;
RTL Device tree functions
function SysDeviceTreeRead(const Path,Name:String; Buffer:Pointer; var Size:LongWord):LongWord;
function SysDeviceTreeRead32(const Path,Name:String; var Value:LongWord):LongWord;
function SysDeviceTreeRead64(const Path,Name:String; var Value:UInt64):LongWord;
function SysDeviceTreeReadString(const Path,Name:String; var Value:String):LongWord;
Device tree helper functions
function DeviceTreeGetBootArgs:PChar;
function DeviceTreeGetRamdisk(var Address:PtrUInt; var Size:UInt64):Boolean;
function DeviceTreeGetMemory(Index:LongWord; var Range:LongWord; var Address:PtrUInt; var Size:UInt64):Boolean;
function DeviceTreeGetReservation(Index:LongWord; var Address:PtrUInt; var Size:UInt64):Boolean;
function DeviceTreeLogTree:LongWord;
function DeviceTreeLogTreeEx(Node:THandle; Output:TDTBLogOutput; Decode:TDTBDecodeValue; Data:Pointer):LongWord;
Return to Unit Reference