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