blob: 77856a8f3a47991c2f0f18cfb57fa402e09b0a35 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Adrian Alonso1a8150d2015-09-03 11:49:28 -05002/*
3 * Copyright (C) 2015 Freescale Semiconductor, Inc.
4 *
5 * Configuration settings for the Freescale i.MX7D SABRESD board.
Adrian Alonso1a8150d2015-09-03 11:49:28 -05006 */
7
8#ifndef __MX7D_SABRESD_CONFIG_H
9#define __MX7D_SABRESD_CONFIG_H
10
11#include "mx7_common.h"
12
Adrian Alonso1a8150d2015-09-03 11:49:28 -050013#define PHYS_SDRAM_SIZE SZ_1G
14
Fabio Estevam5d692692016-02-22 18:41:48 -030015#define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
16
Fabio Estevam6baa2612016-03-26 13:30:49 -030017/* Size of malloc() pool */
18#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
19
Adrian Alonso1a8150d2015-09-03 11:49:28 -050020/* Network */
Adrian Alonso1a8150d2015-09-03 11:49:28 -050021#define CONFIG_FEC_MXC
Adrian Alonso1a8150d2015-09-03 11:49:28 -050022#define CONFIG_FEC_XCV_TYPE RGMII
23#define CONFIG_ETHPRIME "FEC"
24#define CONFIG_FEC_MXC_PHYADDR 0
25
Adrian Alonso1a8150d2015-09-03 11:49:28 -050026#define CONFIG_PHY_BROADCOM
Adrian Alonso1a8150d2015-09-03 11:49:28 -050027/* ENET1 */
28#define IMX_FEC_BASE ENET_IPS_BASE_ADDR
29
30/* MMC Config*/
31#define CONFIG_SYS_FSL_ESDHC_ADDR 0
32
Adrian Alonso1a8150d2015-09-03 11:49:28 -050033#undef CONFIG_BOOTM_NETBSD
34#undef CONFIG_BOOTM_PLAN9
35#undef CONFIG_BOOTM_RTEMS
36
Adrian Alonso1a8150d2015-09-03 11:49:28 -050037/* I2C configs */
Adrian Alonso1a8150d2015-09-03 11:49:28 -050038#define CONFIG_SYS_I2C_MXC
Adrian Alonso1a8150d2015-09-03 11:49:28 -050039#define CONFIG_SYS_I2C_SPEED 100000
40
Adrian Alonso1a8150d2015-09-03 11:49:28 -050041#define CONFIG_SYS_MMC_IMG_LOAD_PART 1
42
Peng Fan79e355f2016-01-28 16:55:08 +080043#ifdef CONFIG_IMX_BOOTAUX
44/* Set to QSPI1 A flash at default */
45#define CONFIG_SYS_AUXCORE_BOOTDATA 0x60000000
Peng Fan79e355f2016-01-28 16:55:08 +080046
47#define UPDATE_M4_ENV \
48 "m4image=m4_qspi.bin\0" \
49 "loadm4image=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4image}\0" \
50 "update_m4_from_sd=" \
51 "if sf probe 0:0; then " \
52 "if run loadm4image; then " \
53 "setexpr fw_sz ${filesize} + 0xffff; " \
54 "setexpr fw_sz ${fw_sz} / 0x10000; " \
55 "setexpr fw_sz ${fw_sz} * 0x10000; " \
56 "sf erase 0x0 ${fw_sz}; " \
57 "sf write ${loadaddr} 0x0 ${filesize}; " \
58 "fi; " \
59 "fi\0" \
60 "m4boot=sf probe 0:0; bootaux "__stringify(CONFIG_SYS_AUXCORE_BOOTDATA)"\0"
61#else
62#define UPDATE_M4_ENV ""
63#endif
64
Adrian Alonso1a8150d2015-09-03 11:49:28 -050065#define CONFIG_MFG_ENV_SETTINGS \
66 "mfgtool_args=setenv bootargs console=${console},${baudrate} " \
67 "rdinit=/linuxrc " \
68 "g_mass_storage.stall=0 g_mass_storage.removable=1 " \
69 "g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF "\
70 "g_mass_storage.iSerialNumber=\"\" "\
71 "clk_ignore_unused "\
72 "\0" \
73 "initrd_addr=0x83800000\0" \
74 "initrd_high=0xffffffff\0" \
75 "bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};\0" \
76
Tzu-Jung Lee73f1b802015-10-27 23:00:50 +000077#define CONFIG_DFU_ENV_SETTINGS \
78 "dfu_alt_info=image raw 0 0x800000;"\
79 "u-boot raw 0 0x4000;"\
80 "bootimg part 0 1;"\
81 "rootfs part 0 2\0" \
82
Adrian Alonso1a8150d2015-09-03 11:49:28 -050083#define CONFIG_EXTRA_ENV_SETTINGS \
Peng Fan79e355f2016-01-28 16:55:08 +080084 UPDATE_M4_ENV \
Adrian Alonso1a8150d2015-09-03 11:49:28 -050085 CONFIG_MFG_ENV_SETTINGS \
Tzu-Jung Lee73f1b802015-10-27 23:00:50 +000086 CONFIG_DFU_ENV_SETTINGS \
Adrian Alonso1a8150d2015-09-03 11:49:28 -050087 "script=boot.scr\0" \
88 "image=zImage\0" \
89 "console=ttymxc0\0" \
90 "fdt_high=0xffffffff\0" \
91 "initrd_high=0xffffffff\0" \
92 "fdt_file=imx7d-sdb.dtb\0" \
93 "fdt_addr=0x83000000\0" \
94 "boot_fdt=try\0" \
95 "ip_dyn=yes\0" \
Peng Fanebe517b2015-10-29 15:54:53 +080096 "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 Alonso1a8150d2015-09-03 11:49:28 -050097 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
98 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
99 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
100 "mmcautodetect=yes\0" \
101 "mmcargs=setenv bootargs console=${console},${baudrate} " \
102 "root=${mmcroot}\0" \
103 "loadbootscript=" \
104 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
105 "bootscript=echo Running bootscript from mmc ...; " \
106 "source\0" \
107 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
108 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
109 "mmcboot=echo Booting from mmc ...; " \
110 "run mmcargs; " \
111 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
112 "if run loadfdt; then " \
113 "bootz ${loadaddr} - ${fdt_addr}; " \
114 "else " \
115 "if test ${boot_fdt} = try; then " \
116 "bootz; " \
117 "else " \
118 "echo WARN: Cannot load the DT; " \
119 "fi; " \
120 "fi; " \
121 "else " \
122 "bootz; " \
123 "fi;\0" \
124 "netargs=setenv bootargs console=${console},${baudrate} " \
125 "root=/dev/nfs " \
126 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
127 "netboot=echo Booting from net ...; " \
128 "run netargs; " \
129 "if test ${ip_dyn} = yes; then " \
130 "setenv get_cmd dhcp; " \
131 "else " \
132 "setenv get_cmd tftp; " \
133 "fi; " \
134 "${get_cmd} ${image}; " \
135 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
136 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
137 "bootz ${loadaddr} - ${fdt_addr}; " \
138 "else " \
139 "if test ${boot_fdt} = try; then " \
140 "bootz; " \
141 "else " \
142 "echo WARN: Cannot load the DT; " \
143 "fi; " \
144 "fi; " \
145 "else " \
146 "bootz; " \
147 "fi;\0"
148
149#define CONFIG_BOOTCOMMAND \
150 "mmc dev ${mmcdev};" \
151 "mmc dev ${mmcdev}; if mmc rescan; then " \
152 "if run loadbootscript; then " \
153 "run bootscript; " \
154 "else " \
155 "if run loadimage; then " \
156 "run mmcboot; " \
157 "else run netboot; " \
158 "fi; " \
159 "fi; " \
160 "else run netboot; fi"
161
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500162#define CONFIG_SYS_MEMTEST_START 0x80000000
163#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x20000000)
164
165#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
166#define CONFIG_SYS_HZ 1000
167
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500168/* Physical Memory Map */
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500169#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
170
171#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
172#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
173#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
174
175#define CONFIG_SYS_INIT_SP_OFFSET \
176 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
177#define CONFIG_SYS_INIT_SP_ADDR \
178 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
179
Masahiro Yamadae856bdc2017-02-11 22:43:54 +0900180/* environment organization */
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500181#define CONFIG_ENV_SIZE SZ_8K
Peng Fan6e1a41c2015-12-22 17:04:24 +0800182
183/*
184 * If want to use nand, define CONFIG_NAND_MXS and rework board
185 * to support nand, since emmc has pin conflicts with nand
186 */
187#ifdef CONFIG_NAND_MXS
Peng Fan6e1a41c2015-12-22 17:04:24 +0800188/* NAND stuff */
189#define CONFIG_SYS_MAX_NAND_DEVICE 1
190#define CONFIG_SYS_NAND_BASE 0x40000000
191#define CONFIG_SYS_NAND_5_ADDR_CYCLE
192#define CONFIG_SYS_NAND_ONFI_DETECTION
193
194/* DMA stuff, needed for GPMI/MXS NAND support */
Peng Fan6e1a41c2015-12-22 17:04:24 +0800195#endif
196
Fabio Estevamda384fc2017-05-28 14:07:24 -0300197#define CONFIG_ENV_OFFSET (12 * SZ_64K)
Peng Fan6e1a41c2015-12-22 17:04:24 +0800198#ifdef CONFIG_NAND_MXS
199#define CONFIG_SYS_FSL_USDHC_NUM 1
200#else
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500201#define CONFIG_SYS_FSL_USDHC_NUM 2
Peng Fan6e1a41c2015-12-22 17:04:24 +0800202#endif
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500203
204#define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1 */
205#define CONFIG_SYS_MMC_ENV_PART 0 /* user area */
206#define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
207
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500208/* USB Configs */
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500209#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500210
211#define CONFIG_IMX_THERMAL
212
Tzu-Jung Lee73f1b802015-10-27 23:00:50 +0000213#define CONFIG_USBD_HS
Tzu-Jung Lee73f1b802015-10-27 23:00:50 +0000214
Peng Fanebe517b2015-10-29 15:54:53 +0800215#ifdef CONFIG_VIDEO
Peng Fanebe517b2015-10-29 15:54:53 +0800216#define CONFIG_VIDEO_MXS
217#define CONFIG_VIDEO_LOGO
Peng Fanebe517b2015-10-29 15:54:53 +0800218#define CONFIG_SPLASH_SCREEN
219#define CONFIG_SPLASH_SCREEN_ALIGN
Peng Fanebe517b2015-10-29 15:54:53 +0800220#define CONFIG_BMP_16BPP
221#define CONFIG_VIDEO_BMP_RLE8
222#define CONFIG_VIDEO_BMP_LOGO
223#endif
224
Peng Fan53cc6472015-11-30 17:45:02 +0800225#ifdef CONFIG_FSL_QSPI
Ye Li3b823352018-06-27 19:30:53 -0700226#define CONFIG_SYS_FSL_QSPI_AHB
Peng Fan53cc6472015-11-30 17:45:02 +0800227#define FSL_QSPI_FLASH_NUM 1
228#define FSL_QSPI_FLASH_SIZE SZ_64M
229#define QSPI0_BASE_ADDR QSPI1_IPS_BASE_ADDR
230#define QSPI0_AMBA_BASE QSPI0_ARB_BASE_ADDR
231#endif
232
Adrian Alonso1a8150d2015-09-03 11:49:28 -0500233#endif /* __CONFIG_H */