vf610twr.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2013 Freescale Semiconductor, Inc.
  4. *
  5. * Configuration settings for the Freescale Vybrid vf610twr board.
  6. */
  7. #ifndef __CONFIG_H
  8. #define __CONFIG_H
  9. #include <asm/arch/imx-regs.h>
  10. #define CONFIG_SYS_FSL_CLK
  11. #define CONFIG_MACH_TYPE 4146
  12. #define CONFIG_SKIP_LOWLEVEL_INIT
  13. /* Enable passing of ATAGs */
  14. #define CONFIG_CMDLINE_TAG
  15. #ifdef CONFIG_CMD_FUSE
  16. #define CONFIG_MXC_OCOTP
  17. #endif
  18. /* Size of malloc() pool */
  19. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
  20. /* Allow to overwrite serial and ethaddr */
  21. #define CONFIG_ENV_OVERWRITE
  22. /* NAND support */
  23. #define CONFIG_SYS_NAND_ONFI_DETECTION
  24. #ifdef CONFIG_CMD_NAND
  25. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  26. #define CONFIG_SYS_NAND_BASE NFC_BASE_ADDR
  27. /* Dynamic MTD partition support */
  28. #define CONFIG_MTD_PARTITIONS
  29. #define CONFIG_MTD_DEVICE
  30. #endif
  31. #define CONFIG_SYS_FSL_ESDHC_ADDR 0
  32. #define CONFIG_SYS_FSL_ESDHC_NUM 1
  33. #define CONFIG_FEC_MXC
  34. #define CONFIG_MII
  35. #define IMX_FEC_BASE ENET_BASE_ADDR
  36. #define CONFIG_FEC_XCV_TYPE RMII
  37. #define CONFIG_FEC_MXC_PHYADDR 0
  38. /* QSPI Configs*/
  39. #ifdef CONFIG_FSL_QSPI
  40. #define FSL_QSPI_FLASH_SIZE (1 << 24)
  41. #define FSL_QSPI_FLASH_NUM 2
  42. #define CONFIG_SYS_FSL_QSPI_LE
  43. #endif
  44. /* I2C Configs */
  45. #define CONFIG_SYS_I2C
  46. #define CONFIG_SYS_I2C_MXC
  47. #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
  48. #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
  49. #define CONFIG_SYS_SPD_BUS_NUM 0
  50. #define CONFIG_SYS_LOAD_ADDR 0x82000000
  51. /* We boot from the gfxRAM area of the OCRAM. */
  52. #define CONFIG_BOARD_SIZE_LIMIT 520192
  53. /*
  54. * We do have 128MB of memory on the Vybrid Tower board. Leave the last
  55. * 16MB alone to avoid conflicts with Cortex-M4 firmwares running from
  56. * DDR3. Hence, limit the memory range for image processing to 112MB
  57. * using bootm_size. All of the following must be within this range.
  58. * We have the default load at 32MB into DDR (for the kernel), FDT at
  59. * 64MB and the ramdisk 512KB above that (allowing for hopefully never
  60. * seen large trees). This allows a reasonable split between ramdisk
  61. * and kernel size, where the ram disk can be a bit larger.
  62. */
  63. #define MEM_LAYOUT_ENV_SETTINGS \
  64. "bootm_size=0x07000000\0" \
  65. "loadaddr=0x82000000\0" \
  66. "kernel_addr_r=0x82000000\0" \
  67. "fdt_addr=0x84000000\0" \
  68. "fdt_addr_r=0x84000000\0" \
  69. "rdaddr=0x84080000\0" \
  70. "ramdisk_addr_r=0x84080000\0"
  71. #define CONFIG_EXTRA_ENV_SETTINGS \
  72. MEM_LAYOUT_ENV_SETTINGS \
  73. "script=boot.scr\0" \
  74. "image=zImage\0" \
  75. "console=ttyLP1\0" \
  76. "fdt_file=vf610-twr.dtb\0" \
  77. "boot_fdt=try\0" \
  78. "ip_dyn=yes\0" \
  79. "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
  80. "mmcpart=1\0" \
  81. "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
  82. "update_sd_firmware_filename=u-boot.imx\0" \
  83. "update_sd_firmware=" \
  84. "if test ${ip_dyn} = yes; then " \
  85. "setenv get_cmd dhcp; " \
  86. "else " \
  87. "setenv get_cmd tftp; " \
  88. "fi; " \
  89. "if mmc dev ${mmcdev}; then " \
  90. "if ${get_cmd} ${update_sd_firmware_filename}; then " \
  91. "setexpr fw_sz ${filesize} / 0x200; " \
  92. "setexpr fw_sz ${fw_sz} + 1; " \
  93. "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
  94. "fi; " \
  95. "fi\0" \
  96. "mmcargs=setenv bootargs console=${console},${baudrate} " \
  97. "root=${mmcroot}\0" \
  98. "loadbootscript=" \
  99. "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
  100. "bootscript=echo Running bootscript from mmc ...; " \
  101. "source\0" \
  102. "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
  103. "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
  104. "mmcboot=echo Booting from mmc ...; " \
  105. "run mmcargs; " \
  106. "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  107. "if run loadfdt; then " \
  108. "bootz ${loadaddr} - ${fdt_addr}; " \
  109. "else " \
  110. "if test ${boot_fdt} = try; then " \
  111. "bootz; " \
  112. "else " \
  113. "echo WARN: Cannot load the DT; " \
  114. "fi; " \
  115. "fi; " \
  116. "else " \
  117. "bootz; " \
  118. "fi;\0" \
  119. "netargs=setenv bootargs console=${console},${baudrate} " \
  120. "root=/dev/nfs " \
  121. "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
  122. "netboot=echo Booting from net ...; " \
  123. "run netargs; " \
  124. "if test ${ip_dyn} = yes; then " \
  125. "setenv get_cmd dhcp; " \
  126. "else " \
  127. "setenv get_cmd tftp; " \
  128. "fi; " \
  129. "${get_cmd} ${image}; " \
  130. "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  131. "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
  132. "bootz ${loadaddr} - ${fdt_addr}; " \
  133. "else " \
  134. "if test ${boot_fdt} = try; then " \
  135. "bootz; " \
  136. "else " \
  137. "echo WARN: Cannot load the DT; " \
  138. "fi; " \
  139. "fi; " \
  140. "else " \
  141. "bootz; " \
  142. "fi;\0"
  143. #define CONFIG_BOOTCOMMAND \
  144. "mmc dev ${mmcdev}; if mmc rescan; then " \
  145. "if run loadbootscript; then " \
  146. "run bootscript; " \
  147. "else " \
  148. "if run loadimage; then " \
  149. "run mmcboot; " \
  150. "else run netboot; " \
  151. "fi; " \
  152. "fi; " \
  153. "else run netboot; fi"
  154. /* Miscellaneous configurable options */
  155. #define CONFIG_SYS_MEMTEST_START 0x80010000
  156. #define CONFIG_SYS_MEMTEST_END 0x87C00000
  157. /* Physical memory map */
  158. #define CONFIG_NR_DRAM_BANKS 1
  159. #define PHYS_SDRAM (0x80000000)
  160. #define PHYS_SDRAM_SIZE (128 * 1024 * 1024)
  161. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
  162. #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
  163. #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
  164. #define CONFIG_SYS_INIT_SP_OFFSET \
  165. (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  166. #define CONFIG_SYS_INIT_SP_ADDR \
  167. (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
  168. #ifdef CONFIG_ENV_IS_IN_MMC
  169. #define CONFIG_ENV_SIZE (8 * 1024)
  170. #define CONFIG_ENV_OFFSET (12 * 64 * 1024)
  171. #define CONFIG_SYS_MMC_ENV_DEV 0
  172. #endif
  173. #ifdef CONFIG_ENV_IS_IN_NAND
  174. #define CONFIG_ENV_SIZE (64 * 2048)
  175. #define CONFIG_ENV_SECT_SIZE (64 * 2048)
  176. #define CONFIG_ENV_RANGE (512 * 1024)
  177. #define CONFIG_ENV_OFFSET 0x180000
  178. #endif
  179. #endif