1 /* 2 * Copyright 2016 Toradex AG 3 * 4 * Configuration settings for the Colibri iMX7 module. 5 * 6 * based on mx7dsabresd.h: 7 * Copyright (C) 2015 Freescale Semiconductor, Inc. 8 * 9 * SPDX-License-Identifier: GPL-2.0+ 10 */ 11 12 #ifndef __COLIBRI_IMX7_CONFIG_H 13 #define __COLIBRI_IMX7_CONFIG_H 14 15 #include "mx7_common.h" 16 17 /*#define CONFIG_DBG_MONITOR*/ 18 #define PHYS_SDRAM_SIZE SZ_512M 19 20 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG 21 22 /* Size of malloc() pool */ 23 #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) 24 25 /* Network */ 26 #define CONFIG_FEC_MXC 27 #define CONFIG_MII 28 #define CONFIG_FEC_XCV_TYPE RMII 29 #define CONFIG_ETHPRIME "FEC" 30 #define CONFIG_FEC_MXC_PHYADDR 0 31 32 #define CONFIG_IP_DEFRAG 33 #define CONFIG_TFTP_BLOCKSIZE 16352 34 #define CONFIG_TFTP_TSIZE 35 36 /* ENET1 */ 37 #define IMX_FEC_BASE ENET_IPS_BASE_ADDR 38 39 /* MMC Config*/ 40 #define CONFIG_SYS_FSL_ESDHC_ADDR 0 41 #define CONFIG_SYS_FSL_USDHC_NUM 1 42 43 #undef CONFIG_BOOTM_PLAN9 44 #undef CONFIG_BOOTM_RTEMS 45 46 /* I2C configs */ 47 #define CONFIG_SYS_I2C_MXC 48 #define CONFIG_SYS_I2C_SPEED 100000 49 50 #define CONFIG_IPADDR 192.168.10.2 51 #define CONFIG_NETMASK 255.255.255.0 52 #define CONFIG_SERVERIP 192.168.10.1 53 54 #define MEM_LAYOUT_ENV_SETTINGS \ 55 "bootm_size=0x10000000\0" \ 56 "fdt_addr_r=0x82000000\0" \ 57 "fdt_high=0xffffffff\0" \ 58 "initrd_high=0xffffffff\0" \ 59 "kernel_addr_r=0x81000000\0" \ 60 "ramdisk_addr_r=0x82100000\0" 61 62 #define SD_BOOTCMD \ 63 "sdargs=root=/dev/mmcblk0p2 rw rootwait\0" \ 64 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \ 65 "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \ 66 "run m4boot && " \ 67 "load mmc 0:1 ${kernel_addr_r} ${kernel_file} && " \ 68 "load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \ 69 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ 70 71 #define NFS_BOOTCMD \ 72 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \ 73 "nfsboot=run setup; " \ 74 "setenv bootargs ${defargs} ${nfsargs} " \ 75 "${setupargs} ${vidargs}; echo Booting from NFS...;" \ 76 "dhcp ${kernel_addr_r} && " \ 77 "tftp ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \ 78 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ 79 80 #define UBI_BOOTCMD \ 81 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \ 82 "ubi.fm_autoconvert=1\0" \ 83 "ubiboot=run setup; " \ 84 "setenv bootargs ${defargs} ${ubiargs} " \ 85 "${setupargs} ${vidargs}; echo Booting from NAND...; " \ 86 "ubi part ubi && run m4boot && " \ 87 "ubi read ${kernel_addr_r} kernel && " \ 88 "ubi read ${fdt_addr_r} dtb && " \ 89 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ 90 91 #define CONFIG_BOOTCOMMAND "run ubiboot; run sdboot; run nfsboot" 92 93 #define CONFIG_EXTRA_ENV_SETTINGS \ 94 MEM_LAYOUT_ENV_SETTINGS \ 95 NFS_BOOTCMD \ 96 SD_BOOTCMD \ 97 UBI_BOOTCMD \ 98 "console=ttymxc0\0" \ 99 "defargs=\0" \ 100 "fdt_board=eval-v3\0" \ 101 "fdt_fixup=;\0" \ 102 "m4boot=;\0" \ 103 "ip_dyn=yes\0" \ 104 "kernel_file=zImage\0" \ 105 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ 106 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \ 107 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \ 108 "${board}/flash_eth.img && source ${loadaddr}\0" \ 109 "setsdupdate=mmc rescan && setenv interface mmc && " \ 110 "fatload ${interface} 0:1 ${loadaddr} " \ 111 "${board}/flash_blk.img && source ${loadaddr}\0" \ 112 "setup=setenv setupargs " \ 113 "console=tty1 console=${console}" \ 114 ",${baudrate}n8 ${memargs} consoleblank=0\0" \ 115 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \ 116 "setusbupdate=usb start && setenv interface usb && " \ 117 "fatload ${interface} 0:1 ${loadaddr} " \ 118 "${board}/flash_blk.img && source ${loadaddr}\0" \ 119 "splashpos=m,m\0" \ 120 "videomode=video=ctfb:x:640,y:480,depth:18,pclk:39722,le:48,ri:16,up:33,lo:10,hs:96,vs:2,sync:0,vmode:0\0" \ 121 "updlevel=2\0" 122 123 /* Miscellaneous configurable options */ 124 125 #define CONFIG_SYS_MEMTEST_START 0x80000000 126 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000) 127 128 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR 129 #define CONFIG_SYS_HZ 1000 130 131 /* Physical Memory Map */ 132 #define CONFIG_NR_DRAM_BANKS 1 133 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR 134 135 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM 136 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR 137 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE 138 139 #define CONFIG_SYS_INIT_SP_OFFSET \ 140 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) 141 #define CONFIG_SYS_INIT_SP_ADDR \ 142 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) 143 144 /* environment organization */ 145 146 #if defined(CONFIG_ENV_IS_IN_MMC) 147 #define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1 */ 148 #define CONFIG_SYS_MMC_ENV_PART 0 /* user area */ 149 #define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */ 150 #define CONFIG_ENV_OFFSET (8 * SZ_64K) 151 #elif defined(CONFIG_ENV_IS_IN_NAND) 152 #define CONFIG_ENV_SECT_SIZE (128 * 1024) 153 #define CONFIG_ENV_OFFSET (28 * CONFIG_ENV_SECT_SIZE) 154 #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE 155 #endif 156 157 /* NAND stuff */ 158 #define CONFIG_SYS_MAX_NAND_DEVICE 1 159 #define CONFIG_SYS_NAND_BASE 0x40000000 160 #define CONFIG_SYS_NAND_5_ADDR_CYCLE 161 #define CONFIG_SYS_NAND_ONFI_DETECTION 162 #define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES 163 164 /* Dynamic MTD partition support */ 165 #define CONFIG_MTD_PARTITIONS 166 #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ 167 168 /* DMA stuff, needed for GPMI/MXS NAND support */ 169 170 /* USB Configs */ 171 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET 172 173 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) 174 #define CONFIG_MXC_USB_FLAGS 0 175 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 176 177 #define CONFIG_IMX_THERMAL 178 179 #define CONFIG_USBD_HS 180 181 /* USB Device Firmware Update support */ 182 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M 183 #define DFU_DEFAULT_POLL_TIMEOUT 300 184 185 #ifdef CONFIG_VIDEO 186 #define CONFIG_VIDEO_MXS 187 #define CONFIG_VIDEO_LOGO 188 #define CONFIG_SPLASH_SCREEN 189 #define CONFIG_SPLASH_SCREEN_ALIGN 190 #define CONFIG_BMP_16BPP 191 #define CONFIG_VIDEO_BMP_RLE8 192 #define CONFIG_VIDEO_BMP_LOGO 193 #endif 194 195 #endif 196