mcf5225x.nut 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. mcf5225x_i2c0_scl_pins = { "PAS0", "PQS2" }
  2. mcf5225x_i2c0_sda_pins = { "PAS1", "PQS3" }
  3. mcf5225x_i2c0_scl_pins_descr = "Choose I2C 0 SCL pin:\n\tPAS0 (I2C_SCL0)\n\tPQS2 (QSPI_CLK)"
  4. mcf5225x_i2c0_sda_pins_descr = "Choose I2C 0 SDA pin:\n\tPAS1 (I2C_SDA0)\n\tPQS3 (QSPI_CS0)"
  5. mcf5225x_i2c1_scl_pins = { "PQS0", "PUB0", "PUC3", "PTH3" }
  6. mcf5225x_i2c1_sda_pins = { "PQS1", "PUB1", "PUC2", "PTH2" }
  7. mcf5225x_i2c1_scl_pins_descr = "Choose I2C 1 SCL pin:\n\tPQS0 (QSPI_DOUT)\n\tPUB0 (UTXD1)\n\tPUC3 (UCTS2)\n\tPTH3 (FB_D5)"
  8. mcf5225x_i2c1_sda_pins_descr = "Choose I2C 1 SDL pin:\n\tPQS1 (QSPI_IN) \n\tPUB1 (URXD1)\n\tPUC2 (URTS2)\n\tPTH2 (FB_D4)"
  9. mcf5225x_uart0_txd_pins = { "PUA0" }
  10. mcf5225x_uart0_rxd_pins = { "PUA1" }
  11. mcf5225x_uart0_rts_pins = { "PUA2" }
  12. mcf5225x_uart0_cts_pins = { "PUA3" }
  13. mcf5225x_uart0_txd_pins_descr = "Choose UART0 TXD Pin:\n\tPUA0 (UTXD0)"
  14. mcf5225x_uart0_rxd_pins_descr = "Choose UART0 RXD Pin:\n\tPUA1 (URXD0)"
  15. mcf5225x_uart0_rts_pins_descr = "Choose UART0 RTS Pin:\n\tPUA2 (URTS0)"
  16. mcf5225x_uart0_cts_pins_descr = "Choose UART0 CTS Pin:\n\tPUA3 (UCTS0)"
  17. mcf5225x_uart1_txd_pins = { "PUB0", "PQS0" }
  18. mcf5225x_uart1_rxd_pins = { "PUB1", "PQS1" }
  19. mcf5225x_uart1_rts_pins = { "PUB2", "PQS2" }
  20. mcf5225x_uart1_cts_pins = { "PUB3", "PQS3" }
  21. mcf5225x_uart1_txd_pins_descr = "Choose UART1 TXD Pin:\n\tPUB0 (UTXD1)\n\tPQS0 (QSPI_DOUT)"
  22. mcf5225x_uart1_rxd_pins_descr = "Choose UART1 RXD Pin:\n\tPUB1 (URXD1)\n\tPQS1 (QSPI_DIN)"
  23. mcf5225x_uart1_rts_pins_descr = "Choose UART1 RTS Pin:\n\tPUB2 (URTS1)\n\tPQS2 (QSPI_CLK)"
  24. mcf5225x_uart1_cts_pins_descr = "Choose UART1 CTS Pin:\n\tPUB3 (UCTS1)\n\tPQS3 (QSPI_CS0)"
  25. mcf5225x_uart2_txd_pins = { "PUC0", "PUB2", "PAS0" }
  26. mcf5225x_uart2_rxd_pins = { "PUC1", "PUB3", "PAS1" }
  27. mcf5225x_uart2_rts_pins = { "PUC2" }
  28. mcf5225x_uart2_cts_pins = { "PUC3" }
  29. mcf5225x_uart2_txd_pins_descr = "Choose UART2 TXD Pin:\n\tPUC0 (UTXD2)\n\tPUB2 (URTS1)\n\tPAS0 (I2C_SCL0)"
  30. mcf5225x_uart2_rxd_pins_descr = "Choose UART2 RXD Pin:\n\tPUC1 (URXD2)\n\tPUB3 (UCTS1)\n\tPAS1 (I2C_SDA0)"
  31. mcf5225x_uart2_rts_pins_descr = "Choose UART2 RTS Pin:\n\tPUC2 (URTS2)"
  32. mcf5225x_uart2_cts_pins_descr = "Choose UART2 CTS Pin:\n\tPUC3 (UCTS2)"
  33. nutarch_m68k_coldfire_mcf5225x =
  34. {
  35. --
  36. -- MCU Family
  37. --
  38. {
  39. name = "nutarch_m68k_coldfire_mcf5225x_family",
  40. brief = "Family",
  41. provides = {
  42. "HW_GPIO_COLDFIRE",
  43. "HW_UART_COLDFIRE",
  44. "HW_PIT_COLDFIRE",
  45. "HW_CWD_COLDFIRE",
  46. "HW_I2C_COLDFIRE",
  47. },
  48. options =
  49. {
  50. {
  51. macro = "MCU_MCF5225X",
  52. brief = "MCF5225X",
  53. description = "MCF5225X Coldfire Family",
  54. type = "integer",
  55. default = 1,
  56. file = "include/cfg/arch.h"
  57. },
  58. {
  59. macro = "PIT0",
  60. type = "integer",
  61. default = 1,
  62. provides = { "HW_PIT0" },
  63. file = "include/cfg/peripherals.h"
  64. },
  65. {
  66. macro = "PIT1",
  67. type = "integer",
  68. default = 1,
  69. provides = { "HW_PIT1" },
  70. file = "include/cfg/peripherals.h"
  71. },
  72. {
  73. macro = "UART0",
  74. type = "integer",
  75. default = 1,
  76. provides = { "HW_UART0" },
  77. file = "include/cfg/peripherals.h"
  78. },
  79. {
  80. macro = "UART1",
  81. type = "integer",
  82. default = 1,
  83. provides = { "HW_UART1" },
  84. file = "include/cfg/peripherals.h"
  85. },
  86. {
  87. macro = "UART2",
  88. type = "integer",
  89. default = 1,
  90. provides = { "HW_UART2" },
  91. file = "include/cfg/peripherals.h"
  92. },
  93. {
  94. macro = "I2C0",
  95. type = "integer",
  96. default = 1,
  97. provides = { "HW_I2C0" },
  98. file = "include/cfg/peripherals.h"
  99. },
  100. {
  101. macro = "I2C1",
  102. type = "integer",
  103. default = 1,
  104. provides = { "HW_I2C1" },
  105. file = "include/cfg/peripherals.h"
  106. },
  107. }
  108. },
  109. --
  110. -- Runtime Initialization
  111. --
  112. {
  113. name = "nutarch_m68k_coldfire_mcf5225x_init",
  114. brief = "Initialization",
  115. description = "System startup code for MCF5225X family MCUs:\n"..
  116. " - Vector table\n"..
  117. " - Memories\n"..
  118. " - MCU\n"..
  119. " - Peripherals",
  120. sources = {
  121. -- "m68k/coldfire/init/crt_common.S",
  122. -- "m68k/coldfire/init/crt_$(LDNAME).S",
  123. -- "m68k/coldfire/init/crt_mcf5225x.S",
  124. "m68k/coldfire/init/crt_common_c.c",
  125. "m68k/coldfire/init/crt_mcf5225x_c.c",
  126. },
  127. targets = {
  128. -- "m68k/coldfire/init/crt_common.o",
  129. -- "m68k/coldfire/init/crt_mcf5225x.o",
  130. -- "m68k/coldfire/init/crt_$(LDNAME).o",
  131. },
  132. requires = { "TOOL_CC_M68K", "TOOL_GCC"},
  133. },
  134. --
  135. -- Runtime Initialization 2
  136. -- FIXME: Initialization code is in two groups due to problems with Configurator.
  137. -- If "targets" are used together with more than one .c sources, then
  138. -- the configurator crashes when building.
  139. --
  140. {
  141. name = "nutarch_m68k_coldfire_mcf5225x_init2",
  142. brief = "Initialization",
  143. description = "System startup code for MCF5225X family MCUs:\n"..
  144. " - Vector table\n"..
  145. " - Memories\n"..
  146. " - MCU\n"..
  147. " - Peripherals",
  148. sources = {
  149. "m68k/coldfire/init/crt_common.S",
  150. "m68k/coldfire/init/crt_$(LDNAME).S",
  151. "m68k/coldfire/init/crt_mcf5225x.S",
  152. },
  153. targets = {
  154. "m68k/coldfire/init/crt_common.o",
  155. "m68k/coldfire/init/crt_$(LDNAME).o",
  156. "m68k/coldfire/init/crt_mcf5225x.o",
  157. },
  158. requires = { "TOOL_CC_M68K", "TOOL_GCC"},
  159. },
  160. --
  161. -- GPIO Interface
  162. --
  163. {
  164. name = "nutarch_m68k_coldfire_mcf5225x_gpio",
  165. brief = "GPIO",
  166. description = "Generic port I/O API.",
  167. requires = { "HW_GPIO_COLDFIRE" },
  168. sources = { "m68k/coldfire/dev/mcf5225x/mcf5225x_gpio.c"}
  169. },
  170. --
  171. -- Interrupt Handler
  172. --
  173. {
  174. name = "nutarch_m68k_coldfire_mcf5225x_ihndlr",
  175. brief = "Interrupt Handler",
  176. description = "Peripheral interrupt handlers for MCF5225X family.",
  177. provides = { "DEV_IRQ_PIT0",
  178. "DEV_IRQ_PIT1",
  179. "DEV_IRQ_CWD",
  180. "DEV_IRQ_I2C0",
  181. "DEV_IRQ_I2C1",
  182. "DEV_IRQ_UART0",
  183. "DEV_IRQ_UART1",
  184. "DEV_IRQ_UART2",
  185. },
  186. sources = { "m68k/coldfire/dev/mcf5225x/ih_mcf5225x_common.c",
  187. "m68k/coldfire/dev/mcf5225x/ih_mcf5225x_pit.c",
  188. "m68k/coldfire/dev/mcf5225x/ih_mcf5225x_cwd.c",
  189. "m68k/coldfire/dev/mcf5225x/ih_mcf5225x_i2c.c",
  190. "m68k/coldfire/dev/mcf5225x/ih_mcf5225x_uart.c" },
  191. },
  192. --
  193. -- System Timer Hardware
  194. --
  195. {
  196. name = "nutarch_m68k_coldfire_mcf5225x_ostimer",
  197. brief = "System Timer",
  198. requires = { "HW_PIT_COLDFIRE", "HW_PIT0", "DEV_IRQ_PIT0" },
  199. provides = { "NUT_OSTIMER_DEV" },
  200. sources = { "m68k/coldfire/dev/mcf5225x/mcf5225x_ostimer.c" },
  201. },
  202. --
  203. -- Reset Controller
  204. --
  205. {
  206. name = "nutarch_m68k_coldfire_mcf5225x_reset",
  207. brief = "Reset Controller",
  208. sources = { "m68k/coldfire/dev/mcf5225x/mcf5225x_reset.c" },
  209. },
  210. --
  211. -- Core Watchdog
  212. --
  213. {
  214. name = "nutarch_m68k_coldfire_mcf5225x_cwd",
  215. brief = "Core Watchdog",
  216. requires = {"HW_CWD_COLDFIRE", "DEV_IRQ_CWD" },
  217. sources = { "m68k/coldfire/dev/mcf5225x/mcf5225x_cwd.c" }
  218. },
  219. }