blob: 19ccf633c404fa51ea8489be8a666d75ebf28129 [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 */
Lukasz Majewskif3adb662019-12-08 22:06:56 +010018
Lukasz Majewskif3adb662019-12-08 22:06:56 +010019#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
22
Lukasz Majewskif3adb662019-12-08 22:06:56 +010023/* 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
27
Lukasz Majewskif3adb662019-12-08 22:06:56 +010028/* Extra Environment */
Lukasz Majewskif3adb662019-12-08 22:06:56 +010029#define CONFIG_HOSTNAME "xea"
30
31#define CONFIG_EXTRA_ENV_SETTINGS \
32 "bootmode=update\0" \
33 "bootpri=mmc_mmc\0" \
34 "bootsec=sf_swu\0" \
35 "consdev=ttyAMA0\0" \
36 "baudrate=115200\0" \
37 "dtbaddr=0x44000000\0" \
38 "dtbfile=imx28-xea.dtb\0" \
39 "rootdev=/dev/mmcblk0p2\0" \
40 "netdev=eth0\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" \
48 "do_update_mmc=" \
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} ; " \
55 "fi ; " \
56 "fi\0" \
57 "do_update_sf=" \
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} ; " \
62 "fi ; " \
63 "fi\0" \
64 "update_spl_filename=u-boot.sb\0" \
65 "update_spl=" \
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" \
70 "update_uboot=" \
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" \
78 "update_kernel=" \
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" \
86 "update_sfkernel=" \
87 "setenv update_filename fitImage ; " \
88 "setenv update_offset ${sf_kernel_offset} ; " \
89 "run do_update_sf\0" \
90 "update_swu=" \
91 "setenv update_filename ${swufile} ; " \
92 "setenv update_offset ${sf_swu_offset} ; " \
93 "run do_update_sf\0" \
94 "addcons=" \
95 "setenv bootargs ${bootargs} " \
96 "console=${consdev},${baudrate}\0" \
97 "addip=" \
98 "setenv bootargs ${bootargs} " \
99 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
100 "${netmask}:${hostname}:${netdev}:off\0" \
101 "addmisc=" \
102 "setenv bootargs ${bootargs} ${miscargs}\0" \
103 "addargs=run addcons addmisc\0" \
104 "mmcload=" \
105 "mmc rescan ; " \
106 "mmc dev 0 1 ; " \
107 "mmc read ${loadaddr} 0x800 0x2000 ; " \
108 "mmc read ${dtbaddr} 0x400 0x80\0" \
109 "netload=" \
110 "dhcp ${loadaddr} ${hostname}/${bootfile} ; " \
111 "tftp ${dtbaddr} ${hostname}/${dtbfile}\0" \
112 "sfload=" \
113 "sf probe ; " \
114 "sf read ${loadaddr} ${sf_kernel_offset} ${sf_kernel_size}\0" \
115 "usbload=" \
116 "usb start ; " \
117 "load usb 0:1 ${loadaddr} ${bootfile}\0" \
118 "miscargs=panic=1\0" \
119 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
120 "nfsargs=" \
121 "setenv bootargs root=/dev/nfs rw " \
122 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
123 "mmc_mmc=" \
124 "if run mmcload mmcargs addargs ; then " \
125 "bootm ${loadaddr} - ${dtbaddr} ; " \
126 "fi\0" \
127 "mmc_nfs=" \
128 "if run mmcload nfsargs addip addargs ; then " \
129 "bootm ${loadaddr} - ${dtbaddr} ; " \
130 "fi\0" \
131 "sf_mmc=" \
132 "if run sfload mmcargs addargs ; then " \
133 "bootm ${loadaddr} - ${dtbaddr} ; " \
134 "fi\0" \
135 "sf_swu=" \
136 "if run sfload ; then " \
137 "sf read ${rdaddr} ${sf_swu_offset} ${sf_swu_size} ; " \
138 "setenv bootargs root=/dev/ram0 rw ; " \
139 "run addargs ; " \
140 "bootm ${loadaddr} ${rdaddr} ; " \
141 "fi\0" \
142 "net_mmc=" \
143 "if run netload mmcargs addargs ; then " \
144 "bootm ${loadaddr} - ${dtbaddr} ; " \
145 "fi\0" \
146 "net_nfs=" \
147 "if run netload nfsargs addip addargs ; then " \
148 "bootm ${loadaddr} - ${dtbaddr} ; " \
149 "fi\0" \
150 "prebootcmd=" \
151 "if test \"${envsaved}\" != y ; then ; " \
152 "setenv envsaved y ; " \
153 "saveenv ; " \
154 "fi ; " \
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 ; " \
161 "else " \
162 "if test \"${bootmode}\" != update ; then " \
163 "echo Warning: unknown bootmode \"${bootmode}\" ; " \
164 "fi ; " \
165 "setenv bootdelay 1 ; " \
166 "setenv bootpri sf_swu ; " \
167 "fi\0"
168
169/* The rest of the configuration is shared */
170#include <configs/mxs.h>
171
172#endif /* __CONFIGS_XEA_H__ */