Kconfig 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. #
  2. # For a description of the syntax of this configuration file,
  3. # see the file kconfig-language.txt in the NuttX tools repository.
  4. #
  5. if ARCH_SIM
  6. comment "Simulation Configuration Options"
  7. choice
  8. prompt "Host CPU Type"
  9. default HOST_X86_64
  10. config HOST_X86_64
  11. bool "x86_64"
  12. select ARCH_HAVE_STACKCHECK
  13. select LIBC_ARCH_ELF_64BIT if LIBC_ARCH_ELF && !SIM_M32
  14. config HOST_X86
  15. bool "x86"
  16. select ARCH_HAVE_STACKCHECK
  17. config HOST_ARM
  18. bool "arm"
  19. select ARCH_HAVE_STACKCHECK
  20. endchoice # Host CPU Type
  21. config ARCH_CHIP
  22. string
  23. default "sim"
  24. config SIM_M32
  25. bool "Build 32-bit simulation on 64-bit machine"
  26. default n
  27. depends on HOST_X86_64
  28. ---help---
  29. Simulation context switching is based on logic like setjmp and longjmp. This
  30. context switching is only available for 32-bit targets. On 64-bit machines,
  31. this context switching will fail.
  32. The workaround on 64-bit machines for now is to build for a 32-bit target on the
  33. 64-bit machine. The workaround for this issue has been included in NuttX 6.15 and
  34. beyond. For those versions, you must add SIM_M32=y to the .config file in
  35. order to enable building a 32-bit image on a 64-bit platform.
  36. config SIM_CYGWIN_DECORATED
  37. bool "Decorated Cygwin names"
  38. default n
  39. depends on WINDOWS_CYGWIN
  40. ---help---
  41. Older versions of Cygwin tools decorated C symbol names by adding an
  42. underscore to the beginning of the symbol name. Newer versions of
  43. Cygwin do not seem to do this.
  44. How do you know if you need this option? You could look at the generated
  45. symbol tables to see if there are underscore characters at the beginning
  46. of the symbol names. Or, if you need this option, the simulation will not
  47. run: It will crash early, probably in some function due to the failure to
  48. allocate memory.
  49. choice
  50. prompt "X64_64 ABI"
  51. default SIM_X8664_SYSTEMV if HOST_LINUX
  52. default SIM_X8664_MICROSOFT if HOST_WINDOWS
  53. depends on HOST_X86_64 && !SIM_32
  54. config SIM_X8664_SYSTEMV
  55. bool "System V AMD64 ABI"
  56. ---help---
  57. The calling convention of the System V AMD64 ABI is followed on Solaris,
  58. Linux, FreeBSD, macOS, and other UNIX-like or POSIX-compliant operating
  59. systems. The first six integer or pointer arguments are passed in registers
  60. RDI, RSI, RDX, RCX, R8, and R9, while XMM0, XMM1, XMM2, XMM3, XMM4, XMM5,
  61. XMM6 and XMM7 are used for floating point arguments. For system calls, R10
  62. is used instead of RCX. As in the Microsoft x64 calling convention,
  63. additional arguments are passed on the stack and the return value is stored
  64. in RAX.
  65. Registers RBP, RBX, and R12-R15 are callee-save registers; all others must
  66. be saved by the caller if they wish to preserve their values.
  67. Unlike the Microsoft calling convention, a shadow space is not provided; on
  68. function entry, the return address is adjacent to the seventh integer argument
  69. on the stack.
  70. config SIM_X8664_MICROSOFT
  71. bool "Microsoft x64 calling convention"
  72. ---help---
  73. The Microsoft x64 calling convention is followed on Microsoft Windows and
  74. pre-boot UEFI (for long mode on x86-64). It uses registers RCX, RDX, R8,
  75. R9 for the first four integer or pointer arguments (in that order), and
  76. XMM0, XMM1, XMM2, XMM3 are used for floating point arguments. Additional
  77. arguments are pushed onto the stack (right to left). Integer return
  78. values (similar to x86) are returned in RAX if 64 bits or less. Floating
  79. point return values are returned in XMM0. Parameters less than 64 bits
  80. long are not zero extended; the high bits are not zeroed.
  81. endchoice
  82. config SIM_WALLTIME
  83. bool "Run the simulation at a fixed cadence in near real-time"
  84. default n
  85. if SIM_WALLTIME
  86. choice
  87. prompt "Simulation at a fixed cadence in near real-time"
  88. default SIM_WALLTIME_SLEEP
  89. config SIM_WALLTIME_SLEEP
  90. bool "Execution the simulation in near real-time using host sleep"
  91. ---help---
  92. NOTE: In order to facility fast testing, the sim target's IDLE loop, by default,
  93. calls the system timer "interrupt handler" as fast as possible. As a result, there
  94. really are no noticeable delays when a task sleeps. However, the task really does
  95. sleep -- but the time scale is wrong. If you want behavior that is closer to
  96. normal timing, then you can define SIM_WALLTIME=y in your configuration
  97. file. This configuration setting will cause the sim target's IDLE loop to delay
  98. on each call so that the system "timer interrupt" is called at a rate approximately
  99. correct for the system timer tick rate. With this definition in the configuration,
  100. sleep() behavior is more or less normal.
  101. config SIM_WALLTIME_SIGNAL
  102. bool "Execute the simulation using a host timer"
  103. ---help---
  104. Run the NuttX simulation using a host timer that delivers periodic SIGALRM
  105. events at a tick rate specified by CONFIG_USEC_PER_TICK. Enabling this option
  106. will generate the timer 'tick' events from the host timer at a fixed rate.
  107. The simulated 'tick' events from Idle task are no longer sent.
  108. endchoice
  109. endif
  110. config SIM_NETDEV
  111. bool "Simulated Network Device"
  112. default y
  113. depends on NET_ETHERNET
  114. select ARCH_HAVE_NETDEV_STATISTICS
  115. select SCHED_LPWORK
  116. select SIM_WALLTIME
  117. ---help---
  118. Build in support for a simulated network device.
  119. if SIM_NETDEV
  120. choice
  121. prompt "Simulated Network Device Type"
  122. default SIM_NETDEV_TAP
  123. config SIM_NETDEV_TAP
  124. bool "Simulated Network Device with TAP/WPCAP"
  125. depends on (HOST_LINUX || HOST_WINDOWS)
  126. ---help---
  127. Build in support for a simulated network device using a TAP device on Linux or
  128. WPCAP on Windows.
  129. config SIM_NETDEV_VPNKIT
  130. bool "Simulated Network Device with VPNKit"
  131. ---help---
  132. Build in support for a simulated network device using VPNKit.
  133. endchoice
  134. endif
  135. config SIM_NETDEV_VPNKIT_PATH
  136. string "Unix domain socket to communicate with VPNKit"
  137. default "/tmp/vpnkit-nuttx"
  138. depends on SIM_NETDEV_VPNKIT
  139. if HOST_LINUX
  140. choice
  141. prompt "Simulation Network Type"
  142. default SIM_NET_HOST_ROUTE
  143. depends on SIM_NETDEV_TAP
  144. config SIM_NET_HOST_ROUTE
  145. bool "Use local host route"
  146. ---help---
  147. Add a host route for the simulation that points to the created tap device. The
  148. simulation will not be able to access the public network unless iptables is
  149. configured to masquerade for it. See boards/sim/sim sim/NETWORK-LINUX.txt
  150. for more information.
  151. config SIM_NET_BRIDGE
  152. bool "Attach to Linux bridge"
  153. ---help---
  154. Add the created tap device to the specified bridge. You will need to manually
  155. configure the bridge IP address (if any) and routes that point to the bridge.
  156. See boards/sim/sim/sim/NETWORK-LINUX.txt for more information.
  157. endchoice
  158. endif
  159. if SIM_NET_BRIDGE
  160. config SIM_NET_BRIDGE_DEVICE
  161. string "Bridge device to attach"
  162. default "nuttx0"
  163. ---help---
  164. The name of the bridge device (as passed to "brctl create") to which the simulation's
  165. TAP interface should be added.
  166. endif
  167. config SIM_RPTUN_MASTER
  168. bool "Remote Processor Tunneling Role"
  169. depends on RPTUN
  170. config SIM_LCDDRIVER
  171. bool "Build a simulated LCD driver"
  172. default y
  173. depends on NX && NX_LCDDRIVER
  174. ---help---
  175. Build a simulated LCD driver"
  176. config SIM_FRAMEBUFFER
  177. bool "Build a simulated frame buffer driver"
  178. default n
  179. depends on !NX_LCDDRIVER
  180. ---help---
  181. Build a simulated frame buffer driver"
  182. if SIM_FRAMEBUFFER
  183. config SIM_X11FB
  184. bool "Use X11 window"
  185. default n
  186. select SCHED_LPWORK
  187. select SIM_WALLTIME
  188. ---help---
  189. Use an X11 graphics window to simulate the graphics device"
  190. config SIM_X11NOSHM
  191. bool "Don't use shared memory with X11"
  192. default n
  193. depends on SIM_X11FB
  194. ---help---
  195. Don't use shared memory with the X11 graphics device emulation."
  196. config SIM_FBHEIGHT
  197. int "Display height"
  198. default 240
  199. ---help---
  200. Simulated display height. Default: 240
  201. config SIM_FBWIDTH
  202. int "Display width"
  203. default 320 if SIM_LCDDRIVER
  204. default 480 if SIM_FRAMEBUFFER
  205. ---help---
  206. Simulated width of the display. Default: 320 or 480
  207. config SIM_FBBPP
  208. int "Pixel depth in bits"
  209. default 8
  210. ---help---
  211. Pixel depth in bits. Valid choices are 4, 8, 16, 24, or 32.
  212. If you use the X11 display emulation, the selected BPP must match the BPP
  213. of your graphics hardware (probably 32 bits). Default: 8
  214. endif # SIM_FRAMEBUFFER
  215. if SIM_X11FB && INPUT
  216. choice
  217. prompt "X11 Simulated Input Device"
  218. default SIM_NOINPUT
  219. config SIM_TOUCHSCREEN
  220. bool "X11 mouse-based touchscreen emulation"
  221. ---help---
  222. Support an X11 mouse-based touchscreen emulation. Also needs INPUT=y
  223. config SIM_AJOYSTICK
  224. bool "X11 mouse-based analog joystick emulation"
  225. ---help---
  226. Support an X11 mouse-based analog joystick emulation. Also needs INPUT=y
  227. config SIM_NOINPUT
  228. bool "No input device"
  229. endchoice # X11 Simulated Input Device
  230. endif # SIM_X11FB && INPUT
  231. config SIM_TCNWAITERS
  232. bool "Maximum number poll() waiters"
  233. default 4
  234. depends on SIM_TOUCHSCREEN
  235. ---help---
  236. The maximum number of threads that can be waiting on poll() for a
  237. touchscreen event. Default: 4
  238. config SIM_IOEXPANDER
  239. bool "Simulated I/O Expander"
  240. default n
  241. depends on IOEXPANDER
  242. select IOEXPANDER_INT_ENABLE
  243. ---help---
  244. Build a simple, simulated I/O Expander chip simulation (for testing
  245. purposes only).
  246. if SIM_IOEXPANDER
  247. config SIM_INT_NCALLBACKS
  248. int "Max number of interrupt callbacks"
  249. default 4
  250. ---help---
  251. This is the maximum number of interrupt callbacks supported
  252. config SIM_INT_POLLDELAY
  253. int "Interrupt poll delay (used)"
  254. default 500000
  255. ---help---
  256. This microsecond delay defines the polling rate for missed interrupts.
  257. endif # SIM_IOEXPANDER
  258. config SIM_SPIFLASH
  259. bool "Simulated SPI FLASH with SMARTFS"
  260. default n
  261. select FS_SMARTFS
  262. select MTD_SMART
  263. ---help---
  264. Adds a simulated SPI FLASH that responds to standard M25 style
  265. commands on the SPI bus.
  266. choice
  267. prompt "Simulated SPI FLASH Size"
  268. default SIM_SPIFLASH_1M
  269. depends on SIM_SPIFLASH
  270. config SIM_SPIFLASH_1M
  271. bool "1 MBit (128K Byte)"
  272. config SIM_SPIFLASH_8M
  273. bool "8 MBit (1M Byte)"
  274. config SIM_SPIFLASH_32M
  275. bool "32 MBit (4M Byte)"
  276. config SIM_SPIFLASH_64M
  277. bool "64 MBit (8M Byte)"
  278. config SIM_SPIFLASH_128M
  279. bool "128 MBit (16M Byte)"
  280. endchoice
  281. config SIM_SPIFLASH_SECTORSIZE
  282. int "FLASH Sector Erase Size"
  283. default 65536
  284. depends on SIM_SPIFLASH
  285. ---help---
  286. Sets the large sector erase size that the part simulates.
  287. This driver simulates SPI devices that have both a large
  288. sector erase as well as a "sub-sector" (per the datasheet)
  289. erase size (typically 4K bytes).
  290. config SIM_SPIFLASH_SUBSECTORSIZE
  291. int "FLASH Sub-Sector Erase Size"
  292. default 4096
  293. depends on SIM_SPIFLASH
  294. ---help---
  295. Sets the smaller sub-sector erase size supported by the
  296. FLASH emulation
  297. config SIM_SPIFLASH_M25P
  298. bool "Enable M25Pxx FLASH"
  299. depends on MTD_M25P
  300. ---help---
  301. Enables simulation of an M25P type FLASH
  302. config SIM_SPIFLASH_SST26
  303. bool "Enable SST26 FLASH"
  304. depends on MTD_SST26
  305. ---help---
  306. Enables simulation of an SST26 type FLASH
  307. config SIM_SPIFLASH_W25
  308. bool "Enable W25 FLASH"
  309. depends on MTD_W25
  310. ---help---
  311. Enables simulation of a W25 type FLASH
  312. config SIM_SPIFLASH_CUSTOM
  313. bool "Enable Emulation of a Custom Manufacturer / ID FLASH"
  314. depends on SIM_SPIFLASH
  315. ---help---
  316. Enables simulation of FLASH with a custom Manufacturer, ID and Capacity
  317. config SIM_SPIFLASH_MANUFACTURER
  318. hex "Hex ID of the FLASH manufacturer code"
  319. default 0x20
  320. depends on SIM_SPIFLASH_CUSTOM
  321. ---help---
  322. Allows the simulated FLASH Manufacturer ID to be set.
  323. config SIM_SPIFLASH_MEMORY_TYPE
  324. hex "Hex ID of the FLASH Memory Type code"
  325. default 0x20
  326. depends on SIM_SPIFLASH_CUSTOM
  327. ---help---
  328. Allows the simulated FLASH Memory Type code to be set.
  329. config SIM_SPIFLASH_CAPACITY
  330. hex "Hex ID of the FLASH capacity code"
  331. default 0x14
  332. depends on SIM_SPIFLASH_CUSTOM
  333. ---help---
  334. Allows the simulated FLASH Memory Capacity code to be set.
  335. config SIM_SPIFLASH_PAGESIZE
  336. int "FLASH Write / Program Page Size"
  337. default 256
  338. depends on SIM_SPIFLASH
  339. ---help---
  340. Sets the size of a page program operation. The page size
  341. represents the maximum number of bytes that can be sent
  342. for a program operation. If more bytes than this are
  343. sent on a single Page Program, then the address will
  344. "wrap" causing the initial data sent to be overwritten.
  345. This is consistent with standard SPI FLASH operation.
  346. config SIM_QSPIFLASH
  347. bool "Simulated QSPI FLASH with SMARTFS"
  348. default n
  349. select FS_SMARTFS
  350. select MTD_SMART
  351. ---help---
  352. Adds a simulated QSPI FLASH that responds to N25QXXX style
  353. commands on the QSPI bus.
  354. choice
  355. prompt "Simulated QSPI FLASH Size"
  356. default SIM_QSPIFLASH_1M
  357. depends on SIM_QSPIFLASH
  358. config SIM_QSPIFLASH_1M
  359. bool "1 MBit (128K Byte)"
  360. config SIM_QSPIFLASH_8M
  361. bool "8 MBit (1M Byte)"
  362. config SIM_QSPIFLASH_32M
  363. bool "32 MBit (4M Byte)"
  364. config SIM_QSPIFLASH_64M
  365. bool "64 MBit (8M Byte)"
  366. config SIM_QSPIFLASH_128M
  367. bool "128 MBit (16M Byte)"
  368. endchoice
  369. config SIM_QSPIFLASH_MANUFACTURER
  370. hex "Hex ID of the FLASH manufacturer code"
  371. default 0x20
  372. depends on SIM_QSPIFLASH
  373. ---help---
  374. Allows the simulated FLASH Manufacturer ID to be set.
  375. config SIM_QSPIFLASH_MEMORY_TYPE
  376. hex "Hex ID of the FLASH Memory Type code"
  377. default 0xba
  378. depends on SIM_QSPIFLASH
  379. ---help---
  380. Allows the simulated FLASH Memory Type code to be set.
  381. config SIM_QSPIFLASH_SECTORSIZE
  382. int "FLASH Sector Erase Size"
  383. default 65536
  384. depends on SIM_QSPIFLASH
  385. ---help---
  386. Sets the large sector erase size that the part simulates.
  387. This driver simulates QSPI devices that have both a large
  388. sector erase as well as a "sub-sector" (per the datasheet)
  389. erase size (typically 4K bytes).
  390. config SIM_QSPIFLASH_SUBSECTORSIZE
  391. int "FLASH Sub-Sector Erase Size"
  392. default 4096
  393. depends on SIM_QSPIFLASH
  394. ---help---
  395. Sets the smaller sub-sector erase size supported by the
  396. FLASH emulation
  397. config SIM_QSPIFLASH_PAGESIZE
  398. int "FLASH Write / Program Page Size"
  399. default 256
  400. depends on SIM_QSPIFLASH
  401. ---help---
  402. Sets the size of a page program operation. The page size
  403. represents the maximum number of bytes that can be sent
  404. for a program operation. If more bytes than this are
  405. sent on a single Page Program, then the address will
  406. "wrap" causing the initial data sent to be overwritten.
  407. This is consistent with standard SPI FLASH operation.
  408. config SIM_HCISOCKET
  409. bool "Attach Host Bluetooth"
  410. default false
  411. depends on (WIRELESS_BLUETOOTH && HOST_LINUX)
  412. ---help---
  413. Attached the local bluetooth device to the simulation
  414. target via HCI_CHANNEL_USER. This gives NuttX full
  415. control of the device, but is abstracted from the
  416. physical interface which is still handled by Linux.
  417. config SIM_UART_NUMBER
  418. int "The number of tty ports on sim platform, range is 0~4"
  419. default 0
  420. config SIM_UART0_NAME
  421. string "the name of uart0 on sim"
  422. default "/dev/ttySIM0"
  423. depends on SIM_UART_NUMBER >= 1
  424. config SIM_UART1_NAME
  425. string "the name of uart1 on sim"
  426. default "/dev/ttySIM1"
  427. depends on SIM_UART_NUMBER >= 2
  428. config SIM_UART2_NAME
  429. string "the name of uart2 on sim"
  430. default "/dev/ttySIM2"
  431. depends on SIM_UART_NUMBER >= 3
  432. config SIM_UART3_NAME
  433. string "the name of uart3 on sim"
  434. default "/dev/ttySIM3"
  435. depends on SIM_UART_NUMBER >= 4
  436. endif # ARCH_SIM