const FDT_MAGIC
pub const FDT_MAGIC = 0xD00DFEEDPurpose
Constant FDT_MAGIC, defining protocol or algorithm parameters.
#core/fdtStandard library package `#core/fdt`.
const FDT_MAGICpub const FDT_MAGIC = 0xD00DFEEDConstant FDT_MAGIC, defining protocol or algorithm parameters.
const FDT_BEGIN_NODEpub const FDT_BEGIN_NODE = 1Constant FDT_BEGIN_NODE, defining protocol or algorithm parameters.
const FDT_END_NODEpub const FDT_END_NODE = 2Constant FDT_END_NODE, defining protocol or algorithm parameters.
const FDT_PROPpub const FDT_PROP = 3Constant FDT_PROP, defining protocol or algorithm parameters.
const FDT_NOPpub const FDT_NOP = 4Constant FDT_NOP, defining protocol or algorithm parameters.
const FDT_ENDpub const FDT_END = 9Constant FDT_END, defining protocol or algorithm parameters.
struct FdtSummarypub struct FdtSummary {
pub total_size u32
pub node_count int
pub cpu_count int
pub mem_base u64
pub mem_size u64
pub has_uart bool
pub uart_base u64
pub has_gic bool
pub gic_dist_base u64
pub has_plic bool
pub plic_base u64
pub has_clint bool
pub clint_base u64
}Structure encapsulating total_size, node_count, cpu_count, mem_base, mem_size.
total_size u32node_count intcpu_count intmem_base u64mem_size u64has_uart booluart_base u64has_gic boolgic_dist_base u64has_plic boolplic_base u64has_clint boolclint_base u64fdt_be32pub fn fdt_be32(addr u64) u32Fdt be32.
addr u64u32 — a value of this type
fdt_be64pub fn fdt_be64(addr u64) u64Fdt be64.
addr u64u64 — a value of this type
fdt_validpub fn fdt_valid(dtb_addr u64) boolFdt valid.
dtb_addr u64bool — true or false
fdt_total_sizepub fn fdt_total_size(dtb_addr u64) u32Fdt total size.
dtb_addr u64u32 — a value of this type
fdt_parse_summarypub fn fdt_parse_summary(dtb_addr u64, out *raw FdtSummary) boolFdt parse summary.
dtb_addr u64out *raw FdtSummarybool — true or false
fdt_find_nodepub fn fdt_find_node(dtb_addr u64, path &string) u64Find a DTB node by path (e.g. "/", "/soc", "/soc/uart" matching "uart@9000000"). Returns node_off as the byte offset from dtb_addr to the node's FDT_BEGIN_NODE token (>= 40 when valid), or 0 if not found.
dtb_addr u64path &stringu64 — a value of this type
fdt_find_compatiblepub fn fdt_find_compatible(dtb_addr u64, compat &string, start_off u64) u64Find a DTB node whose "compatible" string-list property contains compat. If start_off == 0, starts scanning at off_dt_struct; otherwise starts at start_off and skips matching the node beginning right at start_off so callers can iterate matches. Returns node_off (byte offset from dtb_addr to FDT_BEGIN_NODE), or 0 if not found.
dtb_addr u64compat &stringstart_off u64u64 — a value of this type
fdt_get_proppub fn fdt_get_prop(dtb_addr u64, node_off u64, prop_name &string, out_len *raw u32) u64Look up a direct property on the node at node_off (byte offset from dtb_addr). Writes property byte length to out_len (when non-null) and returns dtb_addr + data_off, or 0 if not found.
dtb_addr u64node_off u64prop_name &stringout_len *raw u32u64 — a value of this type
fdt_read_regpub fn fdt_read_reg(dtb_addr u64, node_off u64, index int, out_addr *raw u64, out_size *raw u64) boolRead the index-th (addr, size) pair from the node's "reg" property. Supports 64-bit (u64, u64) entries and single 32-bit (u32, u32) fallback when index == 0 and len == 8.
dtb_addr u64node_off u64index intout_addr *raw u64out_size *raw u64bool — true or false