at91sam9x5ek.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. /*
  2. * Copyright (C) 2012 Atmel Corporation
  3. *
  4. * Configuation settings for the AT91SAM9X5EK board.
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #ifndef __CONFIG_H__
  9. #define __CONFIG_H__
  10. #include <asm/hardware.h>
  11. #define CONFIG_SYS_TEXT_BASE 0x26f00000
  12. /* ARM asynchronous clock */
  13. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768
  14. #define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* 12 MHz crystal */
  15. #define CONFIG_SYS_HZ 1000
  16. #define CONFIG_AT91SAM9X5EK
  17. #define CONFIG_AT91FAMILY
  18. #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
  19. #define CONFIG_SETUP_MEMORY_TAGS
  20. #define CONFIG_INITRD_TAG
  21. #define CONFIG_SKIP_LOWLEVEL_INIT
  22. #define CONFIG_BOARD_EARLY_INIT_F
  23. #define CONFIG_DISPLAY_CPUINFO
  24. #define CONFIG_CMD_BOOTZ
  25. #define CONFIG_OF_LIBFDT
  26. /* general purpose I/O */
  27. #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */
  28. #define CONFIG_AT91_GPIO
  29. /* serial console */
  30. #define CONFIG_ATMEL_USART
  31. #define CONFIG_USART_BASE ATMEL_BASE_DBGU
  32. #define CONFIG_USART_ID ATMEL_ID_SYS
  33. /* LCD */
  34. #define CONFIG_LCD
  35. #define LCD_BPP LCD_COLOR16
  36. #define LCD_OUTPUT_BPP 24
  37. #define CONFIG_LCD_LOGO
  38. #undef LCD_TEST_PATTERN
  39. #define CONFIG_LCD_INFO
  40. #define CONFIG_LCD_INFO_BELOW_LOGO
  41. #define CONFIG_SYS_WHITE_ON_BLACK
  42. #define CONFIG_ATMEL_HLCD
  43. #define CONFIG_ATMEL_LCD_RGB565
  44. #define CONFIG_SYS_CONSOLE_IS_IN_ENV
  45. #define CONFIG_BOOTDELAY 3
  46. /*
  47. * BOOTP options
  48. */
  49. #define CONFIG_BOOTP_BOOTFILESIZE
  50. #define CONFIG_BOOTP_BOOTPATH
  51. #define CONFIG_BOOTP_GATEWAY
  52. #define CONFIG_BOOTP_HOSTNAME
  53. /*
  54. * Command line configuration.
  55. */
  56. #include <config_cmd_default.h>
  57. #undef CONFIG_CMD_FPGA
  58. #undef CONFIG_CMD_IMI
  59. #undef CONFIG_CMD_IMLS
  60. #undef CONFIG_CMD_LOADS
  61. #define CONFIG_CMD_PING
  62. #define CONFIG_CMD_DHCP
  63. #define CONFIG_CMD_NAND
  64. #define CONFIG_CMD_SF
  65. #define CONFIG_CMD_MMC
  66. #define CONFIG_CMD_FAT
  67. #define CONFIG_CMD_USB
  68. /*
  69. * define CONFIG_USB_EHCI to enable USB Hi-Speed (aka 2.0)
  70. * NB: in this case, USB 1.1 devices won't be recognized.
  71. */
  72. /* SDRAM */
  73. #define CONFIG_NR_DRAM_BANKS 1
  74. #define CONFIG_SYS_SDRAM_BASE 0x20000000
  75. #define CONFIG_SYS_SDRAM_SIZE 0x08000000 /* 128 megs */
  76. #define CONFIG_SYS_INIT_SP_ADDR \
  77. (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
  78. /* DataFlash */
  79. #ifdef CONFIG_CMD_SF
  80. #define CONFIG_ATMEL_SPI
  81. #define CONFIG_SPI_FLASH
  82. #define CONFIG_SPI_FLASH_ATMEL
  83. #define CONFIG_SF_DEFAULT_SPEED 30000000
  84. #endif
  85. /* no NOR flash */
  86. #define CONFIG_SYS_NO_FLASH
  87. /* NAND flash */
  88. #ifdef CONFIG_CMD_NAND
  89. #define CONFIG_NAND_ATMEL
  90. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  91. #define CONFIG_SYS_NAND_BASE 0x40000000
  92. #define CONFIG_SYS_NAND_DBW_8 1
  93. /* our ALE is AD21 */
  94. #define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
  95. /* our CLE is AD22 */
  96. #define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
  97. #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PD4
  98. #define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PD5
  99. /* PMECC & PMERRLOC */
  100. #define CONFIG_ATMEL_NAND_HWECC 1
  101. #define CONFIG_ATMEL_NAND_HW_PMECC 1
  102. #define CONFIG_PMECC_CAP 2
  103. #define CONFIG_PMECC_SECTOR_SIZE 512
  104. #define CONFIG_CMD_NAND_TRIMFFS
  105. #define CONFIG_MTD_DEVICE
  106. #define CONFIG_CMD_MTDPARTS
  107. #define CONFIG_MTD_PARTITIONS
  108. #define CONFIG_RBTREE
  109. #define CONFIG_LZO
  110. #define CONFIG_CMD_UBI
  111. #define CONFIG_CMD_UBIFS
  112. #endif
  113. /* MMC */
  114. #ifdef CONFIG_CMD_MMC
  115. #define CONFIG_MMC
  116. #define CONFIG_GENERIC_MMC
  117. #define CONFIG_GENERIC_ATMEL_MCI
  118. #endif
  119. /* FAT */
  120. #ifdef CONFIG_CMD_FAT
  121. #define CONFIG_DOS_PARTITION
  122. #endif
  123. /* Ethernet */
  124. #define CONFIG_MACB
  125. #define CONFIG_RMII
  126. #define CONFIG_NET_RETRY_COUNT 20
  127. #define CONFIG_MACB_SEARCH_PHY
  128. /* USB */
  129. #ifdef CONFIG_CMD_USB
  130. #ifdef CONFIG_USB_EHCI
  131. #define CONFIG_USB_EHCI_ATMEL
  132. #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2
  133. #else
  134. #define CONFIG_USB_OHCI_NEW
  135. #define CONFIG_SYS_USB_OHCI_CPU_INIT
  136. #define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_BASE_OHCI
  137. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9x5"
  138. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 3
  139. #endif
  140. #define CONFIG_USB_ATMEL
  141. #define CONFIG_USB_STORAGE
  142. #endif
  143. #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
  144. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  145. #define CONFIG_SYS_MEMTEST_END 0x26e00000
  146. #ifdef CONFIG_SYS_USE_NANDFLASH
  147. /* bootstrap + u-boot + env + linux in nandflash */
  148. #define CONFIG_ENV_IS_IN_NAND
  149. #define CONFIG_ENV_OFFSET 0xc0000
  150. #define CONFIG_ENV_OFFSET_REDUND 0x100000
  151. #define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
  152. #define CONFIG_BOOTCOMMAND "nand read " \
  153. "0x22000000 0x200000 0x300000; " \
  154. "bootm 0x22000000"
  155. #elif defined(CONFIG_SYS_USE_SPIFLASH)
  156. /* bootstrap + u-boot + env + linux in spi flash */
  157. #define CONFIG_ENV_IS_IN_SPI_FLASH
  158. #define CONFIG_ENV_OFFSET 0x5000
  159. #define CONFIG_ENV_SIZE 0x3000
  160. #define CONFIG_ENV_SECT_SIZE 0x1000
  161. #define CONFIG_ENV_SPI_MAX_HZ 30000000
  162. #define CONFIG_BOOTCOMMAND "sf probe 0; " \
  163. "sf read 0x22000000 0x100000 0x300000; " \
  164. "bootm 0x22000000"
  165. #elif defined(CONFIG_SYS_USE_DATAFLASH)
  166. /* bootstrap + u-boot + env + linux in data flash */
  167. #define CONFIG_ENV_IS_IN_SPI_FLASH
  168. #define CONFIG_ENV_OFFSET 0x4200
  169. #define CONFIG_ENV_SIZE 0x4200
  170. #define CONFIG_ENV_SECT_SIZE 0x210
  171. #define CONFIG_ENV_SPI_MAX_HZ 30000000
  172. #define CONFIG_BOOTCOMMAND "sf probe 0; " \
  173. "sf read 0x22000000 0x84000 0x294000; " \
  174. "bootm 0x22000000"
  175. #else /* CONFIG_SYS_USE_MMC */
  176. /* bootstrap + u-boot + env + linux in mmc */
  177. #define CONFIG_ENV_IS_IN_MMC
  178. /* For FAT system, most cases it should be in the reserved sector */
  179. #define CONFIG_ENV_OFFSET 0x2000
  180. #define CONFIG_ENV_SIZE 0x1000
  181. #define CONFIG_SYS_MMC_ENV_DEV 0
  182. #endif
  183. #ifdef CONFIG_SYS_USE_MMC
  184. #define CONFIG_BOOTARGS "mem=128M console=ttyS0,115200 " \
  185. "mtdparts=atmel_nand:" \
  186. "8M(bootstrap/uboot/kernel)ro,-(rootfs) " \
  187. "root=/dev/mmcblk0p2 " \
  188. "rw rootfstype=ext4 rootwait"
  189. #else
  190. #define CONFIG_BOOTARGS \
  191. "console=ttyS0,115200 earlyprintk " \
  192. "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \
  193. "256k(env),256k(env_redundant),256k(spare)," \
  194. "512k(dtb),6M(kernel)ro,-(rootfs) " \
  195. "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs rw"
  196. #endif
  197. #define CONFIG_BAUDRATE 115200
  198. #define CONFIG_SYS_PROMPT "U-Boot> "
  199. #define CONFIG_SYS_CBSIZE 256
  200. #define CONFIG_SYS_MAXARGS 16
  201. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) \
  202. + 16)
  203. #define CONFIG_SYS_LONGHELP
  204. #define CONFIG_CMDLINE_EDITING
  205. #define CONFIG_AUTO_COMPLETE
  206. #define CONFIG_SYS_HUSH_PARSER
  207. /*
  208. * Size of malloc() pool
  209. */
  210. #define CONFIG_SYS_MALLOC_LEN (512 * 1024 + 0x1000)
  211. #ifdef CONFIG_USE_IRQ
  212. #error CONFIG_USE_IRQ not supported
  213. #endif
  214. #endif