Kconfig 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547
  1. if ARCH_ARMV8 && ARCH_CPU_64BIT
  2. orsource "./aarch64/Kconfig"
  3. endif
  4. config ARCH_CPU_64BIT
  5. bool
  6. help
  7. Indicates that this architecture uses 64-bit addressing and data types.
  8. When enabled, pointers and registers are 64-bit wide, providing access
  9. to larger memory spaces (>4GB). This is automatically selected by 64-bit
  10. architectures like AArch64, RISC-V64, and MIPS64.
  11. Impact: Affects memory layout, data structure sizes, and ABI conventions.
  12. config RT_USING_CACHE
  13. bool
  14. default n
  15. help
  16. Enable CPU cache support for data and instruction caches.
  17. When enabled, RT-Thread will provide cache management APIs (flush, invalidate)
  18. and properly handle cache coherency during DMA operations and memory management.
  19. This is essential for high-performance CPUs like Cortex-A and Cortex-M7.
  20. Typical use cases:
  21. - DMA transfers requiring cache synchronization
  22. - Memory-mapped I/O operations
  23. - Multi-core systems requiring cache coherency
  24. Note: Automatically selected by architectures with cache support (e.g., Cortex-M7,
  25. Cortex-A series, ARMv8). Improper cache management can lead to data corruption.
  26. config RT_USING_HW_ATOMIC
  27. bool
  28. default n
  29. help
  30. Enable hardware atomic operations support using CPU-specific instructions.
  31. When enabled, RT-Thread uses hardware atomic instructions (e.g., LDREX/STREX on ARM,
  32. atomic instructions on RISC-V) for lock-free synchronization primitives, improving
  33. performance and reducing interrupt latency compared to software implementations.
  34. Automatically selected by CPUs with atomic instruction support:
  35. - ARM Cortex-M3 and above (LDREX/STREX)
  36. - ARM Cortex-A series
  37. - ARM Cortex-R series
  38. - RISC-V with 'A' extension
  39. Benefits: Better performance for spinlocks, reference counting, and concurrent data structures.
  40. No action required - this is automatically configured based on CPU architecture.
  41. config ARCH_CPU_BIG_ENDIAN
  42. bool
  43. help
  44. Indicates that this CPU uses big-endian byte ordering.
  45. In big-endian systems, the most significant byte is stored at the lowest memory address.
  46. This affects how multi-byte data (integers, floats) are stored and accessed in memory.
  47. Most ARM, RISC-V, and x86 systems use little-endian. Big-endian is common in:
  48. - Some PowerPC configurations
  49. - MIPS systems (configurable)
  50. - Network protocols (network byte order)
  51. Note: This must match your hardware configuration. Incorrect setting will cause
  52. data corruption when accessing multi-byte values.
  53. config ARCH_ARM_BOOTWITH_FLUSH_CACHE
  54. bool
  55. default n
  56. help
  57. Flush and disable caches during system boot on ARM platforms.
  58. When enabled, the bootloader will flush and disable instruction and data caches
  59. before jumping to RT-Thread kernel. This ensures clean cache state during initialization.
  60. Enable this when:
  61. - Bootloader leaves caches in inconsistent state
  62. - Transitioning from another OS or bootloader
  63. - Debugging cache-related boot issues
  64. Note: Not needed for most configurations. Only enable if experiencing boot failures
  65. related to stale cache data.
  66. config ARCH_CPU_STACK_GROWS_UPWARD
  67. bool
  68. default n
  69. help
  70. Indicates that the stack grows toward higher memory addresses (upward).
  71. Most architectures (ARM, RISC-V, x86, MIPS) use downward-growing stacks where
  72. the stack pointer decreases as items are pushed. However, some architectures
  73. like TI DSP C28x use upward-growing stacks.
  74. This setting affects:
  75. - Stack pointer initialization and overflow detection
  76. - Context switching and exception handling
  77. - Stack boundary checking
  78. Note: This is architecture-specific and automatically configured. Do not change
  79. unless porting to a new architecture with upward-growing stack.
  80. config RT_USING_CPU_FFS
  81. bool
  82. default n
  83. help
  84. Enable optimized Find First Set (FFS) implementation using CPU instructions.
  85. FFS finds the position of the first (least significant) bit set in a word. When enabled,
  86. RT-Thread uses hardware instructions like CLZ (Count Leading Zeros) on ARM or equivalent
  87. on other architectures for fast bit scanning operations.
  88. Used internally by:
  89. - Scheduler for finding highest-priority ready thread
  90. - Bitmap operations
  91. - IPC mechanisms
  92. Automatically selected by CPUs with FFS support:
  93. - ARM Cortex-M3 and above (CLZ instruction)
  94. - ARM Cortex-A series
  95. - ARM Cortex-R series
  96. Benefits: Significantly faster scheduler operation (O(1) vs O(n) thread selection).
  97. No configuration needed - automatically enabled for supported CPUs.
  98. config ARCH_MM_MMU
  99. bool
  100. help
  101. Enable Memory Management Unit (MMU) support for virtual memory.
  102. MMU provides hardware-based virtual memory management, enabling:
  103. - Virtual to physical address translation
  104. - Memory protection between processes
  105. - Demand paging and memory mapping
  106. - Separate address spaces for different processes
  107. Required for:
  108. - RT-Smart mode (user-space applications)
  109. - Process isolation and protection
  110. - Dynamic memory mapping (mmap)
  111. - Copy-on-write mechanisms
  112. Automatically selected by MMU-capable architectures:
  113. - ARM Cortex-A series
  114. - AArch64 (ARMv8)
  115. - RISC-V with Sv39/Sv48 paging
  116. Note: MMU requires proper page table setup and increases system complexity.
  117. Only available on CPUs with hardware MMU support.
  118. config ARCH_MM_MPU
  119. bool
  120. help
  121. Enable Memory Protection Unit (MPU) support.
  122. MPU provides hardware-based memory protection without full virtual memory capabilities.
  123. Unlike MMU, MPU works with physical addresses and has limited number of regions (typically 8-16).
  124. Features:
  125. - Protect memory regions from unauthorized access
  126. - Define region permissions (read, write, execute)
  127. - Prevent stack overflow and buffer overruns
  128. - Isolate kernel from user code
  129. Common use cases:
  130. - Thread stack protection
  131. - Peripheral register protection
  132. - Code/data separation
  133. - Safety-critical applications
  134. Available on:
  135. - ARM Cortex-M0+/M3/M4/M7/M23/M33/M85 (with MPU option)
  136. - ARM Cortex-R series
  137. Note: Less flexible than MMU but lower overhead. Suitable for microcontrollers
  138. without MMU. Enable RT_USING_HW_STACK_GUARD for automatic stack protection.
  139. config ARCH_ARM
  140. bool
  141. help
  142. Select ARM architecture family support.
  143. ARM is a widely-used RISC architecture family for embedded systems and mobile devices.
  144. This is automatically selected when choosing a specific ARM CPU variant.
  145. Supported ARM variants in RT-Thread:
  146. - ARM9/ARM11: Legacy 32-bit ARM cores
  147. - Cortex-M: Microcontroller profile (M0/M0+/M3/M4/M7/M23/M33/M85)
  148. - Cortex-R: Real-time profile (R4/R52)
  149. - Cortex-A: Application profile (A5/A7/A8/A9/A55)
  150. - ARMv8: 64-bit architecture (Cortex-A53/A57/A72/A73)
  151. No direct configuration needed - select specific CPU type instead.
  152. config ARCH_ARM_CORTEX_M
  153. bool
  154. select ARCH_ARM
  155. help
  156. ARM Cortex-M microcontroller profile.
  157. Cortex-M is ARM's microcontroller-optimized architecture designed for low-power,
  158. cost-sensitive embedded applications with deterministic interrupt handling.
  159. Features:
  160. - Nested Vectored Interrupt Controller (NVIC)
  161. - Low interrupt latency (typically 12-15 cycles)
  162. - Thumb-2 instruction set for code density
  163. - Optional MPU for memory protection
  164. - Optional FPU (M4F/M7F variants)
  165. Variants: M0/M0+/M3/M4/M7/M23/M33/M85
  166. Automatically selected when choosing specific Cortex-M CPU variant.
  167. config ARCH_ARM_CORTEX_R
  168. bool
  169. select ARCH_ARM
  170. help
  171. ARM Cortex-R real-time profile.
  172. Cortex-R is designed for high-performance real-time applications requiring
  173. deterministic behavior and fault tolerance.
  174. Features:
  175. - Tightly-coupled memory (TCM) for deterministic access
  176. - Error detection and correction (ECC)
  177. - Dual-core lockstep for safety-critical applications
  178. - Low and deterministic interrupt latency
  179. - Optional MPU or MMU
  180. Common applications:
  181. - Automotive (ADAS, engine control)
  182. - Industrial control systems
  183. - Medical devices
  184. - Hard real-time systems
  185. Variants: R4/R5/R52
  186. Automatically selected when choosing specific Cortex-R CPU variant.
  187. config ARCH_ARM_CORTEX_FPU
  188. bool
  189. help
  190. Enable Floating Point Unit (FPU) support for ARM Cortex processors.
  191. When enabled, RT-Thread will:
  192. - Save/restore FPU registers during context switch
  193. - Enable FPU coprocessor access
  194. - Support hardware floating-point operations
  195. FPU variants:
  196. - Cortex-M4F/M7F: Single-precision FPv4-SP
  197. - Cortex-M7: Optional double-precision FPv5
  198. - Cortex-A: VFPv3/VFPv4/NEON
  199. Benefits: 10-100x performance improvement for floating-point math
  200. Cost: Increased context switch time, larger stack frames
  201. Enable if your application requires:
  202. - DSP operations
  203. - Audio/video processing
  204. - Scientific computations
  205. - Graphics operations
  206. Note: Hardware must have FPU. Check your MCU datasheet.
  207. config ARCH_ARM_CORTEX_SECURE
  208. bool
  209. help
  210. Enable ARM TrustZone security extension support.
  211. TrustZone provides hardware-based isolation between secure and non-secure worlds,
  212. enabling trusted execution environments (TEE).
  213. Features:
  214. - Secure and non-secure memory regions
  215. - Secure and non-secure peripheral access
  216. - Secure state transitions
  217. - Protection of cryptographic keys and sensitive data
  218. Available on:
  219. - Cortex-M23/M33/M35P/M55/M85 (ARMv8-M)
  220. - Cortex-A with Security Extensions
  221. Use cases:
  222. - Secure boot
  223. - Cryptographic operations
  224. - Key storage
  225. - Secure firmware updates
  226. - Payment and DRM systems
  227. Note: Requires secure firmware and proper secure/non-secure memory partitioning.
  228. config ARCH_ARM_CORTEX_M0
  229. bool
  230. select ARCH_ARM_CORTEX_M
  231. help
  232. ARM Cortex-M0 ultra-low-power microcontroller core.
  233. Smallest and most energy-efficient ARM processor, ideal for simple control applications.
  234. Features:
  235. - ARMv6-M architecture
  236. - 32-bit processor with Thumb instruction set (subset)
  237. - Minimal interrupt latency
  238. - No MPU, no FPU, no cache
  239. - Very low gate count and power consumption
  240. Performance: ~0.9 DMIPS/MHz
  241. Typical applications: Sensors, simple controllers, battery-powered devices
  242. Choose this for your BSP if using Cortex-M0 based MCU.
  243. config ARCH_ARM_CORTEX_M3
  244. bool
  245. select ARCH_ARM_CORTEX_M
  246. select RT_USING_CPU_FFS
  247. select RT_USING_HW_ATOMIC
  248. help
  249. ARM Cortex-M3 mainstream microcontroller core.
  250. Balanced processor for general-purpose embedded applications with good performance
  251. and energy efficiency.
  252. Features:
  253. - ARMv7-M architecture
  254. - Thumb-2 instruction set (full)
  255. - Hardware divide instructions
  256. - Optional MPU (8 regions)
  257. - Atomic operations (LDREX/STREX)
  258. - No FPU, no cache
  259. Performance: ~1.25 DMIPS/MHz
  260. Common use cases:
  261. - Industrial control
  262. - Consumer electronics
  263. - Motor control
  264. - IoT devices
  265. Examples: STM32F1xx, LPC17xx, EFM32
  266. Choose this for your BSP if using Cortex-M3 based MCU.
  267. config ARCH_ARM_MPU
  268. bool
  269. depends on ARCH_ARM
  270. select ARCH_MM_MPU
  271. help
  272. Enable Memory Protection Unit for ARM Cortex-M/R processors.
  273. Select this to enable MPU support on compatible ARM cores. The MPU provides
  274. hardware-based memory protection with configurable regions.
  275. When enabled, you can:
  276. - Protect thread stacks from overflow
  277. - Restrict access to peripheral registers
  278. - Enforce execute-never (XN) permissions
  279. - Separate privileged and unprivileged memory
  280. Configuration:
  281. - Number of regions: Typically 8 (Cortex-M3/M4) or 16 (Cortex-M7/M33)
  282. - Region size: Must be power of 2, minimum 32 bytes (Cortex-M3/M4) or 256 bytes (ARMv8-M)
  283. - Permissions: Read, write, execute, privileged/unprivileged
  284. Enable this along with RT_USING_HW_STACK_GUARD for automatic stack protection.
  285. See components/mprotect/Kconfig for detailed MPU configuration.
  286. config ARCH_ARM_CORTEX_M4
  287. bool
  288. select ARCH_ARM_CORTEX_M
  289. select RT_USING_CPU_FFS
  290. select RT_USING_HW_ATOMIC
  291. help
  292. ARM Cortex-M4 DSP-oriented microcontroller core.
  293. Enhanced version of M3 with DSP extensions and optional FPU, designed for
  294. digital signal processing and motor control applications.
  295. Features:
  296. - ARMv7E-M architecture
  297. - DSP instructions (SIMD, saturating arithmetic, MAC)
  298. - Optional single-precision FPU (FPv4-SP)
  299. - Optional MPU (8 regions)
  300. - Hardware divide and atomic operations
  301. - No cache
  302. Performance: ~1.25 DMIPS/MHz (CPU), 10x faster for DSP operations with FPU
  303. Ideal for:
  304. - Audio processing
  305. - Motor control (FOC algorithms)
  306. - Sensor fusion
  307. - Real-time control loops
  308. Examples: STM32F4xx, K64F, nRF52, TM4C
  309. Choose this for your BSP if using Cortex-M4 or M4F based MCU.
  310. config ARCH_ARM_CORTEX_M7
  311. bool
  312. select ARCH_ARM_CORTEX_M
  313. select RT_USING_CPU_FFS
  314. select RT_USING_CACHE
  315. select RT_USING_HW_ATOMIC
  316. help
  317. ARM Cortex-M7 high-performance microcontroller core.
  318. Most powerful Cortex-M processor with superscalar architecture, cache, and
  319. advanced features for demanding embedded applications.
  320. Features:
  321. - ARMv7E-M architecture with 6-stage superscalar pipeline
  322. - L1 instruction and data cache (configurable 0-64KB each)
  323. - Optional single/double-precision FPU (FPv5)
  324. - Tightly-coupled memory (TCM) for deterministic access
  325. - Optional MPU (8 or 16 regions)
  326. - DSP instructions and atomic operations
  327. Performance: ~2.14 DMIPS/MHz (up to 600MHz), 5 CoreMark/MHz
  328. Critical for cache management:
  329. - Must flush cache before DMA reads from memory
  330. - Must invalidate cache after DMA writes to memory
  331. - Cache coherency APIs automatically enabled
  332. Ideal for:
  333. - High-performance embedded systems
  334. - Vision and image processing
  335. - Advanced motor control
  336. - Real-time communication protocols
  337. Examples: STM32F7xx/H7xx, i.MX RT, SAM V71
  338. Choose this for your BSP if using Cortex-M7 based MCU.
  339. config ARCH_ARM_CORTEX_M85
  340. bool
  341. select ARCH_ARM_CORTEX_M
  342. select RT_USING_CPU_FFS
  343. select RT_USING_HW_ATOMIC
  344. help
  345. ARM Cortex-M85 next-generation high-performance microcontroller core.
  346. Latest and most powerful Cortex-M processor with AI/ML acceleration and
  347. advanced security features (ARMv8.1-M architecture).
  348. Features:
  349. - ARMv8.1-M architecture with Helium (M-Profile Vector Extension)
  350. - TrustZone security
  351. - L1 cache (optional)
  352. - Optional single/double-precision FPU
  353. - Optional MPU (8 or 16 regions)
  354. - Pointer authentication and branch target identification
  355. - DSP and atomic operations
  356. Performance: Up to 6.2 CoreMark/MHz
  357. Helium benefits:
  358. - 5-15x performance for ML inference
  359. - Enhanced DSP for signal processing
  360. - Vector operations for parallel data processing
  361. Ideal for:
  362. - Edge AI/ML applications
  363. - Advanced image/audio processing
  364. - Security-critical applications
  365. - Next-generation IoT devices
  366. Examples: Future MCUs with Cortex-M85
  367. Choose this for your BSP if using Cortex-M85 based MCU.
  368. config ARCH_ARM_CORTEX_M23
  369. bool
  370. select ARCH_ARM_CORTEX_M
  371. select RT_USING_HW_ATOMIC
  372. help
  373. ARM Cortex-M23 ultra-low-power core with TrustZone.
  374. Energy-efficient processor with security features, successor to Cortex-M0+.
  375. Features:
  376. - ARMv8-M Baseline architecture
  377. - TrustZone security extension
  378. - Optional MPU (8 or 16 regions)
  379. - Atomic operations (LDREX/STREX)
  380. - Low power consumption
  381. - No FPU, no cache
  382. Performance: ~1.0 DMIPS/MHz
  383. Key advantage: Hardware security with minimal area/power overhead
  384. Ideal for:
  385. - Secure IoT devices
  386. - Battery-powered secure sensors
  387. - Payment terminals
  388. - Smart cards
  389. Examples: Future secure IoT MCUs
  390. Choose this for your BSP if using Cortex-M23 based MCU.
  391. config ARCH_ARM_CORTEX_M33
  392. bool
  393. select ARCH_ARM_CORTEX_M
  394. select RT_USING_CPU_FFS
  395. select RT_USING_HW_ATOMIC
  396. help
  397. ARM Cortex-M33 mainstream core with TrustZone.
  398. Balanced processor combining Cortex-M4 performance with TrustZone security,
  399. ideal for secure IoT and connected devices.
  400. Features:
  401. - ARMv8-M Mainline architecture
  402. - TrustZone security extension
  403. - Optional single-precision FPU (FPv5)
  404. - Optional MPU (8 or 16 regions)
  405. - DSP instructions
  406. - Atomic operations
  407. - Optional cache (Cortex-M33 derivatives)
  408. Performance: ~1.5 DMIPS/MHz
  409. Security features:
  410. - Secure/non-secure memory partitioning
  411. - Secure function calls
  412. - Stack limit checking
  413. - Co-processor isolation
  414. Ideal for:
  415. - Secure IoT gateways
  416. - Industrial automation with security
  417. - Connected consumer devices
  418. - Secure bootloaders
  419. Examples: nRF91, LPC55xx, STM32L5xx
  420. Choose this for your BSP if using Cortex-M33 based MCU.
  421. config ARCH_ARM_CORTEX_R
  422. bool
  423. select ARCH_ARM
  424. select RT_USING_HW_ATOMIC
  425. help
  426. ARM Cortex-R real-time processor family.
  427. High-performance real-time processors with deterministic behavior for
  428. safety-critical and real-time systems.
  429. Common features across Cortex-R family:
  430. - Low and deterministic interrupt latency
  431. - Tightly-coupled memory (TCM)
  432. - Error correction code (ECC)
  433. - Optional MPU or MMU
  434. - VFP floating-point
  435. Automatically selected when choosing specific Cortex-R variant (R4/R52).
  436. See individual Cortex-R variant options for detailed specifications.
  437. config ARCH_ARM_CORTEX_R52
  438. bool
  439. select ARCH_ARM_CORTEX_R
  440. help
  441. ARM Cortex-R52 safety-critical real-time core.
  442. Latest Cortex-R processor designed for ASIL-D automotive and IEC 61508 SIL-3
  443. industrial safety applications.
  444. Features:
  445. - ARMv8-R architecture (32-bit)
  446. - Dual-core lockstep for fault detection
  447. - ECC on caches and TCM
  448. - Optional MPU or MMU
  449. - Virtualization extensions
  450. - Single/double precision FPU
  451. - NEON SIMD
  452. Performance: Up to 1.6 DMIPS/MHz per core
  453. Safety features:
  454. - Redundant execution for error detection
  455. - Memory protection and ECC
  456. - Built-in self-test (BIST)
  457. Ideal for:
  458. - Automotive ADAS and autonomous driving
  459. - Industrial safety controllers (SIL-3)
  460. - Medical devices
  461. - Aerospace applications
  462. Choose this for your BSP if using Cortex-R52 based SoC.
  463. config ARCH_ARM_MMU
  464. bool
  465. select RT_USING_CACHE
  466. select ARCH_MM_MMU
  467. depends on ARCH_ARM
  468. help
  469. Enable MMU support for ARM Cortex-A processors.
  470. Provides full virtual memory management with page-based address translation.
  471. Automatically selected by Cortex-A variants.
  472. Features:
  473. - 4KB/16KB/64KB page sizes
  474. - Two-level (LPAE: three-level) page tables
  475. - Virtual memory for multiple processes
  476. - Memory attributes (cacheable, bufferable, shareable)
  477. - Access permissions (privileged, user, read-only, execute-never)
  478. Enables:
  479. - RT-Smart user-space applications
  480. - Memory protection between processes
  481. - Demand paging and swapping
  482. - Memory-mapped files (mmap)
  483. - Shared memory between processes
  484. Performance impact:
  485. - TLB (Translation Lookaside Buffer) misses add latency
  486. - Page table walks on TLB miss
  487. - Requires proper cache and TLB management
  488. Note: Automatically enabled for Cortex-A. Required for RT-Smart mode.
  489. if RT_USING_SMART
  490. config KERNEL_VADDR_START
  491. hex "The virtural address of kernel start"
  492. default 0xffff000000000000 if ARCH_ARMV8
  493. default 0xc0000000 if ARCH_ARM
  494. default 0xffffffc000000000 if ARCH_RISCV && ARCH_REMAP_KERNEL
  495. default 0x80000000 if ARCH_RISCV
  496. depends on ARCH_MM_MMU
  497. help
  498. Starting virtual address for kernel space in RT-Smart mode.
  499. This defines where the kernel is mapped in the virtual address space.
  500. The kernel typically resides in the upper half of the address space to
  501. separate it from user-space applications.
  502. Default values:
  503. - ARMv8 (64-bit): 0xffff000000000000 (upper 256TB)
  504. - ARM (32-bit): 0xc0000000 (upper 1GB, Linux-compatible)
  505. - RISC-V with remap: 0xffffffc000000000
  506. - RISC-V standard: 0x80000000 (2GB mark)
  507. User-space applications use addresses below this value.
  508. Note: Must be aligned to architecture's virtual memory requirements.
  509. Changing this requires recompiling all kernel and user-space code.
  510. config RT_IOREMAP_LATE
  511. bool "Support to create IO mapping in the kernel address space after system initlalization."
  512. default n
  513. depends on ARCH_ARM_CORTEX_A
  514. depends on ARCH_MM_MMU
  515. help
  516. Enable dynamic I/O memory remapping after system initialization.
  517. When enabled, allows mapping device I/O memory into kernel virtual address
  518. space at runtime using rt_ioremap(). This is useful for:
  519. - Hot-pluggable devices
  520. - Runtime device discovery (device tree)
  521. - Drivers loaded after boot
  522. - Flexible peripheral address mapping
  523. Without this option, all I/O mappings must be established during early boot.
  524. Impact:
  525. - Slightly increased memory overhead for dynamic mapping tables
  526. - Additional TLB entries for I/O regions
  527. Enable if you need runtime flexibility for device driver loading or
  528. working with device tree-based systems.
  529. endif
  530. config ARCH_ARM_ARM9
  531. bool
  532. select ARCH_ARM
  533. help
  534. ARM9 processor family (legacy ARMv4T/ARMv5 architecture).
  535. Classic ARM architecture used in many embedded systems from the 2000s.
  536. Now largely superseded by Cortex-A for application processors.
  537. Features:
  538. - 5-stage pipeline
  539. - MMU for virtual memory
  540. - Separate instruction and data caches
  541. - ARM and Thumb instruction sets
  542. Performance: ~1.1 DMIPS/MHz
  543. Examples: ARM926EJ-S (NXP i.MX, Atmel AT91SAM9)
  544. Choose this if your BSP uses ARM9-based SoC.
  545. config ARCH_ARM_ARM11
  546. bool
  547. select ARCH_ARM
  548. help
  549. ARM11 processor family (ARMv6 architecture).
  550. Enhanced ARM architecture with improved performance and SIMD extensions.
  551. Bridges the gap between ARM9 and Cortex-A.
  552. Features:
  553. - 8-stage pipeline
  554. - MMU with improved TLB
  555. - SIMD instructions
  556. - Unaligned access support
  557. - Hardware divide (some variants)
  558. Performance: ~1.25 DMIPS/MHz
  559. Examples: ARM1176JZF-S (Raspberry Pi 1, BCM2835)
  560. Choose this if your BSP uses ARM11-based SoC.
  561. config ARCH_ARM_CORTEX_A
  562. bool
  563. select ARCH_ARM
  564. select ARCH_ARM_MMU
  565. select RT_USING_CPU_FFS
  566. select RT_USING_HW_ATOMIC
  567. help
  568. ARM Cortex-A application processor family.
  569. High-performance processors designed for complex operating systems and
  570. rich applications (Linux, Android, RT-Smart).
  571. Common features:
  572. - MMU for virtual memory (required)
  573. - Multi-level caches (L1/L2/L3)
  574. - VFP floating-point and NEON SIMD
  575. - TrustZone security extensions
  576. - Multi-core configurations (SMP)
  577. - GIC (Generic Interrupt Controller)
  578. Typical applications:
  579. - Industrial HMI and gateways
  580. - Multimedia devices
  581. - Automotive infotainment
  582. - Edge computing
  583. - RT-Smart mixed-criticality systems
  584. Variants: A5/A7/A8/A9/A15/A17/A35/A53/A55/A57/A72/A73
  585. Automatically selected when choosing specific Cortex-A variant.
  586. if ARCH_ARM_CORTEX_A
  587. config RT_SMP_AUTO_BOOT
  588. bool
  589. default n
  590. help
  591. Automatically boot secondary CPU cores at system startup.
  592. When enabled, RT-Thread will start all available CPU cores during
  593. initialization for symmetric multiprocessing (SMP).
  594. If disabled, secondary cores remain in reset/low-power state until
  595. explicitly started by application code.
  596. Enable for:
  597. - Multi-core load distribution
  598. - Parallel task execution
  599. - Maximum system performance
  600. Disable for:
  601. - Power-sensitive applications
  602. - Asymmetric multiprocessing (AMP)
  603. - Single-core debugging
  604. Note: Requires RT_USING_SMP to be enabled.
  605. config RT_USING_GIC_V2
  606. bool
  607. default n
  608. help
  609. Use ARM Generic Interrupt Controller version 2 (GICv2).
  610. GICv2 is the interrupt controller for Cortex-A processors, providing:
  611. - Up to 1020 interrupt sources
  612. - Interrupt priority and masking
  613. - CPU interface for each core
  614. - Distributor for routing interrupts to cores
  615. - Software-generated interrupts (SGI) for inter-core communication
  616. Used in:
  617. - Cortex-A5/A7/A8/A9/A15/A17
  618. - Single and multi-core SMP systems
  619. Mutually exclusive with GICv3. Select based on your SoC hardware.
  620. config RT_USING_GIC_V3
  621. bool
  622. default n
  623. help
  624. Use ARM Generic Interrupt Controller version 3/4 (GICv3/GICv4).
  625. GICv3 is the enhanced interrupt controller for newer ARM processors:
  626. - Improved scalability (supports more cores)
  627. - System register access (no memory-mapped CPU interface)
  628. - Locality-specific peripheral interrupts (LPI)
  629. - Message-based interrupts
  630. - GICv4: Direct injection of virtual interrupts
  631. Used in:
  632. - Cortex-A55/A57/A72/A73 and newer
  633. - ARMv8 (AArch64) systems
  634. - Large SMP systems (>8 cores)
  635. Mutually exclusive with GICv2. Select based on your SoC hardware.
  636. config RT_NO_USING_GIC
  637. bool
  638. default y if !RT_USING_GIC_V2 && !RT_USING_GIC_V3
  639. help
  640. No GIC interrupt controller in use.
  641. Automatically set when neither GICv2 nor GICv3 is selected.
  642. This may indicate:
  643. - Custom interrupt controller
  644. - Legacy interrupt controller
  645. - Configuration error
  646. Most Cortex-A systems require either GICv2 or GICv3.
  647. endif
  648. config ARCH_ARM_CORTEX_A5
  649. bool
  650. select ARCH_ARM_CORTEX_A
  651. help
  652. ARM Cortex-A5 energy-efficient application processor.
  653. Entry-level Cortex-A processor offering lower cost and power than A9
  654. while maintaining application-class capabilities.
  655. Features:
  656. - ARMv7-A architecture
  657. - 1-4 cores, in-order execution
  658. - Optional NEON SIMD and VFPv4
  659. - TrustZone security
  660. - L1 cache, optional L2
  661. - GICv2
  662. Performance: ~1.57 DMIPS/MHz
  663. Ideal for: Cost-sensitive IoT gateways, industrial HMI
  664. Examples: Vybrid VF6xx (Cortex-A5 + Cortex-M4)
  665. Choose this if your BSP uses Cortex-A5 based SoC.
  666. config ARCH_ARM_CORTEX_A7
  667. bool
  668. select ARCH_ARM_CORTEX_A
  669. help
  670. ARM Cortex-A7 power-efficient application processor.
  671. Most power-efficient ARMv7-A processor, often paired with A15 in big.LITTLE
  672. configurations or used standalone for cost-effective systems.
  673. Features:
  674. - ARMv7-A architecture with hardware virtualization
  675. - 1-4 cores, in-order execution
  676. - VFPv4 and NEON standard
  677. - TrustZone security
  678. - L1 and L2 cache
  679. - GICv2
  680. Performance: ~1.9 DMIPS/MHz
  681. Power: 40% lower than Cortex-A9 at same performance
  682. Ideal for: IoT gateways, set-top boxes, entry-level tablets
  683. Examples: BCM2836 (Raspberry Pi 2), i.MX6UL, Allwinner A33
  684. Choose this if your BSP uses Cortex-A7 based SoC.
  685. config ARCH_ARM_CORTEX_A8
  686. bool
  687. select ARCH_ARM_CORTEX_A
  688. help
  689. ARM Cortex-A8 general-purpose application processor.
  690. First Cortex-A processor, designed for multimedia and mobile applications.
  691. Features:
  692. - ARMv7-A architecture
  693. - Single core, 13-stage superscalar pipeline
  694. - VFPv3 and NEON
  695. - TrustZone security
  696. - L1 and L2 cache
  697. Performance: ~2.0 DMIPS/MHz
  698. Ideal for: Industrial automation, multimedia systems
  699. Examples: TI AM335x (BeagleBone), OMAP3
  700. Choose this if your BSP uses Cortex-A8 based SoC.
  701. config ARCH_ARM_CORTEX_A9
  702. bool
  703. select ARCH_ARM_CORTEX_A
  704. help
  705. ARM Cortex-A9 high-performance application processor.
  706. Popular multi-core processor balancing performance and power efficiency.
  707. Features:
  708. - ARMv7-A architecture
  709. - 1-4 cores, out-of-order execution
  710. - VFPv3 and NEON
  711. - TrustZone security
  712. - L1 cache per core, shared L2
  713. - GICv2
  714. Performance: ~2.5 DMIPS/MHz per core
  715. Ideal for: Industrial gateways, automotive, network equipment
  716. Examples: Zynq-7000 (A9 + FPGA), i.MX6, NVIDIA Tegra 2/3
  717. Choose this if your BSP uses Cortex-A9 based SoC.
  718. config ARCH_ARM_CORTEX_A55
  719. bool
  720. select ARCH_ARM_CORTEX_A
  721. help
  722. ARM Cortex-A55 ultra-efficient 64-bit processor (ARMv8.2-A).
  723. DynamIQ-enabled processor for modern SMP and big.LITTLE configurations,
  724. designed for power efficiency and AI/ML workloads.
  725. Features:
  726. - ARMv8.2-A architecture (64-bit)
  727. - 1-8 cores in DynamIQ cluster
  728. - Dot product instructions for ML
  729. - TrustZone and pointer authentication
  730. - L1 and L2 cache, optional L3
  731. - GICv3
  732. Performance: ~1.8 DMIPS/MHz (better IPC than A53)
  733. Ideal for: Mobile, automotive ADAS, edge AI
  734. Examples: MediaTek Helio, Qualcomm Snapdragon 7xx/6xx
  735. Choose this if your BSP uses Cortex-A55 based SoC.
  736. config ARCH_ARM_SECURE_MODE
  737. bool "Running in secure mode [ARM Cortex-A]"
  738. default n
  739. depends on ARCH_ARM_CORTEX_A
  740. help
  741. Run RT-Thread in ARM secure mode (TrustZone secure world).
  742. TrustZone divides the system into two execution environments:
  743. - Secure world: Access to all resources, runs trusted code
  744. - Non-secure world: Restricted access, runs normal applications
  745. Enable this when:
  746. - RT-Thread acts as secure monitor or trusted OS
  747. - Implementing secure boot chain
  748. - Running in EL3 (ARMv8) or secure state (ARMv7)
  749. - Providing secure services to non-secure OS
  750. Disable when:
  751. - Running as normal OS in non-secure world
  752. - No TrustZone partitioning needed
  753. - Booting directly without secure monitor
  754. Impact:
  755. - Changes memory access permissions
  756. - Affects SCR (Secure Configuration Register) settings
  757. - Influences interrupt routing
  758. Note: Most applications run in non-secure mode. Only enable if you're
  759. implementing secure firmware or trusted execution environment.
  760. config RT_BACKTRACE_FUNCTION_NAME
  761. bool "To show function name when backtrace."
  762. default n
  763. depends on ARCH_ARM_CORTEX_A
  764. help
  765. Display function names in backtrace/call stack dumps.
  766. When enabled, exception handlers and assertion failures will show
  767. symbolic function names in addition to addresses, making debugging easier.
  768. Requires:
  769. - Debug symbols in the binary
  770. - Symbol table in memory or accessible
  771. - Additional processing during backtrace
  772. Benefits:
  773. - Easier identification of crash location
  774. - Better error reports
  775. - Faster debugging
  776. Costs:
  777. - Slightly larger binary (symbol information)
  778. - Increased backtrace processing time
  779. Recommended for development builds. May be disabled for production
  780. to save space and improve backtrace speed.
  781. config ARCH_ARMV8
  782. bool
  783. select ARCH_ARM
  784. select ARCH_ARM_MMU
  785. select RT_USING_CPU_FFS
  786. select ARCH_USING_ASID
  787. select ARCH_USING_IRQ_CTX_LIST
  788. help
  789. ARM 64-bit architecture (ARMv8-A / AArch64).
  790. Modern 64-bit ARM architecture for high-performance application processors.
  791. Represents major architectural evolution from ARMv7 with enhanced features.
  792. Key features:
  793. - 64-bit addressing and registers (can also run 32-bit code in AArch32 mode)
  794. - Exception levels (EL0-EL3) for privilege separation
  795. - Enhanced virtual memory (48-bit addressing, up to 256TB)
  796. - ASID (Address Space ID) for efficient context switching
  797. - Improved SIMD (Advanced SIMD / NEON)
  798. - Hardware virtualization support
  799. - Scalable Vector Extension (SVE) on some variants
  800. Advantages over ARMv7:
  801. - More registers (31 general-purpose 64-bit registers)
  802. - Larger addressable memory (>4GB)
  803. - Better performance and efficiency
  804. - Enhanced security features
  805. Processors: Cortex-A53/A57/A72/A73/A75/A76, Neoverse, Apple M-series
  806. Automatically selected by AArch64 BSP configurations.
  807. Required for RT-Smart on 64-bit ARM platforms.
  808. config ARCH_MIPS
  809. bool
  810. help
  811. MIPS (Microprocessor without Interlocked Pipeline Stages) architecture.
  812. Classic RISC architecture used in embedded systems, networking equipment,
  813. and consumer electronics.
  814. Features:
  815. - Simple load/store RISC design
  816. - Configurable endianness (big or little)
  817. - Optional FPU and DSP extensions
  818. - Hardware multithreading (MIPS MT)
  819. Common applications:
  820. - Network routers and switches
  821. - Set-top boxes
  822. - Gaming consoles
  823. - Embedded Linux systems
  824. Variants: MIPS32, MIPS64, microMIPS
  825. Choose this if your BSP uses MIPS-based SoC.
  826. config ARCH_MIPS64
  827. bool
  828. select ARCH_CPU_64BIT
  829. help
  830. MIPS 64-bit architecture.
  831. 64-bit extension of MIPS architecture providing:
  832. - 64-bit addressing and registers
  833. - Backward compatible with MIPS32 code
  834. - Enhanced performance for 64-bit operations
  835. - Access to larger memory spaces
  836. Applications: High-end networking equipment, servers
  837. Examples: Cavium OCTEON, Loongson processors
  838. Choose this if your BSP uses MIPS64-based SoC.
  839. config ARCH_MIPS_XBURST
  840. bool
  841. select ARCH_MIPS
  842. help
  843. Ingenic XBurst MIPS-based processor family.
  844. Customized MIPS architecture optimized for mobile and multimedia applications
  845. by Ingenic Semiconductor.
  846. Features:
  847. - MIPS32-compatible core with enhancements
  848. - Low power consumption
  849. - Integrated multimedia accelerators
  850. Common applications: Handheld devices, e-readers, IoT
  851. Examples: JZ47xx series SoCs
  852. Choose this if your BSP uses Ingenic XBurst processor.
  853. config ARCH_ANDES
  854. bool
  855. help
  856. Andes RISC-V based architecture.
  857. Custom RISC-V implementation by Andes Technology with proprietary extensions
  858. for enhanced performance and features.
  859. Features:
  860. - RISC-V ISA with Andes-specific extensions
  861. - CoDense (16-bit instruction compression)
  862. - StackSafe for stack protection
  863. - PowerBrake for power management
  864. Applications: AIoT, storage controllers, automotive
  865. Choose this if your BSP uses Andes processor core.
  866. config ARCH_CSKY
  867. bool
  868. help
  869. C-SKY CPU architecture.
  870. Chinese-designed processor architecture (now part of Alibaba's T-Head).
  871. Features:
  872. - 16/32-bit RISC architecture
  873. - Low power and small code size
  874. - DSP extensions
  875. Applications: IoT devices, consumer electronics
  876. Choose this if your BSP uses C-SKY based processor.
  877. config ARCH_POWERPC
  878. bool
  879. help
  880. PowerPC architecture.
  881. High-performance RISC architecture traditionally used in embedded and
  882. server applications.
  883. Features:
  884. - Big-endian (configurable to little-endian on some models)
  885. - AltiVec SIMD on some variants
  886. - Strong memory consistency model
  887. Applications: Networking equipment, aerospace, industrial control
  888. Examples: MPC5xxx, QorIQ series
  889. Choose this if your BSP uses PowerPC processor.
  890. config ARCH_RISCV
  891. bool
  892. help
  893. RISC-V open standard instruction set architecture.
  894. Modern, modular, open-source ISA designed for efficiency and extensibility.
  895. Gaining rapid adoption in embedded systems, IoT, and AI/ML applications.
  896. Key advantages:
  897. - Open standard (no licensing fees)
  898. - Modular design (choose only needed extensions)
  899. - Simple and clean architecture
  900. - Growing ecosystem and vendor support
  901. Base ISAs: RV32I (32-bit), RV64I (64-bit)
  902. Common extensions:
  903. - M: Integer multiplication/division
  904. - A: Atomic instructions
  905. - F: Single-precision floating-point
  906. - D: Double-precision floating-point
  907. - C: Compressed 16-bit instructions
  908. - V: Vector operations
  909. Examples: SiFive, Allwinner D1, ESP32-C3/C6, GigaDevice GD32V
  910. Automatically selected when choosing RV32 or RV64 variant.
  911. config ARCH_RISCV_FPU
  912. bool
  913. help
  914. RISC-V floating-point unit support.
  915. Enable hardware floating-point operations using RISC-V F and/or D extensions.
  916. Automatically selected by ARCH_RISCV_FPU_S or ARCH_RISCV_FPU_D.
  917. When enabled:
  918. - FPU registers (f0-f31) saved/restored during context switch
  919. - Hardware FP instructions used by compiler
  920. - Significant performance improvement for floating-point math
  921. Note: CPU must have F and/or D extension support.
  922. config ARCH_RISCV_VECTOR
  923. bool
  924. help
  925. RISC-V Vector Extension (RVV) support.
  926. Enable RISC-V Vector Extension for SIMD operations, ideal for data-parallel
  927. workloads like DSP, image processing, and AI/ML inference.
  928. Features:
  929. - Vector registers with configurable length (VLEN)
  930. - Vector arithmetic, logic, and memory operations
  931. - Predication and masking
  932. - Auto-vectorization by compiler
  933. Benefits:
  934. - 4-10x performance for vectorizable workloads
  935. - Efficient memory access patterns
  936. - Scalable across different vector lengths
  937. Applications: Signal processing, multimedia, ML inference
  938. Note: Requires CPU with V extension (ratified v1.0).
  939. Select VLEN based on your hardware specification.
  940. if ARCH_RISCV_VECTOR
  941. choice ARCH_VECTOR_VLEN
  942. prompt "RISCV Vector Vlen"
  943. default ARCH_VECTOR_VLEN_128
  944. help
  945. Select the vector register length (VLEN) for RISC-V Vector Extension.
  946. VLEN defines the width of vector registers in bits. This must match
  947. your hardware's vector implementation.
  948. Common VLEN values:
  949. - 128-bit: Entry-level vector implementations, good balance
  950. - 256-bit: Higher throughput, more aggressive vectorization
  951. Larger VLEN:
  952. + More data processed per instruction
  953. + Better performance for vector operations
  954. - Larger context switch overhead
  955. - More silicon area required
  956. Check your CPU documentation for supported VLEN.
  957. config ARCH_VECTOR_VLEN_128
  958. bool "128"
  959. help
  960. 128-bit vector register length.
  961. Standard choice for embedded RISC-V processors with vector support.
  962. Provides good performance/area balance.
  963. Choose this for most RISC-V vector implementations.
  964. config ARCH_VECTOR_VLEN_256
  965. bool "256"
  966. help
  967. 256-bit vector register length.
  968. Wider vector registers for higher throughput in data-parallel workloads.
  969. Requires more silicon area and increases context switch time.
  970. Choose this only if your CPU supports 256-bit VLEN.
  971. endchoice
  972. endif
  973. config ARCH_RISCV_FPU_S
  974. select ARCH_RISCV_FPU
  975. bool
  976. help
  977. RISC-V single-precision floating-point (F extension).
  978. Enable support for 32-bit (float) floating-point operations in hardware.
  979. Features:
  980. - 32 single-precision FP registers (f0-f31)
  981. - IEEE 754 single-precision arithmetic
  982. - FP load/store, arithmetic, conversion instructions
  983. Sufficient for many embedded applications requiring FP without the
  984. overhead of double-precision.
  985. Automatically selected by BSP when CPU has F extension.
  986. config ARCH_RISCV_FPU_D
  987. select ARCH_RISCV_FPU
  988. bool
  989. help
  990. RISC-V double-precision floating-point (D extension).
  991. Enable support for 64-bit (double) floating-point operations in hardware.
  992. Includes F extension functionality.
  993. Features:
  994. - 32 double-precision FP registers (f0-f31, 64-bit wide)
  995. - IEEE 754 double-precision arithmetic
  996. - Both single and double-precision operations
  997. Required for:
  998. - High-precision scientific computations
  999. - Financial calculations
  1000. - Applications requiring >7 significant digits
  1001. Note: D extension requires F extension as prerequisite.
  1002. Automatically selected by BSP when CPU has D extension.
  1003. config ARCH_RISCV32
  1004. select ARCH_RISCV
  1005. bool
  1006. help
  1007. RISC-V 32-bit architecture (RV32).
  1008. 32-bit RISC-V implementation optimized for resource-constrained
  1009. embedded systems and microcontrollers.
  1010. Features:
  1011. - 32-bit addressing (4GB address space)
  1012. - 32 general-purpose 32-bit registers
  1013. - Compact code size with C extension
  1014. - Lower power consumption
  1015. Ideal for:
  1016. - Microcontrollers and IoT devices
  1017. - Cost-sensitive applications
  1018. - Battery-powered systems
  1019. Common variants: RV32IMAC, RV32IMAFC
  1020. Examples: ESP32-C3, GigaDevice GD32VF103, Nuclei Bumblebee
  1021. Choose this if your BSP uses 32-bit RISC-V processor.
  1022. config ARCH_RISCV64
  1023. select ARCH_RISCV
  1024. select ARCH_CPU_64BIT
  1025. bool
  1026. help
  1027. RISC-V 64-bit architecture (RV64).
  1028. 64-bit RISC-V implementation for high-performance embedded systems
  1029. and application processors.
  1030. Features:
  1031. - 64-bit addressing (16 exabyte address space)
  1032. - 32 general-purpose 64-bit registers
  1033. - Backward compatible with RV32 software (with proper toolchain)
  1034. - Better performance for 64-bit arithmetic
  1035. Ideal for:
  1036. - Application processors
  1037. - RT-Smart user-space applications
  1038. - Systems requiring >4GB memory
  1039. - High-performance embedded Linux
  1040. Common variants: RV64IMAC, RV64GC
  1041. Examples: SiFive U74, Allwinner D1 (C906), Kendryte K210
  1042. Choose this if your BSP uses 64-bit RISC-V processor.
  1043. if ARCH_RISCV64
  1044. config ARCH_USING_NEW_CTX_SWITCH
  1045. bool
  1046. default y
  1047. help
  1048. Use optimized context switch implementation for RISC-V 64-bit.
  1049. Enables improved context switching with better performance and
  1050. smaller code size. This is the recommended implementation for RV64.
  1051. Automatically enabled for RISC-V 64-bit. No manual configuration needed.
  1052. config ARCH_USING_RISCV_COMMON64
  1053. bool
  1054. depends on ARCH_RISCV64
  1055. select RT_USING_CPUTIME
  1056. select ARCH_USING_NEW_CTX_SWITCH
  1057. help
  1058. Use common 64-bit RISC-V implementation under ./libcpu/risc-v/common64.
  1059. Provides unified, optimized implementation for 64-bit RISC-V cores:
  1060. - Standard context switch routines
  1061. - Exception and interrupt handling
  1062. - MMU/PMP management
  1063. - CPU time measurement
  1064. Benefits:
  1065. - Code reuse across different RV64 cores
  1066. - Well-tested implementation
  1067. - Consistent behavior
  1068. Enable this for standard RV64 cores (SiFive U74, T-Head C906, etc.)
  1069. unless you have specific custom requirements.
  1070. endif
  1071. config ARCH_REMAP_KERNEL
  1072. bool
  1073. depends on RT_USING_SMART
  1074. help
  1075. Remap kernel image to high virtual address region.
  1076. In RT-Smart mode, move kernel to upper virtual memory region to separate
  1077. it from user-space, similar to Linux kernel layout.
  1078. Benefits:
  1079. - Clear separation between kernel and user address spaces
  1080. - User applications can use lower addresses (0x0 upward)
  1081. - Prevents accidental user access to kernel memory
  1082. - Compatible with standard executable loaders
  1083. Memory layout with remapping:
  1084. - User space: 0x00000000 - KERNEL_VADDR_START
  1085. - Kernel space: KERNEL_VADDR_START - 0xFFFFFFFF...
  1086. Required for: Full RT-Smart user-space isolation
  1087. Note: Increases boot time slightly due to remapping overhead.
  1088. config ARCH_USING_ASID
  1089. bool
  1090. depends on RT_USING_SMART
  1091. help
  1092. Enable Address Space ID (ASID) support from architecture.
  1093. ASID is a hardware feature that tags TLB (Translation Lookaside Buffer)
  1094. entries with process identifiers, avoiding TLB flushes on context switch.
  1095. Benefits:
  1096. - Faster context switches between processes
  1097. - Better TLB utilization (multiple processes' translations cached)
  1098. - Reduced MMU overhead
  1099. Without ASID: TLB must be flushed on every context switch (expensive)
  1100. With ASID: TLB entries for multiple processes coexist (efficient)
  1101. Performance impact: Can reduce context switch time by 50-70%
  1102. Automatically enabled for:
  1103. - ARMv8 (8-bit or 16-bit ASID)
  1104. - Some ARMv7-A implementations
  1105. - RISC-V with ASID support
  1106. Note: Requires MMU with ASID support. Automatically selected by
  1107. compatible architectures.
  1108. config ARCH_IA32
  1109. bool
  1110. help
  1111. Intel IA-32 (x86 32-bit) architecture.
  1112. 32-bit x86 architecture for PC-compatible systems and embedded x86 platforms.
  1113. Features:
  1114. - CISC architecture
  1115. - Segmented memory model (legacy) or flat model
  1116. - x87 FPU, MMX, SSE extensions
  1117. - Paging and segmentation
  1118. Applications: Industrial PCs, legacy embedded systems, virtualization hosts
  1119. Examples: Intel Atom, AMD Geode
  1120. Choose this if your BSP uses x86 32-bit processor.
  1121. config ARCH_TIDSP
  1122. bool
  1123. help
  1124. Texas Instruments DSP architecture family.
  1125. Specialized processors for digital signal processing applications.
  1126. Features:
  1127. - Optimized for real-time signal processing
  1128. - Harvard architecture (separate program/data memory)
  1129. - Hardware multipliers and MAC units
  1130. - Low-latency interrupt handling
  1131. Applications: Motor control, audio processing, power electronics
  1132. Automatically selected by specific TI DSP variant (e.g., C28x).
  1133. config ARCH_TIDSP_C28X
  1134. bool
  1135. select ARCH_TIDSP
  1136. select ARCH_CPU_STACK_GROWS_UPWARD
  1137. help
  1138. Texas Instruments C28x DSP architecture.
  1139. Fixed-point DSP optimized for real-time control applications,
  1140. especially motor control and power conversion.
  1141. Features:
  1142. - 32-bit fixed-point architecture
  1143. - Upward-growing stack (unusual characteristic)
  1144. - Single-cycle MAC operations
  1145. - Fast interrupt response (<50ns)
  1146. - Floating-point unit (C28x+FPU variants)
  1147. Ideal for:
  1148. - Digital motor control (FOC, vector control)
  1149. - Power inverters and converters
  1150. - Solar inverters
  1151. - Industrial drives
  1152. Examples: TMS320F28xxx series
  1153. Note: Stack grows upward unlike most architectures.
  1154. Choose this if your BSP uses TI C28x DSP.
  1155. config ARCH_HOST_SIMULATOR
  1156. bool
  1157. help
  1158. Host machine simulator (running RT-Thread on development PC).
  1159. Allows running RT-Thread as a user-space application on Linux, Windows,
  1160. or macOS for development, testing, and debugging without physical hardware.
  1161. Features:
  1162. - Rapid prototyping and testing
  1163. - Debugger-friendly (use GDB, Visual Studio debugger)
  1164. - File system access to host files
  1165. - Network simulation
  1166. Use cases:
  1167. - Algorithm development and testing
  1168. - Application logic verification
  1169. - CI/CD automated testing
  1170. - Learning RT-Thread without hardware
  1171. Note: Timing behavior differs from real hardware. Not suitable for
  1172. real-time performance validation.
  1173. Choose this for simulator-based BSP (e.g., qemu-vexpress-a9, simulator).
  1174. config ARCH_USING_HW_THREAD_SELF
  1175. bool
  1176. default n
  1177. help
  1178. Use hardware register to identify current thread (thread self-identification).
  1179. Some architectures provide dedicated registers or instructions to identify
  1180. the currently executing thread without memory access.
  1181. Benefits:
  1182. - Faster rt_thread_self() operation (single register read)
  1183. - Reduced memory bandwidth
  1184. - Better performance in multi-core systems
  1185. Examples:
  1186. - ARM: TPIDRURO/TPIDR_EL0 register
  1187. - x86: FS/GS segment registers
  1188. - RISC-V: Some implementations use tp register
  1189. Automatically enabled by architectures supporting this feature.
  1190. No manual configuration needed.
  1191. config ARCH_USING_IRQ_CTX_LIST
  1192. bool
  1193. default n
  1194. help
  1195. Use interrupt context list for nested interrupt handling.
  1196. Maintains a list of interrupt contexts for proper nested interrupt
  1197. management, especially important for complex interrupt scenarios.
  1198. Benefits:
  1199. - Correct handling of deeply nested interrupts
  1200. - Proper context tracking in multi-level interrupt systems
  1201. - Better debugging of interrupt-related issues
  1202. Overhead:
  1203. - Slight increase in interrupt entry/exit time
  1204. - Small memory overhead for context list
  1205. Automatically enabled by architectures requiring it (e.g., ARMv8).
  1206. No manual configuration needed.