summaryrefslogtreecommitdiff
path: root/components/drivers/ofw/Kconfig
blob: e893a839f621ac74619850f2d0f71e052c519063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
menuconfig RT_USING_OFW
    bool "Using Open Firmware (OFW)"
    select RT_USING_ADT
    select RT_USING_ADT_REF
    select RT_USING_ADT_BITMAP
    select RT_USING_MEMBLOCK
    depends on RT_USING_DM
    default n
    help
        Enable Open Firmware (Device Tree) support.
        
        OFW/Device Tree provides hardware description separate from code:
        - Flattened Device Tree (FDT/DTB) parsing
        - Hardware discovery and configuration
        - Platform-independent device drivers
        - Runtime hardware detection
        
        Features:
        - Standard device tree bindings
        - Property parsing and access
        - Node traversal and searching
        - Phandle reference resolution
        - Address translation
        - Interrupt mapping
        
        Benefits:
        - Single kernel binary for multiple boards
        - Easier board porting (just change DTB)
        - Better hardware abstraction
        - Industry-standard hardware description
        
        Use cases:
        - ARM/RISC-V systems with complex hardware
        - Supporting multiple board variants
        - Dynamic hardware configuration
        - PCI, USB, network device enumeration
        
        Requires:
        - RT_USING_DM (Device Model)
        - Memory block allocator
        - Abstract Data Types (ADT) support
        
        Essential for modern ARM Cortex-A and RISC-V systems.
        Enable for device tree-based hardware discovery.

config RT_USING_BUILTIN_FDT
    bool "Using builtin fdt in kernel"
    depends on RT_USING_OFW
    default n
    help
        Embed Flattened Device Tree (FDT) binary into kernel image.
        
        When enabled:
        - DTB file linked into kernel binary
        - No need for bootloader to pass DTB
        - DTB always available at boot
        
        Advantages:
        + Simpler boot process
        + No DTB location dependencies
        + Guaranteed DTB availability
        
        Disadvantages:
        - Larger kernel image
        - Must rebuild kernel to change DTB
        - Less flexible than bootloader-provided DTB
        
        Typical use:
        - Systems without proper bootloader
        - Debugging and development
        - Single-board configurations
        
        Alternative: Have bootloader pass DTB address to kernel.
        
        Enable for embedded DTB in kernel image.

config RT_BUILTIN_FDT_PATH
    string "Builtin fdt path, will rebuild if have dts"
    depends on RT_USING_BUILTIN_FDT
    default "rtthread.dtb"
    help
        Path to the compiled Device Tree Blob (DTB) file to embed.
        
        Default: "rtthread.dtb"
        
        This file is included in the kernel binary during linking.
        
        Workflow:
        1. Write device tree source (.dts file)
        2. Compile to DTB: dtc -I dts -O dtb -o rtthread.dtb rtthread.dts
        3. Set this path to the DTB location
        4. Rebuild kernel (DTB will be embedded)
        
        Path can be:
        - Relative to build directory
        - Absolute path
        
        Kernel will automatically rebuild if DTS changes (if build system configured).

config RT_FDT_EARLYCON_MSG_SIZE
    int "Earlycon message buffer size (KB)"
    depends on RT_USING_OFW
    default 128
    help
        Size of early console message buffer in kilobytes.
        
        Default: 128 KB
        
        Early console (earlycon) provides debug output before full console initialization:
        - Available during early boot
        - Before full UART driver loads
        - Critical for debugging boot failures
        
        Buffer stores messages when:
        - Console not yet available
        - Output faster than transmission
        
        Larger buffer:
        + More boot messages captured
        + Better for verbose debugging
        - More memory usage
        
        Smaller buffer:
        + Less memory overhead
        - May lose early messages
        
        Increase for detailed boot debugging.
        Decrease to save memory if earlycon not critical.

config RT_USING_OFW_BUS_RANGES_NUMBER
    int "Max bus ranges number"
    depends on RT_USING_OFW
    default 8 if ARCH_CPU_64BIT
    default 4
    help
        Maximum number of bus address ranges for device tree translation.
        
        Default:
        - 64-bit systems: 8 ranges
        - 32-bit systems: 4 ranges
        
        Bus ranges define address space mappings:
        - CPU address to device bus address
        - PCI memory/IO spaces
        - Different bus protocols (AHB, APB, AXI)
        
        Each range describes a memory window mapping.
        
        Typical usage:
        - PCI: 2-3 ranges (prefetchable mem, non-prefetchable mem, I/O)
        - Complex SoCs: 4-8 ranges for different buses
        
        Increase for:
        - Complex bus hierarchies
        - Multiple PCI buses
        - Systems with many address spaces
        
        Each range uses ~32-48 bytes of memory.
        Set based on your SoC's bus complexity.