arm: mvebu: clearfog: Unify DT selection paths
[platform/kernel/u-boot.git] / include / configs / mx6sabre_common.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2012 Freescale Semiconductor, Inc.
4  *
5  * Configuration settings for the Freescale i.MX6Q SabreSD board.
6  */
7
8 #ifndef __MX6QSABRE_COMMON_CONFIG_H
9 #define __MX6QSABRE_COMMON_CONFIG_H
10
11 #include "mx6_common.h"
12
13 #define CONFIG_IMX_THERMAL
14
15 /* Size of malloc() pool */
16 #define CONFIG_SYS_MALLOC_LEN           (10 * SZ_1M)
17
18 #define CONFIG_MXC_UART
19
20 /* MMC Configs */
21 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
22
23 #ifdef CONFIG_SUPPORT_EMMC_BOOT
24 #define EMMC_ENV \
25         "emmcdev=2\0" \
26         "update_emmc_firmware=" \
27                 "if test ${ip_dyn} = yes; then " \
28                         "setenv get_cmd dhcp; " \
29                 "else " \
30                         "setenv get_cmd tftp; " \
31                 "fi; " \
32                 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
33                         "if mmc dev ${emmcdev} 1; then "        \
34                                 "setexpr fw_sz ${filesize} / 0x200; " \
35                                 "setexpr fw_sz ${fw_sz} + 1; "  \
36                                 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
37                         "fi; "  \
38                 "fi\0"
39 #else
40 #define EMMC_ENV ""
41 #endif
42
43 #define CONFIG_EXTRA_ENV_SETTINGS \
44         "script=boot.scr\0" \
45         "image=zImage\0" \
46         "fdtfile=undefined\0" \
47         "fdt_addr=0x18000000\0" \
48         "boot_fdt=try\0" \
49         "ip_dyn=yes\0" \
50         "console=" CONSOLE_DEV "\0" \
51         "dfuspi=dfu 0 sf 0:0:10000000:0\0" \
52         "dfu_alt_info_spl=spl raw 0x400\0" \
53         "dfu_alt_info_img=u-boot raw 0x10000\0" \
54         "dfu_alt_info=spl raw 0x400\0" \
55         "fdt_high=0xffffffff\0"   \
56         "initrd_high=0xffffffff\0" \
57         "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
58         "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
59         "mmcpart=1\0" \
60         "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
61         "update_sd_firmware=" \
62                 "if test ${ip_dyn} = yes; then " \
63                         "setenv get_cmd dhcp; " \
64                 "else " \
65                         "setenv get_cmd tftp; " \
66                 "fi; " \
67                 "if mmc dev ${mmcdev}; then "   \
68                         "if ${get_cmd} ${update_sd_firmware_filename}; then " \
69                                 "setexpr fw_sz ${filesize} / 0x200; " \
70                                 "setexpr fw_sz ${fw_sz} + 1; "  \
71                                 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
72                         "fi; "  \
73                 "fi\0" \
74         EMMC_ENV          \
75         "mmcargs=setenv bootargs console=${console},${baudrate} " \
76                 "root=PARTUUID=${uuid} rootwait rw\0" \
77         "loadbootscript=" \
78                 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
79         "bootscript=echo Running bootscript from mmc ...; " \
80                 "source\0" \
81         "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
82         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdtfile}\0" \
83         "mmcboot=echo Booting from mmc ...; " \
84                 "run finduuid; " \
85                 "run mmcargs; " \
86                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
87                         "if run loadfdt; then " \
88                                 "bootz ${loadaddr} - ${fdt_addr}; " \
89                         "else " \
90                                 "if test ${boot_fdt} = try; then " \
91                                         "bootz; " \
92                                 "else " \
93                                         "echo WARN: Cannot load the DT; " \
94                                 "fi; " \
95                         "fi; " \
96                 "else " \
97                         "bootz; " \
98                 "fi;\0" \
99         "netargs=setenv bootargs console=${console},${baudrate} " \
100                 "root=/dev/nfs " \
101                 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
102         "netboot=echo Booting from net ...; " \
103                 "run netargs; " \
104                 "if test ${ip_dyn} = yes; then " \
105                         "setenv get_cmd dhcp; " \
106                 "else " \
107                         "setenv get_cmd tftp; " \
108                 "fi; " \
109                 "${get_cmd} ${image}; " \
110                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
111                         "if ${get_cmd} ${fdt_addr} ${fdtfile}; then " \
112                                 "bootz ${loadaddr} - ${fdt_addr}; " \
113                         "else " \
114                                 "if test ${boot_fdt} = try; then " \
115                                         "bootz; " \
116                                 "else " \
117                                         "echo WARN: Cannot load the DT; " \
118                                 "fi; " \
119                         "fi; " \
120                 "else " \
121                         "bootz; " \
122                 "fi;\0" \
123                 "findfdt="\
124                         "if test $fdtfile = undefined; then " \
125                                 "if test $board_name = SABREAUTO && test $board_rev = MX6QP; then " \
126                                         "setenv fdtfile imx6qp-sabreauto.dtb; fi; " \
127                                 "if test $board_name = SABREAUTO && test $board_rev = MX6Q; then " \
128                                         "setenv fdtfile imx6q-sabreauto.dtb; fi; " \
129                                 "if test $board_name = SABREAUTO && test $board_rev = MX6DL; then " \
130                                         "setenv fdtfile imx6dl-sabreauto.dtb; fi; " \
131                                 "if test $board_name = SABRESD && test $board_rev = MX6QP; then " \
132                                         "setenv fdtfile imx6qp-sabresd.dtb; fi; " \
133                                 "if test $board_name = SABRESD && test $board_rev = MX6Q; then " \
134                                         "setenv fdtfile imx6q-sabresd.dtb; fi; " \
135                                 "if test $board_name = SABRESD && test $board_rev = MX6DL; then " \
136                                         "setenv fdtfile imx6dl-sabresd.dtb; fi; " \
137                                 "if test $fdtfile = undefined; then " \
138                                         "echo WARNING: Could not determine dtb to use; fi; " \
139                         "fi;\0" \
140
141 #define CONFIG_BOOTCOMMAND \
142         "run findfdt;" \
143         "mmc dev ${mmcdev};" \
144         "if mmc rescan; then " \
145                 "if run loadbootscript; then " \
146                 "run bootscript; " \
147                 "else " \
148                         "if run loadimage; then " \
149                                 "run mmcboot; " \
150                         "else run netboot; " \
151                         "fi; " \
152                 "fi; " \
153         "else run netboot; fi"
154
155 #define CONFIG_ARP_TIMEOUT     200UL
156
157 #define CONFIG_SYS_MEMTEST_START       0x10000000
158 #define CONFIG_SYS_MEMTEST_END         0x10010000
159 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
160
161 /* Physical Memory Map */
162 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
163
164 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
165 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
166 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
167
168 #define CONFIG_SYS_INIT_SP_OFFSET \
169         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
170 #define CONFIG_SYS_INIT_SP_ADDR \
171         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
172
173 /* Environment organization */
174
175 /* Framebuffer */
176 #define CONFIG_VIDEO_BMP_RLE8
177 #define CONFIG_SPLASH_SCREEN
178 #define CONFIG_SPLASH_SCREEN_ALIGN
179 #define CONFIG_BMP_16BPP
180 #define CONFIG_VIDEO_LOGO
181 #define CONFIG_VIDEO_BMP_LOGO
182 #define CONFIG_IMX_HDMI
183 #define CONFIG_IMX_VIDEO_SKIP
184
185 #define CONFIG_USBD_HS
186
187 #endif                         /* __MX6QSABRE_COMMON_CONFIG_H */