platinum.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2014, Barco (www.barco.com)
  4. */
  5. #ifndef __PLATINUM_CONFIG_H__
  6. #define __PLATINUM_CONFIG_H__
  7. /* SPL */
  8. /* Location in NAND to read U-Boot from */
  9. #define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * 1024 * 1024)
  10. #include "imx6_spl.h" /* common IMX6 SPL configuration */
  11. #include "mx6_common.h"
  12. /*
  13. * Hardware configuration
  14. */
  15. /* UART config */
  16. #define CONFIG_MXC_UART
  17. #define CONFIG_MXC_UART_BASE UART1_BASE
  18. /* I2C config */
  19. #define CONFIG_SYS_I2C
  20. #define CONFIG_SYS_I2C_MXC
  21. #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
  22. #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
  23. #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
  24. #define CONFIG_SYS_I2C_SPEED 100000
  25. /* MMC config */
  26. #define CONFIG_SYS_FSL_ESDHC_ADDR 0
  27. #define CONFIG_SYS_FSL_USDHC_NUM 1
  28. /* Ethernet config */
  29. #define CONFIG_FEC_MXC
  30. #define IMX_FEC_BASE ENET_BASE_ADDR
  31. /* USB config */
  32. #define CONFIG_MXC_USB_PORT 1
  33. #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
  34. #define CONFIG_MXC_USB_FLAGS 0
  35. /* Memory config */
  36. #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
  37. #ifndef PHYS_SDRAM_SIZE
  38. #define PHYS_SDRAM_SIZE (1024 << 20)
  39. #endif
  40. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
  41. #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
  42. #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
  43. #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
  44. GENERATED_GBL_DATA_SIZE)
  45. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  46. CONFIG_SYS_INIT_SP_OFFSET)
  47. #define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024)
  48. #ifdef CONFIG_CMD_NAND
  49. /* NAND config */
  50. #ifndef CONFIG_SYS_NAND_MAX_CHIPS
  51. #define CONFIG_SYS_NAND_MAX_CHIPS 2
  52. #endif
  53. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  54. #define CONFIG_SYS_NAND_BASE 0x40000000
  55. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  56. #define CONFIG_SYS_NAND_ONFI_DETECTION
  57. /* DMA config, needed for GPMI/MXS NAND support */
  58. /* Environment in NAND */
  59. #else /* CONFIG_CMD_NAND */
  60. /* Environment in MMC */
  61. #define CONFIG_SYS_MMC_ENV_DEV 0
  62. #endif /* CONFIG_CMD_NAND */
  63. /*
  64. * U-Boot configuration
  65. */
  66. /* Board startup config */
  67. #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
  68. #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + \
  69. PHYS_SDRAM_SIZE - (12 << 20))
  70. #define CONFIG_BOOTCOMMAND "run bootubi_scr"
  71. /* Miscellaneous configurable options */
  72. /* MTD/UBI/UBIFS config */
  73. /*
  74. * Environment configuration
  75. */
  76. #if (CONFIG_SYS_NAND_MAX_CHIPS == 1)
  77. #define CONFIG_COMMON_ENV_UBI \
  78. "setubipartition=env set ubipartition ubi\0" \
  79. "setubirfs=env set ubirfs $ubipartition:rootfs$boot_vol\0"
  80. #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2)
  81. #define CONFIG_COMMON_ENV_UBI \
  82. "setubipartition=env set ubipartition ubi$boot_vol\0" \
  83. "setubirfs=env set ubirfs ubi0:rootfs\0"
  84. #endif
  85. #define CONFIG_COMMON_ENV_MISC \
  86. "user=user\0" \
  87. "project="CONFIG_PLATINUM_PROJECT"\0" \
  88. "uimage=uImage\0" \
  89. "dtb="CONFIG_PLATINUM_CPU"-platinum-"CONFIG_PLATINUM_PROJECT".dtb\0" \
  90. "serverip=serverip\0" \
  91. "memaddrlinux=0x10800000\0" \
  92. "memaddrsrc=0x11000000\0" \
  93. "memaddrdtb=0x12000000\0" \
  94. "console=ttymxc0\0" \
  95. "baudrate=115200\0" \
  96. "boot_scr=boot.uboot\0" \
  97. "boot_vol=0\0" \
  98. "mtdids="CONFIG_MTDIDS_DEFAULT"\0" \
  99. "mtdparts="CONFIG_MTDPARTS_DEFAULT"\0" \
  100. "mmcfs=ext2\0" \
  101. "mmcrootpart=1\0" \
  102. \
  103. "setnfspath=env set nfspath /home/nfs/$user/$project/root\0" \
  104. "settftpfilelinux=env set tftpfilelinux $user/$project/$uimage\0" \
  105. "settftpfiledtb=env set tftpfiledtb $user/$project/$dtb\0" \
  106. "setubifilelinux=env set ubifilelinux boot/$uimage\0" \
  107. "setubipfiledtb=env set ubifiledtb boot/$dtb\0" \
  108. "setmmcrootdev=env set mmcrootdev /dev/mmcblk0p$mmcrootpart\0" \
  109. "setmmcfilelinux=env set mmcfilelinux /boot/$uimage\0" \
  110. "setmmcfiledtb=env set mmcfiledtb /boot/$dtb\0" \
  111. \
  112. "loadtftpkernel=dhcp $memaddrlinux $tftpfilelinux\0" \
  113. "loadtftpdtb=dhcp $memaddrdtb $tftpfiledtb\0" \
  114. "loadubikernel=ubifsload $memaddrlinux $ubifilelinux\0" \
  115. "loadubidtb=ubifsload $memaddrdtb $ubifiledtb\0" \
  116. "loadmmckernel=${mmcfs}load mmc 0:$mmcrootpart $memaddrlinux " \
  117. "$mmcfilelinux\0" \
  118. "loadmmcdtb=${mmcfs}load mmc 0:$mmcrootpart $memaddrdtb " \
  119. "$mmcfiledtb\0" \
  120. \
  121. "ubipart=ubi part $ubipartition\0" \
  122. "ubimount=ubifsmount $ubirfs\0" \
  123. \
  124. "setbootargscommon=env set bootargs $bootargs " \
  125. "console=$console,$baudrate enable_wait_mode=off\0" \
  126. "setbootargsmtd=env set bootargs $bootargs $mtdparts\0" \
  127. "setbootargsdhcp=env set bootargs $bootargs ip=dhcp\0" \
  128. "setbootargsubirfs=env set bootargs $bootargs " \
  129. "ubi.mtd=$ubipartition root=$ubirfs rootfstype=ubifs\0" \
  130. "setbootargsnfsrfs=env set bootargs $bootargs root=/dev/nfs " \
  131. "nfsroot=$serverip:$nfspath,v3,tcp\0" \
  132. "setbootargsmmcrfs=env set bootargs $bootargs " \
  133. "root=$mmcrootdev rootwait rw\0" \
  134. \
  135. "bootnet=run settftpfilelinux settftpfiledtb setnfspath " \
  136. "setbootargscommon setbootargsmtd setbootargsdhcp " \
  137. "setbootargsnfsrfs;" \
  138. "run loadtftpkernel loadtftpdtb;" \
  139. "bootm $memaddrlinux - $memaddrdtb\0" \
  140. "bootnet_ubirfs=run settftpfilelinux settftpfiledtb;" \
  141. "run setubipartition setubirfs;" \
  142. "run setbootargscommon setbootargsmtd " \
  143. "setbootargsubirfs;" \
  144. "run loadtftpkernel loadtftpdtb;" \
  145. "bootm $memaddrlinux - $memaddrdtb\0" \
  146. "bootubi=run setubipartition setubirfs setubifilelinux " \
  147. "setubipfiledtb;" \
  148. "run setbootargscommon setbootargsmtd " \
  149. "setbootargsubirfs;" \
  150. "run ubipart ubimount loadubikernel loadubidtb;" \
  151. "bootm $memaddrlinux - $memaddrdtb\0" \
  152. "bootubi_scr=run setubipartition setubirfs;" \
  153. "run ubipart ubimount;" \
  154. "if ubifsload ${memaddrsrc} boot/${boot_scr}; " \
  155. "then source ${memaddrsrc}; else run bootubi; fi\0" \
  156. "bootmmc=run setmmcrootdev setmmcfilelinux setmmcfiledtb " \
  157. "setbootargscommon setbootargsmmcrfs;" \
  158. "run loadmmckernel loadmmcdtb;" \
  159. "bootm $memaddrlinux - $memaddrdtb\0" \
  160. \
  161. "bootcmd="CONFIG_BOOTCOMMAND"\0"
  162. #define CONFIG_COMMON_ENV_SETTINGS CONFIG_COMMON_ENV_MISC \
  163. CONFIG_COMMON_ENV_UBI
  164. #endif /* __PLATINUM_CONFIG_H__ */