gw_ventana.h 8.3 KB

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