Difference between revisions of "Unit DeviceTree"
Line 108: | Line 108: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | |colspan="2"|Standard nodes | + | |colspan="2"|''Standard nodes'' |
|- | |- | ||
| <code>DTB_NODE_ROOT = '/';</code> | | <code>DTB_NODE_ROOT = '/';</code> | ||
Line 125: | Line 125: | ||
| | | | ||
|- | |- | ||
− | |colspan="2"|Other nodes | + | |colspan="2"|''Other nodes'' |
|- | |- | ||
| <code>DTB_NODE_SYMBOLS = '__symbols__';</code> | | <code>DTB_NODE_SYMBOLS = '__symbols__';</code> | ||
Line 184: | Line 184: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | |colspan="2"|Standard properties | + | |colspan="2"|''Standard properties'' |
|- | |- | ||
| <code>DTB_PROPERTY_COMPATIBLE = 'compatible';</code> | | <code>DTB_PROPERTY_COMPATIBLE = 'compatible';</code> | ||
Line 222: | Line 222: | ||
| The device_type property was used in IEEE 1275 to describe the device (Type: <string>) | | The device_type property was used in IEEE 1275 to describe the device (Type: <string>) | ||
|- | |- | ||
− | |colspan="2"|Additional properties for Interrupt Generating Devices | + | |colspan="2"|''Additional properties for Interrupt Generating Devices'' |
|- | |- | ||
| <code>DTB_PROPERTY_INTERRUPTS = 'interrupts';</code> | | <code>DTB_PROPERTY_INTERRUPTS = 'interrupts';</code> | ||
Line 233: | Line 233: | ||
| The interrupts-extended property lists the interrupt(s) generated by a device (Type: <phandle> <prop-encoded-array>) | | The interrupts-extended property lists the interrupt(s) generated by a device (Type: <phandle> <prop-encoded-array>) | ||
|- | |- | ||
− | |colspan="2"|Additional properties for Interrupt Controllers | + | |colspan="2"|''Additional properties for Interrupt Controllers'' |
|- | |- | ||
| <code>DTB_PROPERTY_INTERRUPT_CELLS = '#interrupt-cells';</code> | | <code>DTB_PROPERTY_INTERRUPT_CELLS = '#interrupt-cells';</code> | ||
Line 241: | Line 241: | ||
| The presence of an interrupt-controller property defines a node as an interrupt controller node (Type: <empty>) | | The presence of an interrupt-controller property defines a node as an interrupt controller node (Type: <empty>) | ||
|- | |- | ||
− | |colspan="2"|Additional Interrupt Nexus properties | + | |colspan="2"|''Additional Interrupt Nexus properties'' |
|- | |- | ||
| <code>DTB_PROPERTY_INTERRUPT_MAP = 'interrupt-map';</code> | | <code>DTB_PROPERTY_INTERRUPT_MAP = 'interrupt-map';</code> | ||
Line 249: | Line 249: | ||
| An interrupt-map-mask property is specified for a nexus node in the interrupt tree (Type: <prop-encoded-array>) | | 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 | + | |colspan="2"|''Additional Memory Node properties'' |
|- | |- | ||
| <code>DTB_PROPERTY_INITIAL_MAPPED_AREA = 'initial-mapped-area';</code> | | <code>DTB_PROPERTY_INITIAL_MAPPED_AREA = 'initial-mapped-area';</code> | ||
| Specifies the address and size of the Initial Mapped Area (Type: <prop-encoded-array>) | | Specifies the address and size of the Initial Mapped Area (Type: <prop-encoded-array>) | ||
|- | |- | ||
− | |colspan="2"|Additional Chosen Node properties | + | |colspan="2"|''Additional Chosen Node properties'' |
|- | |- | ||
| <code>DTB_PROPERTY_BOOTARGS = 'bootargs';</code> | | <code>DTB_PROPERTY_BOOTARGS = 'bootargs';</code> | ||
Line 271: | Line 271: | ||
| The ending address of the initial ram disk (Type: <u32>) | | The ending address of the initial ram disk (Type: <u32>) | ||
|- | |- | ||
− | |colspan="2"|Additional CPUs Node properties | + | |colspan="2"|''Additional CPUs Node properties'' |
|- | |- | ||
| <code>DTB_PROPERTY_CLOCK_FREQUENCY = 'clock-frequency';</code> | | <code>DTB_PROPERTY_CLOCK_FREQUENCY = 'clock-frequency';</code> |
Revision as of 03:58, 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