platinum.h 5.9 KB

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