Explanation of Linux Device tree-DTB file format "Go"

Source: Internet
Author: User

51782449

1. dtb file format

The format of the DtB file is as follows:

Note: Different parts order may not be the same

2. File Header Boot_param_header
1 structBoot_param_header {2U32 magic;----------------used to mark DtB file header, equal to Of_dt_header= "0xd00dfeed"3U32 totalsize;------------dtb File Size4U32 off_dt_struct;--------DT Structure Offset5U32 off_dt_strings;-------DT Strings Offset6U32 Off_mem_rsvmap;-------Memory Reserve Map offset7U32 version;--------------Version number8U32 last_comp_version;----compatible with the earliest version number9 Ten         /*version 2 fields below*/ OneU32 Boot_cpuid_phys;------Physical CPU ID A  -         /*version 3 fields below*/ -U32 size_dt_strings;------size of the strings block the  -         /*version below*/ -U32 size_dt_struct;-----------size of the DT structure block -};

3. Reserved Memory Reserve Map

This saves a list of reserved memory mappings, each of which consists of a pair of 64-bit physical addresses and sizes

4, Device-tree structure&strings

Because some properties, such as compatible, exist under most nodes, in order to reduce the size of the DtB file, you need to specify only one storage location for these property strings, so that the properties of each node can be obtained by locating the property string location by position. So DTB the Device-tree strings is stored separately, is the Device-tree structure format, node nesting node

The above macro is defined as follows

1 #defineFdt_magic 0xd00dfeed/* 4:version, 4:total size */2 #defineFdt_tagsize sizeof (uint32_t)3 4 #defineFdt_begin_node 0x1/* Start node:full name */5 #defineFdt_end_node 0x2/* END NODE */6 #defineFdt_prop 0x3/* property:name off,7Size, Content */8 #defineFdt_nop 0x4/* NOP */9 #defineFdt_end 0x9Ten  One #defineFdt_v1_size (7*sizeof (uint32_t)) A #defineFdt_v2_size (fdt_v1_size + sizeof (uint32_t)) - #defineFdt_v3_size (fdt_v2_size + sizeof (uint32_t)) - #defineFdt_v16_size fdt_v3_size the #defineFdt_v17_size (fdt_v16_size + sizeof (uint32_t))

General diagram

Explanation of Linux Device tree-DTB file format "Go"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.