sama5d3xek.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. /*
  2. * Configuation settings for the SAMA5D3xEK board.
  3. *
  4. * Copyright (C) 2012 - 2013 Atmel
  5. *
  6. * based on at91sam9m10g45ek.h by:
  7. * Stelian Pop <stelian@popies.net>
  8. * Lead Tech Design <www.leadtechdesign.com>
  9. *
  10. * See file CREDITS for list of people who contributed to this
  11. * project.
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License as
  15. * published by the Free Software Foundation; either version 2 of
  16. * the License, or (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  26. * MA 02111-1307 USA
  27. */
  28. #ifndef __CONFIG_H
  29. #define __CONFIG_H
  30. #include <asm/hardware.h>
  31. #define CONFIG_SYS_TEXT_BASE 0x26f00000
  32. /* ARM asynchronous clock */
  33. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768
  34. #define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */
  35. #define CONFIG_SYS_HZ 1000
  36. #define CONFIG_AT91FAMILY
  37. #define CONFIG_ARCH_CPU_INIT
  38. #define CONFIG_SKIP_LOWLEVEL_INIT
  39. #define CONFIG_BOARD_EARLY_INIT_F
  40. #define CONFIG_DISPLAY_CPUINFO
  41. #define CONFIG_CMD_BOOTZ
  42. #define CONFIG_OF_LIBFDT /* Device Tree support */
  43. /* general purpose I/O */
  44. #define CONFIG_AT91_GPIO
  45. /* serial console */
  46. #define CONFIG_ATMEL_USART
  47. #define CONFIG_USART_BASE ATMEL_BASE_DBGU
  48. #define CONFIG_USART_ID ATMEL_ID_DBGU
  49. /*
  50. * This needs to be defined for the OHCI code to work but it is defined as
  51. * ATMEL_ID_UHPHS in the CPU specific header files.
  52. */
  53. #define ATMEL_ID_UHP ATMEL_ID_UHPHS
  54. /*
  55. * Specify the clock enable bit in the PMC_SCER register.
  56. */
  57. #define ATMEL_PMC_UHP AT91SAM926x_PMC_UHP
  58. /* LCD */
  59. #define CONFIG_LCD
  60. #define LCD_BPP LCD_COLOR16
  61. #define LCD_OUTPUT_BPP 24
  62. #define CONFIG_LCD_LOGO
  63. #undef LCD_TEST_PATTERN
  64. #define CONFIG_LCD_INFO
  65. #define CONFIG_LCD_INFO_BELOW_LOGO
  66. #define CONFIG_SYS_WHITE_ON_BLACK
  67. #define CONFIG_ATMEL_HLCD
  68. #define CONFIG_ATMEL_LCD_RGB565
  69. #define CONFIG_SYS_CONSOLE_IS_IN_ENV
  70. /* board specific (not enough SRAM) */
  71. #define CONFIG_SAMA5D3_LCD_BASE 0x23E00000
  72. #define CONFIG_BOOTDELAY 3
  73. /*
  74. * BOOTP options
  75. */
  76. #define CONFIG_BOOTP_BOOTFILESIZE
  77. #define CONFIG_BOOTP_BOOTPATH
  78. #define CONFIG_BOOTP_GATEWAY
  79. #define CONFIG_BOOTP_HOSTNAME
  80. /* No NOR flash */
  81. #define CONFIG_SYS_NO_FLASH
  82. /*
  83. * Command line configuration.
  84. */
  85. #include <config_cmd_default.h>
  86. #undef CONFIG_CMD_FPGA
  87. #undef CONFIG_CMD_IMI
  88. #undef CONFIG_CMD_LOADS
  89. #define CONFIG_CMD_PING
  90. #define CONFIG_CMD_DHCP
  91. /* SDRAM */
  92. #define CONFIG_NR_DRAM_BANKS 1
  93. #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
  94. #define CONFIG_SYS_SDRAM_SIZE 0x20000000
  95. #define CONFIG_SYS_INIT_SP_ADDR \
  96. (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
  97. /* SerialFlash */
  98. #define CONFIG_CMD_SF
  99. #ifdef CONFIG_CMD_SF
  100. #define CONFIG_ATMEL_SPI
  101. #define CONFIG_SPI_FLASH
  102. #define CONFIG_SPI_FLASH_ATMEL
  103. #define CONFIG_SF_DEFAULT_SPEED 30000000
  104. #endif
  105. /* NAND flash */
  106. #define CONFIG_CMD_NAND
  107. #ifdef CONFIG_CMD_NAND
  108. #define CONFIG_NAND_MAX_CHIPS 1
  109. #define CONFIG_NAND_ATMEL
  110. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  111. #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3
  112. /* our ALE is AD21 */
  113. #define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
  114. /* our CLE is AD22 */
  115. #define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
  116. #define CONFIG_SYS_NAND_ONFI_DETECTION
  117. /* PMECC & PMERRLOC */
  118. #define CONFIG_ATMEL_NAND_HWECC
  119. #define CONFIG_ATMEL_NAND_HW_PMECC
  120. #define CONFIG_PMECC_CAP 4
  121. #define CONFIG_PMECC_SECTOR_SIZE 512
  122. #define CONFIG_PMECC_INDEX_TABLE_OFFSET ATMEL_PMECC_INDEX_OFFSET_512
  123. #define CONFIG_CMD_NAND_TRIMFFS
  124. #endif
  125. /* Ethernet Hardware */
  126. #define CONFIG_MACB
  127. #define CONFIG_RMII
  128. #define CONFIG_NET_MULTI
  129. #define CONFIG_NET_RETRY_COUNT 20
  130. #define CONFIG_MACB_SEARCH_PHY
  131. /* MMC */
  132. #define CONFIG_CMD_MMC
  133. #ifdef CONFIG_CMD_MMC
  134. #define CONFIG_MMC
  135. #define CONFIG_GENERIC_MMC
  136. #define CONFIG_GENERIC_ATMEL_MCI
  137. #define ATMEL_BASE_MMCI ATMEL_BASE_MCI0
  138. #endif
  139. /* USB */
  140. #define CONFIG_CMD_USB
  141. #ifdef CONFIG_CMD_USB
  142. #define CONFIG_USB_ATMEL
  143. #define CONFIG_USB_OHCI_NEW
  144. #define CONFIG_SYS_USB_OHCI_CPU_INIT
  145. #define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_BASE_OHCI
  146. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "sama5d3"
  147. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 3
  148. #define CONFIG_DOS_PARTITION
  149. #define CONFIG_USB_STORAGE
  150. #endif
  151. #if defined(CONFIG_CMD_USB) || defined(CONFIG_CMD_MMC)
  152. #define CONFIG_CMD_FAT
  153. #endif
  154. #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
  155. #ifdef CONFIG_SYS_USE_SERIALFLASH
  156. /* bootstrap + u-boot + env + linux in serial 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_BOOTCOMMAND "sf probe 0; " \
  162. "sf read 0x22000000 0x42000 0x300000; " \
  163. "bootm 0x22000000"
  164. #elif CONFIG_SYS_USE_NANDFLASH
  165. /* bootstrap + u-boot + env in nandflash */
  166. #define CONFIG_ENV_IS_IN_NAND
  167. #define CONFIG_ENV_OFFSET 0xc0000
  168. #define CONFIG_ENV_OFFSET_REDUND 0x100000
  169. #define CONFIG_ENV_SIZE 0x20000
  170. #define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
  171. "nand read 0x22000000 0x200000 0x600000;" \
  172. "bootm 0x22000000 - 0x21000000"
  173. #elif CONFIG_SYS_USE_MMC
  174. /* bootstrap + u-boot + env in sd card */
  175. #define CONFIG_ENV_IS_IN_MMC
  176. #define CONFIG_ENV_OFFSET 0x2000
  177. #define CONFIG_ENV_SIZE 0x1000
  178. #define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 dtb; " \
  179. "fatload mmc 0:1 0x22000000 uImage; " \
  180. "bootm 0x22000000 - 0x21000000"
  181. #define CONFIG_SYS_MMC_ENV_DEV 0
  182. #else
  183. #define CONIG_ENV_IS_NOWHERE
  184. #endif
  185. #ifdef CONFIG_SYS_USE_MMC
  186. #define CONFIG_BOOTARGS \
  187. "console=ttyS0,115200 earlyprintk " \
  188. "root=/dev/mmcblk0p2 rw 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(evn_redundent),256k(spare)," \
  194. "512k(dtb),6M(kernel)ro,-(rootfs) " \
  195. "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs"
  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 + \
  202. sizeof(CONFIG_SYS_PROMPT) + 16)
  203. #define CONFIG_SYS_LONGHELP
  204. #define CONFIG_CMDLINE_EDITING
  205. #define CONFIG_AUTO_COMPLETE
  206. #define CONFIG_SYS_HUSH_PARSER
  207. /* Size of malloc() pool */
  208. #define CONFIG_SYS_MALLOC_LEN (1024 * 1024)
  209. #endif