1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Freescale i.MX23 EVK board config
4  *
5  * Copyright (C) 2013 Otavio Salvador <otavio@ossystems.com.br>
6  * on behalf of O.S. Systems Software LTDA.
7  */
8 #ifndef __CONFIGS_MX23EVK_H__
9 #define __CONFIGS_MX23EVK_H__
10 
11 /* System configurations */
12 #define CONFIG_MACH_TYPE	MACH_TYPE_MX23EVK
13 
14 /* U-Boot Commands */
15 
16 /* Memory configuration */
17 #define PHYS_SDRAM_1			0x40000000	/* Base address */
18 #define PHYS_SDRAM_1_SIZE		0x08000000	/* Max 128 MB RAM */
19 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
20 
21 /* Environment */
22 
23 /* Environment is in MMC */
24 
25 /* USB */
26 #ifdef	CONFIG_CMD_USB
27 #define CONFIG_EHCI_MXS_PORT0
28 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
29 #endif
30 
31 /* Framebuffer support */
32 #ifdef CONFIG_VIDEO
33 #define CONFIG_VIDEO_LOGO
34 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE	(512 << 10)
35 #endif
36 
37 /* Boot Linux */
38 #define CONFIG_BOOTFILE		"uImage"
39 #define CONFIG_LOADADDR		0x42000000
40 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
41 
42 /* Extra Environments */
43 #define CONFIG_EXTRA_ENV_SETTINGS \
44 	"update_sd_firmware_filename=u-boot.sd\0" \
45 	"update_sd_firmware="		/* Update the SD firmware partition */ \
46 		"if mmc rescan ; then "	\
47 		"if tftp ${update_sd_firmware_filename} ; then " \
48 		"setexpr fw_sz ${filesize} / 0x200 ; "	/* SD block size */ \
49 		"setexpr fw_sz ${fw_sz} + 1 ; "	\
50 		"mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
51 		"fi ; "	\
52 		"fi\0" \
53 	"script=boot.scr\0"	\
54 	"image=zImage\0" \
55 	"console=ttyAMA0\0" \
56 	"fdt_file=imx23-evk.dtb\0" \
57 	"fdt_addr=0x41000000\0" \
58 	"boot_fdt=try\0" \
59 	"mmcdev=0\0" \
60 	"mmcpart=2\0" \
61 	"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
62 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
63 		"root=${mmcroot}\0" \
64 	"loadbootscript="  \
65 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
66 	"bootscript=echo Running bootscript from mmc ...; "	\
67 		"source\0" \
68 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
69 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
70 	"mmcboot=echo Booting from mmc ...; " \
71 		"run mmcargs; " \
72 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
73 			"if run loadfdt; then " \
74 				"bootz ${loadaddr} - ${fdt_addr}; " \
75 			"else " \
76 				"if test ${boot_fdt} = try; then " \
77 					"bootz; " \
78 				"else " \
79 					"echo WARN: Cannot load the DT; " \
80 				"fi; " \
81 			"fi; " \
82 		"else " \
83 			"bootz; " \
84 		"fi;\0"
85 
86 #define CONFIG_BOOTCOMMAND \
87 	"mmc dev ${mmcdev}; if mmc rescan; then " \
88 		"if run loadbootscript; then " \
89 			"run bootscript; " \
90 		"else " \
91 			"if run loadimage; then " \
92 				"run mmcboot; " \
93 			"else " \
94 				"echo ERR: Fail to boot from MMC; " \
95 			"fi; " \
96 		"fi; " \
97 	"else exit; fi"
98 
99 /* The rest of the configuration is shared */
100 #include <configs/mxs.h>
101 
102 #endif /* __CONFIGS_MX23EVK_H__ */
103