blob: acaf81dedeb234e0033a7ee96f11b391c12075c4 [file] [log] [blame]
Lukasz Majewski010e58d2019-12-08 22:06:56 +01001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2019 DENX Software Engineering
4 * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
5 *
6 * Copyright (C) 2018 DENX Software Engineering
7 * Måns Rullgård, DENX Software Engineering, mans@mansr.com
8 *
9 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
10 * on behalf of DENX Software Engineering GmbH
11 */
12#ifndef __CONFIGS_XEA_H__
13#define __CONFIGS_XEA_H__
14
15#include <linux/sizes.h>
16
Lukasz Majewski010e58d2019-12-08 22:06:56 +010017/* SPL */
18#define CONFIG_SPL_STACK 0x20000
19
20#define CONFIG_SYS_SPL_ARGS_ADDR 0x44000000
21
22#define CONFIG_SYS_SPI_KERNEL_OFFS SZ_1M
23#define CONFIG_SYS_SPI_ARGS_OFFS SZ_512K
24#define CONFIG_SYS_SPI_ARGS_SIZE SZ_32K
25
26#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR (SZ_512K / 0x200)
27#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (SZ_32K / 0x200)
Lukasz Majewski010e58d2019-12-08 22:06:56 +010028
Lukasz Majewski010e58d2019-12-08 22:06:56 +010029/* Memory configuration */
30#define PHYS_SDRAM_1 0x40000000 /* Base address */
31#define PHYS_SDRAM_1_SIZE 0x10000000 /* Max 256 MB RAM */
32#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
33
34/* Environment */
Lukasz Majewski010e58d2019-12-08 22:06:56 +010035
36/* Booting Linux */
37#define CONFIG_BOOTFILE "uImage"
Lukasz Majewski010e58d2019-12-08 22:06:56 +010038
39/* Extra Environment */
Lukasz Majewski010e58d2019-12-08 22:06:56 +010040#define CONFIG_HOSTNAME "xea"
41
42#define CONFIG_EXTRA_ENV_SETTINGS \
43 "bootmode=update\0" \
44 "bootpri=mmc_mmc\0" \
45 "bootsec=sf_swu\0" \
46 "consdev=ttyAMA0\0" \
47 "baudrate=115200\0" \
48 "dtbaddr=0x44000000\0" \
49 "dtbfile=imx28-xea.dtb\0" \
50 "rootdev=/dev/mmcblk0p2\0" \
51 "netdev=eth0\0" \
52 "rdaddr=0x43000000\0" \
53 "swufile=swupdate.img\0" \
54 "sf_kernel_offset=0x100000\0" \
55 "sf_kernel_size=0x400000\0" \
56 "sf_swu_offset=0x500000\0" \
57 "sf_swu_size=0x800000\0" \
58 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
59 "do_update_mmc=" \
60 "if mmc rescan ; then " \
61 "mmc dev 0 ${update_mmc_part} ; " \
62 "if dhcp ${hostname}/${update_filename} ; then " \
63 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
64 "setexpr fw_sz ${fw_sz} + 1 ; " \
65 "mmc write ${loadaddr} ${update_offset} ${fw_sz} ; " \
66 "fi ; " \
67 "fi\0" \
68 "do_update_sf=" \
69 "if sf probe ; then " \
70 "if dhcp ${hostname}/${update_filename} ; then " \
71 "sf erase ${update_offset} +${filesize} ; " \
72 "sf write ${loadaddr} ${update_offset} ${filesize} ; " \
73 "fi ; " \
74 "fi\0" \
75 "update_spl_filename=u-boot.sb\0" \
76 "update_spl=" \
77 "setenv update_filename ${update_spl_filename} ; " \
78 "setenv update_offset 0 ; " \
79 "run do_update_sf\0" \
80 "update_uboot_filename=u-boot.img\0" \
81 "update_uboot=" \
82 "setenv update_filename ${update_uboot_filename} ; " \
83 "setenv update_offset 0x10000 ; " \
84 "run do_update_sf ; " \
85 "setenv update_mmc_part 1 ; " \
86 "setenv update_offset 0 ; " \
87 "run do_update_mmc\0" \
88 "update_kernel_filename=uImage\0" \
89 "update_kernel=" \
90 "setenv update_mmc_part 1 ; " \
91 "setenv update_filename ${update_kernel_filename} ; " \
92 "setenv update_offset 0x800 ; " \
93 "run do_update_mmc ; " \
94 "setenv update_filename ${dtbfile} ; " \
95 "setenv update_offset 0x400 ; " \
96 "run do_update_mmc\0" \
97 "update_sfkernel=" \
98 "setenv update_filename fitImage ; " \
99 "setenv update_offset ${sf_kernel_offset} ; " \
100 "run do_update_sf\0" \
101 "update_swu=" \
102 "setenv update_filename ${swufile} ; " \
103 "setenv update_offset ${sf_swu_offset} ; " \
104 "run do_update_sf\0" \
105 "addcons=" \
106 "setenv bootargs ${bootargs} " \
107 "console=${consdev},${baudrate}\0" \
108 "addip=" \
109 "setenv bootargs ${bootargs} " \
110 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
111 "${netmask}:${hostname}:${netdev}:off\0" \
112 "addmisc=" \
113 "setenv bootargs ${bootargs} ${miscargs}\0" \
114 "addargs=run addcons addmisc\0" \
115 "mmcload=" \
116 "mmc rescan ; " \
117 "mmc dev 0 1 ; " \
118 "mmc read ${loadaddr} 0x800 0x2000 ; " \
119 "mmc read ${dtbaddr} 0x400 0x80\0" \
120 "netload=" \
121 "dhcp ${loadaddr} ${hostname}/${bootfile} ; " \
122 "tftp ${dtbaddr} ${hostname}/${dtbfile}\0" \
123 "sfload=" \
124 "sf probe ; " \
125 "sf read ${loadaddr} ${sf_kernel_offset} ${sf_kernel_size}\0" \
126 "usbload=" \
127 "usb start ; " \
128 "load usb 0:1 ${loadaddr} ${bootfile}\0" \
129 "miscargs=panic=1\0" \
130 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
131 "nfsargs=" \
132 "setenv bootargs root=/dev/nfs rw " \
133 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
134 "mmc_mmc=" \
135 "if run mmcload mmcargs addargs ; then " \
136 "bootm ${loadaddr} - ${dtbaddr} ; " \
137 "fi\0" \
138 "mmc_nfs=" \
139 "if run mmcload nfsargs addip addargs ; then " \
140 "bootm ${loadaddr} - ${dtbaddr} ; " \
141 "fi\0" \
142 "sf_mmc=" \
143 "if run sfload mmcargs addargs ; then " \
144 "bootm ${loadaddr} - ${dtbaddr} ; " \
145 "fi\0" \
146 "sf_swu=" \
147 "if run sfload ; then " \
148 "sf read ${rdaddr} ${sf_swu_offset} ${sf_swu_size} ; " \
149 "setenv bootargs root=/dev/ram0 rw ; " \
150 "run addargs ; " \
151 "bootm ${loadaddr} ${rdaddr} ; " \
152 "fi\0" \
153 "net_mmc=" \
154 "if run netload mmcargs addargs ; then " \
155 "bootm ${loadaddr} - ${dtbaddr} ; " \
156 "fi\0" \
157 "net_nfs=" \
158 "if run netload nfsargs addip addargs ; then " \
159 "bootm ${loadaddr} - ${dtbaddr} ; " \
160 "fi\0" \
161 "prebootcmd=" \
162 "if test \"${envsaved}\" != y ; then ; " \
163 "setenv envsaved y ; " \
164 "saveenv ; " \
165 "fi ; " \
166 "if test \"${bootmode}\" = normal ; then " \
167 "setenv bootdelay 0 ; " \
168 "setenv bootpri mmc_mmc ; " \
169 "elif test \"${bootmode}\" = devel ; then " \
170 "setenv bootdelay 3 ; " \
171 "setenv bootpri net_mmc ; " \
172 "else " \
173 "if test \"${bootmode}\" != update ; then " \
174 "echo Warning: unknown bootmode \"${bootmode}\" ; " \
175 "fi ; " \
176 "setenv bootdelay 1 ; " \
177 "setenv bootpri sf_swu ; " \
178 "fi\0"
179
180/* The rest of the configuration is shared */
181#include <configs/mxs.h>
182
183#endif /* __CONFIGS_XEA_H__ */