blob: aa48bb9263192299556d85933c0d05614df0baa3 [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
17#define CONFIG_TIMESTAMP /* Print image info with timestamp */
18
19/* SPL */
20#define CONFIG_SPL_STACK 0x20000
21
22#define CONFIG_SYS_SPL_ARGS_ADDR 0x44000000
23
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
27
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)
31
Lukasz Majewski010e58d2019-12-08 22:06:56 +010032/* Memory configuration */
33#define PHYS_SDRAM_1 0x40000000 /* Base address */
34#define PHYS_SDRAM_1_SIZE 0x10000000 /* Max 256 MB RAM */
35#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
36
37/* Environment */
Lukasz Majewski010e58d2019-12-08 22:06:56 +010038
39/* Booting Linux */
40#define CONFIG_BOOTFILE "uImage"
Lukasz Majewski010e58d2019-12-08 22:06:56 +010041
42/* Extra Environment */
Lukasz Majewski010e58d2019-12-08 22:06:56 +010043#define CONFIG_HOSTNAME "xea"
44
45#define CONFIG_EXTRA_ENV_SETTINGS \
46 "bootmode=update\0" \
47 "bootpri=mmc_mmc\0" \
48 "bootsec=sf_swu\0" \
49 "consdev=ttyAMA0\0" \
50 "baudrate=115200\0" \
51 "dtbaddr=0x44000000\0" \
52 "dtbfile=imx28-xea.dtb\0" \
53 "rootdev=/dev/mmcblk0p2\0" \
54 "netdev=eth0\0" \
55 "rdaddr=0x43000000\0" \
56 "swufile=swupdate.img\0" \
57 "sf_kernel_offset=0x100000\0" \
58 "sf_kernel_size=0x400000\0" \
59 "sf_swu_offset=0x500000\0" \
60 "sf_swu_size=0x800000\0" \
61 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
62 "do_update_mmc=" \
63 "if mmc rescan ; then " \
64 "mmc dev 0 ${update_mmc_part} ; " \
65 "if dhcp ${hostname}/${update_filename} ; then " \
66 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
67 "setexpr fw_sz ${fw_sz} + 1 ; " \
68 "mmc write ${loadaddr} ${update_offset} ${fw_sz} ; " \
69 "fi ; " \
70 "fi\0" \
71 "do_update_sf=" \
72 "if sf probe ; then " \
73 "if dhcp ${hostname}/${update_filename} ; then " \
74 "sf erase ${update_offset} +${filesize} ; " \
75 "sf write ${loadaddr} ${update_offset} ${filesize} ; " \
76 "fi ; " \
77 "fi\0" \
78 "update_spl_filename=u-boot.sb\0" \
79 "update_spl=" \
80 "setenv update_filename ${update_spl_filename} ; " \
81 "setenv update_offset 0 ; " \
82 "run do_update_sf\0" \
83 "update_uboot_filename=u-boot.img\0" \
84 "update_uboot=" \
85 "setenv update_filename ${update_uboot_filename} ; " \
86 "setenv update_offset 0x10000 ; " \
87 "run do_update_sf ; " \
88 "setenv update_mmc_part 1 ; " \
89 "setenv update_offset 0 ; " \
90 "run do_update_mmc\0" \
91 "update_kernel_filename=uImage\0" \
92 "update_kernel=" \
93 "setenv update_mmc_part 1 ; " \
94 "setenv update_filename ${update_kernel_filename} ; " \
95 "setenv update_offset 0x800 ; " \
96 "run do_update_mmc ; " \
97 "setenv update_filename ${dtbfile} ; " \
98 "setenv update_offset 0x400 ; " \
99 "run do_update_mmc\0" \
100 "update_sfkernel=" \
101 "setenv update_filename fitImage ; " \
102 "setenv update_offset ${sf_kernel_offset} ; " \
103 "run do_update_sf\0" \
104 "update_swu=" \
105 "setenv update_filename ${swufile} ; " \
106 "setenv update_offset ${sf_swu_offset} ; " \
107 "run do_update_sf\0" \
108 "addcons=" \
109 "setenv bootargs ${bootargs} " \
110 "console=${consdev},${baudrate}\0" \
111 "addip=" \
112 "setenv bootargs ${bootargs} " \
113 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
114 "${netmask}:${hostname}:${netdev}:off\0" \
115 "addmisc=" \
116 "setenv bootargs ${bootargs} ${miscargs}\0" \
117 "addargs=run addcons addmisc\0" \
118 "mmcload=" \
119 "mmc rescan ; " \
120 "mmc dev 0 1 ; " \
121 "mmc read ${loadaddr} 0x800 0x2000 ; " \
122 "mmc read ${dtbaddr} 0x400 0x80\0" \
123 "netload=" \
124 "dhcp ${loadaddr} ${hostname}/${bootfile} ; " \
125 "tftp ${dtbaddr} ${hostname}/${dtbfile}\0" \
126 "sfload=" \
127 "sf probe ; " \
128 "sf read ${loadaddr} ${sf_kernel_offset} ${sf_kernel_size}\0" \
129 "usbload=" \
130 "usb start ; " \
131 "load usb 0:1 ${loadaddr} ${bootfile}\0" \
132 "miscargs=panic=1\0" \
133 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
134 "nfsargs=" \
135 "setenv bootargs root=/dev/nfs rw " \
136 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
137 "mmc_mmc=" \
138 "if run mmcload mmcargs addargs ; then " \
139 "bootm ${loadaddr} - ${dtbaddr} ; " \
140 "fi\0" \
141 "mmc_nfs=" \
142 "if run mmcload nfsargs addip addargs ; then " \
143 "bootm ${loadaddr} - ${dtbaddr} ; " \
144 "fi\0" \
145 "sf_mmc=" \
146 "if run sfload mmcargs addargs ; then " \
147 "bootm ${loadaddr} - ${dtbaddr} ; " \
148 "fi\0" \
149 "sf_swu=" \
150 "if run sfload ; then " \
151 "sf read ${rdaddr} ${sf_swu_offset} ${sf_swu_size} ; " \
152 "setenv bootargs root=/dev/ram0 rw ; " \
153 "run addargs ; " \
154 "bootm ${loadaddr} ${rdaddr} ; " \
155 "fi\0" \
156 "net_mmc=" \
157 "if run netload mmcargs addargs ; then " \
158 "bootm ${loadaddr} - ${dtbaddr} ; " \
159 "fi\0" \
160 "net_nfs=" \
161 "if run netload nfsargs addip addargs ; then " \
162 "bootm ${loadaddr} - ${dtbaddr} ; " \
163 "fi\0" \
164 "prebootcmd=" \
165 "if test \"${envsaved}\" != y ; then ; " \
166 "setenv envsaved y ; " \
167 "saveenv ; " \
168 "fi ; " \
169 "if test \"${bootmode}\" = normal ; then " \
170 "setenv bootdelay 0 ; " \
171 "setenv bootpri mmc_mmc ; " \
172 "elif test \"${bootmode}\" = devel ; then " \
173 "setenv bootdelay 3 ; " \
174 "setenv bootpri net_mmc ; " \
175 "else " \
176 "if test \"${bootmode}\" != update ; then " \
177 "echo Warning: unknown bootmode \"${bootmode}\" ; " \
178 "fi ; " \
179 "setenv bootdelay 1 ; " \
180 "setenv bootpri sf_swu ; " \
181 "fi\0"
182
183/* The rest of the configuration is shared */
184#include <configs/mxs.h>
185
186#endif /* __CONFIGS_XEA_H__ */