Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015 Freescale Semiconductor, Inc. |
| 4 | * |
| 5 | * Configuration settings for the Freescale i.MX7D SABRESD board. |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __MX7D_SABRESD_CONFIG_H |
| 9 | #define __MX7D_SABRESD_CONFIG_H |
| 10 | |
| 11 | #include "mx7_common.h" |
| 12 | |
| 13 | #define CONFIG_DBG_MONITOR |
| 14 | #define PHYS_SDRAM_SIZE SZ_1G |
| 15 | |
Fabio Estevam | 82bf1a0 | 2016-02-22 18:41:48 -0300 | [diff] [blame] | 16 | #define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR |
| 17 | |
Fabio Estevam | ddeb4c4 | 2016-03-26 13:30:49 -0300 | [diff] [blame] | 18 | /* Size of malloc() pool */ |
| 19 | #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) |
| 20 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 21 | /* Network */ |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 22 | #define CONFIG_FEC_MXC |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 23 | #define CONFIG_FEC_XCV_TYPE RGMII |
| 24 | #define CONFIG_ETHPRIME "FEC" |
| 25 | #define CONFIG_FEC_MXC_PHYADDR 0 |
| 26 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 27 | #define CONFIG_PHY_BROADCOM |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 28 | /* ENET1 */ |
| 29 | #define IMX_FEC_BASE ENET_IPS_BASE_ADDR |
| 30 | |
| 31 | /* MMC Config*/ |
| 32 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 33 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 34 | #undef CONFIG_BOOTM_NETBSD |
| 35 | #undef CONFIG_BOOTM_PLAN9 |
| 36 | #undef CONFIG_BOOTM_RTEMS |
| 37 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 38 | /* I2C configs */ |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 39 | #define CONFIG_SYS_I2C_MXC |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 40 | #define CONFIG_SYS_I2C_SPEED 100000 |
| 41 | |
| 42 | #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */ |
| 43 | #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 |
| 44 | |
Peng Fan | 48509ae | 2016-01-28 16:55:08 +0800 | [diff] [blame] | 45 | #ifdef CONFIG_IMX_BOOTAUX |
| 46 | /* Set to QSPI1 A flash at default */ |
| 47 | #define CONFIG_SYS_AUXCORE_BOOTDATA 0x60000000 |
Peng Fan | 48509ae | 2016-01-28 16:55:08 +0800 | [diff] [blame] | 48 | |
| 49 | #define UPDATE_M4_ENV \ |
| 50 | "m4image=m4_qspi.bin\0" \ |
| 51 | "loadm4image=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4image}\0" \ |
| 52 | "update_m4_from_sd=" \ |
| 53 | "if sf probe 0:0; then " \ |
| 54 | "if run loadm4image; then " \ |
| 55 | "setexpr fw_sz ${filesize} + 0xffff; " \ |
| 56 | "setexpr fw_sz ${fw_sz} / 0x10000; " \ |
| 57 | "setexpr fw_sz ${fw_sz} * 0x10000; " \ |
| 58 | "sf erase 0x0 ${fw_sz}; " \ |
| 59 | "sf write ${loadaddr} 0x0 ${filesize}; " \ |
| 60 | "fi; " \ |
| 61 | "fi\0" \ |
| 62 | "m4boot=sf probe 0:0; bootaux "__stringify(CONFIG_SYS_AUXCORE_BOOTDATA)"\0" |
| 63 | #else |
| 64 | #define UPDATE_M4_ENV "" |
| 65 | #endif |
| 66 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 67 | #define CONFIG_MFG_ENV_SETTINGS \ |
| 68 | "mfgtool_args=setenv bootargs console=${console},${baudrate} " \ |
| 69 | "rdinit=/linuxrc " \ |
| 70 | "g_mass_storage.stall=0 g_mass_storage.removable=1 " \ |
| 71 | "g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF "\ |
| 72 | "g_mass_storage.iSerialNumber=\"\" "\ |
| 73 | "clk_ignore_unused "\ |
| 74 | "\0" \ |
| 75 | "initrd_addr=0x83800000\0" \ |
| 76 | "initrd_high=0xffffffff\0" \ |
| 77 | "bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};\0" \ |
| 78 | |
Tzu-Jung Lee | 7db2714 | 2015-10-27 23:00:50 +0000 | [diff] [blame] | 79 | #define CONFIG_DFU_ENV_SETTINGS \ |
| 80 | "dfu_alt_info=image raw 0 0x800000;"\ |
| 81 | "u-boot raw 0 0x4000;"\ |
| 82 | "bootimg part 0 1;"\ |
| 83 | "rootfs part 0 2\0" \ |
| 84 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 85 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Peng Fan | 48509ae | 2016-01-28 16:55:08 +0800 | [diff] [blame] | 86 | UPDATE_M4_ENV \ |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 87 | CONFIG_MFG_ENV_SETTINGS \ |
Tzu-Jung Lee | 7db2714 | 2015-10-27 23:00:50 +0000 | [diff] [blame] | 88 | CONFIG_DFU_ENV_SETTINGS \ |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 89 | "script=boot.scr\0" \ |
| 90 | "image=zImage\0" \ |
| 91 | "console=ttymxc0\0" \ |
| 92 | "fdt_high=0xffffffff\0" \ |
| 93 | "initrd_high=0xffffffff\0" \ |
| 94 | "fdt_file=imx7d-sdb.dtb\0" \ |
| 95 | "fdt_addr=0x83000000\0" \ |
| 96 | "boot_fdt=try\0" \ |
| 97 | "ip_dyn=yes\0" \ |
Peng Fan | 55be1ed | 2015-10-29 15:54:53 +0800 | [diff] [blame] | 98 | "videomode=video=ctfb:x:480,y:272,depth:24,pclk:108695,le:8,ri:4,up:2,lo:4,hs:41,vs:10,sync:0,vmode:0\0" \ |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 99 | "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ |
| 100 | "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ |
| 101 | "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ |
| 102 | "mmcautodetect=yes\0" \ |
| 103 | "mmcargs=setenv bootargs console=${console},${baudrate} " \ |
| 104 | "root=${mmcroot}\0" \ |
| 105 | "loadbootscript=" \ |
| 106 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 107 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 108 | "source\0" \ |
| 109 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ |
| 110 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
| 111 | "mmcboot=echo Booting from mmc ...; " \ |
| 112 | "run mmcargs; " \ |
| 113 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 114 | "if run loadfdt; then " \ |
| 115 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
| 116 | "else " \ |
| 117 | "if test ${boot_fdt} = try; then " \ |
| 118 | "bootz; " \ |
| 119 | "else " \ |
| 120 | "echo WARN: Cannot load the DT; " \ |
| 121 | "fi; " \ |
| 122 | "fi; " \ |
| 123 | "else " \ |
| 124 | "bootz; " \ |
| 125 | "fi;\0" \ |
| 126 | "netargs=setenv bootargs console=${console},${baudrate} " \ |
| 127 | "root=/dev/nfs " \ |
| 128 | "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 129 | "netboot=echo Booting from net ...; " \ |
| 130 | "run netargs; " \ |
| 131 | "if test ${ip_dyn} = yes; then " \ |
| 132 | "setenv get_cmd dhcp; " \ |
| 133 | "else " \ |
| 134 | "setenv get_cmd tftp; " \ |
| 135 | "fi; " \ |
| 136 | "${get_cmd} ${image}; " \ |
| 137 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 138 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ |
| 139 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
| 140 | "else " \ |
| 141 | "if test ${boot_fdt} = try; then " \ |
| 142 | "bootz; " \ |
| 143 | "else " \ |
| 144 | "echo WARN: Cannot load the DT; " \ |
| 145 | "fi; " \ |
| 146 | "fi; " \ |
| 147 | "else " \ |
| 148 | "bootz; " \ |
| 149 | "fi;\0" |
| 150 | |
| 151 | #define CONFIG_BOOTCOMMAND \ |
| 152 | "mmc dev ${mmcdev};" \ |
| 153 | "mmc dev ${mmcdev}; if mmc rescan; then " \ |
| 154 | "if run loadbootscript; then " \ |
| 155 | "run bootscript; " \ |
| 156 | "else " \ |
| 157 | "if run loadimage; then " \ |
| 158 | "run mmcboot; " \ |
| 159 | "else run netboot; " \ |
| 160 | "fi; " \ |
| 161 | "fi; " \ |
| 162 | "else run netboot; fi" |
| 163 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 164 | #define CONFIG_SYS_MEMTEST_START 0x80000000 |
| 165 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x20000000) |
| 166 | |
| 167 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 168 | #define CONFIG_SYS_HZ 1000 |
| 169 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 170 | /* Physical Memory Map */ |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 171 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 172 | |
| 173 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 174 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 175 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 176 | |
| 177 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 178 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 179 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 180 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 181 | |
Masahiro Yamada | 8cea9b5 | 2017-02-11 22:43:54 +0900 | [diff] [blame] | 182 | /* environment organization */ |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 183 | #define CONFIG_ENV_SIZE SZ_8K |
Peng Fan | 62f9260 | 2015-12-22 17:04:24 +0800 | [diff] [blame] | 184 | |
| 185 | /* |
| 186 | * If want to use nand, define CONFIG_NAND_MXS and rework board |
| 187 | * to support nand, since emmc has pin conflicts with nand |
| 188 | */ |
| 189 | #ifdef CONFIG_NAND_MXS |
Peng Fan | 62f9260 | 2015-12-22 17:04:24 +0800 | [diff] [blame] | 190 | /* NAND stuff */ |
| 191 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 192 | #define CONFIG_SYS_NAND_BASE 0x40000000 |
| 193 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 194 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
| 195 | |
| 196 | /* DMA stuff, needed for GPMI/MXS NAND support */ |
Peng Fan | 62f9260 | 2015-12-22 17:04:24 +0800 | [diff] [blame] | 197 | #endif |
| 198 | |
Fabio Estevam | 13562e0 | 2017-05-28 14:07:24 -0300 | [diff] [blame] | 199 | #define CONFIG_ENV_OFFSET (12 * SZ_64K) |
Peng Fan | 62f9260 | 2015-12-22 17:04:24 +0800 | [diff] [blame] | 200 | #ifdef CONFIG_NAND_MXS |
| 201 | #define CONFIG_SYS_FSL_USDHC_NUM 1 |
| 202 | #else |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 203 | #define CONFIG_SYS_FSL_USDHC_NUM 2 |
Peng Fan | 62f9260 | 2015-12-22 17:04:24 +0800 | [diff] [blame] | 204 | #endif |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 205 | |
| 206 | #define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1 */ |
| 207 | #define CONFIG_SYS_MMC_ENV_PART 0 /* user area */ |
| 208 | #define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */ |
| 209 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 210 | /* USB Configs */ |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 211 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 212 | |
| 213 | #define CONFIG_IMX_THERMAL |
| 214 | |
Tzu-Jung Lee | 7db2714 | 2015-10-27 23:00:50 +0000 | [diff] [blame] | 215 | #define CONFIG_USBD_HS |
Tzu-Jung Lee | 7db2714 | 2015-10-27 23:00:50 +0000 | [diff] [blame] | 216 | |
Peng Fan | 55be1ed | 2015-10-29 15:54:53 +0800 | [diff] [blame] | 217 | #ifdef CONFIG_VIDEO |
Peng Fan | 55be1ed | 2015-10-29 15:54:53 +0800 | [diff] [blame] | 218 | #define CONFIG_VIDEO_MXS |
| 219 | #define CONFIG_VIDEO_LOGO |
Peng Fan | 55be1ed | 2015-10-29 15:54:53 +0800 | [diff] [blame] | 220 | #define CONFIG_SPLASH_SCREEN |
| 221 | #define CONFIG_SPLASH_SCREEN_ALIGN |
Peng Fan | 55be1ed | 2015-10-29 15:54:53 +0800 | [diff] [blame] | 222 | #define CONFIG_BMP_16BPP |
| 223 | #define CONFIG_VIDEO_BMP_RLE8 |
| 224 | #define CONFIG_VIDEO_BMP_LOGO |
| 225 | #endif |
| 226 | |
Peng Fan | 7431e70 | 2015-11-30 17:45:02 +0800 | [diff] [blame] | 227 | #ifdef CONFIG_FSL_QSPI |
Ye Li | 3c5c2d6 | 2018-06-27 19:30:53 -0700 | [diff] [blame] | 228 | #define CONFIG_SYS_FSL_QSPI_AHB |
Peng Fan | 7431e70 | 2015-11-30 17:45:02 +0800 | [diff] [blame] | 229 | #define CONFIG_SF_DEFAULT_BUS 0 |
| 230 | #define CONFIG_SF_DEFAULT_CS 0 |
| 231 | #define CONFIG_SF_DEFAULT_SPEED 40000000 |
| 232 | #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 |
| 233 | #define FSL_QSPI_FLASH_NUM 1 |
| 234 | #define FSL_QSPI_FLASH_SIZE SZ_64M |
| 235 | #define QSPI0_BASE_ADDR QSPI1_IPS_BASE_ADDR |
| 236 | #define QSPI0_AMBA_BASE QSPI0_ARB_BASE_ADDR |
| 237 | #endif |
| 238 | |
Adrian Alonso | 9881077 | 2015-09-03 11:49:28 -0500 | [diff] [blame] | 239 | #endif /* __CONFIG_H */ |