README.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. Architecture-Specific Code
  2. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  3. Table of Contents
  4. ^^^^^^^^^^^^^^^^^
  5. o Architecture-Specific Code
  6. o Summary of Files
  7. o Supported Architectures
  8. o Configuring NuttX
  9. Architecture-Specific Code
  10. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  11. The NuttX configuration consists of:
  12. o Processor architecture specific files. These are the files contained
  13. in the arch/<arch-name>/ directory discussed in this README.
  14. o Chip/SoC specific files. Each processor architecture is embedded in
  15. chip or System-on-a-Chip (SoC) architecture. The full chip
  16. architecture includes the processor architecture plus chip-specific
  17. interrupt logic, general purpose I/O (GPIO) logic, and specialized,
  18. internal peripherals (such as UARTs, USB, etc.).
  19. These chip-specific files are contained within chip-specific
  20. sub-directories in the arch/<arch-name>/ directory and are selected
  21. via the CONFIG_ARCH_name selection
  22. o Board specific files. In order to be usable, the chip must be
  23. contained in a board environment. The board configuration defines
  24. additional properties of the board including such things as peripheral
  25. LEDs, external peripherals (such as network, USB, etc.).
  26. These board-specific configuration files can be found in the
  27. boards/<arch>/<chip>/<board> sub-directories.
  28. This README will address the processor architecture specific files that
  29. are contained in the arch/<arch-name>/ directory. The file
  30. include/nuttx/arch.h identifies all of the APIs that must be provided by
  31. this architecture specific logic. (It also includes
  32. arch/<arch-name>/arch.h as described below).
  33. Directory Structure
  34. ^^^^^^^^^^^^^^^^^^^
  35. The arch/ directory contains architecture-specific logic. The complete
  36. board port is defined by the architecture-specific code in this
  37. directory plus the board-specific configurations in the boards/
  38. directory. Each architecture must provide a subdirectory <arch-name>
  39. under arch/ with the following characteristics:
  40. <arch-name>/
  41. |-- include/
  42. | |--<chip-name>/
  43. | | `-- (chip-specific header files)
  44. | |--<other-chips>/
  45. | |-- arch.h
  46. | |-- irq.h
  47. | `-- types.h
  48. `-- src/
  49. |--<chip-name>/
  50. | `-- (chip-specific source files)
  51. |--<other-chips>/
  52. |-- Makefile
  53. `-- (architecture-specific source files)
  54. Summary of Files
  55. ^^^^^^^^^^^^^^^^
  56. include/<chip-name>/
  57. This sub-directory contains chip-specific header files.
  58. include/arch.h
  59. This is a hook for any architecture specific definitions that may be
  60. needed by the system. It is included by include/nuttx/arch.h
  61. include/types.h
  62. This provides architecture/toolchain-specific definitions for standard
  63. types. This file should typedef:
  64. _int8_t, _uint8_t, _int16_t, _uint16_t, _int32_t, _uint32_t
  65. and if the architecture supports 64-bit integers:
  66. _int24_t, _uint24_t, _int64_t, _uint64_t
  67. NOTE that these type names have a leading underscore character. This
  68. file will be included (indirectly) by include/stdint.h and typedef'ed
  69. to the final name without the underscore character. This roundabout
  70. way of doings things allows the stdint.h to be removed from the
  71. include/ directory in the event that the user prefers to use the
  72. definitions provided by their toolchain header files.
  73. irqstate_t
  74. Must be defined to the size required to hold the interrupt
  75. enable/disable state.
  76. This file will be included by include/sys/types.h and be made
  77. available to all files.
  78. include/irq.h
  79. This file needs to define some architecture-specific functions
  80. (usually inline if the compiler supports inlining) and structures.
  81. These include:
  82. - struct xcptcontext. This structure represents the saved context of
  83. a thread.
  84. - irqstate_t up_irq_save(void) -- Used to disable all interrupts.
  85. - void up_irq_restore(irqstate_t flags) -- Used to restore interrupt
  86. enables to the same state as before up_irq_save was called.
  87. NOTE: These interfaces are not available to application code but can
  88. only be used within the operating system code. And, in general, these
  89. functions should *never* be called directly, not unless you know
  90. absolutely well what you are doing. Rather you should typically use
  91. the wrapper functions enter_critical_section() and
  92. leave_critical_section() as prototyped in include/nuttx/irq.h.
  93. This file must also define NR_IRQS, the total number of IRQs supported
  94. by the board.
  95. src/<chip-name>/
  96. This sub-directory contains chip-specific source files.
  97. src/Makefile
  98. This makefile will be executed to build the targets src/libup.a and
  99. src/up_head.o. The up_head.o file holds the entry point into the
  100. system (power-on reset entry point, for example). It will be used in
  101. the final link with libup.a and other system archives to generate the
  102. final executable.
  103. Supported Architectures
  104. ^^^^^^^^^^^^^^^^^^^^^^^
  105. NOTE: nuttx/Documentation/NuttX.html for current information about the
  106. state of these MCU ports.
  107. arch/sim - Linux/Cygwin simulation
  108. A user-mode port of NuttX to the x86 Linux platform is available.
  109. The purpose of this port is primarily to support OS feature
  110. development. This port does not support interrupts or a real timer
  111. (and hence no round robin scheduler). Otherwise, it is complete.
  112. arch/arm - ARM-based micro-controllers
  113. This directory holds common ARM architectures. At present, this
  114. includes the following subdirectories:
  115. Architecture Support
  116. arch/arm/include and arch/arm/src/common
  117. arch/arm/src/arm and arch/arm/include/arm
  118. arch/arm/src/armv7-a and arch/arm/include/armv6-m
  119. arch/arm/src/armv7-a and arch/arm/include/armv7-a
  120. arch/arm/src/armv7-m and arch/arm/include/armv7-m
  121. arch/arm/src/armv7-r and arch/arm/include/armv7-r
  122. MCU support
  123. arch/arm/include/a1x and arch/arm/src/a1x
  124. arch/arm/include/am335x and arch/arm/src/am335x
  125. arch/arm/include/c5471 and arch/arm/src/c5471
  126. arch/arm/include/cxd56xx and arch/arm/src/cxd56xx
  127. arch/arm/include/dm320 and arch/arm/src/dm320
  128. arch/arm/include/efm32 and arch/arm/src/efm32
  129. arch/arm/include/imx1 and arch/arm/src/imx1
  130. arch/arm/include/imx6 and arch/arm/src/imx6
  131. arch/arm/include/imxrt and arch/arm/src/imxrt
  132. arch/arm/include/kinetis and arch/arm/src/kinetis
  133. arch/arm/include/kl and arch/arm/src/kl
  134. arch/arm/include/lc823450 and arch/arm/src/lc823450
  135. arch/arm/include/lpc17xx_40xx and arch/arm/src/lpc17xx_40xx
  136. arch/arm/include/lpc214x and arch/arm/src/lpc214x
  137. arch/arm/include/lpc2378 and arch/arm/src/lpc2378
  138. arch/arm/include/lpc31xx and arch/arm/src/lpc31xx
  139. arch/arm/include/lpc43xx and arch/arm/src/lpc43xx
  140. arch/arm/include/lpc54xx and arch/arm/src/lpc54xx
  141. arch/arm/include/max326xx and arch/arm/src/max326xx
  142. arch/arm/include/moxart and arch/arm/src/moxart
  143. arch/arm/include/nrf52 and arch/arm/src/nrf52
  144. arch/arm/include/nuc1xx and arch/arm/src/nuc1xx
  145. arch/arm/include/s32k1xx and arch/arm/src/s32k1xx
  146. arch/arm/include/sam34 and arch/arm/src/sam34
  147. arch/arm/include/sama5 and arch/arm/src/sama5
  148. arch/arm/include/samd2l2 and arch/arm/src/samd2l2
  149. arch/arm/include/samd5e5 and arch/arm/src/samd5e5
  150. arch/arm/include/samv7 and arch/arm/src/samv7
  151. arch/arm/include/stm32 and arch/arm/src/stm32
  152. arch/arm/include/stm32f0l0g0 and arch/arm/src/stm32f0l0g0
  153. arch/arm/include/stm32f7 and arch/arm/src/stm32f7
  154. arch/arm/include/stm32h7 and arch/arm/src/stm32h7
  155. arch/arm/include/stm32l4 and arch/arm/src/stm32l4
  156. arch/arm/include/str71x and arch/arm/src/str71x
  157. arch/arm/include/tiva and arch/arm/src/tiva
  158. arch/arm/include/tms570 and arch/arm/src/tms570
  159. arch/arm/include/xmc4 and arch/arm/src/xmc4
  160. arch/avr
  161. This directory is dedicated to ports to the Atmel AVR (8-bit) and
  162. AVR32 (32-bit) MCU families. STATUS: Under development.
  163. Architecture Support
  164. arch/avr/include/avr and arch/avr/src/avr
  165. arch/avr/include/avr32 and arch/avr/src/avr32
  166. MCU support
  167. arch/avr/include/atmega and arch/avr/src/atmega
  168. arch/avr/include/at90usb and arch/avr/src/at90usb
  169. arch/avr/include/at32uc3 and arch/avr/src/at32uc3
  170. arch/avr/include/xmega and arch/avr/src/xmega
  171. arch/hc
  172. This directory is dedicated to ports to the Freescale HC family.
  173. arch/arm/include/m9s12 and arch/arm/src/m9s12
  174. arch/mips
  175. This directory is dedicated to ports to the MIPS family.
  176. Architecture Support
  177. arch/mips/include/mips32 and arch/mips/src/mips32
  178. MCU support
  179. arch/mips/include/pic32mx and arch/mips/src/pic32mx
  180. arch/mips/include/pic32mz and arch/mips/src/pic32mz
  181. arch/misoc
  182. This directory is dedicated to ports to the Misoc family.
  183. MCU support
  184. arch/misoc/include/lm32 and arch/misoc/src/lm32
  185. arch/misoc/include/minerva and arch/misoc/src/minerva
  186. arch/renesas - Support for Renesas and legacy Hitachi microcontrollers.
  187. This include SuperH and M16C.
  188. Architecture Support
  189. arch/renesas/include and arch/renesas/src/common
  190. MCU support
  191. arch/renesas/include/m16c and arch/renesas/src/m16c
  192. arch/renesas/include/rx65n and arch/renesas/src/rx65n
  193. arch/renesas/include/sh1 and arch/renesas/src/sh1
  194. arch/or1k
  195. This directory is dedicated to ports to OpenRISC architectures.
  196. arch/or1k/include/mor1k and arch/or1k/src/mor1k
  197. arch/risc-v
  198. This directory is dedicated to ports to the RISC-V family.
  199. Architecture Support
  200. arch/risc-v/include/rv32im
  201. MCU support
  202. arch/risc-v/include/fe310 and arch/risc-v/src/fe310
  203. arch/risc-v/include/gap8 and arch/risc-v/src/gap8
  204. arch/risc-v/include/k210 and arch/risc-v/src/k210
  205. arch/risc-v/include/litex and arch/risc-v/src/litex
  206. arch/risc-v/include/nr5m100 and arch/risc-v/src/nr5m100
  207. arch/risc-v/include/rv32im and arch/risc-v/src/rv32im
  208. arch/risc-v/include/rv64gc and arch/risc-v/src/rv64gc
  209. arch/x86 - Intel x86 architectures
  210. This directory holds related, 32- and 64-bit architectures from
  211. Intel. At present, this includes the following subdirectories:
  212. Architecture Support
  213. arch/x86/include and arch/x86/src/common
  214. MCU support
  215. arch/x86/include/i486 and arch/x86/src/i486
  216. arch/x86/include/qemu and arch/x86/src/qemu
  217. arch/x86_64 - Intel x86 64-bit architectures
  218. This directory holds related 64-bit architectures from Intel. At
  219. present, this includes the following subdirectories:
  220. Architecture Support
  221. arch/x86_64/include and arch/x86_64/src/common
  222. MCU support
  223. arch/x86_64/include/intel64 and arch/x86_64/src/intel64
  224. arch/x86_64/include/qemu and arch/x86_64/src/qemu
  225. arch/xtensa
  226. Implementations based on the Cadence® Tensilica® Xtensa® processors,
  227. such as the Xtensa LX6 dataplane processing units (DPUs). At
  228. present, this includes the following subdirectories:
  229. Common XTENSA support:
  230. arch/xtensa/include and arch/xtensa/src/common
  231. LX6 DPU support:
  232. arch/xtensa/include/lx6 and arch/xtensa/xtensa/lx6
  233. Espressif ESP32 implementation of the LX6 DPU:
  234. arch/xtensa/include/esp32 and arch/xtensa/xtensa/esp32
  235. arch/z16 - ZiLOG 16-bit processors
  236. This directory holds related, 16-bit architectures from ZiLOG. At
  237. present, this includes the following subdirectories:
  238. Architecture Support
  239. arch/z16/include and arch/z16/src/common
  240. MCU support
  241. arch/z16/include/z16f and arch/z16/src/z16f
  242. arch/z80 - ZiLOG 8-bit microcontrollers
  243. This directory holds related, 8-bit architectures from ZiLOG. At
  244. present, this includes the following subdirectories:
  245. Architecture Support
  246. arch/z80/include and arch/z80/src/common
  247. MCU support
  248. arch/z80/include/ez80 and arch/z80/src/ez80
  249. arch/z80/include/z80 and arch/z80/src/z180
  250. arch/z80/include/z8 and arch/z80/src/z8
  251. arch/z80/include/z80 and arch/z80/src/z80