gw_ventana.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2013 Gateworks Corporation
  4. */
  5. #ifndef __CONFIG_H
  6. #define __CONFIG_H
  7. /* SPL */
  8. /* Location in NAND to read U-Boot from */
  9. #define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * SZ_1M)
  10. /* Falcon Mode */
  11. #define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000
  12. /* Falcon Mode - NAND support: args@17MB kernel@18MB */
  13. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS (18 * SZ_1M)
  14. /* Falcon Mode - MMC support: args@1MB kernel@2MB */
  15. #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */
  16. #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
  17. #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000 /* 2MB */
  18. #include "imx6_spl.h" /* common IMX6 SPL configuration */
  19. #include "mx6_common.h"
  20. #define CONFIG_MACH_TYPE 4520 /* Gateworks Ventana Platform */
  21. /* Serial ATAG */
  22. #define CONFIG_SERIAL_TAG
  23. /* Size of malloc() pool */
  24. #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
  25. /* Init Functions */
  26. /* Driver Model */
  27. #ifndef CONFIG_SPL_BUILD
  28. #define CONFIG_DM_THERMAL
  29. #endif
  30. /* Thermal */
  31. #define CONFIG_IMX_THERMAL
  32. /* Serial */
  33. #define CONFIG_MXC_UART_BASE UART2_BASE
  34. #if !defined(CONFIG_SPI_FLASH) && defined(CONFIG_SPL_NAND_SUPPORT)
  35. /* Enable NAND support */
  36. #ifdef CONFIG_CMD_NAND
  37. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  38. #define CONFIG_SYS_NAND_BASE 0x40000000
  39. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  40. #define CONFIG_SYS_NAND_ONFI_DETECTION
  41. /* DMA stuff, needed for GPMI/MXS NAND support */
  42. #endif
  43. #endif /* CONFIG_SPI_FLASH */
  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_I2C_MXC_I2C3 /* enable I2C bus 3 */
  50. #define CONFIG_SYS_I2C_SPEED 100000
  51. #define CONFIG_I2C_GSC 0
  52. #define CONFIG_I2C_EDID
  53. /* MMC Configs */
  54. #define CONFIG_SYS_FSL_ESDHC_ADDR 0
  55. /*
  56. * SATA Configs
  57. */
  58. #ifdef CONFIG_CMD_SATA
  59. #define CONFIG_SYS_SATA_MAX_DEVICE 1
  60. #define CONFIG_DWC_AHSATA_PORT_ID 0
  61. #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
  62. #define CONFIG_LBA48
  63. #endif
  64. /*
  65. * PCI express
  66. */
  67. #ifdef CONFIG_CMD_PCI
  68. #define CONFIG_PCI_SCAN_SHOW
  69. #define CONFIG_PCI_FIXUP_DEV
  70. #define CONFIG_PCIE_IMX
  71. #endif
  72. /*
  73. * PMIC
  74. */
  75. #define CONFIG_POWER
  76. #define CONFIG_POWER_I2C
  77. #define CONFIG_POWER_PFUZE100
  78. #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
  79. #define CONFIG_POWER_LTC3676
  80. #define CONFIG_POWER_LTC3676_I2C_ADDR 0x3c
  81. /* Various command support */
  82. /* Ethernet support */
  83. #define CONFIG_FEC_MXC
  84. #define IMX_FEC_BASE ENET_BASE_ADDR
  85. #define CONFIG_FEC_XCV_TYPE RGMII
  86. #define CONFIG_FEC_MXC_PHYADDR 0
  87. #define CONFIG_ARP_TIMEOUT 200UL
  88. /* USB Configs */
  89. #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
  90. #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
  91. #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
  92. #define CONFIG_MXC_USB_FLAGS 0
  93. #define CONFIG_USBD_HS
  94. /* Framebuffer and LCD */
  95. #define CONFIG_VIDEO_LOGO
  96. #define CONFIG_IMX_HDMI
  97. #define CONFIG_IMX_VIDEO_SKIP
  98. #define CONFIG_VIDEO_BMP_LOGO
  99. #define CONFIG_HIDE_LOGO_VERSION /* Custom config to hide U-boot version */
  100. /* Miscellaneous configurable options */
  101. #define CONFIG_HWCONFIG
  102. /* Memory configuration */
  103. /* Physical Memory Map */
  104. #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
  105. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
  106. #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
  107. #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
  108. #define CONFIG_SYS_INIT_SP_OFFSET \
  109. (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  110. #define CONFIG_SYS_INIT_SP_ADDR \
  111. (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
  112. /*
  113. * MTD Command for mtdparts
  114. */
  115. /* Persistent Environment Config */
  116. /* Environment */
  117. #define CONFIG_IPADDR 192.168.1.1
  118. #define CONFIG_SERVERIP 192.168.1.146
  119. #define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
  120. "pcidisable=1\0" \
  121. "splashpos=m,m\0" \
  122. "usb_pgood_delay=2000\0" \
  123. "console=ttymxc1\0" \
  124. "bootdevs=usb mmc sata flash\0" \
  125. "hwconfig=_UNKNOWN_\0" \
  126. "video=\0" \
  127. \
  128. "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
  129. "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
  130. "disk=0\0" \
  131. "part=1\0" \
  132. \
  133. "fdt_high=0xffffffff\0" \
  134. "fdt_addr=0x18000000\0" \
  135. "initrd_high=0xffffffff\0" \
  136. "fixfdt=" \
  137. "fdt addr ${fdt_addr}\0" \
  138. "bootdir=boot\0" \
  139. "loadfdt=" \
  140. "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
  141. "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
  142. "run fixfdt; " \
  143. "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
  144. "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
  145. "run fixfdt; " \
  146. "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
  147. "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
  148. "run fixfdt; " \
  149. "fi\0" \
  150. \
  151. "fs=ext4\0" \
  152. "script=6x_bootscript-ventana\0" \
  153. "loadscript=" \
  154. "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
  155. "source ${loadaddr}; " \
  156. "fi\0" \
  157. \
  158. "uimage=uImage\0" \
  159. "mmc_root=mmcblk0p1\0" \
  160. "mmc_boot=" \
  161. "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
  162. "mmc dev ${disk} && mmc rescan && " \
  163. "setenv dtype mmc; run loadscript; " \
  164. "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
  165. "setenv bootargs console=${console},${baudrate} " \
  166. "root=/dev/${mmc_root} rootfstype=${fs} " \
  167. "rootwait rw ${video} ${extra}; " \
  168. "if run loadfdt; then " \
  169. "bootm ${loadaddr} - ${fdt_addr}; " \
  170. "else " \
  171. "bootm; " \
  172. "fi; " \
  173. "fi\0" \
  174. \
  175. "sata_boot=" \
  176. "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
  177. "sata init && " \
  178. "setenv dtype sata; run loadscript; " \
  179. "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
  180. "setenv bootargs console=${console},${baudrate} " \
  181. "root=/dev/sda1 rootfstype=${fs} " \
  182. "rootwait rw ${video} ${extra}; " \
  183. "if run loadfdt; then " \
  184. "bootm ${loadaddr} - ${fdt_addr}; " \
  185. "else " \
  186. "bootm; " \
  187. "fi; " \
  188. "fi\0" \
  189. "usb_boot=" \
  190. "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
  191. "usb start && usb dev ${disk} && " \
  192. "setenv dtype usb; run loadscript; " \
  193. "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
  194. "setenv bootargs console=${console},${baudrate} " \
  195. "root=/dev/sda1 rootfstype=${fs} " \
  196. "rootwait rw ${video} ${extra}; " \
  197. "if run loadfdt; then " \
  198. "bootm ${loadaddr} - ${fdt_addr}; " \
  199. "else " \
  200. "bootm; " \
  201. "fi; " \
  202. "fi\0"
  203. #ifdef CONFIG_SPI_FLASH
  204. #define CONFIG_EXTRA_ENV_SETTINGS \
  205. CONFIG_EXTRA_ENV_SETTINGS_COMMON \
  206. "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
  207. "image_uboot=ventana/u-boot_spi.imx\0" \
  208. \
  209. "spi_koffset=0x90000\0" \
  210. "spi_klen=0x200000\0" \
  211. \
  212. "spi_updateuboot=echo Updating uboot from " \
  213. "${serverip}:${image_uboot}...; " \
  214. "tftpboot ${loadaddr} ${image_uboot} && " \
  215. "sf probe && sf erase 0 80000 && " \
  216. "sf write ${loadaddr} 400 ${filesize}\0" \
  217. "spi_update=echo Updating OS from ${serverip}:${image_os} " \
  218. "to ${spi_koffset} ...; " \
  219. "tftp ${loadaddr} ${image_os} && " \
  220. "sf probe && " \
  221. "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
  222. \
  223. "flash_boot=" \
  224. "if sf probe && " \
  225. "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
  226. "setenv bootargs console=${console},${baudrate} " \
  227. "root=/dev/mtdblock3 " \
  228. "rootfstype=squashfs,jffs2 " \
  229. "${video} ${extra}; " \
  230. "bootm; " \
  231. "fi\0"
  232. #else
  233. #define CONFIG_EXTRA_ENV_SETTINGS \
  234. CONFIG_EXTRA_ENV_SETTINGS_COMMON \
  235. \
  236. "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
  237. "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
  238. "tftp ${loadaddr} ${image_rootfs} && " \
  239. "nand erase.part rootfs && " \
  240. "nand write ${loadaddr} rootfs ${filesize}\0" \
  241. \
  242. "flash_boot=" \
  243. "setenv fsload 'ubifsload'; " \
  244. "ubi part rootfs; " \
  245. "if ubi check boot; then " \
  246. "ubifsmount ubi0:boot; " \
  247. "setenv root ubi0:rootfs ubi.mtd=2 " \
  248. "rootfstype=squashfs,ubifs; " \
  249. "setenv bootdir; " \
  250. "elif ubi check rootfs; then " \
  251. "ubifsmount ubi0:rootfs; " \
  252. "setenv root ubi0:rootfs ubi.mtd=2 " \
  253. "rootfstype=ubifs; " \
  254. "fi; " \
  255. "setenv dtype nand; run loadscript; " \
  256. "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
  257. "setenv bootargs console=${console},${baudrate} " \
  258. "root=${root} ${video} ${extra}; " \
  259. "if run loadfdt; then " \
  260. "ubifsumount; " \
  261. "bootm ${loadaddr} - ${fdt_addr}; " \
  262. "else " \
  263. "ubifsumount; bootm; " \
  264. "fi; " \
  265. "fi\0"
  266. #endif
  267. #define CONFIG_BOOTCOMMAND \
  268. "for btype in ${bootdevs}; do " \
  269. "echo; echo Attempting ${btype} boot...; " \
  270. "if run ${btype}_boot; then; fi; " \
  271. "done"
  272. #endif /* __CONFIG_H */