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