gw_ventana.h 7.2 KB

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