1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2019 DENX Software Engineering
4 * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
6 * Copyright (C) 2018 DENX Software Engineering
7 * Måns Rullgård, DENX Software Engineering, mans@mansr.com
9 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
10 * on behalf of DENX Software Engineering GmbH
12 #ifndef __CONFIGS_XEA_H__
13 #define __CONFIGS_XEA_H__
15 #include <linux/sizes.h>
17 #define CONFIG_TIMESTAMP /* Print image info with timestamp */
20 #define CONFIG_SPL_STACK 0x20000
22 #define CONFIG_SYS_SPL_ARGS_ADDR 0x44000000
24 #define CONFIG_SYS_SPI_KERNEL_OFFS SZ_1M
25 #define CONFIG_SYS_SPI_ARGS_OFFS SZ_512K
26 #define CONFIG_SYS_SPI_ARGS_SIZE SZ_32K
28 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR (SZ_512K / 0x200)
29 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (SZ_32K / 0x200)
30 #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR (SZ_1M / 0x200)
32 #ifndef CONFIG_SPL_BUILD
33 #define CONFIG_SPI_FLASH_MTD
36 /* Memory configuration */
37 #define PHYS_SDRAM_1 0x40000000 /* Base address */
38 #define PHYS_SDRAM_1_SIZE 0x10000000 /* Max 256 MB RAM */
39 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
42 #define CONFIG_ENV_OVERWRITE
45 #define CONFIG_BOOTFILE "uImage"
46 #define CONFIG_BOOTCOMMAND "run ${bootpri} ; run ${bootsec}"
47 #define CONFIG_LOADADDR 0x42000000
48 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
50 /* Extra Environment */
51 #define CONFIG_PREBOOT "run prebootcmd"
52 #define CONFIG_HOSTNAME "xea"
54 #define CONFIG_EXTRA_ENV_SETTINGS \
60 "dtbaddr=0x44000000\0" \
61 "dtbfile=imx28-xea.dtb\0" \
62 "rootdev=/dev/mmcblk0p2\0" \
64 "rdaddr=0x43000000\0" \
65 "swufile=swupdate.img\0" \
66 "sf_kernel_offset=0x100000\0" \
67 "sf_kernel_size=0x400000\0" \
68 "sf_swu_offset=0x500000\0" \
69 "sf_swu_size=0x800000\0" \
70 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
72 "if mmc rescan ; then " \
73 "mmc dev 0 ${update_mmc_part} ; " \
74 "if dhcp ${hostname}/${update_filename} ; then " \
75 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
76 "setexpr fw_sz ${fw_sz} + 1 ; " \
77 "mmc write ${loadaddr} ${update_offset} ${fw_sz} ; " \
81 "if sf probe ; then " \
82 "if dhcp ${hostname}/${update_filename} ; then " \
83 "sf erase ${update_offset} +${filesize} ; " \
84 "sf write ${loadaddr} ${update_offset} ${filesize} ; " \
87 "update_spl_filename=u-boot.sb\0" \
89 "setenv update_filename ${update_spl_filename} ; " \
90 "setenv update_offset 0 ; " \
91 "run do_update_sf\0" \
92 "update_uboot_filename=u-boot.img\0" \
94 "setenv update_filename ${update_uboot_filename} ; " \
95 "setenv update_offset 0x10000 ; " \
96 "run do_update_sf ; " \
97 "setenv update_mmc_part 1 ; " \
98 "setenv update_offset 0 ; " \
99 "run do_update_mmc\0" \
100 "update_kernel_filename=uImage\0" \
102 "setenv update_mmc_part 1 ; " \
103 "setenv update_filename ${update_kernel_filename} ; " \
104 "setenv update_offset 0x800 ; " \
105 "run do_update_mmc ; " \
106 "setenv update_filename ${dtbfile} ; " \
107 "setenv update_offset 0x400 ; " \
108 "run do_update_mmc\0" \
110 "setenv update_filename fitImage ; " \
111 "setenv update_offset ${sf_kernel_offset} ; " \
112 "run do_update_sf\0" \
114 "setenv update_filename ${swufile} ; " \
115 "setenv update_offset ${sf_swu_offset} ; " \
116 "run do_update_sf\0" \
118 "setenv bootargs ${bootargs} " \
119 "console=${consdev},${baudrate}\0" \
121 "setenv bootargs ${bootargs} " \
122 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
123 "${netmask}:${hostname}:${netdev}:off\0" \
125 "setenv bootargs ${bootargs} ${miscargs}\0" \
126 "addargs=run addcons addmisc\0" \
130 "mmc read ${loadaddr} 0x800 0x2000 ; " \
131 "mmc read ${dtbaddr} 0x400 0x80\0" \
133 "dhcp ${loadaddr} ${hostname}/${bootfile} ; " \
134 "tftp ${dtbaddr} ${hostname}/${dtbfile}\0" \
137 "sf read ${loadaddr} ${sf_kernel_offset} ${sf_kernel_size}\0" \
140 "load usb 0:1 ${loadaddr} ${bootfile}\0" \
141 "miscargs=panic=1\0" \
142 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
144 "setenv bootargs root=/dev/nfs rw " \
145 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
147 "if run mmcload mmcargs addargs ; then " \
148 "bootm ${loadaddr} - ${dtbaddr} ; " \
151 "if run mmcload nfsargs addip addargs ; then " \
152 "bootm ${loadaddr} - ${dtbaddr} ; " \
155 "if run sfload mmcargs addargs ; then " \
156 "bootm ${loadaddr} - ${dtbaddr} ; " \
159 "if run sfload ; then " \
160 "sf read ${rdaddr} ${sf_swu_offset} ${sf_swu_size} ; " \
161 "setenv bootargs root=/dev/ram0 rw ; " \
163 "bootm ${loadaddr} ${rdaddr} ; " \
166 "if run netload mmcargs addargs ; then " \
167 "bootm ${loadaddr} - ${dtbaddr} ; " \
170 "if run netload nfsargs addip addargs ; then " \
171 "bootm ${loadaddr} - ${dtbaddr} ; " \
174 "if test \"${envsaved}\" != y ; then ; " \
175 "setenv envsaved y ; " \
178 "if test \"${bootmode}\" = normal ; then " \
179 "setenv bootdelay 0 ; " \
180 "setenv bootpri mmc_mmc ; " \
181 "elif test \"${bootmode}\" = devel ; then " \
182 "setenv bootdelay 3 ; " \
183 "setenv bootpri net_mmc ; " \
185 "if test \"${bootmode}\" != update ; then " \
186 "echo Warning: unknown bootmode \"${bootmode}\" ; " \
188 "setenv bootdelay 1 ; " \
189 "setenv bootpri sf_swu ; " \
192 /* The rest of the configuration is shared */
193 #include <configs/mxs.h>
195 #endif /* __CONFIGS_XEA_H__ */