gw_ventana.h 8.8 KB

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