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