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>
19 #define CONFIG_SYS_SPI_KERNEL_OFFS SZ_1M
20 #define CONFIG_SYS_SPI_ARGS_OFFS SZ_512K
21 #define CONFIG_SYS_SPI_ARGS_SIZE SZ_32K
23 /* Memory configuration */
24 #define PHYS_SDRAM_1 0x40000000 /* Base address */
25 #define PHYS_SDRAM_1_SIZE 0x10000000 /* Max 256 MB RAM */
26 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
28 /* Extra Environment */
29 #define CONFIG_HOSTNAME "xea"
31 #define CONFIG_EXTRA_ENV_SETTINGS \
37 "dtbaddr=0x44000000\0" \
38 "dtbfile=imx28-xea.dtb\0" \
39 "rootdev=/dev/mmcblk0p2\0" \
41 "rdaddr=0x43000000\0" \
42 "swufile=swupdate.img\0" \
43 "sf_kernel_offset=0x100000\0" \
44 "sf_kernel_size=0x400000\0" \
45 "sf_swu_offset=0x500000\0" \
46 "sf_swu_size=0x800000\0" \
47 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
49 "if mmc rescan ; then " \
50 "mmc dev 0 ${update_mmc_part} ; " \
51 "if dhcp ${hostname}/${update_filename} ; then " \
52 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
53 "setexpr fw_sz ${fw_sz} + 1 ; " \
54 "mmc write ${loadaddr} ${update_offset} ${fw_sz} ; " \
58 "if sf probe ; then " \
59 "if dhcp ${hostname}/${update_filename} ; then " \
60 "sf erase ${update_offset} +${filesize} ; " \
61 "sf write ${loadaddr} ${update_offset} ${filesize} ; " \
64 "update_spl_filename=u-boot.sb\0" \
66 "setenv update_filename ${update_spl_filename} ; " \
67 "setenv update_offset 0 ; " \
68 "run do_update_sf\0" \
69 "update_uboot_filename=u-boot.img\0" \
71 "setenv update_filename ${update_uboot_filename} ; " \
72 "setenv update_offset 0x10000 ; " \
73 "run do_update_sf ; " \
74 "setenv update_mmc_part 1 ; " \
75 "setenv update_offset 0 ; " \
76 "run do_update_mmc\0" \
77 "update_kernel_filename=uImage\0" \
79 "setenv update_mmc_part 1 ; " \
80 "setenv update_filename ${update_kernel_filename} ; " \
81 "setenv update_offset 0x800 ; " \
82 "run do_update_mmc ; " \
83 "setenv update_filename ${dtbfile} ; " \
84 "setenv update_offset 0x400 ; " \
85 "run do_update_mmc\0" \
87 "setenv update_filename fitImage ; " \
88 "setenv update_offset ${sf_kernel_offset} ; " \
89 "run do_update_sf\0" \
91 "setenv update_filename ${swufile} ; " \
92 "setenv update_offset ${sf_swu_offset} ; " \
93 "run do_update_sf\0" \
95 "setenv bootargs ${bootargs} " \
96 "console=${consdev},${baudrate}\0" \
98 "setenv bootargs ${bootargs} " \
99 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
100 "${netmask}:${hostname}:${netdev}:off\0" \
102 "setenv bootargs ${bootargs} ${miscargs}\0" \
103 "addargs=run addcons addmisc\0" \
107 "mmc read ${loadaddr} 0x800 0x2000 ; " \
108 "mmc read ${dtbaddr} 0x400 0x80\0" \
110 "dhcp ${loadaddr} ${hostname}/${bootfile} ; " \
111 "tftp ${dtbaddr} ${hostname}/${dtbfile}\0" \
114 "sf read ${loadaddr} ${sf_kernel_offset} ${sf_kernel_size}\0" \
117 "load usb 0:1 ${loadaddr} ${bootfile}\0" \
118 "miscargs=panic=1\0" \
119 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
121 "setenv bootargs root=/dev/nfs rw " \
122 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
124 "if run mmcload mmcargs addargs ; then " \
125 "bootm ${loadaddr} - ${dtbaddr} ; " \
128 "if run mmcload nfsargs addip addargs ; then " \
129 "bootm ${loadaddr} - ${dtbaddr} ; " \
132 "if run sfload mmcargs addargs ; then " \
133 "bootm ${loadaddr} - ${dtbaddr} ; " \
136 "if run sfload ; then " \
137 "sf read ${rdaddr} ${sf_swu_offset} ${sf_swu_size} ; " \
138 "setenv bootargs root=/dev/ram0 rw ; " \
140 "bootm ${loadaddr} ${rdaddr} ; " \
143 "if run netload mmcargs addargs ; then " \
144 "bootm ${loadaddr} - ${dtbaddr} ; " \
147 "if run netload nfsargs addip addargs ; then " \
148 "bootm ${loadaddr} - ${dtbaddr} ; " \
151 "if test \"${envsaved}\" != y ; then ; " \
152 "setenv envsaved y ; " \
155 "if test \"${bootmode}\" = normal ; then " \
156 "setenv bootdelay 0 ; " \
157 "setenv bootpri mmc_mmc ; " \
158 "elif test \"${bootmode}\" = devel ; then " \
159 "setenv bootdelay 3 ; " \
160 "setenv bootpri net_mmc ; " \
162 "if test \"${bootmode}\" != update ; then " \
163 "echo Warning: unknown bootmode \"${bootmode}\" ; " \
165 "setenv bootdelay 1 ; " \
166 "setenv bootpri sf_swu ; " \
169 /* The rest of the configuration is shared */
170 #include <configs/mxs.h>
172 #endif /* __CONFIGS_XEA_H__ */