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