Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 2 | /* |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 3 | * Copyright 2016-2018 Toradex AG |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 4 | * |
| 5 | * Configuration settings for the Colibri iMX7 module. |
| 6 | * |
| 7 | * based on mx7dsabresd.h: |
| 8 | * Copyright (C) 2015 Freescale Semiconductor, Inc. |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef __COLIBRI_IMX7_CONFIG_H |
| 12 | #define __COLIBRI_IMX7_CONFIG_H |
| 13 | |
| 14 | #include "mx7_common.h" |
| 15 | |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 16 | /* Size of malloc() pool */ |
| 17 | #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) |
| 18 | |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 19 | /* Network */ |
| 20 | #define CONFIG_FEC_MXC |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 21 | #define CONFIG_FEC_XCV_TYPE RMII |
| 22 | #define CONFIG_ETHPRIME "FEC" |
| 23 | #define CONFIG_FEC_MXC_PHYADDR 0 |
| 24 | |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 25 | #define CONFIG_IP_DEFRAG |
Marcel Ziswiler | f7c81e2 | 2016-09-15 00:54:00 +0200 | [diff] [blame] | 26 | #define CONFIG_TFTP_BLOCKSIZE 16352 |
| 27 | #define CONFIG_TFTP_TSIZE |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 28 | |
| 29 | /* ENET1 */ |
| 30 | #define IMX_FEC_BASE ENET_IPS_BASE_ADDR |
| 31 | |
| 32 | /* MMC Config*/ |
| 33 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 34 | #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 35 | #define CONFIG_SYS_FSL_USDHC_NUM 1 |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 36 | #elif CONFIG_TARGET_COLIBRI_IMX7_EMMC |
| 37 | #define CONFIG_SYS_FSL_USDHC_NUM 2 |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 38 | #endif |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 39 | |
| 40 | #undef CONFIG_BOOTM_PLAN9 |
| 41 | #undef CONFIG_BOOTM_RTEMS |
| 42 | |
| 43 | /* I2C configs */ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 44 | #define CONFIG_SYS_I2C_MXC |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 45 | #define CONFIG_SYS_I2C_SPEED 100000 |
| 46 | |
| 47 | #define CONFIG_IPADDR 192.168.10.2 |
| 48 | #define CONFIG_NETMASK 255.255.255.0 |
| 49 | #define CONFIG_SERVERIP 192.168.10.1 |
| 50 | |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 51 | #define EMMC_BOOTCMD \ |
| 52 | "emmcargs=ip=off root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait\0" \ |
| 53 | "emmcboot=run setup; " \ |
| 54 | "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \ |
| 55 | "${vidargs}; echo Booting from internal eMMC chip...; " \ |
| 56 | "run m4boot && " \ |
| 57 | "load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-emmc-${fdt_board}.dtb && " \ |
| 58 | "load mmc 0:1 ${kernel_addr_r} ${boot_file} && " \ |
| 59 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" |
| 60 | |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 61 | #define MEM_LAYOUT_ENV_SETTINGS \ |
Stefan Agner | 9af131e | 2017-03-09 17:17:51 -0800 | [diff] [blame] | 62 | "bootm_size=0x10000000\0" \ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 63 | "fdt_addr_r=0x82000000\0" \ |
| 64 | "fdt_high=0xffffffff\0" \ |
| 65 | "initrd_high=0xffffffff\0" \ |
| 66 | "kernel_addr_r=0x81000000\0" \ |
| 67 | "ramdisk_addr_r=0x82100000\0" |
| 68 | |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 69 | #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND) |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 70 | #define SD_BOOTCMD \ |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 71 | "sdargs=root=/dev/mmcblk0p2 ro rootwait\0" \ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 72 | "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \ |
| 73 | "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \ |
| 74 | "run m4boot && " \ |
| 75 | "load mmc 0:1 ${kernel_addr_r} ${kernel_file} && " \ |
| 76 | "load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \ |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 77 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" |
| 78 | #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC) |
| 79 | #define SD_BOOTCMD \ |
| 80 | "sdargs=root=/dev/mmcblk1p2 ro rootwait\0" \ |
| 81 | "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \ |
| 82 | "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \ |
| 83 | "run m4boot && " \ |
| 84 | "load mmc 1:1 ${kernel_addr_r} ${kernel_file} && " \ |
| 85 | "load mmc 1:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \ |
| 86 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" |
| 87 | #endif |
| 88 | |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 89 | |
| 90 | #define NFS_BOOTCMD \ |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 91 | "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 92 | "nfsboot=run setup; " \ |
| 93 | "setenv bootargs ${defargs} ${nfsargs} " \ |
| 94 | "${setupargs} ${vidargs}; echo Booting from NFS...;" \ |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 95 | "dhcp ${kernel_addr_r} && " \ |
| 96 | "tftp ${fdt_addr_r} ${soc}-colibri${variant}-${fdt_board}.dtb && " \ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 97 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ |
| 98 | |
| 99 | #define UBI_BOOTCMD \ |
| 100 | "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \ |
| 101 | "ubi.fm_autoconvert=1\0" \ |
| 102 | "ubiboot=run setup; " \ |
| 103 | "setenv bootargs ${defargs} ${ubiargs} " \ |
| 104 | "${setupargs} ${vidargs}; echo Booting from NAND...; " \ |
| 105 | "ubi part ubi && run m4boot && " \ |
| 106 | "ubi read ${kernel_addr_r} kernel && " \ |
| 107 | "ubi read ${fdt_addr_r} dtb && " \ |
| 108 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ |
| 109 | |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 110 | #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND) |
Stefan Agner | 2bc18ce | 2019-01-08 12:42:28 +0100 | [diff] [blame] | 111 | #define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \ |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 112 | "setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;" |
| 113 | #define MODULE_EXTRA_ENV_SETTINGS \ |
| 114 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ |
| 115 | UBI_BOOTCMD |
| 116 | #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC) |
Stefan Agner | 2bc18ce | 2019-01-08 12:42:28 +0100 | [diff] [blame] | 117 | #define CONFIG_BOOTCOMMAND "run emmcboot ; echo ; echo emmcboot failed ; " \ |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 118 | "setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;" |
| 119 | #define MODULE_EXTRA_ENV_SETTINGS \ |
| 120 | "variant=-emmc\0" \ |
| 121 | EMMC_BOOTCMD |
| 122 | #endif |
| 123 | |
| 124 | #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND) |
| 125 | #define BOOT_TARGET_DEVICES(func) \ |
| 126 | func(MMC, mmc, 0) \ |
| 127 | func(USB, usb, 0) \ |
| 128 | func(DHCP, dhcp, na) |
| 129 | #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC) |
| 130 | #define BOOT_TARGET_DEVICES(func) \ |
| 131 | func(MMC, mmc, 0) \ |
| 132 | func(MMC, mmc, 1) \ |
| 133 | func(USB, usb, 0) \ |
| 134 | func(DHCP, dhcp, na) |
| 135 | #endif |
| 136 | #include <config_distro_bootcmd.h> |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 137 | |
| 138 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 139 | BOOTENV \ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 140 | MEM_LAYOUT_ENV_SETTINGS \ |
| 141 | NFS_BOOTCMD \ |
| 142 | SD_BOOTCMD \ |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 143 | MODULE_EXTRA_ENV_SETTINGS \ |
Stefan Agner | 2bc18ce | 2019-01-08 12:42:28 +0100 | [diff] [blame] | 144 | "boot_file=zImage\0" \ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 145 | "console=ttymxc0\0" \ |
| 146 | "defargs=\0" \ |
| 147 | "fdt_board=eval-v3\0" \ |
| 148 | "fdt_fixup=;\0" \ |
| 149 | "m4boot=;\0" \ |
| 150 | "ip_dyn=yes\0" \ |
| 151 | "kernel_file=zImage\0" \ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 152 | "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \ |
| 153 | "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \ |
| 154 | "${board}/flash_eth.img && source ${loadaddr}\0" \ |
| 155 | "setsdupdate=mmc rescan && setenv interface mmc && " \ |
| 156 | "fatload ${interface} 0:1 ${loadaddr} " \ |
| 157 | "${board}/flash_blk.img && source ${loadaddr}\0" \ |
| 158 | "setup=setenv setupargs " \ |
| 159 | "console=tty1 console=${console}" \ |
Stefan Agner | 6409570 | 2017-03-09 17:17:54 -0800 | [diff] [blame] | 160 | ",${baudrate}n8 ${memargs} consoleblank=0\0" \ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 161 | "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \ |
| 162 | "setusbupdate=usb start && setenv interface usb && " \ |
| 163 | "fatload ${interface} 0:1 ${loadaddr} " \ |
| 164 | "${board}/flash_blk.img && source ${loadaddr}\0" \ |
| 165 | "splashpos=m,m\0" \ |
| 166 | "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] | 167 | "updlevel=2\0" |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 168 | |
| 169 | /* Miscellaneous configurable options */ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 170 | |
| 171 | #define CONFIG_SYS_MEMTEST_START 0x80000000 |
| 172 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000) |
| 173 | |
| 174 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 175 | #define CONFIG_SYS_HZ 1000 |
| 176 | |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 177 | /* Physical Memory Map */ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 178 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 179 | |
| 180 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 181 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 182 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 183 | |
| 184 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 185 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 186 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 187 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 188 | |
Masahiro Yamada | e856bdc | 2017-02-11 22:43:54 +0900 | [diff] [blame] | 189 | /* environment organization */ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 190 | |
| 191 | #if defined(CONFIG_ENV_IS_IN_MMC) |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 192 | /* Environment in eMMC, before config block at the end of 1st "boot sector" */ |
| 193 | #define CONFIG_ENV_SIZE (8 * 1024) |
| 194 | #define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \ |
| 195 | CONFIG_TDX_CFG_BLOCK_OFFSET) |
| 196 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
| 197 | #define CONFIG_SYS_MMC_ENV_PART 1 |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 198 | #elif defined(CONFIG_ENV_IS_IN_NAND) |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 199 | #define CONFIG_ENV_SECT_SIZE (128 * 1024) |
Stefan Agner | 38045f5 | 2017-03-09 17:17:55 -0800 | [diff] [blame] | 200 | #define CONFIG_ENV_OFFSET (28 * CONFIG_ENV_SECT_SIZE) |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 201 | #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE |
| 202 | #endif |
| 203 | |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 204 | #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 205 | /* NAND stuff */ |
| 206 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 207 | #define CONFIG_SYS_NAND_BASE 0x40000000 |
| 208 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 209 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
| 210 | #define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES |
Stefan Agner | a62c606 | 2018-08-06 09:19:19 +0200 | [diff] [blame] | 211 | #endif |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 212 | |
| 213 | /* USB Configs */ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 214 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET |
| 215 | |
| 216 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 217 | #define CONFIG_MXC_USB_FLAGS 0 |
| 218 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 |
| 219 | |
| 220 | #define CONFIG_IMX_THERMAL |
| 221 | |
| 222 | #define CONFIG_USBD_HS |
| 223 | |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 224 | /* USB Device Firmware Update support */ |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 225 | #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M |
| 226 | #define DFU_DEFAULT_POLL_TIMEOUT 300 |
| 227 | |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 228 | #ifdef CONFIG_VIDEO |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 229 | #define CONFIG_VIDEO_MXS |
| 230 | #define CONFIG_VIDEO_LOGO |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 231 | #define CONFIG_SPLASH_SCREEN |
| 232 | #define CONFIG_SPLASH_SCREEN_ALIGN |
Stefan Agner | ae440ab | 2016-07-20 21:27:49 -0700 | [diff] [blame] | 233 | #define CONFIG_BMP_16BPP |
| 234 | #define CONFIG_VIDEO_BMP_RLE8 |
| 235 | #define CONFIG_VIDEO_BMP_LOGO |
| 236 | #endif |
| 237 | |
| 238 | #endif |