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