Difference between revisions of "Unit DeviceTree"
Line 371: | Line 371: | ||
| Specifies the level in the cache hierarchy (Type: <u32>) | | Specifies the level in the cache hierarchy (Type: <u32>) | ||
|- | |- | ||
− | |colspan="2"|Other Additional properties | + | |colspan="2"|''Other Additional properties'' |
|- | |- | ||
| <code>DTB_PROPERTY_SERIAL_NUMBER = 'serial-number';</code> | | <code>DTB_PROPERTY_SERIAL_NUMBER = 'serial-number';</code> |
Revision as of 04:00, 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