Kconfig 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. menuconfig RT_USING_OFW
  2. bool "Using Open Firmware (OFW)"
  3. select RT_USING_ADT
  4. select RT_USING_ADT_REF
  5. select RT_USING_ADT_BITMAP
  6. select RT_USING_MEMBLOCK
  7. depends on RT_USING_DM
  8. default n
  9. help
  10. Enable Open Firmware (Device Tree) support.
  11. OFW/Device Tree provides hardware description separate from code:
  12. - Flattened Device Tree (FDT/DTB) parsing
  13. - Hardware discovery and configuration
  14. - Platform-independent device drivers
  15. - Runtime hardware detection
  16. Features:
  17. - Standard device tree bindings
  18. - Property parsing and access
  19. - Node traversal and searching
  20. - Phandle reference resolution
  21. - Address translation
  22. - Interrupt mapping
  23. Benefits:
  24. - Single kernel binary for multiple boards
  25. - Easier board porting (just change DTB)
  26. - Better hardware abstraction
  27. - Industry-standard hardware description
  28. Use cases:
  29. - ARM/RISC-V systems with complex hardware
  30. - Supporting multiple board variants
  31. - Dynamic hardware configuration
  32. - PCI, USB, network device enumeration
  33. Requires:
  34. - RT_USING_DM (Device Model)
  35. - Memory block allocator
  36. - Abstract Data Types (ADT) support
  37. Essential for modern ARM Cortex-A and RISC-V systems.
  38. Enable for device tree-based hardware discovery.
  39. config RT_USING_BUILTIN_FDT
  40. bool "Using builtin fdt in kernel"
  41. depends on RT_USING_OFW
  42. default n
  43. help
  44. Embed Flattened Device Tree (FDT) binary into kernel image.
  45. When enabled:
  46. - DTB file linked into kernel binary
  47. - No need for bootloader to pass DTB
  48. - DTB always available at boot
  49. Advantages:
  50. + Simpler boot process
  51. + No DTB location dependencies
  52. + Guaranteed DTB availability
  53. Disadvantages:
  54. - Larger kernel image
  55. - Must rebuild kernel to change DTB
  56. - Less flexible than bootloader-provided DTB
  57. Typical use:
  58. - Systems without proper bootloader
  59. - Debugging and development
  60. - Single-board configurations
  61. Alternative: Have bootloader pass DTB address to kernel.
  62. Enable for embedded DTB in kernel image.
  63. config RT_BUILTIN_FDT_PATH
  64. string "Builtin fdt path, will rebuild if have dts"
  65. depends on RT_USING_BUILTIN_FDT
  66. default "rtthread.dtb"
  67. help
  68. Path to the compiled Device Tree Blob (DTB) file to embed.
  69. Default: "rtthread.dtb"
  70. This file is included in the kernel binary during linking.
  71. Workflow:
  72. 1. Write device tree source (.dts file)
  73. 2. Compile to DTB: dtc -I dts -O dtb -o rtthread.dtb rtthread.dts
  74. 3. Set this path to the DTB location
  75. 4. Rebuild kernel (DTB will be embedded)
  76. Path can be:
  77. - Relative to build directory
  78. - Absolute path
  79. Kernel will automatically rebuild if DTS changes (if build system configured).
  80. config RT_FDT_EARLYCON_MSG_SIZE
  81. int "Earlycon message buffer size (KB)"
  82. depends on RT_USING_OFW
  83. default 128
  84. help
  85. Size of early console message buffer in kilobytes.
  86. Default: 128 KB
  87. Early console (earlycon) provides debug output before full console initialization:
  88. - Available during early boot
  89. - Before full UART driver loads
  90. - Critical for debugging boot failures
  91. Buffer stores messages when:
  92. - Console not yet available
  93. - Output faster than transmission
  94. Larger buffer:
  95. + More boot messages captured
  96. + Better for verbose debugging
  97. - More memory usage
  98. Smaller buffer:
  99. + Less memory overhead
  100. - May lose early messages
  101. Increase for detailed boot debugging.
  102. Decrease to save memory if earlycon not critical.
  103. config RT_USING_OFW_BUS_RANGES_NUMBER
  104. int "Max bus ranges number"
  105. depends on RT_USING_OFW
  106. default 8 if ARCH_CPU_64BIT
  107. default 4
  108. help
  109. Maximum number of bus address ranges for device tree translation.
  110. Default:
  111. - 64-bit systems: 8 ranges
  112. - 32-bit systems: 4 ranges
  113. Bus ranges define address space mappings:
  114. - CPU address to device bus address
  115. - PCI memory/IO spaces
  116. - Different bus protocols (AHB, APB, AXI)
  117. Each range describes a memory window mapping.
  118. Typical usage:
  119. - PCI: 2-3 ranges (prefetchable mem, non-prefetchable mem, I/O)
  120. - Complex SoCs: 4-8 ranges for different buses
  121. Increase for:
  122. - Complex bus hierarchies
  123. - Multiple PCI buses
  124. - Systems with many address spaces
  125. Each range uses ~32-48 bytes of memory.
  126. Set based on your SoC's bus complexity.