at91sam9260ek.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. /*
  2. * (C) Copyright 2007-2008
  3. * Stelian Pop <stelian@popies.net>
  4. * Lead Tech Design <www.leadtechdesign.com>
  5. *
  6. * Configuation settings for the AT91SAM9260EK & AT91SAM9G20EK boards.
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #ifndef __CONFIG_H
  11. #define __CONFIG_H
  12. /*
  13. * SoC must be defined first, before hardware.h is included.
  14. * In this case SoC is defined in boards.cfg.
  15. */
  16. #include <asm/hardware.h>
  17. /*
  18. * Warning: changing CONFIG_SYS_TEXT_BASE requires
  19. * adapting the initial boot program.
  20. * Since the linker has to swallow that define, we must use a pure
  21. * hex number here!
  22. */
  23. #define CONFIG_SYS_TEXT_BASE 0x21f00000
  24. /* ARM asynchronous clock */
  25. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768 /* slow clock xtal */
  26. #define CONFIG_SYS_AT91_MAIN_CLOCK 18432000 /* main clock xtal */
  27. /* Define actual evaluation board type from used processor type */
  28. #ifdef CONFIG_AT91SAM9G20
  29. # define CONFIG_AT91SAM9G20EK /* It's an Atmel AT91SAM9G20 EK */
  30. #else
  31. # define CONFIG_AT91SAM9260EK /* It's an Atmel AT91SAM9260 EK */
  32. #endif
  33. /* Misc CPU related */
  34. #define CONFIG_ARCH_CPU_INIT
  35. #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
  36. #define CONFIG_SETUP_MEMORY_TAGS
  37. #define CONFIG_INITRD_TAG
  38. #define CONFIG_SKIP_LOWLEVEL_INIT
  39. #define CONFIG_BOARD_EARLY_INIT_F
  40. /* general purpose I/O */
  41. #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */
  42. #define CONFIG_AT91_GPIO
  43. #define CONFIG_AT91_GPIO_PULLUP 1 /* keep pullups on peripheral pins */
  44. /* serial console */
  45. #define CONFIG_ATMEL_USART
  46. #define CONFIG_USART_BASE ATMEL_BASE_DBGU
  47. #define CONFIG_USART_ID ATMEL_ID_SYS
  48. #define CONFIG_BAUDRATE 115200
  49. /* LED */
  50. #define CONFIG_AT91_LED
  51. #define CONFIG_RED_LED AT91_PIN_PA9 /* this is the power led */
  52. #define CONFIG_GREEN_LED AT91_PIN_PA6 /* this is the user led */
  53. /*
  54. * BOOTP options
  55. */
  56. #define CONFIG_BOOTP_BOOTFILESIZE 1
  57. #define CONFIG_BOOTP_BOOTPATH 1
  58. #define CONFIG_BOOTP_GATEWAY 1
  59. #define CONFIG_BOOTP_HOSTNAME 1
  60. /*
  61. * Command line configuration.
  62. */
  63. #define CONFIG_CMD_NAND 1
  64. /*
  65. * SDRAM: 1 bank, min 32, max 128 MB
  66. * Initialized before u-boot gets started.
  67. */
  68. #define CONFIG_NR_DRAM_BANKS 1
  69. #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_CS1
  70. #define CONFIG_SYS_SDRAM_SIZE 0x04000000
  71. /*
  72. * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
  73. * leaving the correct space for initial global data structure above
  74. * that address while providing maximum stack area below.
  75. */
  76. #ifdef CONFIG_AT91SAM9XE
  77. # define CONFIG_SYS_INIT_SP_ADDR \
  78. (ATMEL_BASE_SRAM + 0x1000 - GENERATED_GBL_DATA_SIZE)
  79. #else
  80. # define CONFIG_SYS_INIT_SP_ADDR \
  81. (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
  82. #endif
  83. /*
  84. * The (arm)linux board id set by generic code depending on configured board
  85. * (see boards.cfg for different boards)
  86. */
  87. #ifdef CONFIG_AT91SAM9G20
  88. /* the sam9g20 variants have two different board ids */
  89. # ifdef CONFIG_AT91SAM9G20EK_2MMC
  90. /* we may be setup for the 2MMC variant of at91sam9g20ek */
  91. # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
  92. # else
  93. /* or the normal at91sam9g20ek */
  94. # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
  95. # endif
  96. #else
  97. /* otherwise default to good old at91sam9260ek */
  98. # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK
  99. #endif
  100. #ifndef CONFIG_AT91SAM9G20EK_2MMC
  101. /* DataFlash */
  102. #define CONFIG_ATMEL_DATAFLASH_SPI
  103. #define CONFIG_HAS_DATAFLASH 1
  104. #define CONFIG_SYS_MAX_DATAFLASH_BANKS 2
  105. #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 0xC0000000 /* CS0 */
  106. #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 0xD0000000 /* CS1 */
  107. #define AT91_SPI_CLK 15000000
  108. #else
  109. /* Enable MMC. The MCCK is conflicted with DataFlash */
  110. #endif
  111. #ifdef CONFIG_AT91SAM9G20EK
  112. #define DATAFLASH_TCSS (0x22 << 16)
  113. #else
  114. #define DATAFLASH_TCSS (0x1a << 16)
  115. #endif
  116. #define DATAFLASH_TCHS (0x1 << 24)
  117. /* NAND flash */
  118. #ifdef CONFIG_CMD_NAND
  119. #define CONFIG_NAND_ATMEL
  120. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  121. #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3
  122. #define CONFIG_SYS_NAND_DBW_8
  123. #define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
  124. #define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
  125. #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PC14
  126. #define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PC13
  127. #endif
  128. /* MMC */
  129. #ifdef CONFIG_CMD_MMC
  130. #define CONFIG_GENERIC_MMC
  131. #define CONFIG_GENERIC_ATMEL_MCI
  132. #endif
  133. /* FAT */
  134. #ifdef CONFIG_CMD_FAT
  135. #define CONFIG_DOS_PARTITION
  136. #endif
  137. /* NOR flash - no real flash on this board */
  138. #define CONFIG_SYS_NO_FLASH 1
  139. /* Ethernet */
  140. #define CONFIG_MACB 1
  141. #define CONFIG_RMII 1
  142. #define CONFIG_NET_RETRY_COUNT 20
  143. #define CONFIG_RESET_PHY_R 1
  144. #define CONFIG_AT91_WANTS_COMMON_PHY
  145. /* USB */
  146. #define CONFIG_USB_ATMEL
  147. #define CONFIG_USB_ATMEL_CLK_SEL_PLLB
  148. #define CONFIG_USB_OHCI_NEW 1
  149. #define CONFIG_SYS_USB_OHCI_CPU_INIT 1
  150. #define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000 /* AT91SAM9260_UHP_BASE */
  151. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260"
  152. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
  153. #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
  154. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  155. #define CONFIG_SYS_MEMTEST_END 0x23e00000
  156. #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
  157. /* bootstrap + u-boot + env + linux in dataflash on CS0 */
  158. #define CONFIG_ENV_IS_IN_DATAFLASH 1
  159. #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
  160. #define CONFIG_ENV_OFFSET 0x4200
  161. #define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
  162. #define CONFIG_ENV_SIZE 0x4200
  163. #define CONFIG_BOOTCOMMAND "cp.b 0xC0084000 0x22000000 0x210000; bootm"
  164. #define CONFIG_BOOTARGS "console=ttyS0,115200 " \
  165. "root=/dev/mtdblock0 " \
  166. "mtdparts=atmel_nand:-(root) " \
  167. "rw rootfstype=jffs2"
  168. #elif CONFIG_SYS_USE_DATAFLASH_CS1
  169. /* bootstrap + u-boot + env + linux in dataflash on CS1 */
  170. #define CONFIG_ENV_IS_IN_DATAFLASH 1
  171. #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
  172. #define CONFIG_ENV_OFFSET 0x4200
  173. #define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET)
  174. #define CONFIG_ENV_SIZE 0x4200
  175. #define CONFIG_BOOTCOMMAND "cp.b 0xD0084000 0x22000000 0x210000; bootm"
  176. #define CONFIG_BOOTARGS "console=ttyS0,115200 " \
  177. "root=/dev/mtdblock0 " \
  178. "mtdparts=atmel_nand:-(root) " \
  179. "rw rootfstype=jffs2"
  180. #elif defined(CONFIG_SYS_USE_NANDFLASH)
  181. /* bootstrap + u-boot + env + linux in nandflash */
  182. #define CONFIG_ENV_IS_IN_NAND 1
  183. #define CONFIG_ENV_OFFSET 0xc0000
  184. #define CONFIG_ENV_OFFSET_REDUND 0x100000
  185. #define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
  186. #define CONFIG_BOOTCOMMAND "nand read 0x22000000 0x200000 0x300000; bootm"
  187. #define CONFIG_BOOTARGS \
  188. "console=ttyS0,115200 earlyprintk " \
  189. "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \
  190. "256k(env),256k(env_redundant),256k(spare)," \
  191. "512k(dtb),6M(kernel)ro,-(rootfs) " \
  192. "root=/dev/mtdblock7 rw rootfstype=jffs2"
  193. #else /* CONFIG_SYS_USE_MMC */
  194. /* bootstrap + u-boot + env + linux in mmc */
  195. #define CONFIG_ENV_IS_IN_MMC
  196. /* For FAT system, most cases it should be in the reserved sector */
  197. #define CONFIG_ENV_OFFSET 0x2000
  198. #define CONFIG_ENV_SIZE 0x1000
  199. #define CONFIG_SYS_MMC_ENV_DEV 0
  200. #define CONFIG_BOOTCOMMAND \
  201. "fatload mmc 0:1 0x22000000 uImage; bootm"
  202. #define CONFIG_BOOTARGS \
  203. "console=ttyS0,115200 earlyprintk " \
  204. "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \
  205. "256k(env),256k(env_redundant),256k(spare)," \
  206. "512k(dtb),6M(kernel)ro,-(rootfs) " \
  207. "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait"
  208. #endif
  209. #define CONFIG_SYS_CBSIZE 256
  210. #define CONFIG_SYS_MAXARGS 16
  211. #define CONFIG_SYS_LONGHELP 1
  212. #define CONFIG_CMDLINE_EDITING 1
  213. #define CONFIG_AUTO_COMPLETE
  214. /*
  215. * Size of malloc() pool
  216. */
  217. #define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
  218. #endif