Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 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_SYS_THUMB_BUILD |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 18 | |
| 19 | /*#define CONFIG_DBG_MONITOR*/ |
| 20 | #define PHYS_SDRAM_SIZE SZ_512M |
| 21 | |
Marcel Ziswiler | d92dee5 | 2016-11-16 17:49:23 +0100 | [diff] [blame] | 22 | #define CONFIG_ARCH_MISC_INIT |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 23 | #define CONFIG_BOARD_EARLY_INIT_F |
| 24 | #define CONFIG_BOARD_LATE_INIT |
| 25 | |
Marcel Ziswiler | d92dee5 | 2016-11-16 17:49:23 +0100 | [diff] [blame] | 26 | #define CONFIG_DISPLAY_BOARDINFO_LATE /* Calls show_board_info() */ |
| 27 | |
| 28 | #define CONFIG_ENV_VARS_UBOOT_CONFIG |
| 29 | #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 30 | |
| 31 | /* Size of malloc() pool */ |
| 32 | #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) |
| 33 | |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 34 | #define CONFIG_CMD_BMODE |
| 35 | |
| 36 | /* Network */ |
| 37 | #define CONFIG_FEC_MXC |
| 38 | #define CONFIG_MII |
| 39 | #define CONFIG_FEC_XCV_TYPE RMII |
| 40 | #define CONFIG_ETHPRIME "FEC" |
| 41 | #define CONFIG_FEC_MXC_PHYADDR 0 |
| 42 | |
| 43 | #define CONFIG_PHYLIB |
| 44 | #define CONFIG_PHY_MICREL |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 45 | #define CONFIG_IP_DEFRAG |
Marcel Ziswiler | 36124b9 | 2016-09-15 00:54:00 +0200 | [diff] [blame] | 46 | #define CONFIG_TFTP_BLOCKSIZE 16352 |
| 47 | #define CONFIG_TFTP_TSIZE |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 48 | |
| 49 | /* ENET1 */ |
| 50 | #define IMX_FEC_BASE ENET_IPS_BASE_ADDR |
| 51 | |
| 52 | /* MMC Config*/ |
| 53 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 54 | #define CONFIG_SYS_FSL_USDHC_NUM 1 |
| 55 | |
| 56 | #undef CONFIG_BOOTM_PLAN9 |
| 57 | #undef CONFIG_BOOTM_RTEMS |
| 58 | |
| 59 | /* I2C configs */ |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 60 | #define CONFIG_SYS_I2C_MXC |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 61 | #define CONFIG_SYS_I2C_SPEED 100000 |
| 62 | |
| 63 | #define CONFIG_IPADDR 192.168.10.2 |
| 64 | #define CONFIG_NETMASK 255.255.255.0 |
| 65 | #define CONFIG_SERVERIP 192.168.10.1 |
| 66 | |
| 67 | #define MEM_LAYOUT_ENV_SETTINGS \ |
| 68 | "fdt_addr_r=0x82000000\0" \ |
| 69 | "fdt_high=0xffffffff\0" \ |
| 70 | "initrd_high=0xffffffff\0" \ |
| 71 | "kernel_addr_r=0x81000000\0" \ |
| 72 | "ramdisk_addr_r=0x82100000\0" |
| 73 | |
| 74 | #define SD_BOOTCMD \ |
| 75 | "sdargs=root=/dev/mmcblk0p2 rw rootwait\0" \ |
| 76 | "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \ |
| 77 | "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \ |
| 78 | "run m4boot && " \ |
| 79 | "load mmc 0:1 ${kernel_addr_r} ${kernel_file} && " \ |
| 80 | "load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \ |
| 81 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ |
| 82 | |
| 83 | #define NFS_BOOTCMD \ |
| 84 | "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \ |
| 85 | "nfsboot=run setup; " \ |
| 86 | "setenv bootargs ${defargs} ${nfsargs} " \ |
| 87 | "${setupargs} ${vidargs}; echo Booting from NFS...;" \ |
| 88 | "dhcp ${kernel_addr_r} && " \ |
| 89 | "tftp ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \ |
| 90 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ |
| 91 | |
| 92 | #define UBI_BOOTCMD \ |
| 93 | "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \ |
| 94 | "ubi.fm_autoconvert=1\0" \ |
| 95 | "ubiboot=run setup; " \ |
| 96 | "setenv bootargs ${defargs} ${ubiargs} " \ |
| 97 | "${setupargs} ${vidargs}; echo Booting from NAND...; " \ |
| 98 | "ubi part ubi && run m4boot && " \ |
| 99 | "ubi read ${kernel_addr_r} kernel && " \ |
| 100 | "ubi read ${fdt_addr_r} dtb && " \ |
| 101 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ |
| 102 | |
| 103 | #define CONFIG_BOOTCOMMAND "run ubiboot; run sdboot; run nfsboot" |
| 104 | |
| 105 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 106 | MEM_LAYOUT_ENV_SETTINGS \ |
| 107 | NFS_BOOTCMD \ |
| 108 | SD_BOOTCMD \ |
| 109 | UBI_BOOTCMD \ |
| 110 | "console=ttymxc0\0" \ |
| 111 | "defargs=\0" \ |
| 112 | "fdt_board=eval-v3\0" \ |
| 113 | "fdt_fixup=;\0" \ |
| 114 | "m4boot=;\0" \ |
| 115 | "ip_dyn=yes\0" \ |
| 116 | "kernel_file=zImage\0" \ |
| 117 | "mtdparts=" MTDPARTS_DEFAULT "\0" \ |
| 118 | "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \ |
| 119 | "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \ |
| 120 | "${board}/flash_eth.img && source ${loadaddr}\0" \ |
| 121 | "setsdupdate=mmc rescan && setenv interface mmc && " \ |
| 122 | "fatload ${interface} 0:1 ${loadaddr} " \ |
| 123 | "${board}/flash_blk.img && source ${loadaddr}\0" \ |
| 124 | "setup=setenv setupargs " \ |
| 125 | "console=tty1 console=${console}" \ |
| 126 | ",${baudrate}n8 ${memargs} consoleblank=0 ${mtdparts}\0" \ |
| 127 | "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \ |
| 128 | "setusbupdate=usb start && setenv interface usb && " \ |
| 129 | "fatload ${interface} 0:1 ${loadaddr} " \ |
| 130 | "${board}/flash_blk.img && source ${loadaddr}\0" \ |
| 131 | "splashpos=m,m\0" \ |
| 132 | "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" \ |
| 133 | |
| 134 | /* Miscellaneous configurable options */ |
| 135 | #define CONFIG_SYS_LONGHELP |
| 136 | |
| 137 | #define CONFIG_SYS_MEMTEST_START 0x80000000 |
| 138 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000) |
| 139 | |
| 140 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 141 | #define CONFIG_SYS_HZ 1000 |
| 142 | |
| 143 | #define CONFIG_STACKSIZE SZ_128K |
| 144 | |
| 145 | /* Physical Memory Map */ |
| 146 | #define CONFIG_NR_DRAM_BANKS 1 |
| 147 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 148 | |
| 149 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 150 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 151 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 152 | |
| 153 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 154 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 155 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 156 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 157 | |
| 158 | /* FLASH and environment organization */ |
| 159 | #define CONFIG_SYS_NO_FLASH |
| 160 | #define CONFIG_ENV_IS_IN_NAND |
| 161 | |
| 162 | #if defined(CONFIG_ENV_IS_IN_MMC) |
| 163 | #define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1 */ |
| 164 | #define CONFIG_SYS_MMC_ENV_PART 0 /* user area */ |
| 165 | #define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */ |
| 166 | #define CONFIG_ENV_OFFSET (8 * SZ_64K) |
| 167 | #elif defined(CONFIG_ENV_IS_IN_NAND) |
| 168 | #define CONFIG_ENV_OFFSET (4 * 1024 * 1024) |
| 169 | #define CONFIG_ENV_SECT_SIZE (128 * 1024) |
| 170 | #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE |
| 171 | #endif |
| 172 | |
| 173 | #define CONFIG_NAND_MXS |
| 174 | #define CONFIG_CMD_NAND_TRIMFFS |
| 175 | |
| 176 | /* NAND stuff */ |
| 177 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 178 | #define CONFIG_SYS_NAND_BASE 0x40000000 |
| 179 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 180 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
| 181 | #define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES |
| 182 | #define CONFIG_CMD_NAND_TORTURE |
| 183 | |
| 184 | /* UBI stuff */ |
| 185 | #define CONFIG_RBTREE |
| 186 | #define CONFIG_LZO |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 187 | #define CONFIG_CMD_UBIFS /* increases size by almost 60 KB */ |
| 188 | |
| 189 | /* Dynamic MTD partition support */ |
| 190 | #define CONFIG_CMD_MTDPARTS /* Enable 'mtdparts' command line support */ |
| 191 | #define CONFIG_MTD_PARTITIONS |
| 192 | #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ |
| 193 | #define MTDIDS_DEFAULT "nand0=gpmi-nand" |
| 194 | #define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:" \ |
| 195 | "512k(mx7-bcb)," \ |
| 196 | "3584k(u-boot)ro," \ |
| 197 | "512k(u-boot-env)," \ |
| 198 | "-(ubi)" |
| 199 | |
| 200 | /* DMA stuff, needed for GPMI/MXS NAND support */ |
| 201 | #define CONFIG_APBH_DMA |
| 202 | #define CONFIG_APBH_DMA_BURST |
| 203 | #define CONFIG_APBH_DMA_BURST8 |
| 204 | |
| 205 | /* USB Configs */ |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 206 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET |
| 207 | |
| 208 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 209 | #define CONFIG_MXC_USB_FLAGS 0 |
| 210 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 |
| 211 | |
| 212 | #define CONFIG_IMX_THERMAL |
| 213 | |
| 214 | #define CONFIG_USBD_HS |
| 215 | |
| 216 | #define CONFIG_USB_FUNCTION_MASS_STORAGE |
| 217 | |
| 218 | /* USB Device Firmware Update support */ |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 219 | #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M |
| 220 | #define DFU_DEFAULT_POLL_TIMEOUT 300 |
| 221 | |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 222 | #ifdef CONFIG_VIDEO |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 223 | #define CONFIG_VIDEO_MXS |
| 224 | #define CONFIG_VIDEO_LOGO |
Stefan Agner | 41f75bb | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 225 | #define CONFIG_SPLASH_SCREEN |
| 226 | #define CONFIG_SPLASH_SCREEN_ALIGN |
| 227 | #define CONFIG_CMD_BMP |
| 228 | #define CONFIG_BMP_16BPP |
| 229 | #define CONFIG_VIDEO_BMP_RLE8 |
| 230 | #define CONFIG_VIDEO_BMP_LOGO |
| 231 | #endif |
| 232 | |
| 233 | #endif |