sama5d3_xplained.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /*
  2. * Configuration settings for the SAMA5D3 Xplained board.
  3. *
  4. * Copyright (C) 2014 Atmel Corporation
  5. * Bo Shen <voice.shen@atmel.com>
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __CONFIG_H
  10. #define __CONFIG_H
  11. #include <asm/hardware.h>
  12. #define CONFIG_SYS_TEXT_BASE 0x26f00000
  13. /* ARM asynchronous clock */
  14. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768
  15. #define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */
  16. #define CONFIG_ARCH_CPU_INIT
  17. #ifndef CONFIG_SPL_BUILD
  18. #define CONFIG_SKIP_LOWLEVEL_INIT
  19. #endif
  20. #define CONFIG_BOARD_EARLY_INIT_F
  21. #define CONFIG_DISPLAY_CPUINFO
  22. #define CONFIG_CMD_BOOTZ
  23. #define CONFIG_OF_LIBFDT /* Device Tree support */
  24. #define CONFIG_SYS_GENERIC_BOARD
  25. /* general purpose I/O */
  26. #define CONFIG_AT91_GPIO
  27. /* serial console */
  28. #define CONFIG_ATMEL_USART
  29. #define CONFIG_USART_BASE ATMEL_BASE_DBGU
  30. #define CONFIG_USART_ID ATMEL_ID_DBGU
  31. /*
  32. * This needs to be defined for the OHCI code to work but it is defined as
  33. * ATMEL_ID_UHPHS in the CPU specific header files.
  34. */
  35. #define ATMEL_ID_UHP ATMEL_ID_UHPHS
  36. /*
  37. * Specify the clock enable bit in the PMC_SCER register.
  38. */
  39. #define ATMEL_PMC_UHP AT91SAM926x_PMC_UHP
  40. #define CONFIG_BOOTDELAY 3
  41. /*
  42. * BOOTP options
  43. */
  44. #define CONFIG_BOOTP_BOOTFILESIZE
  45. #define CONFIG_BOOTP_BOOTPATH
  46. #define CONFIG_BOOTP_GATEWAY
  47. #define CONFIG_BOOTP_HOSTNAME
  48. /* No NOR flash */
  49. #define CONFIG_SYS_NO_FLASH
  50. /*
  51. * Command line configuration.
  52. */
  53. #include <config_cmd_default.h>
  54. #undef CONFIG_CMD_FPGA
  55. #undef CONFIG_CMD_IMI
  56. #undef CONFIG_CMD_LOADS
  57. #define CONFIG_CMD_PING
  58. #define CONFIG_CMD_DHCP
  59. /* SDRAM */
  60. #define CONFIG_NR_DRAM_BANKS 1
  61. #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
  62. #define CONFIG_SYS_SDRAM_SIZE 0x10000000
  63. #ifdef CONFIG_SPL_BUILD
  64. #define CONFIG_SYS_INIT_SP_ADDR 0x310000
  65. #else
  66. #define CONFIG_SYS_INIT_SP_ADDR \
  67. (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
  68. #endif
  69. /* NAND flash */
  70. #define CONFIG_CMD_NAND
  71. #ifdef CONFIG_CMD_NAND
  72. #define CONFIG_NAND_ATMEL
  73. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  74. #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3
  75. /* our ALE is AD21 */
  76. #define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
  77. /* our CLE is AD22 */
  78. #define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
  79. #define CONFIG_SYS_NAND_ONFI_DETECTION
  80. /* PMECC & PMERRLOC */
  81. #define CONFIG_ATMEL_NAND_HWECC
  82. #define CONFIG_ATMEL_NAND_HW_PMECC
  83. #define CONFIG_PMECC_CAP 4
  84. #define CONFIG_PMECC_SECTOR_SIZE 512
  85. #define CONFIG_CMD_NAND_TRIMFFS
  86. #define CONFIG_CMD_MTDPARTS
  87. #define CONFIG_MTD_DEVICE
  88. #define CONFIG_MTD_PARTITIONS
  89. #define CONFIG_RBTREE
  90. #define CONFIG_LZO
  91. #define CONFIG_CMD_UBI
  92. #define CONFIG_CMD_UBIFS
  93. #endif
  94. /* Ethernet Hardware */
  95. #define CONFIG_MACB
  96. #define CONFIG_RMII
  97. #define CONFIG_NET_MULTI
  98. #define CONFIG_NET_RETRY_COUNT 20
  99. #define CONFIG_MACB_SEARCH_PHY
  100. #define CONFIG_RGMII
  101. #define CONFIG_CMD_MII
  102. #define CONFIG_PHYLIB
  103. /* MMC */
  104. #define CONFIG_CMD_MMC
  105. #ifdef CONFIG_CMD_MMC
  106. #define CONFIG_MMC
  107. #define CONFIG_GENERIC_MMC
  108. #define CONFIG_GENERIC_ATMEL_MCI
  109. #define CONFIG_ATMEL_MCI_8BIT
  110. #endif
  111. /* USB */
  112. #define CONFIG_CMD_USB
  113. #ifdef CONFIG_CMD_USB
  114. #define CONFIG_USB_ATMEL
  115. #define CONFIG_USB_ATMEL_CLK_SEL_UPLL
  116. #define CONFIG_USB_OHCI_NEW
  117. #define CONFIG_SYS_USB_OHCI_CPU_INIT
  118. #define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_BASE_OHCI
  119. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "SAMA5D3 Xplained"
  120. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
  121. #define CONFIG_DOS_PARTITION
  122. #define CONFIG_USB_STORAGE
  123. #endif
  124. #if defined(CONFIG_CMD_USB) || defined(CONFIG_CMD_MMC)
  125. #define CONFIG_CMD_FAT
  126. #define CONFIG_FAT_WRITE
  127. #define CONFIG_CMD_EXT4
  128. #define CONFIG_CMD_EXT4_WRITE
  129. #endif
  130. #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
  131. #if CONFIG_SYS_USE_NANDFLASH
  132. /* bootstrap + u-boot + env in nandflash */
  133. #define CONFIG_ENV_IS_IN_NAND
  134. #define CONFIG_ENV_OFFSET 0xc0000
  135. #define CONFIG_ENV_OFFSET_REDUND 0x100000
  136. #define CONFIG_ENV_SIZE 0x20000
  137. #define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
  138. "nand read 0x22000000 0x200000 0x600000;" \
  139. "bootz 0x22000000 - 0x21000000"
  140. #elif CONFIG_SYS_USE_MMC
  141. /* bootstrap + u-boot + env in sd card */
  142. #define CONFIG_ENV_IS_IN_MMC
  143. #define CONFIG_ENV_OFFSET 0x2000
  144. #define CONFIG_ENV_SIZE 0x1000
  145. #define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d3_xplained.dtb; " \
  146. "fatload mmc 0:1 0x22000000 zImage; " \
  147. "bootz 0x22000000 - 0x21000000"
  148. #define CONFIG_SYS_MMC_ENV_DEV 0
  149. #else
  150. #define CONFIG_ENV_IS_NOWHERE
  151. #endif
  152. #ifdef CONFIG_SYS_USE_MMC
  153. #define CONFIG_BOOTARGS \
  154. "console=ttyS0,115200 earlyprintk " \
  155. "root=/dev/mmcblk0p2 rw rootwait"
  156. #else
  157. #define CONFIG_BOOTARGS \
  158. "console=ttyS0,115200 earlyprintk " \
  159. "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \
  160. "256K(env),256k(evn_redundent),256k(spare)," \
  161. "512k(dtb),6M(kernel)ro,-(rootfs) " \
  162. "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs"
  163. #endif
  164. #define CONFIG_BAUDRATE 115200
  165. #define CONFIG_SYS_PROMPT "U-Boot> "
  166. #define CONFIG_SYS_CBSIZE 256
  167. #define CONFIG_SYS_MAXARGS 16
  168. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  169. sizeof(CONFIG_SYS_PROMPT) + 16)
  170. #define CONFIG_SYS_LONGHELP
  171. #define CONFIG_CMDLINE_EDITING
  172. #define CONFIG_AUTO_COMPLETE
  173. #define CONFIG_SYS_HUSH_PARSER
  174. /* Size of malloc() pool */
  175. #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
  176. /* SPL */
  177. #define CONFIG_SPL 1
  178. #define CONFIG_SPL_FRAMEWORK
  179. #define CONFIG_SPL_TEXT_BASE 0x300000
  180. #define CONFIG_SPL_MAX_SIZE 0x10000
  181. #define CONFIG_SPL_BSS_START_ADDR 0x20000000
  182. #define CONFIG_SPL_BSS_MAX_SIZE 0x80000
  183. #define CONFIG_SYS_SPL_MALLOC_START 0x20080000
  184. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000
  185. #define CONFIG_SPL_LIBCOMMON_SUPPORT
  186. #define CONFIG_SPL_LIBGENERIC_SUPPORT
  187. #define CONFIG_SPL_GPIO_SUPPORT
  188. #define CONFIG_SPL_SERIAL_SUPPORT
  189. #define CONFIG_SPL_BOARD_INIT
  190. #define CONFIG_SYS_MONITOR_LEN (512 << 10)
  191. #ifdef CONFIG_SYS_USE_MMC
  192. #define CONFIG_SPL_LDSCRIPT arch/arm/cpu/at91-common/u-boot-spl.lds
  193. #define CONFIG_SPL_MMC_SUPPORT
  194. #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400
  195. #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
  196. #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
  197. #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
  198. #define CONFIG_SPL_FAT_SUPPORT
  199. #define CONFIG_SPL_LIBDISK_SUPPORT
  200. #elif CONFIG_SYS_USE_NANDFLASH
  201. #define CONFIG_SPL_NAND_SUPPORT
  202. #define CONFIG_SPL_NAND_DRIVERS
  203. #define CONFIG_SPL_NAND_BASE
  204. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x40000
  205. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  206. #define CONFIG_SYS_NAND_PAGE_SIZE 0x800
  207. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  208. #define CONFIG_SYS_NAND_OOBSIZE 64
  209. #define CONFIG_SYS_NAND_BLOCK_SIZE 0x20000
  210. #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0x0
  211. #endif
  212. #endif