1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * Copyright 2013-2015 Toradex, Inc. 4 * 5 * Configuration settings for the Toradex Colibri iMX6 6 */ 7 8 #ifndef __CONFIG_H 9 #define __CONFIG_H 10 11 #include "mx6_common.h" 12 13 #undef CONFIG_DISPLAY_BOARDINFO 14 15 #define CONFIG_SYS_GENERIC_BOARD 16 17 #include <asm/arch/imx-regs.h> 18 #include <asm/mach-imx/gpio.h> 19 20 #ifdef CONFIG_SPL 21 #include "imx6_spl.h" 22 #endif 23 24 #define CONFIG_CMDLINE_TAG 25 #define CONFIG_SETUP_MEMORY_TAGS 26 #define CONFIG_INITRD_TAG 27 #define CONFIG_REVISION_TAG 28 #define CONFIG_SERIAL_TAG 29 30 /* Size of malloc() pool */ 31 #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024) 32 33 #define CONFIG_MISC_INIT_R 34 35 #define CONFIG_MXC_UART 36 #define CONFIG_MXC_UART_BASE UART1_BASE 37 38 /* I2C Configs */ 39 #define CONFIG_SYS_I2C 40 #define CONFIG_SYS_I2C_MXC 41 #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ 42 #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ 43 #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ 44 #define CONFIG_SYS_I2C_SPEED 100000 45 46 /* OCOTP Configs */ 47 #ifdef CONFIG_CMD_FUSE 48 #define CONFIG_MXC_OCOTP 49 #endif 50 51 /* MMC Configs */ 52 #define CONFIG_FSL_USDHC 53 #define CONFIG_SYS_FSL_ESDHC_ADDR 0 54 #define CONFIG_SYS_FSL_USDHC_NUM 2 55 56 #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */ 57 #define CONFIG_BOUNCE_BUFFER 58 59 /* Network */ 60 #define CONFIG_FEC_MXC 61 #define CONFIG_MII 62 #define IMX_FEC_BASE ENET_BASE_ADDR 63 #define CONFIG_FEC_XCV_TYPE RMII 64 #define CONFIG_ETHPRIME "FEC" 65 #define CONFIG_FEC_MXC_PHYADDR 1 66 #define CONFIG_IP_DEFRAG 67 #define CONFIG_TFTP_BLOCKSIZE 16352 68 #define CONFIG_TFTP_TSIZE 69 70 /* USB Configs */ 71 /* Host */ 72 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 73 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */ 74 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) 75 #define CONFIG_MXC_USB_FLAGS 0 76 /* Client */ 77 #define CONFIG_USBD_HS 78 79 #define CONFIG_USB_GADGET_MASS_STORAGE 80 /* USB DFU */ 81 #define CONFIG_DFU_MMC 82 83 /* Miscellaneous commands */ 84 85 /* Framebuffer and LCD */ 86 #define CONFIG_VIDEO_IPUV3 87 #define CONFIG_SYS_CONSOLE_IS_IN_ENV 88 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE 89 #define CONFIG_VIDEO_BMP_RLE8 90 #define CONFIG_SPLASH_SCREEN 91 #define CONFIG_SPLASH_SCREEN_ALIGN 92 #define CONFIG_BMP_16BPP 93 #define CONFIG_VIDEO_LOGO 94 #define CONFIG_VIDEO_BMP_LOGO 95 #define CONFIG_CONSOLE_MUX 96 #define CONFIG_IMX_HDMI 97 #define CONFIG_IMX_VIDEO_SKIP 98 99 /* allow to overwrite serial and ethaddr */ 100 #define CONFIG_ENV_OVERWRITE 101 102 /* Command definition */ 103 #undef CONFIG_CMD_LOADB 104 #undef CONFIG_CMD_LOADS 105 #undef CONFIG_CMD_NFS 106 #undef CONFIG_CMD_FLASH 107 108 #undef CONFIG_IPADDR 109 #define CONFIG_IPADDR 192.168.10.2 110 #define CONFIG_NETMASK 255.255.255.0 111 #undef CONFIG_SERVERIP 112 #define CONFIG_SERVERIP 192.168.10.1 113 114 #define CONFIG_LOADADDR 0x12000000 115 116 #ifdef CONFIG_CMD_MMC 117 #define CONFIG_DRIVE_MMC "mmc " 118 #else 119 #define CONFIG_DRIVE_MMC 120 #endif 121 122 #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_MMC 123 124 #define DFU_ALT_EMMC_INFO \ 125 "u-boot.imx raw 0x2 0x3ff mmcpart 0;" \ 126 "boot part 0 1;" \ 127 "rootfs part 0 2;" \ 128 "uImage fat 0 1;" \ 129 "imx6q-colibri-eval-v3.dtb fat 0 1;" \ 130 "imx6q-colibri-cam-eval-v3.dtb fat 0 1" 131 132 #define EMMC_BOOTCMD \ 133 "emmcargs=ip=off root=/dev/mmcblk0p2 rw,noatime rootfstype=ext3 " \ 134 "rootwait\0" \ 135 "emmcboot=run setup; " \ 136 "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \ 137 "${vidargs}; echo Booting from internal eMMC chip...; " \ 138 "run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \ 139 "${boot_file} && run fdt_fixup && " \ 140 "bootm ${kernel_addr_r} ${dtbparam}\0" \ 141 "emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} " \ 142 "${fdt_file} && setenv dtbparam \" - ${fdt_addr_r}\" && true\0" 143 144 #define MEM_LAYOUT_ENV_SETTINGS \ 145 "bootm_size=0x10000000\0" \ 146 "fdt_addr_r=0x12000000\0" \ 147 "fdt_high=0xffffffff\0" \ 148 "initrd_high=0xffffffff\0" \ 149 "kernel_addr_r=0x11000000\0" \ 150 "ramdisk_addr_r=0x12100000\0" 151 152 #define NFS_BOOTCMD \ 153 "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \ 154 "nfsboot=run setup; " \ 155 "setenv bootargs ${defargs} ${nfsargs} ${setupargs} " \ 156 "${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \ 157 "run nfsdtbload; dhcp ${kernel_addr_r} " \ 158 "&& run fdt_fixup && bootm ${kernel_addr_r} ${dtbparam}\0" \ 159 "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} ${fdt_file} " \ 160 "&& setenv dtbparam \" - ${fdt_addr_r}\" && true\0" 161 162 #define SD_BOOTCMD \ 163 "sdargs=ip=off root=/dev/mmcblk1p2 rw,noatime rootfstype=ext3 " \ 164 "rootwait\0" \ 165 "sdboot=run setup; " \ 166 "setenv bootargs ${defargs} ${sdargs} ${setupargs} " \ 167 "${vidargs}; echo Booting from SD card; " \ 168 "run sddtbload; load mmc 1:1 ${kernel_addr_r} " \ 169 "${boot_file} && run fdt_fixup && " \ 170 "bootm ${kernel_addr_r} ${dtbparam}\0" \ 171 "sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} " \ 172 "${fdt_file} && setenv dtbparam \" - ${fdt_addr_r}\" && true\0" 173 174 #define USB_BOOTCMD \ 175 "usbargs=ip=off root=/dev/sda2 rw,noatime rootfstype=ext3 " \ 176 "rootwait\0" \ 177 "usbboot=run setup; setenv bootargs ${defargs} ${setupargs} " \ 178 "${usbargs} ${vidargs}; echo Booting from USB stick...; " \ 179 "usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} " \ 180 "${boot_file} && run fdt_fixup && " \ 181 "bootm ${kernel_addr_r} ${dtbparam}\0" \ 182 "usbdtbload=setenv dtbparam; load usb 0:1 ${fdt_addr_r} " \ 183 "${fdt_file} && setenv dtbparam \" - ${fdt_addr_r}\" && true\0" 184 185 #define FDT_FILE "imx6dl-colibri-eval-v3.dtb" 186 #define CONFIG_EXTRA_ENV_SETTINGS \ 187 "bootcmd=run emmcboot ; echo ; echo emmcboot failed ; " \ 188 "run nfsboot ; echo ; echo nfsboot failed ; " \ 189 "usb start ;" \ 190 "setenv stdout serial,vga ; setenv stdin serial,usbkbd\0" \ 191 "boot_file=uImage\0" \ 192 "console=ttymxc0\0" \ 193 "defargs=enable_wait_mode=off galcore.contiguousSize=50331648\0" \ 194 "dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \ 195 EMMC_BOOTCMD \ 196 "fdt_file=" FDT_FILE "\0" \ 197 "fdt_fixup=;\0" \ 198 MEM_LAYOUT_ENV_SETTINGS \ 199 NFS_BOOTCMD \ 200 SD_BOOTCMD \ 201 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \ 202 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \ 203 "flash_eth.img && source ${loadaddr}\0" \ 204 "setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; load " \ 205 "${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \ 206 "source ${loadaddr}\0" \ 207 "setup=setenv setupargs fec_mac=${ethaddr} " \ 208 "consoleblank=0 no_console_suspend=1 console=tty1 " \ 209 "console=${console},${baudrate}n8\0 " \ 210 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \ 211 "setusbupdate=usb start && setenv interface usb; setenv drive 0; " \ 212 "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \ 213 "source ${loadaddr}\0" \ 214 "splashpos=m,m\0" \ 215 "vidargs=video=mxcfb0:dev=lcd,640x480M@60,if=RGB666 " \ 216 "video=mxcfb1:off fbmem=8M\0 " 217 218 /* Miscellaneous configurable options */ 219 #undef CONFIG_SYS_CBSIZE 220 #define CONFIG_SYS_CBSIZE 1024 221 #undef CONFIG_SYS_MAXARGS 222 #define CONFIG_SYS_MAXARGS 48 223 224 #define CONFIG_SYS_MEMTEST_START 0x10000000 225 #define CONFIG_SYS_MEMTEST_END 0x10010000 226 #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000 227 228 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR 229 230 /* Physical Memory Map */ 231 #define CONFIG_NR_DRAM_BANKS 1 232 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR 233 234 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM 235 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR 236 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE 237 238 #define CONFIG_SYS_INIT_SP_OFFSET \ 239 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) 240 #define CONFIG_SYS_INIT_SP_ADDR \ 241 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) 242 243 /* environment organization */ 244 #define CONFIG_ENV_SIZE (8 * 1024) 245 246 #if defined(CONFIG_ENV_IS_IN_MMC) 247 /* Environment in eMMC, before config block at the end of 1st "boot sector" */ 248 #define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \ 249 CONFIG_TDX_CFG_BLOCK_OFFSET) 250 #define CONFIG_SYS_MMC_ENV_DEV 0 251 #define CONFIG_SYS_MMC_ENV_PART 1 252 #endif 253 254 #define CONFIG_OF_SYSTEM_SETUP 255 256 #define CONFIG_CMD_TIME 257 258 #endif /* __CONFIG_H */ 259