colibri_imx6.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2013-2019 Toradex, Inc.
  4. *
  5. * Configuration settings for the Toradex Colibri iMX6
  6. */
  7. #ifndef __CONFIG_H
  8. #define __CONFIG_H
  9. #include <linux/stringify.h>
  10. #include "mx6_common.h"
  11. #undef CONFIG_DISPLAY_BOARDINFO
  12. #include <asm/arch/imx-regs.h>
  13. #include <asm/mach-imx/gpio.h>
  14. #ifdef CONFIG_SPL
  15. #include "imx6_spl.h"
  16. #endif
  17. #define CONFIG_CMDLINE_TAG
  18. #define CONFIG_SETUP_MEMORY_TAGS
  19. #define CONFIG_INITRD_TAG
  20. #define CONFIG_REVISION_TAG
  21. #define CONFIG_SERIAL_TAG
  22. /* Size of malloc() pool */
  23. #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024)
  24. #define CONFIG_MXC_UART
  25. #define CONFIG_MXC_UART_BASE UART1_BASE
  26. /* I2C Configs */
  27. #define CONFIG_SYS_I2C_MXC
  28. #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
  29. #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
  30. #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
  31. #define CONFIG_SYS_I2C_SPEED 100000
  32. #define CONFIG_SYS_MXC_I2C3_SPEED 400000
  33. /* MMC Configs */
  34. #define CONFIG_SYS_FSL_ESDHC_ADDR 0
  35. #define CONFIG_SYS_FSL_USDHC_NUM 2
  36. /* USB Configs */
  37. /* Host */
  38. #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
  39. #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
  40. #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
  41. #define CONFIG_MXC_USB_FLAGS 0
  42. /* Client */
  43. #define CONFIG_USBD_HS
  44. /* Framebuffer and LCD */
  45. #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
  46. #define CONFIG_VIDEO_BMP_RLE8
  47. #define CONFIG_SPLASH_SCREEN
  48. #define CONFIG_SPLASH_SCREEN_ALIGN
  49. #define CONFIG_BMP_16BPP
  50. #define CONFIG_VIDEO_LOGO
  51. #define CONFIG_VIDEO_BMP_LOGO
  52. #define CONFIG_CONSOLE_MUX
  53. #define CONFIG_IMX_HDMI
  54. #define CONFIG_IMX_VIDEO_SKIP
  55. /* allow to overwrite serial and ethaddr */
  56. #define CONFIG_ENV_OVERWRITE
  57. /* Command definition */
  58. #undef CONFIG_CMD_LOADB
  59. #undef CONFIG_CMD_LOADS
  60. #undef CONFIG_CMD_NFS
  61. #undef CONFIG_CMD_FLASH
  62. #undef CONFIG_IPADDR
  63. #define CONFIG_IPADDR 192.168.10.2
  64. #define CONFIG_NETMASK 255.255.255.0
  65. #undef CONFIG_SERVERIP
  66. #define CONFIG_SERVERIP 192.168.10.1
  67. #define CONFIG_LOADADDR 0x12000000
  68. #ifndef CONFIG_SPL_BUILD
  69. #define BOOT_TARGET_DEVICES(func) \
  70. func(MMC, mmc, 0) \
  71. func(MMC, mmc, 1) \
  72. func(USB, usb, 0) \
  73. func(DHCP, dhcp, na)
  74. #include <config_distro_bootcmd.h>
  75. #undef BOOTENV_RUN_NET_USB_START
  76. #define BOOTENV_RUN_NET_USB_START ""
  77. #else /* CONFIG_SPL_BUILD */
  78. #define BOOTENV
  79. #endif /* CONFIG_SPL_BUILD */
  80. #define DFU_ALT_EMMC_INFO \
  81. "u-boot.imx raw 0x2 0x3ff mmcpart 0;" \
  82. "boot part 0 1;" \
  83. "rootfs part 0 2;" \
  84. "zImage fat 0 1;" \
  85. "imx6dl-colibri-eval-v3.dtb fat 0 1;" \
  86. "imx6dl-colibri-cam-eval-v3.dtb fat 0 1"
  87. #define UBOOT_UPDATE \
  88. "uboot_hwpart=1\0" \
  89. "uboot_blk=8a\0" \
  90. "uboot_spl_blk=2\0" \
  91. "set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && " \
  92. "setexpr blkcnt ${blkcnt} / 0x200\0" \
  93. "update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
  94. "mmc write ${loadaddr} ${uboot_blk} ${blkcnt}\0" \
  95. "update_spl=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
  96. "mmc write ${loadaddr} ${uboot_spl_blk} ${blkcnt}\0"
  97. #define EMMC_BOOTCMD \
  98. "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} "\
  99. "rw,noatime rootfstype=ext4 " \
  100. "rootwait\0" \
  101. "emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \
  102. "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \
  103. "${vidargs}; echo Booting from internal eMMC chip...; " \
  104. "run emmcdtbload; load mmc ${emmcdev}:${emmcbootpart} " \
  105. "${kernel_addr_r} ${boot_file} && run fdt_fixup && " \
  106. "bootz ${kernel_addr_r} ${dtbparam}\0" \
  107. "emmcbootpart=1\0" \
  108. "emmcdev=0\0" \
  109. "emmcdtbload=setenv dtbparam; load mmc ${emmcdev}:${emmcbootpart} " \
  110. "${fdt_addr_r} ${fdt_file} && " \
  111. "setenv dtbparam \" - ${fdt_addr_r}\" && true\0" \
  112. "emmcfinduuid=part uuid mmc ${mmcdev}:${emmcrootpart} uuid\0" \
  113. "emmcrootpart=2\0"
  114. #define MEM_LAYOUT_ENV_SETTINGS \
  115. "bootm_size=0x10000000\0" \
  116. "fdt_addr_r=0x12100000\0" \
  117. "kernel_addr_r=0x11000000\0" \
  118. "pxefile_addr_r=0x17100000\0" \
  119. "ramdisk_addr_r=0x12200000\0" \
  120. "scriptaddr=0x17000000\0"
  121. #define NFS_BOOTCMD \
  122. "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \
  123. "nfsboot=run setup; " \
  124. "setenv bootargs ${defargs} ${nfsargs} ${setupargs} " \
  125. "${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \
  126. "run nfsdtbload; dhcp ${kernel_addr_r} " \
  127. "&& run fdt_fixup && bootz ${kernel_addr_r} ${dtbparam}\0" \
  128. "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} ${fdt_file} " \
  129. "&& setenv dtbparam \" - ${fdt_addr_r}\" && true\0"
  130. #define FDT_FILE "imx6dl-colibri-eval-v3.dtb"
  131. #define CONFIG_EXTRA_ENV_SETTINGS \
  132. BOOTENV \
  133. "bootcmd=setenv fdtfile ${fdt_file}; run distro_bootcmd; " \
  134. "usb start ; " \
  135. "setenv stdout serial,vga ; setenv stdin serial,usbkbd\0" \
  136. "boot_file=zImage\0" \
  137. "console=ttymxc0\0" \
  138. "defargs=enable_wait_mode=off galcore.contiguousSize=50331648\0" \
  139. "dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \
  140. EMMC_BOOTCMD \
  141. "fdt_file=" FDT_FILE "\0" \
  142. "fdt_fixup=;\0" \
  143. MEM_LAYOUT_ENV_SETTINGS \
  144. NFS_BOOTCMD \
  145. UBOOT_UPDATE \
  146. "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
  147. "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
  148. "flash_eth.img && source ${loadaddr}\0" \
  149. "setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; load " \
  150. "${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
  151. "source ${loadaddr}\0" \
  152. "setup=setenv setupargs fec_mac=${ethaddr} " \
  153. "consoleblank=0 no_console_suspend=1 console=tty1 " \
  154. "console=${console},${baudrate}n8\0 " \
  155. "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
  156. "setusbupdate=usb start && setenv interface usb; setenv drive 0; " \
  157. "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
  158. "source ${loadaddr}\0" \
  159. "splashpos=m,m\0" \
  160. "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
  161. "vidargs=video=mxcfb0:dev=lcd,640x480M@60,if=RGB666 " \
  162. "video=mxcfb1:off fbmem=8M\0 "
  163. /* Miscellaneous configurable options */
  164. #undef CONFIG_SYS_CBSIZE
  165. #define CONFIG_SYS_CBSIZE 1024
  166. #undef CONFIG_SYS_MAXARGS
  167. #define CONFIG_SYS_MAXARGS 48
  168. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  169. /* Physical Memory Map */
  170. #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
  171. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
  172. #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
  173. #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
  174. #define CONFIG_SYS_INIT_SP_OFFSET \
  175. (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  176. #define CONFIG_SYS_INIT_SP_ADDR \
  177. (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
  178. /* environment organization */
  179. #if defined(CONFIG_ENV_IS_IN_MMC)
  180. /* Environment in eMMC, before config block at the end of 1st "boot sector" */
  181. #define CONFIG_SYS_MMC_ENV_DEV 0
  182. #define CONFIG_SYS_MMC_ENV_PART 1
  183. #endif
  184. #define CONFIG_CMD_TIME
  185. #endif /* __CONFIG_H */