SyterKit
0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
include
lib
fdt
fdt.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
2
#ifndef FDT_H
3
#define FDT_H
4
/*
5
* libfdt - Flat Device Tree manipulation
6
* Copyright (C) 2006 David Gibson, IBM Corporation.
7
* Copyright 2012 Kim Phillips, Freescale Semiconductor.
8
*/
9
10
#ifdef __cplusplus
11
extern
"C"
{
12
#endif
// __cplusplus
13
14
#ifndef __ASSEMBLY__
15
16
struct
fdt_header
{
17
fdt32_t
magic
;
/* magic word FDT_MAGIC */
18
fdt32_t
totalsize
;
/* total size of DT block */
19
fdt32_t
off_dt_struct
;
/* offset to structure */
20
fdt32_t
off_dt_strings
;
/* offset to strings */
21
fdt32_t
off_mem_rsvmap
;
/* offset to memory reserve map */
22
fdt32_t
version
;
/* format version */
23
fdt32_t
last_comp_version
;
/* last compatible version */
24
25
/* version 2 fields below */
26
fdt32_t
boot_cpuid_phys
;
/* Which physical CPU id we're
27
booting on */
28
/* version 3 fields below */
29
fdt32_t
size_dt_strings
;
/* size of the strings block */
30
31
/* version 17 fields below */
32
fdt32_t
size_dt_struct
;
/* size of the structure block */
33
};
34
35
struct
fdt_reserve_entry
{
36
fdt64_t
address
;
37
fdt64_t
size
;
38
};
39
40
struct
fdt_node_header
{
41
fdt32_t
tag
;
42
char
name
[];
43
};
44
45
struct
fdt_property
{
46
fdt32_t
tag
;
47
fdt32_t
len
;
48
fdt32_t
nameoff
;
49
char
data
[];
50
};
51
52
#endif
/* !__ASSEMBLY */
53
54
#define FDT_MAGIC 0xd00dfeed
/* 4: version, 4: total size */
55
#define FDT_TAGSIZE sizeof(fdt32_t)
56
57
#define FDT_BEGIN_NODE 0x1
/* Start node: full name */
58
#define FDT_END_NODE 0x2
/* End node */
59
#define FDT_PROP \
60
0x3
/* Property: name off,
61
size, content */
62
#define FDT_NOP 0x4
/* nop */
63
#define FDT_END 0x9
64
65
#define FDT_V1_SIZE (7 * sizeof(fdt32_t))
66
#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(fdt32_t))
67
#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(fdt32_t))
68
#define FDT_V16_SIZE FDT_V3_SIZE
69
#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(fdt32_t))
70
71
#ifdef __cplusplus
72
}
73
#endif
// __cplusplus
74
75
#endif
/* FDT_H */
fdt32_t
uint32_t FDT_BITWISE fdt32_t
Definition
libfdt_env.h:30
fdt64_t
uint64_t FDT_BITWISE fdt64_t
Definition
libfdt_env.h:31
fdt_header
Definition
fdt.h:16
fdt_header::totalsize
fdt32_t totalsize
Definition
fdt.h:18
fdt_header::last_comp_version
fdt32_t last_comp_version
Definition
fdt.h:23
fdt_header::off_dt_struct
fdt32_t off_dt_struct
Definition
fdt.h:19
fdt_header::off_dt_strings
fdt32_t off_dt_strings
Definition
fdt.h:20
fdt_header::size_dt_struct
fdt32_t size_dt_struct
Definition
fdt.h:32
fdt_header::version
fdt32_t version
Definition
fdt.h:22
fdt_header::size_dt_strings
fdt32_t size_dt_strings
Definition
fdt.h:29
fdt_header::magic
fdt32_t magic
Definition
fdt.h:17
fdt_header::boot_cpuid_phys
fdt32_t boot_cpuid_phys
Definition
fdt.h:26
fdt_header::off_mem_rsvmap
fdt32_t off_mem_rsvmap
Definition
fdt.h:21
fdt_node_header
Definition
fdt.h:40
fdt_node_header::tag
fdt32_t tag
Definition
fdt.h:41
fdt_node_header::name
char name[]
Definition
fdt.h:42
fdt_property
Definition
fdt.h:45
fdt_property::len
fdt32_t len
Definition
fdt.h:47
fdt_property::tag
fdt32_t tag
Definition
fdt.h:46
fdt_property::data
char data[]
Definition
fdt.h:49
fdt_property::nameoff
fdt32_t nameoff
Definition
fdt.h:48
fdt_reserve_entry
Definition
fdt.h:35
fdt_reserve_entry::address
fdt64_t address
Definition
fdt.h:36
fdt_reserve_entry::size
fdt64_t size
Definition
fdt.h:37
Generated by
1.9.8