Skip to main content

Device Tree

  • dtb - Device Tree Blob - device tree binary
    • hardware layout description
    • platform identification
    • runtime configuration
    • device population
  • arch/<arch>/boot/dts/<board>
  • CONFIG_ARM_APPENDED_DTB - dtb 在 kernel 之后
    • cat zImage board.dtb > my-zImage; mkimage ... -d my-zImage my-uImage
  • CONFIG_ARM_ATAG_DTB_COMPAT
    • read ATAGS, update DT
  • Embedded Power Architecture Platform Requirements (ePAPR)
  • Device Tree Source - DTS
    • .dts - board-level definitions
      • 最终的 - include 多个 dtsi
    • .dtsi - included files, generally containing SoC-level definitions
    • e.g arch/arm64/boot/dts
  • Device Tree Compiler
  • Documentation/devicetree/bindings

Device Tree

  • cpus
  • memory
  • chosen
    • defines parameters chosen or defined by the system firmware at boot time
  • aliases
  • buses
/ {
model = "Freescale i.MX28 Evaluation Kit";
compatible = "fsl,imx28-evk", "fsl,imx28";
memory {
reg = <0x40000000 0x08000000>;
};
apb@80000000 {
apbh@80000000 { };
apbx@80040000 { };
};
ahb@80080000 { };
sound { };
leds { };
backlight { };
};
  • of_machine_is_compatible

References