platinum.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. /*
  2. * Copyright (C) 2014, Barco (www.barco.com)
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __PLATINUM_CONFIG_H__
  7. #define __PLATINUM_CONFIG_H__
  8. /* SPL */
  9. /* Location in NAND to read U-Boot from */
  10. #define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * 1024 * 1024)
  11. #include "imx6_spl.h" /* common IMX6 SPL configuration */
  12. #include "mx6_common.h"
  13. /*
  14. * Console configuration
  15. */
  16. #define CONFIG_CMD_BMODE
  17. #define CONFIG_CMD_MTDPARTS
  18. #define CONFIG_CMD_NAND
  19. #define CONFIG_CMD_NAND_TRIMFFS
  20. #define CONFIG_CMD_UBIFS
  21. /*
  22. * Hardware configuration
  23. */
  24. /* UART config */
  25. #define CONFIG_MXC_UART
  26. #define CONFIG_MXC_UART_BASE UART1_BASE
  27. /* I2C config */
  28. #define CONFIG_SYS_I2C
  29. #define CONFIG_SYS_I2C_MXC
  30. #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
  31. #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
  32. #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
  33. #define CONFIG_SYS_I2C_SPEED 100000
  34. /* MMC config */
  35. #define CONFIG_SYS_FSL_ESDHC_ADDR 0
  36. #define CONFIG_SYS_FSL_USDHC_NUM 1
  37. /* Ethernet config */
  38. #define CONFIG_FEC_MXC
  39. #define CONFIG_MII
  40. #define IMX_FEC_BASE ENET_BASE_ADDR
  41. #define CONFIG_PHYLIB
  42. /* USB config */
  43. #define CONFIG_USB_EHCI
  44. #define CONFIG_USB_EHCI_MX6
  45. #define CONFIG_MXC_USB_PORT 1
  46. #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
  47. #define CONFIG_MXC_USB_FLAGS 0
  48. /* Memory config */
  49. #define CONFIG_NR_DRAM_BANKS 1
  50. #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
  51. #ifndef PHYS_SDRAM_SIZE
  52. #define PHYS_SDRAM_SIZE (1024 << 20)
  53. #endif
  54. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
  55. #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
  56. #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
  57. #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
  58. GENERATED_GBL_DATA_SIZE)
  59. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  60. CONFIG_SYS_INIT_SP_OFFSET)
  61. #define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024)
  62. #ifdef CONFIG_CMD_NAND
  63. /* NAND config */
  64. #define CONFIG_NAND_MXS
  65. #ifndef CONFIG_SYS_NAND_MAX_CHIPS
  66. #define CONFIG_SYS_NAND_MAX_CHIPS 2
  67. #endif
  68. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  69. #define CONFIG_SYS_NAND_BASE 0x40000000
  70. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  71. #define CONFIG_SYS_NAND_ONFI_DETECTION
  72. /* DMA config, needed for GPMI/MXS NAND support */
  73. #define CONFIG_APBH_DMA
  74. #define CONFIG_APBH_DMA_BURST
  75. #define CONFIG_APBH_DMA_BURST8
  76. /* Environment in NAND */
  77. #define CONFIG_ENV_IS_IN_NAND
  78. #define CONFIG_ENV_OFFSET (16 << 20)
  79. #define CONFIG_ENV_SECT_SIZE (128 << 10)
  80. #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
  81. #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 << 10))
  82. #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
  83. #else /* CONFIG_CMD_NAND */
  84. /* Environment in MMC */
  85. #define CONFIG_ENV_SIZE (8 << 10)
  86. #define CONFIG_ENV_IS_IN_MMC
  87. #define CONFIG_ENV_OFFSET (6 * 64 * 1024)
  88. #define CONFIG_SYS_MMC_ENV_DEV 0
  89. #endif /* CONFIG_CMD_NAND */
  90. /*
  91. * U-Boot configuration
  92. */
  93. /* Board startup config */
  94. #define CONFIG_BOARD_EARLY_INIT_F
  95. #define CONFIG_MISC_INIT_R
  96. #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
  97. #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + \
  98. PHYS_SDRAM_SIZE - (12 << 20))
  99. #define CONFIG_BOOTCOMMAND "run bootubi_scr"
  100. /* Miscellaneous configurable options */
  101. #define CONFIG_PREBOOT
  102. /* Print Buffer Size */
  103. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  104. sizeof(CONFIG_SYS_PROMPT) + 16)
  105. /* MTD/UBI/UBIFS config */
  106. #define CONFIG_LZO
  107. #define CONFIG_MTD_DEVICE
  108. #define CONFIG_MTD_PARTITIONS
  109. #define CONFIG_RBTREE
  110. #if (CONFIG_SYS_NAND_MAX_CHIPS == 1)
  111. #define MTDIDS_DEFAULT "nand0=gpmi-nand"
  112. #define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:14M(spl),2M(uboot)," \
  113. "512k(env1),512k(env2),-(ubi)"
  114. #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2)
  115. #define MTDIDS_DEFAULT "nand0=gpmi-nand"
  116. #define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:14M(spl),2M(uboot)," \
  117. "512k(env1),512k(env2),495M(ubi0)," \
  118. "14M(res0),2M(res1)," \
  119. "512k(res2),512k(res3),-(ubi1)"
  120. #endif
  121. /*
  122. * Environment configuration
  123. */
  124. #if (CONFIG_SYS_NAND_MAX_CHIPS == 1)
  125. #define CONFIG_COMMON_ENV_UBI \
  126. "setubipartition=env set ubipartition ubi\0" \
  127. "setubirfs=env set ubirfs $ubipartition:rootfs$boot_vol\0"
  128. #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2)
  129. #define CONFIG_COMMON_ENV_UBI \
  130. "setubipartition=env set ubipartition ubi$boot_vol\0" \
  131. "setubirfs=env set ubirfs ubi0:rootfs\0"
  132. #endif
  133. #define CONFIG_COMMON_ENV_MISC \
  134. "user=user\0" \
  135. "project="CONFIG_PLATINUM_PROJECT"\0" \
  136. "uimage=uImage\0" \
  137. "dtb="CONFIG_PLATINUM_CPU"-platinum-"CONFIG_PLATINUM_PROJECT".dtb\0" \
  138. "serverip=serverip\0" \
  139. "memaddrlinux=0x10800000\0" \
  140. "memaddrsrc=0x11000000\0" \
  141. "memaddrdtb=0x12000000\0" \
  142. "console=ttymxc0\0" \
  143. "baudrate=115200\0" \
  144. "boot_scr=boot.uboot\0" \
  145. "boot_vol=0\0" \
  146. "mtdids="MTDIDS_DEFAULT"\0" \
  147. "mtdparts="MTDPARTS_DEFAULT"\0" \
  148. "mmcfs=ext2\0" \
  149. "mmcrootpart=1\0" \
  150. \
  151. "setnfspath=env set nfspath /home/nfs/$user/$project/root\0" \
  152. "settftpfilelinux=env set tftpfilelinux $user/$project/$uimage\0" \
  153. "settftpfiledtb=env set tftpfiledtb $user/$project/$dtb\0" \
  154. "setubifilelinux=env set ubifilelinux boot/$uimage\0" \
  155. "setubipfiledtb=env set ubifiledtb boot/$dtb\0" \
  156. "setmmcrootdev=env set mmcrootdev /dev/mmcblk0p$mmcrootpart\0" \
  157. "setmmcfilelinux=env set mmcfilelinux /boot/$uimage\0" \
  158. "setmmcfiledtb=env set mmcfiledtb /boot/$dtb\0" \
  159. \
  160. "loadtftpkernel=dhcp $memaddrlinux $tftpfilelinux\0" \
  161. "loadtftpdtb=dhcp $memaddrdtb $tftpfiledtb\0" \
  162. "loadubikernel=ubifsload $memaddrlinux $ubifilelinux\0" \
  163. "loadubidtb=ubifsload $memaddrdtb $ubifiledtb\0" \
  164. "loadmmckernel=${mmcfs}load mmc 0:$mmcrootpart $memaddrlinux " \
  165. "$mmcfilelinux\0" \
  166. "loadmmcdtb=${mmcfs}load mmc 0:$mmcrootpart $memaddrdtb " \
  167. "$mmcfiledtb\0" \
  168. \
  169. "ubipart=ubi part $ubipartition\0" \
  170. "ubimount=ubifsmount $ubirfs\0" \
  171. \
  172. "setbootargscommon=env set bootargs $bootargs " \
  173. "console=$console,$baudrate enable_wait_mode=off\0" \
  174. "setbootargsmtd=env set bootargs $bootargs $mtdparts\0" \
  175. "setbootargsdhcp=env set bootargs $bootargs ip=dhcp\0" \
  176. "setbootargsubirfs=env set bootargs $bootargs " \
  177. "ubi.mtd=$ubipartition root=$ubirfs rootfstype=ubifs\0" \
  178. "setbootargsnfsrfs=env set bootargs $bootargs root=/dev/nfs " \
  179. "nfsroot=$serverip:$nfspath,v3,tcp\0" \
  180. "setbootargsmmcrfs=env set bootargs $bootargs " \
  181. "root=$mmcrootdev rootwait rw\0" \
  182. \
  183. "bootnet=run settftpfilelinux settftpfiledtb setnfspath " \
  184. "setbootargscommon setbootargsmtd setbootargsdhcp " \
  185. "setbootargsnfsrfs;" \
  186. "run loadtftpkernel loadtftpdtb;" \
  187. "bootm $memaddrlinux - $memaddrdtb\0" \
  188. "bootnet_ubirfs=run settftpfilelinux settftpfiledtb;" \
  189. "run setubipartition setubirfs;" \
  190. "run setbootargscommon setbootargsmtd " \
  191. "setbootargsubirfs;" \
  192. "run loadtftpkernel loadtftpdtb;" \
  193. "bootm $memaddrlinux - $memaddrdtb\0" \
  194. "bootubi=run setubipartition setubirfs setubifilelinux " \
  195. "setubipfiledtb;" \
  196. "run setbootargscommon setbootargsmtd " \
  197. "setbootargsubirfs;" \
  198. "run ubipart ubimount loadubikernel loadubidtb;" \
  199. "bootm $memaddrlinux - $memaddrdtb\0" \
  200. "bootubi_scr=run setubipartition setubirfs;" \
  201. "run ubipart ubimount;" \
  202. "if ubifsload ${memaddrsrc} boot/${boot_scr}; " \
  203. "then source ${memaddrsrc}; else run bootubi; fi\0" \
  204. "bootmmc=run setmmcrootdev setmmcfilelinux setmmcfiledtb " \
  205. "setbootargscommon setbootargsmmcrfs;" \
  206. "run loadmmckernel loadmmcdtb;" \
  207. "bootm $memaddrlinux - $memaddrdtb\0" \
  208. \
  209. "bootcmd="CONFIG_BOOTCOMMAND"\0"
  210. #define CONFIG_COMMON_ENV_SETTINGS CONFIG_COMMON_ENV_MISC \
  211. CONFIG_COMMON_ENV_UBI
  212. #endif /* __PLATINUM_CONFIG_H__ */