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