arch.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. #ifndef _CFG_ARCH_H_
  2. #define _CFG_ARCH_H_
  3. /*
  4. * Copyright (C) 2004-2006 by egnite Software GmbH. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  23. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. *
  34. */
  35. /*!
  36. * $Log$
  37. * Revision 1.8 2008/10/23 08:55:46 haraldkipp
  38. * Now determines MCU family.
  39. * Added Ethernut 5 settings.
  40. *
  41. * Revision 1.7 2008/08/11 11:51:20 thiagocorrea
  42. * Preliminary Atmega2560 compile options, but not yet supported.
  43. * It builds, but doesn't seam to run properly at this time.
  44. *
  45. * Revision 1.6 2008/02/15 17:00:24 haraldkipp
  46. * Spport for AT91SAM7SE512 added.
  47. *
  48. * Revision 1.5 2007/10/04 20:31:00 olereinhardt
  49. * Support for SAM7S256 added
  50. *
  51. * Revision 1.4 2007/07/17 18:07:44 haraldkipp
  52. * Building in the source tree should work again for AT91 devices.
  53. *
  54. * Revision 1.3 2007/04/12 09:21:10 haraldkipp
  55. * Added ATmega2561 definitions for Ethernut 1 and 2.
  56. *
  57. * Revision 1.2 2006/05/25 09:22:47 haraldkipp
  58. * The PLATFORM definition broke source tree building.
  59. * Fixed for Ethernut Boards.
  60. *
  61. * Revision 1.1 2004/09/19 12:31:52 haraldkipp
  62. * Configuration placeholders added
  63. *
  64. */
  65. /*
  66. * This file is reserved to specify architecture dependant
  67. * configuration and is currently used as a placeholder
  68. * when not using the Configurator.
  69. */
  70. /*
  71. ** Determine board defaults.
  72. **/
  73. #if defined(ETHERNUT1)
  74. #ifndef PLATFORM
  75. #define PLATFORM ETHERNUT1
  76. #endif
  77. #ifndef AVR_GCC
  78. #define AVR_GCC
  79. #endif
  80. #if !defined(MCU_ATMEGA128) && !defined(MCU_ATMEGA2560) && !defined(MCU_ATMEGA2561)
  81. #if defined(__AVR_ATmega2561__) || defined(ATMega2561)
  82. #define MCU_ATMEGA2561
  83. #elif defined(__AVR_ATmega2561__) || defined(ATMega2561)
  84. #define MCU_ATMEGA2560
  85. #else
  86. #define MCU_ATMEGA128
  87. #endif
  88. #endif
  89. #elif defined(ETHERNUT2)
  90. #ifndef PLATFORM
  91. #define PLATFORM ETHERNUT2
  92. #endif
  93. #ifndef AVR_GCC
  94. #define AVR_GCC
  95. #endif
  96. #if !defined(MCU_ATMEGA128) && !defined(MCU_ATMEGA2560) && !defined(MCU_ATMEGA2561)
  97. #if defined(__AVR_ATmega2561__) || defined(ATMega2561)
  98. #define MCU_ATMEGA2561
  99. #elif defined(__AVR_ATmega2561__) || defined(ATMega2561)
  100. #define MCU_ATMEGA2560
  101. #else
  102. #define MCU_ATMEGA128
  103. #endif
  104. #endif
  105. #elif defined(ETHERNUT3)
  106. #ifndef PLATFORM
  107. #define PLATFORM ETHERNUT3
  108. #endif
  109. #ifndef ARM_GCC
  110. #define ARM_GCC
  111. #endif
  112. #ifndef MCU_AT91R40008
  113. #define MCU_AT91R40008
  114. #endif
  115. #elif defined(ETHERNUT5)
  116. #ifndef PLATFORM
  117. #define PLATFORM ETHERNUT5
  118. #endif
  119. #ifndef ARM_GCC
  120. #define ARM_GCC
  121. #endif
  122. #ifndef MCU_AT91SAM9XE512
  123. #define MCU_AT91SAM9XE512
  124. #endif
  125. #elif defined(AT91SAM7X_EK)
  126. #ifndef PLATFORM
  127. #define PLATFORM AT91SAM7X_EK
  128. #endif
  129. #ifndef ARM_GCC
  130. #define ARM_GCC
  131. #endif
  132. #ifndef MCU_AT91SAM7X256
  133. #define MCU_AT91SAM7X256
  134. #endif
  135. #elif defined(AT91SAM7S)
  136. #ifndef PLATFORM
  137. #define PLATFORM AT91SAM7S
  138. #endif
  139. #ifndef ARM_GCC
  140. #define ARM_GCC
  141. #endif
  142. #ifndef MCU_AT91SAM7S256
  143. #define MCU_AT91SAM7S256
  144. #endif
  145. #elif defined(AT91SAM7SE_EK)
  146. #ifndef PLATFORM
  147. #define PLATFORM AT91SAM7SE_EK
  148. #endif
  149. #ifndef ARM_GCC
  150. #define ARM_GCC
  151. #endif
  152. #ifndef MCU_AT91SAM7SE512
  153. #define MCU_AT91SAM7SE512
  154. #endif
  155. #elif defined(ELEKTOR_IR1)
  156. #ifndef PLATFORM
  157. #define PLATFORM ELEKTOR_IR1
  158. #endif
  159. #ifndef ARM_GCC
  160. #define ARM_GCC
  161. #endif
  162. #ifndef MCU_AT91SAM7SE512
  163. #define MCU_AT91SAM7SE512
  164. #endif
  165. #elif defined(AT91SAM9260_EK)
  166. #ifndef PLATFORM
  167. #define PLATFORM AT91SAM9260_EK
  168. #endif
  169. #ifndef ARM_GCC
  170. #define ARM_GCC
  171. #endif
  172. #ifndef MCU_AT91SAM9260
  173. #define MCU_AT91SAM9260
  174. #endif
  175. #elif defined(AT91SAM9G45_EK)
  176. #ifndef PLATFORM
  177. #define PLATFORM AT91SAM9G45_EK
  178. #endif
  179. #ifndef ARM_GCC
  180. #define ARM_GCC
  181. #endif
  182. #ifndef MCU_AT91SAM9G45
  183. #define MCU_AT91SAM9G45
  184. #endif
  185. #elif defined(STM3210E_EVAL)
  186. #ifndef PLATFORM
  187. #define PLATFORM STM3210E_EVAL
  188. #endif
  189. #ifndef CM3_GCC
  190. #define CM3_GCC
  191. #endif
  192. #ifndef MCU_STM32F103
  193. #define MCU_STM32F103 512
  194. #endif
  195. #elif defined(STM3210C_EVAL)
  196. #ifndef PLATFORM
  197. #define PLATFORM STM3210C_EVAL
  198. #endif
  199. #ifndef CM3_GCC
  200. #define CM3_GCC
  201. #endif
  202. #ifndef MCU_STM32F107
  203. #define MCU_STM32F107 256
  204. #endif
  205. #endif /* Board */
  206. /*
  207. ** Determine Atmel MCU family.
  208. **/
  209. #if defined(MCU_AT91SAM7S16) || defined(MCU_AT91SAM7S32) || defined(MCU_AT91SAM7S64) \
  210. || defined(MCU_AT91SAM7S128) || defined(MCU_AT91SAM7S256) || defined(MCU_AT91SAM7S512)
  211. #ifndef MCU_AT91SAM7S
  212. #define MCU_AT91SAM7S
  213. #endif
  214. #endif
  215. #if defined(MCU_AT91SAM7SE32) || defined(MCU_AT91SAM7SE256) || defined(MCU_AT91SAM7SE512)
  216. #ifndef MCU_AT91SAM7SE
  217. #define MCU_AT91SAM7SE
  218. #endif
  219. #endif
  220. #if defined(MCU_AT91SAM7X128) || defined(MCU_AT91SAM7X256) || defined(MCU_AT91SAM7X512)
  221. #ifndef MCU_AT91SAM7X
  222. #define MCU_AT91SAM7X
  223. #endif
  224. #endif
  225. #if defined(MCU_AT91SAM9XE128) || defined(MCU_AT91SAM9XE256) || defined(MCU_AT91SAM9XE512)
  226. #ifndef MCU_AT91SAM9XE
  227. #define MCU_AT91SAM9XE
  228. #endif
  229. #endif
  230. #if defined(MCU_AT91SAM7S) || defined(MCU_AT91SAM7SE) || defined(MCU_AT91SAM9XE) || defined(MCU_AT91SAM9G45)
  231. #ifndef MCU_AT91
  232. #define MCU_AT91
  233. #endif
  234. #endif
  235. #if defined(MCU_STM32F100) || defined(MCU_STM32F101)|| defined(MCU_STM32F102) || defined(MCU_STM32F103) || defined(MCU_STM32F105) || defined(MCU_STM32F107)
  236. #ifndef MCU_STM32
  237. #define MCU_STM32
  238. #endif
  239. #ifndef MCU_STM32F10X
  240. #define MCU_STM32F10X
  241. #endif
  242. #endif
  243. #endif