vf610twr.h 6.9 KB

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