Commit b60eff31f3bd71a6f14b6c6efc8ad5fb3705de6d
1 parent
d0b5d9da5d
Exists in
master
and in
49 other branches
arm: remove unneeded symbol offsets and _TEXT_BASE
Remove the last uses of symbol offsets in ARM U-Boot. Remove some needless uses of _TEXT_BASE. Remove all _TEXT_BASE definitions. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
Showing 26 changed files with 24 additions and 369 deletions Inline Diff
- README
- arch/arm/cpu/arm1136/start.S
- arch/arm/cpu/arm1176/start.S
- arch/arm/cpu/arm720t/start.S
- arch/arm/cpu/arm920t/start.S
- arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
- arch/arm/cpu/arm926ejs/mxs/start.S
- arch/arm/cpu/arm926ejs/start.S
- arch/arm/cpu/arm946es/start.S
- arch/arm/cpu/arm_intcm/start.S
- arch/arm/cpu/armv7/omap3/lowlevel_init.S
- arch/arm/cpu/armv7/start.S
- arch/arm/cpu/pxa/start.S
- arch/arm/cpu/sa1100/start.S
- arch/arm/lib/board.c
- board/armltd/integrator/lowlevel_init.S
- board/cm4008/flash.c
- board/cm41xx/flash.c
- board/mpl/vcma9/lowlevel_init.S
- board/samsung/goni/lowlevel_init.S
- board/samsung/smdk2410/lowlevel_init.S
- board/samsung/smdkc100/lowlevel_init.S
- board/ti/omap5912osk/lowlevel_init.S
- common/board_f.c
- common/board_r.c
- include/asm-generic/sections.h
README
1 | # | 1 | # |
2 | # (C) Copyright 2000 - 2013 | 2 | # (C) Copyright 2000 - 2013 |
3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. | 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
4 | # | 4 | # |
5 | # SPDX-License-Identifier: GPL-2.0+ | 5 | # SPDX-License-Identifier: GPL-2.0+ |
6 | # | 6 | # |
7 | 7 | ||
8 | Summary: | 8 | Summary: |
9 | ======== | 9 | ======== |
10 | 10 | ||
11 | This directory contains the source code for U-Boot, a boot loader for | 11 | This directory contains the source code for U-Boot, a boot loader for |
12 | Embedded boards based on PowerPC, ARM, MIPS and several other | 12 | Embedded boards based on PowerPC, ARM, MIPS and several other |
13 | processors, which can be installed in a boot ROM and used to | 13 | processors, which can be installed in a boot ROM and used to |
14 | initialize and test the hardware or to download and run application | 14 | initialize and test the hardware or to download and run application |
15 | code. | 15 | code. |
16 | 16 | ||
17 | The development of U-Boot is closely related to Linux: some parts of | 17 | The development of U-Boot is closely related to Linux: some parts of |
18 | the source code originate in the Linux source tree, we have some | 18 | the source code originate in the Linux source tree, we have some |
19 | header files in common, and special provision has been made to | 19 | header files in common, and special provision has been made to |
20 | support booting of Linux images. | 20 | support booting of Linux images. |
21 | 21 | ||
22 | Some attention has been paid to make this software easily | 22 | Some attention has been paid to make this software easily |
23 | configurable and extendable. For instance, all monitor commands are | 23 | configurable and extendable. For instance, all monitor commands are |
24 | implemented with the same call interface, so that it's very easy to | 24 | implemented with the same call interface, so that it's very easy to |
25 | add new commands. Also, instead of permanently adding rarely used | 25 | add new commands. Also, instead of permanently adding rarely used |
26 | code (for instance hardware test utilities) to the monitor, you can | 26 | code (for instance hardware test utilities) to the monitor, you can |
27 | load and run it dynamically. | 27 | load and run it dynamically. |
28 | 28 | ||
29 | 29 | ||
30 | Status: | 30 | Status: |
31 | ======= | 31 | ======= |
32 | 32 | ||
33 | In general, all boards for which a configuration option exists in the | 33 | In general, all boards for which a configuration option exists in the |
34 | Makefile have been tested to some extent and can be considered | 34 | Makefile have been tested to some extent and can be considered |
35 | "working". In fact, many of them are used in production systems. | 35 | "working". In fact, many of them are used in production systems. |
36 | 36 | ||
37 | In case of problems see the CHANGELOG and CREDITS files to find out | 37 | In case of problems see the CHANGELOG and CREDITS files to find out |
38 | who contributed the specific port. The boards.cfg file lists board | 38 | who contributed the specific port. The boards.cfg file lists board |
39 | maintainers. | 39 | maintainers. |
40 | 40 | ||
41 | Note: There is no CHANGELOG file in the actual U-Boot source tree; | 41 | Note: There is no CHANGELOG file in the actual U-Boot source tree; |
42 | it can be created dynamically from the Git log using: | 42 | it can be created dynamically from the Git log using: |
43 | 43 | ||
44 | make CHANGELOG | 44 | make CHANGELOG |
45 | 45 | ||
46 | 46 | ||
47 | Where to get help: | 47 | Where to get help: |
48 | ================== | 48 | ================== |
49 | 49 | ||
50 | In case you have questions about, problems with or contributions for | 50 | In case you have questions about, problems with or contributions for |
51 | U-Boot you should send a message to the U-Boot mailing list at | 51 | U-Boot you should send a message to the U-Boot mailing list at |
52 | <u-boot@lists.denx.de>. There is also an archive of previous traffic | 52 | <u-boot@lists.denx.de>. There is also an archive of previous traffic |
53 | on the mailing list - please search the archive before asking FAQ's. | 53 | on the mailing list - please search the archive before asking FAQ's. |
54 | Please see http://lists.denx.de/pipermail/u-boot and | 54 | Please see http://lists.denx.de/pipermail/u-boot and |
55 | http://dir.gmane.org/gmane.comp.boot-loaders.u-boot | 55 | http://dir.gmane.org/gmane.comp.boot-loaders.u-boot |
56 | 56 | ||
57 | 57 | ||
58 | Where to get source code: | 58 | Where to get source code: |
59 | ========================= | 59 | ========================= |
60 | 60 | ||
61 | The U-Boot source code is maintained in the git repository at | 61 | The U-Boot source code is maintained in the git repository at |
62 | git://www.denx.de/git/u-boot.git ; you can browse it online at | 62 | git://www.denx.de/git/u-boot.git ; you can browse it online at |
63 | http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=summary | 63 | http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=summary |
64 | 64 | ||
65 | The "snapshot" links on this page allow you to download tarballs of | 65 | The "snapshot" links on this page allow you to download tarballs of |
66 | any version you might be interested in. Official releases are also | 66 | any version you might be interested in. Official releases are also |
67 | available for FTP download from the ftp://ftp.denx.de/pub/u-boot/ | 67 | available for FTP download from the ftp://ftp.denx.de/pub/u-boot/ |
68 | directory. | 68 | directory. |
69 | 69 | ||
70 | Pre-built (and tested) images are available from | 70 | Pre-built (and tested) images are available from |
71 | ftp://ftp.denx.de/pub/u-boot/images/ | 71 | ftp://ftp.denx.de/pub/u-boot/images/ |
72 | 72 | ||
73 | 73 | ||
74 | Where we come from: | 74 | Where we come from: |
75 | =================== | 75 | =================== |
76 | 76 | ||
77 | - start from 8xxrom sources | 77 | - start from 8xxrom sources |
78 | - create PPCBoot project (http://sourceforge.net/projects/ppcboot) | 78 | - create PPCBoot project (http://sourceforge.net/projects/ppcboot) |
79 | - clean up code | 79 | - clean up code |
80 | - make it easier to add custom boards | 80 | - make it easier to add custom boards |
81 | - make it possible to add other [PowerPC] CPUs | 81 | - make it possible to add other [PowerPC] CPUs |
82 | - extend functions, especially: | 82 | - extend functions, especially: |
83 | * Provide extended interface to Linux boot loader | 83 | * Provide extended interface to Linux boot loader |
84 | * S-Record download | 84 | * S-Record download |
85 | * network boot | 85 | * network boot |
86 | * PCMCIA / CompactFlash / ATA disk / SCSI ... boot | 86 | * PCMCIA / CompactFlash / ATA disk / SCSI ... boot |
87 | - create ARMBoot project (http://sourceforge.net/projects/armboot) | 87 | - create ARMBoot project (http://sourceforge.net/projects/armboot) |
88 | - add other CPU families (starting with ARM) | 88 | - add other CPU families (starting with ARM) |
89 | - create U-Boot project (http://sourceforge.net/projects/u-boot) | 89 | - create U-Boot project (http://sourceforge.net/projects/u-boot) |
90 | - current project page: see http://www.denx.de/wiki/U-Boot | 90 | - current project page: see http://www.denx.de/wiki/U-Boot |
91 | 91 | ||
92 | 92 | ||
93 | Names and Spelling: | 93 | Names and Spelling: |
94 | =================== | 94 | =================== |
95 | 95 | ||
96 | The "official" name of this project is "Das U-Boot". The spelling | 96 | The "official" name of this project is "Das U-Boot". The spelling |
97 | "U-Boot" shall be used in all written text (documentation, comments | 97 | "U-Boot" shall be used in all written text (documentation, comments |
98 | in source files etc.). Example: | 98 | in source files etc.). Example: |
99 | 99 | ||
100 | This is the README file for the U-Boot project. | 100 | This is the README file for the U-Boot project. |
101 | 101 | ||
102 | File names etc. shall be based on the string "u-boot". Examples: | 102 | File names etc. shall be based on the string "u-boot". Examples: |
103 | 103 | ||
104 | include/asm-ppc/u-boot.h | 104 | include/asm-ppc/u-boot.h |
105 | 105 | ||
106 | #include <asm/u-boot.h> | 106 | #include <asm/u-boot.h> |
107 | 107 | ||
108 | Variable names, preprocessor constants etc. shall be either based on | 108 | Variable names, preprocessor constants etc. shall be either based on |
109 | the string "u_boot" or on "U_BOOT". Example: | 109 | the string "u_boot" or on "U_BOOT". Example: |
110 | 110 | ||
111 | U_BOOT_VERSION u_boot_logo | 111 | U_BOOT_VERSION u_boot_logo |
112 | IH_OS_U_BOOT u_boot_hush_start | 112 | IH_OS_U_BOOT u_boot_hush_start |
113 | 113 | ||
114 | 114 | ||
115 | Versioning: | 115 | Versioning: |
116 | =========== | 116 | =========== |
117 | 117 | ||
118 | Starting with the release in October 2008, the names of the releases | 118 | Starting with the release in October 2008, the names of the releases |
119 | were changed from numerical release numbers without deeper meaning | 119 | were changed from numerical release numbers without deeper meaning |
120 | into a time stamp based numbering. Regular releases are identified by | 120 | into a time stamp based numbering. Regular releases are identified by |
121 | names consisting of the calendar year and month of the release date. | 121 | names consisting of the calendar year and month of the release date. |
122 | Additional fields (if present) indicate release candidates or bug fix | 122 | Additional fields (if present) indicate release candidates or bug fix |
123 | releases in "stable" maintenance trees. | 123 | releases in "stable" maintenance trees. |
124 | 124 | ||
125 | Examples: | 125 | Examples: |
126 | U-Boot v2009.11 - Release November 2009 | 126 | U-Boot v2009.11 - Release November 2009 |
127 | U-Boot v2009.11.1 - Release 1 in version November 2009 stable tree | 127 | U-Boot v2009.11.1 - Release 1 in version November 2009 stable tree |
128 | U-Boot v2010.09-rc1 - Release candiate 1 for September 2010 release | 128 | U-Boot v2010.09-rc1 - Release candiate 1 for September 2010 release |
129 | 129 | ||
130 | 130 | ||
131 | Directory Hierarchy: | 131 | Directory Hierarchy: |
132 | ==================== | 132 | ==================== |
133 | 133 | ||
134 | /arch Architecture specific files | 134 | /arch Architecture specific files |
135 | /arm Files generic to ARM architecture | 135 | /arm Files generic to ARM architecture |
136 | /cpu CPU specific files | 136 | /cpu CPU specific files |
137 | /arm720t Files specific to ARM 720 CPUs | 137 | /arm720t Files specific to ARM 720 CPUs |
138 | /arm920t Files specific to ARM 920 CPUs | 138 | /arm920t Files specific to ARM 920 CPUs |
139 | /at91 Files specific to Atmel AT91RM9200 CPU | 139 | /at91 Files specific to Atmel AT91RM9200 CPU |
140 | /imx Files specific to Freescale MC9328 i.MX CPUs | 140 | /imx Files specific to Freescale MC9328 i.MX CPUs |
141 | /s3c24x0 Files specific to Samsung S3C24X0 CPUs | 141 | /s3c24x0 Files specific to Samsung S3C24X0 CPUs |
142 | /arm926ejs Files specific to ARM 926 CPUs | 142 | /arm926ejs Files specific to ARM 926 CPUs |
143 | /arm1136 Files specific to ARM 1136 CPUs | 143 | /arm1136 Files specific to ARM 1136 CPUs |
144 | /pxa Files specific to Intel XScale PXA CPUs | 144 | /pxa Files specific to Intel XScale PXA CPUs |
145 | /sa1100 Files specific to Intel StrongARM SA1100 CPUs | 145 | /sa1100 Files specific to Intel StrongARM SA1100 CPUs |
146 | /lib Architecture specific library files | 146 | /lib Architecture specific library files |
147 | /avr32 Files generic to AVR32 architecture | 147 | /avr32 Files generic to AVR32 architecture |
148 | /cpu CPU specific files | 148 | /cpu CPU specific files |
149 | /lib Architecture specific library files | 149 | /lib Architecture specific library files |
150 | /blackfin Files generic to Analog Devices Blackfin architecture | 150 | /blackfin Files generic to Analog Devices Blackfin architecture |
151 | /cpu CPU specific files | 151 | /cpu CPU specific files |
152 | /lib Architecture specific library files | 152 | /lib Architecture specific library files |
153 | /m68k Files generic to m68k architecture | 153 | /m68k Files generic to m68k architecture |
154 | /cpu CPU specific files | 154 | /cpu CPU specific files |
155 | /mcf52x2 Files specific to Freescale ColdFire MCF52x2 CPUs | 155 | /mcf52x2 Files specific to Freescale ColdFire MCF52x2 CPUs |
156 | /mcf5227x Files specific to Freescale ColdFire MCF5227x CPUs | 156 | /mcf5227x Files specific to Freescale ColdFire MCF5227x CPUs |
157 | /mcf532x Files specific to Freescale ColdFire MCF5329 CPUs | 157 | /mcf532x Files specific to Freescale ColdFire MCF5329 CPUs |
158 | /mcf5445x Files specific to Freescale ColdFire MCF5445x CPUs | 158 | /mcf5445x Files specific to Freescale ColdFire MCF5445x CPUs |
159 | /mcf547x_8x Files specific to Freescale ColdFire MCF547x_8x CPUs | 159 | /mcf547x_8x Files specific to Freescale ColdFire MCF547x_8x CPUs |
160 | /lib Architecture specific library files | 160 | /lib Architecture specific library files |
161 | /microblaze Files generic to microblaze architecture | 161 | /microblaze Files generic to microblaze architecture |
162 | /cpu CPU specific files | 162 | /cpu CPU specific files |
163 | /lib Architecture specific library files | 163 | /lib Architecture specific library files |
164 | /mips Files generic to MIPS architecture | 164 | /mips Files generic to MIPS architecture |
165 | /cpu CPU specific files | 165 | /cpu CPU specific files |
166 | /mips32 Files specific to MIPS32 CPUs | 166 | /mips32 Files specific to MIPS32 CPUs |
167 | /xburst Files specific to Ingenic XBurst CPUs | 167 | /xburst Files specific to Ingenic XBurst CPUs |
168 | /lib Architecture specific library files | 168 | /lib Architecture specific library files |
169 | /nds32 Files generic to NDS32 architecture | 169 | /nds32 Files generic to NDS32 architecture |
170 | /cpu CPU specific files | 170 | /cpu CPU specific files |
171 | /n1213 Files specific to Andes Technology N1213 CPUs | 171 | /n1213 Files specific to Andes Technology N1213 CPUs |
172 | /lib Architecture specific library files | 172 | /lib Architecture specific library files |
173 | /nios2 Files generic to Altera NIOS2 architecture | 173 | /nios2 Files generic to Altera NIOS2 architecture |
174 | /cpu CPU specific files | 174 | /cpu CPU specific files |
175 | /lib Architecture specific library files | 175 | /lib Architecture specific library files |
176 | /openrisc Files generic to OpenRISC architecture | 176 | /openrisc Files generic to OpenRISC architecture |
177 | /cpu CPU specific files | 177 | /cpu CPU specific files |
178 | /lib Architecture specific library files | 178 | /lib Architecture specific library files |
179 | /powerpc Files generic to PowerPC architecture | 179 | /powerpc Files generic to PowerPC architecture |
180 | /cpu CPU specific files | 180 | /cpu CPU specific files |
181 | /74xx_7xx Files specific to Freescale MPC74xx and 7xx CPUs | 181 | /74xx_7xx Files specific to Freescale MPC74xx and 7xx CPUs |
182 | /mpc5xx Files specific to Freescale MPC5xx CPUs | 182 | /mpc5xx Files specific to Freescale MPC5xx CPUs |
183 | /mpc5xxx Files specific to Freescale MPC5xxx CPUs | 183 | /mpc5xxx Files specific to Freescale MPC5xxx CPUs |
184 | /mpc8xx Files specific to Freescale MPC8xx CPUs | 184 | /mpc8xx Files specific to Freescale MPC8xx CPUs |
185 | /mpc824x Files specific to Freescale MPC824x CPUs | 185 | /mpc824x Files specific to Freescale MPC824x CPUs |
186 | /mpc8260 Files specific to Freescale MPC8260 CPUs | 186 | /mpc8260 Files specific to Freescale MPC8260 CPUs |
187 | /mpc85xx Files specific to Freescale MPC85xx CPUs | 187 | /mpc85xx Files specific to Freescale MPC85xx CPUs |
188 | /ppc4xx Files specific to AMCC PowerPC 4xx CPUs | 188 | /ppc4xx Files specific to AMCC PowerPC 4xx CPUs |
189 | /lib Architecture specific library files | 189 | /lib Architecture specific library files |
190 | /sh Files generic to SH architecture | 190 | /sh Files generic to SH architecture |
191 | /cpu CPU specific files | 191 | /cpu CPU specific files |
192 | /sh2 Files specific to sh2 CPUs | 192 | /sh2 Files specific to sh2 CPUs |
193 | /sh3 Files specific to sh3 CPUs | 193 | /sh3 Files specific to sh3 CPUs |
194 | /sh4 Files specific to sh4 CPUs | 194 | /sh4 Files specific to sh4 CPUs |
195 | /lib Architecture specific library files | 195 | /lib Architecture specific library files |
196 | /sparc Files generic to SPARC architecture | 196 | /sparc Files generic to SPARC architecture |
197 | /cpu CPU specific files | 197 | /cpu CPU specific files |
198 | /leon2 Files specific to Gaisler LEON2 SPARC CPU | 198 | /leon2 Files specific to Gaisler LEON2 SPARC CPU |
199 | /leon3 Files specific to Gaisler LEON3 SPARC CPU | 199 | /leon3 Files specific to Gaisler LEON3 SPARC CPU |
200 | /lib Architecture specific library files | 200 | /lib Architecture specific library files |
201 | /x86 Files generic to x86 architecture | 201 | /x86 Files generic to x86 architecture |
202 | /cpu CPU specific files | 202 | /cpu CPU specific files |
203 | /lib Architecture specific library files | 203 | /lib Architecture specific library files |
204 | /api Machine/arch independent API for external apps | 204 | /api Machine/arch independent API for external apps |
205 | /board Board dependent files | 205 | /board Board dependent files |
206 | /common Misc architecture independent functions | 206 | /common Misc architecture independent functions |
207 | /disk Code for disk drive partition handling | 207 | /disk Code for disk drive partition handling |
208 | /doc Documentation (don't expect too much) | 208 | /doc Documentation (don't expect too much) |
209 | /drivers Commonly used device drivers | 209 | /drivers Commonly used device drivers |
210 | /dts Contains Makefile for building internal U-Boot fdt. | 210 | /dts Contains Makefile for building internal U-Boot fdt. |
211 | /examples Example code for standalone applications, etc. | 211 | /examples Example code for standalone applications, etc. |
212 | /fs Filesystem code (cramfs, ext2, jffs2, etc.) | 212 | /fs Filesystem code (cramfs, ext2, jffs2, etc.) |
213 | /include Header Files | 213 | /include Header Files |
214 | /lib Files generic to all architectures | 214 | /lib Files generic to all architectures |
215 | /libfdt Library files to support flattened device trees | 215 | /libfdt Library files to support flattened device trees |
216 | /lzma Library files to support LZMA decompression | 216 | /lzma Library files to support LZMA decompression |
217 | /lzo Library files to support LZO decompression | 217 | /lzo Library files to support LZO decompression |
218 | /net Networking code | 218 | /net Networking code |
219 | /post Power On Self Test | 219 | /post Power On Self Test |
220 | /spl Secondary Program Loader framework | 220 | /spl Secondary Program Loader framework |
221 | /tools Tools to build S-Record or U-Boot images, etc. | 221 | /tools Tools to build S-Record or U-Boot images, etc. |
222 | 222 | ||
223 | Software Configuration: | 223 | Software Configuration: |
224 | ======================= | 224 | ======================= |
225 | 225 | ||
226 | Configuration is usually done using C preprocessor defines; the | 226 | Configuration is usually done using C preprocessor defines; the |
227 | rationale behind that is to avoid dead code whenever possible. | 227 | rationale behind that is to avoid dead code whenever possible. |
228 | 228 | ||
229 | There are two classes of configuration variables: | 229 | There are two classes of configuration variables: |
230 | 230 | ||
231 | * Configuration _OPTIONS_: | 231 | * Configuration _OPTIONS_: |
232 | These are selectable by the user and have names beginning with | 232 | These are selectable by the user and have names beginning with |
233 | "CONFIG_". | 233 | "CONFIG_". |
234 | 234 | ||
235 | * Configuration _SETTINGS_: | 235 | * Configuration _SETTINGS_: |
236 | These depend on the hardware etc. and should not be meddled with if | 236 | These depend on the hardware etc. and should not be meddled with if |
237 | you don't know what you're doing; they have names beginning with | 237 | you don't know what you're doing; they have names beginning with |
238 | "CONFIG_SYS_". | 238 | "CONFIG_SYS_". |
239 | 239 | ||
240 | Later we will add a configuration tool - probably similar to or even | 240 | Later we will add a configuration tool - probably similar to or even |
241 | identical to what's used for the Linux kernel. Right now, we have to | 241 | identical to what's used for the Linux kernel. Right now, we have to |
242 | do the configuration by hand, which means creating some symbolic | 242 | do the configuration by hand, which means creating some symbolic |
243 | links and editing some configuration files. We use the TQM8xxL boards | 243 | links and editing some configuration files. We use the TQM8xxL boards |
244 | as an example here. | 244 | as an example here. |
245 | 245 | ||
246 | 246 | ||
247 | Selection of Processor Architecture and Board Type: | 247 | Selection of Processor Architecture and Board Type: |
248 | --------------------------------------------------- | 248 | --------------------------------------------------- |
249 | 249 | ||
250 | For all supported boards there are ready-to-use default | 250 | For all supported boards there are ready-to-use default |
251 | configurations available; just type "make <board_name>_config". | 251 | configurations available; just type "make <board_name>_config". |
252 | 252 | ||
253 | Example: For a TQM823L module type: | 253 | Example: For a TQM823L module type: |
254 | 254 | ||
255 | cd u-boot | 255 | cd u-boot |
256 | make TQM823L_config | 256 | make TQM823L_config |
257 | 257 | ||
258 | For the Cogent platform, you need to specify the CPU type as well; | 258 | For the Cogent platform, you need to specify the CPU type as well; |
259 | e.g. "make cogent_mpc8xx_config". And also configure the cogent | 259 | e.g. "make cogent_mpc8xx_config". And also configure the cogent |
260 | directory according to the instructions in cogent/README. | 260 | directory according to the instructions in cogent/README. |
261 | 261 | ||
262 | 262 | ||
263 | Configuration Options: | 263 | Configuration Options: |
264 | ---------------------- | 264 | ---------------------- |
265 | 265 | ||
266 | Configuration depends on the combination of board and CPU type; all | 266 | Configuration depends on the combination of board and CPU type; all |
267 | such information is kept in a configuration file | 267 | such information is kept in a configuration file |
268 | "include/configs/<board_name>.h". | 268 | "include/configs/<board_name>.h". |
269 | 269 | ||
270 | Example: For a TQM823L module, all configuration settings are in | 270 | Example: For a TQM823L module, all configuration settings are in |
271 | "include/configs/TQM823L.h". | 271 | "include/configs/TQM823L.h". |
272 | 272 | ||
273 | 273 | ||
274 | Many of the options are named exactly as the corresponding Linux | 274 | Many of the options are named exactly as the corresponding Linux |
275 | kernel configuration options. The intention is to make it easier to | 275 | kernel configuration options. The intention is to make it easier to |
276 | build a config tool - later. | 276 | build a config tool - later. |
277 | 277 | ||
278 | 278 | ||
279 | The following options need to be configured: | 279 | The following options need to be configured: |
280 | 280 | ||
281 | - CPU Type: Define exactly one, e.g. CONFIG_MPC85XX. | 281 | - CPU Type: Define exactly one, e.g. CONFIG_MPC85XX. |
282 | 282 | ||
283 | - Board Type: Define exactly one, e.g. CONFIG_MPC8540ADS. | 283 | - Board Type: Define exactly one, e.g. CONFIG_MPC8540ADS. |
284 | 284 | ||
285 | - CPU Daughterboard Type: (if CONFIG_ATSTK1000 is defined) | 285 | - CPU Daughterboard Type: (if CONFIG_ATSTK1000 is defined) |
286 | Define exactly one, e.g. CONFIG_ATSTK1002 | 286 | Define exactly one, e.g. CONFIG_ATSTK1002 |
287 | 287 | ||
288 | - CPU Module Type: (if CONFIG_COGENT is defined) | 288 | - CPU Module Type: (if CONFIG_COGENT is defined) |
289 | Define exactly one of | 289 | Define exactly one of |
290 | CONFIG_CMA286_60_OLD | 290 | CONFIG_CMA286_60_OLD |
291 | --- FIXME --- not tested yet: | 291 | --- FIXME --- not tested yet: |
292 | CONFIG_CMA286_60, CONFIG_CMA286_21, CONFIG_CMA286_60P, | 292 | CONFIG_CMA286_60, CONFIG_CMA286_21, CONFIG_CMA286_60P, |
293 | CONFIG_CMA287_23, CONFIG_CMA287_50 | 293 | CONFIG_CMA287_23, CONFIG_CMA287_50 |
294 | 294 | ||
295 | - Motherboard Type: (if CONFIG_COGENT is defined) | 295 | - Motherboard Type: (if CONFIG_COGENT is defined) |
296 | Define exactly one of | 296 | Define exactly one of |
297 | CONFIG_CMA101, CONFIG_CMA102 | 297 | CONFIG_CMA101, CONFIG_CMA102 |
298 | 298 | ||
299 | - Motherboard I/O Modules: (if CONFIG_COGENT is defined) | 299 | - Motherboard I/O Modules: (if CONFIG_COGENT is defined) |
300 | Define one or more of | 300 | Define one or more of |
301 | CONFIG_CMA302 | 301 | CONFIG_CMA302 |
302 | 302 | ||
303 | - Motherboard Options: (if CONFIG_CMA101 or CONFIG_CMA102 are defined) | 303 | - Motherboard Options: (if CONFIG_CMA101 or CONFIG_CMA102 are defined) |
304 | Define one or more of | 304 | Define one or more of |
305 | CONFIG_LCD_HEARTBEAT - update a character position on | 305 | CONFIG_LCD_HEARTBEAT - update a character position on |
306 | the LCD display every second with | 306 | the LCD display every second with |
307 | a "rotator" |\-/|\-/ | 307 | a "rotator" |\-/|\-/ |
308 | 308 | ||
309 | - Board flavour: (if CONFIG_MPC8260ADS is defined) | 309 | - Board flavour: (if CONFIG_MPC8260ADS is defined) |
310 | CONFIG_ADSTYPE | 310 | CONFIG_ADSTYPE |
311 | Possible values are: | 311 | Possible values are: |
312 | CONFIG_SYS_8260ADS - original MPC8260ADS | 312 | CONFIG_SYS_8260ADS - original MPC8260ADS |
313 | CONFIG_SYS_8266ADS - MPC8266ADS | 313 | CONFIG_SYS_8266ADS - MPC8266ADS |
314 | CONFIG_SYS_PQ2FADS - PQ2FADS-ZU or PQ2FADS-VR | 314 | CONFIG_SYS_PQ2FADS - PQ2FADS-ZU or PQ2FADS-VR |
315 | CONFIG_SYS_8272ADS - MPC8272ADS | 315 | CONFIG_SYS_8272ADS - MPC8272ADS |
316 | 316 | ||
317 | - Marvell Family Member | 317 | - Marvell Family Member |
318 | CONFIG_SYS_MVFS - define it if you want to enable | 318 | CONFIG_SYS_MVFS - define it if you want to enable |
319 | multiple fs option at one time | 319 | multiple fs option at one time |
320 | for marvell soc family | 320 | for marvell soc family |
321 | 321 | ||
322 | - MPC824X Family Member (if CONFIG_MPC824X is defined) | 322 | - MPC824X Family Member (if CONFIG_MPC824X is defined) |
323 | Define exactly one of | 323 | Define exactly one of |
324 | CONFIG_MPC8240, CONFIG_MPC8245 | 324 | CONFIG_MPC8240, CONFIG_MPC8245 |
325 | 325 | ||
326 | - 8xx CPU Options: (if using an MPC8xx CPU) | 326 | - 8xx CPU Options: (if using an MPC8xx CPU) |
327 | CONFIG_8xx_GCLK_FREQ - deprecated: CPU clock if | 327 | CONFIG_8xx_GCLK_FREQ - deprecated: CPU clock if |
328 | get_gclk_freq() cannot work | 328 | get_gclk_freq() cannot work |
329 | e.g. if there is no 32KHz | 329 | e.g. if there is no 32KHz |
330 | reference PIT/RTC clock | 330 | reference PIT/RTC clock |
331 | CONFIG_8xx_OSCLK - PLL input clock (either EXTCLK | 331 | CONFIG_8xx_OSCLK - PLL input clock (either EXTCLK |
332 | or XTAL/EXTAL) | 332 | or XTAL/EXTAL) |
333 | 333 | ||
334 | - 859/866/885 CPU options: (if using a MPC859 or MPC866 or MPC885 CPU): | 334 | - 859/866/885 CPU options: (if using a MPC859 or MPC866 or MPC885 CPU): |
335 | CONFIG_SYS_8xx_CPUCLK_MIN | 335 | CONFIG_SYS_8xx_CPUCLK_MIN |
336 | CONFIG_SYS_8xx_CPUCLK_MAX | 336 | CONFIG_SYS_8xx_CPUCLK_MAX |
337 | CONFIG_8xx_CPUCLK_DEFAULT | 337 | CONFIG_8xx_CPUCLK_DEFAULT |
338 | See doc/README.MPC866 | 338 | See doc/README.MPC866 |
339 | 339 | ||
340 | CONFIG_SYS_MEASURE_CPUCLK | 340 | CONFIG_SYS_MEASURE_CPUCLK |
341 | 341 | ||
342 | Define this to measure the actual CPU clock instead | 342 | Define this to measure the actual CPU clock instead |
343 | of relying on the correctness of the configured | 343 | of relying on the correctness of the configured |
344 | values. Mostly useful for board bringup to make sure | 344 | values. Mostly useful for board bringup to make sure |
345 | the PLL is locked at the intended frequency. Note | 345 | the PLL is locked at the intended frequency. Note |
346 | that this requires a (stable) reference clock (32 kHz | 346 | that this requires a (stable) reference clock (32 kHz |
347 | RTC clock or CONFIG_SYS_8XX_XIN) | 347 | RTC clock or CONFIG_SYS_8XX_XIN) |
348 | 348 | ||
349 | CONFIG_SYS_DELAYED_ICACHE | 349 | CONFIG_SYS_DELAYED_ICACHE |
350 | 350 | ||
351 | Define this option if you want to enable the | 351 | Define this option if you want to enable the |
352 | ICache only when Code runs from RAM. | 352 | ICache only when Code runs from RAM. |
353 | 353 | ||
354 | - 85xx CPU Options: | 354 | - 85xx CPU Options: |
355 | CONFIG_SYS_PPC64 | 355 | CONFIG_SYS_PPC64 |
356 | 356 | ||
357 | Specifies that the core is a 64-bit PowerPC implementation (implements | 357 | Specifies that the core is a 64-bit PowerPC implementation (implements |
358 | the "64" category of the Power ISA). This is necessary for ePAPR | 358 | the "64" category of the Power ISA). This is necessary for ePAPR |
359 | compliance, among other possible reasons. | 359 | compliance, among other possible reasons. |
360 | 360 | ||
361 | CONFIG_SYS_FSL_TBCLK_DIV | 361 | CONFIG_SYS_FSL_TBCLK_DIV |
362 | 362 | ||
363 | Defines the core time base clock divider ratio compared to the | 363 | Defines the core time base clock divider ratio compared to the |
364 | system clock. On most PQ3 devices this is 8, on newer QorIQ | 364 | system clock. On most PQ3 devices this is 8, on newer QorIQ |
365 | devices it can be 16 or 32. The ratio varies from SoC to Soc. | 365 | devices it can be 16 or 32. The ratio varies from SoC to Soc. |
366 | 366 | ||
367 | CONFIG_SYS_FSL_PCIE_COMPAT | 367 | CONFIG_SYS_FSL_PCIE_COMPAT |
368 | 368 | ||
369 | Defines the string to utilize when trying to match PCIe device | 369 | Defines the string to utilize when trying to match PCIe device |
370 | tree nodes for the given platform. | 370 | tree nodes for the given platform. |
371 | 371 | ||
372 | CONFIG_SYS_PPC_E500_DEBUG_TLB | 372 | CONFIG_SYS_PPC_E500_DEBUG_TLB |
373 | 373 | ||
374 | Enables a temporary TLB entry to be used during boot to work | 374 | Enables a temporary TLB entry to be used during boot to work |
375 | around limitations in e500v1 and e500v2 external debugger | 375 | around limitations in e500v1 and e500v2 external debugger |
376 | support. This reduces the portions of the boot code where | 376 | support. This reduces the portions of the boot code where |
377 | breakpoints and single stepping do not work. The value of this | 377 | breakpoints and single stepping do not work. The value of this |
378 | symbol should be set to the TLB1 entry to be used for this | 378 | symbol should be set to the TLB1 entry to be used for this |
379 | purpose. | 379 | purpose. |
380 | 380 | ||
381 | CONFIG_SYS_FSL_ERRATUM_A004510 | 381 | CONFIG_SYS_FSL_ERRATUM_A004510 |
382 | 382 | ||
383 | Enables a workaround for erratum A004510. If set, | 383 | Enables a workaround for erratum A004510. If set, |
384 | then CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV and | 384 | then CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV and |
385 | CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY must be set. | 385 | CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY must be set. |
386 | 386 | ||
387 | CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV | 387 | CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV |
388 | CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV2 (optional) | 388 | CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV2 (optional) |
389 | 389 | ||
390 | Defines one or two SoC revisions (low 8 bits of SVR) | 390 | Defines one or two SoC revisions (low 8 bits of SVR) |
391 | for which the A004510 workaround should be applied. | 391 | for which the A004510 workaround should be applied. |
392 | 392 | ||
393 | The rest of SVR is either not relevant to the decision | 393 | The rest of SVR is either not relevant to the decision |
394 | of whether the erratum is present (e.g. p2040 versus | 394 | of whether the erratum is present (e.g. p2040 versus |
395 | p2041) or is implied by the build target, which controls | 395 | p2041) or is implied by the build target, which controls |
396 | whether CONFIG_SYS_FSL_ERRATUM_A004510 is set. | 396 | whether CONFIG_SYS_FSL_ERRATUM_A004510 is set. |
397 | 397 | ||
398 | See Freescale App Note 4493 for more information about | 398 | See Freescale App Note 4493 for more information about |
399 | this erratum. | 399 | this erratum. |
400 | 400 | ||
401 | CONFIG_A003399_NOR_WORKAROUND | 401 | CONFIG_A003399_NOR_WORKAROUND |
402 | Enables a workaround for IFC erratum A003399. It is only | 402 | Enables a workaround for IFC erratum A003399. It is only |
403 | requred during NOR boot. | 403 | requred during NOR boot. |
404 | 404 | ||
405 | CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY | 405 | CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY |
406 | 406 | ||
407 | This is the value to write into CCSR offset 0x18600 | 407 | This is the value to write into CCSR offset 0x18600 |
408 | according to the A004510 workaround. | 408 | according to the A004510 workaround. |
409 | 409 | ||
410 | CONFIG_SYS_FSL_DSP_DDR_ADDR | 410 | CONFIG_SYS_FSL_DSP_DDR_ADDR |
411 | This value denotes start offset of DDR memory which is | 411 | This value denotes start offset of DDR memory which is |
412 | connected exclusively to the DSP cores. | 412 | connected exclusively to the DSP cores. |
413 | 413 | ||
414 | CONFIG_SYS_FSL_DSP_M2_RAM_ADDR | 414 | CONFIG_SYS_FSL_DSP_M2_RAM_ADDR |
415 | This value denotes start offset of M2 memory | 415 | This value denotes start offset of M2 memory |
416 | which is directly connected to the DSP core. | 416 | which is directly connected to the DSP core. |
417 | 417 | ||
418 | CONFIG_SYS_FSL_DSP_M3_RAM_ADDR | 418 | CONFIG_SYS_FSL_DSP_M3_RAM_ADDR |
419 | This value denotes start offset of M3 memory which is directly | 419 | This value denotes start offset of M3 memory which is directly |
420 | connected to the DSP core. | 420 | connected to the DSP core. |
421 | 421 | ||
422 | CONFIG_SYS_FSL_DSP_CCSRBAR_DEFAULT | 422 | CONFIG_SYS_FSL_DSP_CCSRBAR_DEFAULT |
423 | This value denotes start offset of DSP CCSR space. | 423 | This value denotes start offset of DSP CCSR space. |
424 | 424 | ||
425 | CONFIG_SYS_FSL_SINGLE_SOURCE_CLK | 425 | CONFIG_SYS_FSL_SINGLE_SOURCE_CLK |
426 | Single Source Clock is clocking mode present in some of FSL SoC's. | 426 | Single Source Clock is clocking mode present in some of FSL SoC's. |
427 | In this mode, a single differential clock is used to supply | 427 | In this mode, a single differential clock is used to supply |
428 | clocks to the sysclock, ddrclock and usbclock. | 428 | clocks to the sysclock, ddrclock and usbclock. |
429 | 429 | ||
430 | - Generic CPU options: | 430 | - Generic CPU options: |
431 | CONFIG_SYS_BIG_ENDIAN, CONFIG_SYS_LITTLE_ENDIAN | 431 | CONFIG_SYS_BIG_ENDIAN, CONFIG_SYS_LITTLE_ENDIAN |
432 | 432 | ||
433 | Defines the endianess of the CPU. Implementation of those | 433 | Defines the endianess of the CPU. Implementation of those |
434 | values is arch specific. | 434 | values is arch specific. |
435 | 435 | ||
436 | CONFIG_SYS_FSL_DDR | 436 | CONFIG_SYS_FSL_DDR |
437 | Freescale DDR driver in use. This type of DDR controller is | 437 | Freescale DDR driver in use. This type of DDR controller is |
438 | found in mpc83xx, mpc85xx, mpc86xx as well as some ARM core | 438 | found in mpc83xx, mpc85xx, mpc86xx as well as some ARM core |
439 | SoCs. | 439 | SoCs. |
440 | 440 | ||
441 | CONFIG_SYS_FSL_DDR_ADDR | 441 | CONFIG_SYS_FSL_DDR_ADDR |
442 | Freescale DDR memory-mapped register base. | 442 | Freescale DDR memory-mapped register base. |
443 | 443 | ||
444 | CONFIG_SYS_FSL_DDR_EMU | 444 | CONFIG_SYS_FSL_DDR_EMU |
445 | Specify emulator support for DDR. Some DDR features such as | 445 | Specify emulator support for DDR. Some DDR features such as |
446 | deskew training are not available. | 446 | deskew training are not available. |
447 | 447 | ||
448 | CONFIG_SYS_FSL_DDRC_GEN1 | 448 | CONFIG_SYS_FSL_DDRC_GEN1 |
449 | Freescale DDR1 controller. | 449 | Freescale DDR1 controller. |
450 | 450 | ||
451 | CONFIG_SYS_FSL_DDRC_GEN2 | 451 | CONFIG_SYS_FSL_DDRC_GEN2 |
452 | Freescale DDR2 controller. | 452 | Freescale DDR2 controller. |
453 | 453 | ||
454 | CONFIG_SYS_FSL_DDRC_GEN3 | 454 | CONFIG_SYS_FSL_DDRC_GEN3 |
455 | Freescale DDR3 controller. | 455 | Freescale DDR3 controller. |
456 | 456 | ||
457 | CONFIG_SYS_FSL_DDRC_ARM_GEN3 | 457 | CONFIG_SYS_FSL_DDRC_ARM_GEN3 |
458 | Freescale DDR3 controller for ARM-based SoCs. | 458 | Freescale DDR3 controller for ARM-based SoCs. |
459 | 459 | ||
460 | CONFIG_SYS_FSL_DDR1 | 460 | CONFIG_SYS_FSL_DDR1 |
461 | Board config to use DDR1. It can be enabled for SoCs with | 461 | Board config to use DDR1. It can be enabled for SoCs with |
462 | Freescale DDR1 or DDR2 controllers, depending on the board | 462 | Freescale DDR1 or DDR2 controllers, depending on the board |
463 | implemetation. | 463 | implemetation. |
464 | 464 | ||
465 | CONFIG_SYS_FSL_DDR2 | 465 | CONFIG_SYS_FSL_DDR2 |
466 | Board config to use DDR2. It can be eanbeld for SoCs with | 466 | Board config to use DDR2. It can be eanbeld for SoCs with |
467 | Freescale DDR2 or DDR3 controllers, depending on the board | 467 | Freescale DDR2 or DDR3 controllers, depending on the board |
468 | implementation. | 468 | implementation. |
469 | 469 | ||
470 | CONFIG_SYS_FSL_DDR3 | 470 | CONFIG_SYS_FSL_DDR3 |
471 | Board config to use DDR3. It can be enabled for SoCs with | 471 | Board config to use DDR3. It can be enabled for SoCs with |
472 | Freescale DDR3 controllers. | 472 | Freescale DDR3 controllers. |
473 | 473 | ||
474 | CONFIG_SYS_FSL_IFC_BE | 474 | CONFIG_SYS_FSL_IFC_BE |
475 | Defines the IFC controller register space as Big Endian | 475 | Defines the IFC controller register space as Big Endian |
476 | 476 | ||
477 | CONFIG_SYS_FSL_IFC_LE | 477 | CONFIG_SYS_FSL_IFC_LE |
478 | Defines the IFC controller register space as Little Endian | 478 | Defines the IFC controller register space as Little Endian |
479 | 479 | ||
480 | CONFIG_SYS_FSL_PBL_PBI | 480 | CONFIG_SYS_FSL_PBL_PBI |
481 | It enables addition of RCW (Power on reset configuration) in built image. | 481 | It enables addition of RCW (Power on reset configuration) in built image. |
482 | Please refer doc/README.pblimage for more details | 482 | Please refer doc/README.pblimage for more details |
483 | 483 | ||
484 | CONFIG_SYS_FSL_PBL_RCW | 484 | CONFIG_SYS_FSL_PBL_RCW |
485 | It adds PBI(pre-boot instructions) commands in u-boot build image. | 485 | It adds PBI(pre-boot instructions) commands in u-boot build image. |
486 | PBI commands can be used to configure SoC before it starts the execution. | 486 | PBI commands can be used to configure SoC before it starts the execution. |
487 | Please refer doc/README.pblimage for more details | 487 | Please refer doc/README.pblimage for more details |
488 | 488 | ||
489 | - Intel Monahans options: | 489 | - Intel Monahans options: |
490 | CONFIG_SYS_MONAHANS_RUN_MODE_OSC_RATIO | 490 | CONFIG_SYS_MONAHANS_RUN_MODE_OSC_RATIO |
491 | 491 | ||
492 | Defines the Monahans run mode to oscillator | 492 | Defines the Monahans run mode to oscillator |
493 | ratio. Valid values are 8, 16, 24, 31. The core | 493 | ratio. Valid values are 8, 16, 24, 31. The core |
494 | frequency is this value multiplied by 13 MHz. | 494 | frequency is this value multiplied by 13 MHz. |
495 | 495 | ||
496 | CONFIG_SYS_MONAHANS_TURBO_RUN_MODE_RATIO | 496 | CONFIG_SYS_MONAHANS_TURBO_RUN_MODE_RATIO |
497 | 497 | ||
498 | Defines the Monahans turbo mode to oscillator | 498 | Defines the Monahans turbo mode to oscillator |
499 | ratio. Valid values are 1 (default if undefined) and | 499 | ratio. Valid values are 1 (default if undefined) and |
500 | 2. The core frequency as calculated above is multiplied | 500 | 2. The core frequency as calculated above is multiplied |
501 | by this value. | 501 | by this value. |
502 | 502 | ||
503 | - MIPS CPU options: | 503 | - MIPS CPU options: |
504 | CONFIG_SYS_INIT_SP_OFFSET | 504 | CONFIG_SYS_INIT_SP_OFFSET |
505 | 505 | ||
506 | Offset relative to CONFIG_SYS_SDRAM_BASE for initial stack | 506 | Offset relative to CONFIG_SYS_SDRAM_BASE for initial stack |
507 | pointer. This is needed for the temporary stack before | 507 | pointer. This is needed for the temporary stack before |
508 | relocation. | 508 | relocation. |
509 | 509 | ||
510 | CONFIG_SYS_MIPS_CACHE_MODE | 510 | CONFIG_SYS_MIPS_CACHE_MODE |
511 | 511 | ||
512 | Cache operation mode for the MIPS CPU. | 512 | Cache operation mode for the MIPS CPU. |
513 | See also arch/mips/include/asm/mipsregs.h. | 513 | See also arch/mips/include/asm/mipsregs.h. |
514 | Possible values are: | 514 | Possible values are: |
515 | CONF_CM_CACHABLE_NO_WA | 515 | CONF_CM_CACHABLE_NO_WA |
516 | CONF_CM_CACHABLE_WA | 516 | CONF_CM_CACHABLE_WA |
517 | CONF_CM_UNCACHED | 517 | CONF_CM_UNCACHED |
518 | CONF_CM_CACHABLE_NONCOHERENT | 518 | CONF_CM_CACHABLE_NONCOHERENT |
519 | CONF_CM_CACHABLE_CE | 519 | CONF_CM_CACHABLE_CE |
520 | CONF_CM_CACHABLE_COW | 520 | CONF_CM_CACHABLE_COW |
521 | CONF_CM_CACHABLE_CUW | 521 | CONF_CM_CACHABLE_CUW |
522 | CONF_CM_CACHABLE_ACCELERATED | 522 | CONF_CM_CACHABLE_ACCELERATED |
523 | 523 | ||
524 | CONFIG_SYS_XWAY_EBU_BOOTCFG | 524 | CONFIG_SYS_XWAY_EBU_BOOTCFG |
525 | 525 | ||
526 | Special option for Lantiq XWAY SoCs for booting from NOR flash. | 526 | Special option for Lantiq XWAY SoCs for booting from NOR flash. |
527 | See also arch/mips/cpu/mips32/start.S. | 527 | See also arch/mips/cpu/mips32/start.S. |
528 | 528 | ||
529 | CONFIG_XWAY_SWAP_BYTES | 529 | CONFIG_XWAY_SWAP_BYTES |
530 | 530 | ||
531 | Enable compilation of tools/xway-swap-bytes needed for Lantiq | 531 | Enable compilation of tools/xway-swap-bytes needed for Lantiq |
532 | XWAY SoCs for booting from NOR flash. The U-Boot image needs to | 532 | XWAY SoCs for booting from NOR flash. The U-Boot image needs to |
533 | be swapped if a flash programmer is used. | 533 | be swapped if a flash programmer is used. |
534 | 534 | ||
535 | - ARM options: | 535 | - ARM options: |
536 | CONFIG_SYS_EXCEPTION_VECTORS_HIGH | 536 | CONFIG_SYS_EXCEPTION_VECTORS_HIGH |
537 | 537 | ||
538 | Select high exception vectors of the ARM core, e.g., do not | 538 | Select high exception vectors of the ARM core, e.g., do not |
539 | clear the V bit of the c1 register of CP15. | 539 | clear the V bit of the c1 register of CP15. |
540 | 540 | ||
541 | CONFIG_SYS_THUMB_BUILD | 541 | CONFIG_SYS_THUMB_BUILD |
542 | 542 | ||
543 | Use this flag to build U-Boot using the Thumb instruction | 543 | Use this flag to build U-Boot using the Thumb instruction |
544 | set for ARM architectures. Thumb instruction set provides | 544 | set for ARM architectures. Thumb instruction set provides |
545 | better code density. For ARM architectures that support | 545 | better code density. For ARM architectures that support |
546 | Thumb2 this flag will result in Thumb2 code generated by | 546 | Thumb2 this flag will result in Thumb2 code generated by |
547 | GCC. | 547 | GCC. |
548 | 548 | ||
549 | CONFIG_ARM_ERRATA_716044 | 549 | CONFIG_ARM_ERRATA_716044 |
550 | CONFIG_ARM_ERRATA_742230 | 550 | CONFIG_ARM_ERRATA_742230 |
551 | CONFIG_ARM_ERRATA_743622 | 551 | CONFIG_ARM_ERRATA_743622 |
552 | CONFIG_ARM_ERRATA_751472 | 552 | CONFIG_ARM_ERRATA_751472 |
553 | 553 | ||
554 | If set, the workarounds for these ARM errata are applied early | 554 | If set, the workarounds for these ARM errata are applied early |
555 | during U-Boot startup. Note that these options force the | 555 | during U-Boot startup. Note that these options force the |
556 | workarounds to be applied; no CPU-type/version detection | 556 | workarounds to be applied; no CPU-type/version detection |
557 | exists, unlike the similar options in the Linux kernel. Do not | 557 | exists, unlike the similar options in the Linux kernel. Do not |
558 | set these options unless they apply! | 558 | set these options unless they apply! |
559 | 559 | ||
560 | - CPU timer options: | 560 | - CPU timer options: |
561 | CONFIG_SYS_HZ | 561 | CONFIG_SYS_HZ |
562 | 562 | ||
563 | The frequency of the timer returned by get_timer(). | 563 | The frequency of the timer returned by get_timer(). |
564 | get_timer() must operate in milliseconds and this CONFIG | 564 | get_timer() must operate in milliseconds and this CONFIG |
565 | option must be set to 1000. | 565 | option must be set to 1000. |
566 | 566 | ||
567 | - Linux Kernel Interface: | 567 | - Linux Kernel Interface: |
568 | CONFIG_CLOCKS_IN_MHZ | 568 | CONFIG_CLOCKS_IN_MHZ |
569 | 569 | ||
570 | U-Boot stores all clock information in Hz | 570 | U-Boot stores all clock information in Hz |
571 | internally. For binary compatibility with older Linux | 571 | internally. For binary compatibility with older Linux |
572 | kernels (which expect the clocks passed in the | 572 | kernels (which expect the clocks passed in the |
573 | bd_info data to be in MHz) the environment variable | 573 | bd_info data to be in MHz) the environment variable |
574 | "clocks_in_mhz" can be defined so that U-Boot | 574 | "clocks_in_mhz" can be defined so that U-Boot |
575 | converts clock data to MHZ before passing it to the | 575 | converts clock data to MHZ before passing it to the |
576 | Linux kernel. | 576 | Linux kernel. |
577 | When CONFIG_CLOCKS_IN_MHZ is defined, a definition of | 577 | When CONFIG_CLOCKS_IN_MHZ is defined, a definition of |
578 | "clocks_in_mhz=1" is automatically included in the | 578 | "clocks_in_mhz=1" is automatically included in the |
579 | default environment. | 579 | default environment. |
580 | 580 | ||
581 | CONFIG_MEMSIZE_IN_BYTES [relevant for MIPS only] | 581 | CONFIG_MEMSIZE_IN_BYTES [relevant for MIPS only] |
582 | 582 | ||
583 | When transferring memsize parameter to linux, some versions | 583 | When transferring memsize parameter to linux, some versions |
584 | expect it to be in bytes, others in MB. | 584 | expect it to be in bytes, others in MB. |
585 | Define CONFIG_MEMSIZE_IN_BYTES to make it in bytes. | 585 | Define CONFIG_MEMSIZE_IN_BYTES to make it in bytes. |
586 | 586 | ||
587 | CONFIG_OF_LIBFDT | 587 | CONFIG_OF_LIBFDT |
588 | 588 | ||
589 | New kernel versions are expecting firmware settings to be | 589 | New kernel versions are expecting firmware settings to be |
590 | passed using flattened device trees (based on open firmware | 590 | passed using flattened device trees (based on open firmware |
591 | concepts). | 591 | concepts). |
592 | 592 | ||
593 | CONFIG_OF_LIBFDT | 593 | CONFIG_OF_LIBFDT |
594 | * New libfdt-based support | 594 | * New libfdt-based support |
595 | * Adds the "fdt" command | 595 | * Adds the "fdt" command |
596 | * The bootm command automatically updates the fdt | 596 | * The bootm command automatically updates the fdt |
597 | 597 | ||
598 | OF_CPU - The proper name of the cpus node (only required for | 598 | OF_CPU - The proper name of the cpus node (only required for |
599 | MPC512X and MPC5xxx based boards). | 599 | MPC512X and MPC5xxx based boards). |
600 | OF_SOC - The proper name of the soc node (only required for | 600 | OF_SOC - The proper name of the soc node (only required for |
601 | MPC512X and MPC5xxx based boards). | 601 | MPC512X and MPC5xxx based boards). |
602 | OF_TBCLK - The timebase frequency. | 602 | OF_TBCLK - The timebase frequency. |
603 | OF_STDOUT_PATH - The path to the console device | 603 | OF_STDOUT_PATH - The path to the console device |
604 | 604 | ||
605 | boards with QUICC Engines require OF_QE to set UCC MAC | 605 | boards with QUICC Engines require OF_QE to set UCC MAC |
606 | addresses | 606 | addresses |
607 | 607 | ||
608 | CONFIG_OF_BOARD_SETUP | 608 | CONFIG_OF_BOARD_SETUP |
609 | 609 | ||
610 | Board code has addition modification that it wants to make | 610 | Board code has addition modification that it wants to make |
611 | to the flat device tree before handing it off to the kernel | 611 | to the flat device tree before handing it off to the kernel |
612 | 612 | ||
613 | CONFIG_OF_BOOT_CPU | 613 | CONFIG_OF_BOOT_CPU |
614 | 614 | ||
615 | This define fills in the correct boot CPU in the boot | 615 | This define fills in the correct boot CPU in the boot |
616 | param header, the default value is zero if undefined. | 616 | param header, the default value is zero if undefined. |
617 | 617 | ||
618 | CONFIG_OF_IDE_FIXUP | 618 | CONFIG_OF_IDE_FIXUP |
619 | 619 | ||
620 | U-Boot can detect if an IDE device is present or not. | 620 | U-Boot can detect if an IDE device is present or not. |
621 | If not, and this new config option is activated, U-Boot | 621 | If not, and this new config option is activated, U-Boot |
622 | removes the ATA node from the DTS before booting Linux, | 622 | removes the ATA node from the DTS before booting Linux, |
623 | so the Linux IDE driver does not probe the device and | 623 | so the Linux IDE driver does not probe the device and |
624 | crash. This is needed for buggy hardware (uc101) where | 624 | crash. This is needed for buggy hardware (uc101) where |
625 | no pull down resistor is connected to the signal IDE5V_DD7. | 625 | no pull down resistor is connected to the signal IDE5V_DD7. |
626 | 626 | ||
627 | CONFIG_MACH_TYPE [relevant for ARM only][mandatory] | 627 | CONFIG_MACH_TYPE [relevant for ARM only][mandatory] |
628 | 628 | ||
629 | This setting is mandatory for all boards that have only one | 629 | This setting is mandatory for all boards that have only one |
630 | machine type and must be used to specify the machine type | 630 | machine type and must be used to specify the machine type |
631 | number as it appears in the ARM machine registry | 631 | number as it appears in the ARM machine registry |
632 | (see http://www.arm.linux.org.uk/developer/machines/). | 632 | (see http://www.arm.linux.org.uk/developer/machines/). |
633 | Only boards that have multiple machine types supported | 633 | Only boards that have multiple machine types supported |
634 | in a single configuration file and the machine type is | 634 | in a single configuration file and the machine type is |
635 | runtime discoverable, do not have to use this setting. | 635 | runtime discoverable, do not have to use this setting. |
636 | 636 | ||
637 | - vxWorks boot parameters: | 637 | - vxWorks boot parameters: |
638 | 638 | ||
639 | bootvx constructs a valid bootline using the following | 639 | bootvx constructs a valid bootline using the following |
640 | environments variables: bootfile, ipaddr, serverip, hostname. | 640 | environments variables: bootfile, ipaddr, serverip, hostname. |
641 | It loads the vxWorks image pointed bootfile. | 641 | It loads the vxWorks image pointed bootfile. |
642 | 642 | ||
643 | CONFIG_SYS_VXWORKS_BOOT_DEVICE - The vxworks device name | 643 | CONFIG_SYS_VXWORKS_BOOT_DEVICE - The vxworks device name |
644 | CONFIG_SYS_VXWORKS_MAC_PTR - Ethernet 6 byte MA -address | 644 | CONFIG_SYS_VXWORKS_MAC_PTR - Ethernet 6 byte MA -address |
645 | CONFIG_SYS_VXWORKS_SERVERNAME - Name of the server | 645 | CONFIG_SYS_VXWORKS_SERVERNAME - Name of the server |
646 | CONFIG_SYS_VXWORKS_BOOT_ADDR - Address of boot parameters | 646 | CONFIG_SYS_VXWORKS_BOOT_ADDR - Address of boot parameters |
647 | 647 | ||
648 | CONFIG_SYS_VXWORKS_ADD_PARAMS | 648 | CONFIG_SYS_VXWORKS_ADD_PARAMS |
649 | 649 | ||
650 | Add it at the end of the bootline. E.g "u=username pw=secret" | 650 | Add it at the end of the bootline. E.g "u=username pw=secret" |
651 | 651 | ||
652 | Note: If a "bootargs" environment is defined, it will overwride | 652 | Note: If a "bootargs" environment is defined, it will overwride |
653 | the defaults discussed just above. | 653 | the defaults discussed just above. |
654 | 654 | ||
655 | - Cache Configuration: | 655 | - Cache Configuration: |
656 | CONFIG_SYS_ICACHE_OFF - Do not enable instruction cache in U-Boot | 656 | CONFIG_SYS_ICACHE_OFF - Do not enable instruction cache in U-Boot |
657 | CONFIG_SYS_DCACHE_OFF - Do not enable data cache in U-Boot | 657 | CONFIG_SYS_DCACHE_OFF - Do not enable data cache in U-Boot |
658 | CONFIG_SYS_L2CACHE_OFF- Do not enable L2 cache in U-Boot | 658 | CONFIG_SYS_L2CACHE_OFF- Do not enable L2 cache in U-Boot |
659 | 659 | ||
660 | - Cache Configuration for ARM: | 660 | - Cache Configuration for ARM: |
661 | CONFIG_SYS_L2_PL310 - Enable support for ARM PL310 L2 cache | 661 | CONFIG_SYS_L2_PL310 - Enable support for ARM PL310 L2 cache |
662 | controller | 662 | controller |
663 | CONFIG_SYS_PL310_BASE - Physical base address of PL310 | 663 | CONFIG_SYS_PL310_BASE - Physical base address of PL310 |
664 | controller register space | 664 | controller register space |
665 | 665 | ||
666 | - Serial Ports: | 666 | - Serial Ports: |
667 | CONFIG_PL010_SERIAL | 667 | CONFIG_PL010_SERIAL |
668 | 668 | ||
669 | Define this if you want support for Amba PrimeCell PL010 UARTs. | 669 | Define this if you want support for Amba PrimeCell PL010 UARTs. |
670 | 670 | ||
671 | CONFIG_PL011_SERIAL | 671 | CONFIG_PL011_SERIAL |
672 | 672 | ||
673 | Define this if you want support for Amba PrimeCell PL011 UARTs. | 673 | Define this if you want support for Amba PrimeCell PL011 UARTs. |
674 | 674 | ||
675 | CONFIG_PL011_CLOCK | 675 | CONFIG_PL011_CLOCK |
676 | 676 | ||
677 | If you have Amba PrimeCell PL011 UARTs, set this variable to | 677 | If you have Amba PrimeCell PL011 UARTs, set this variable to |
678 | the clock speed of the UARTs. | 678 | the clock speed of the UARTs. |
679 | 679 | ||
680 | CONFIG_PL01x_PORTS | 680 | CONFIG_PL01x_PORTS |
681 | 681 | ||
682 | If you have Amba PrimeCell PL010 or PL011 UARTs on your board, | 682 | If you have Amba PrimeCell PL010 or PL011 UARTs on your board, |
683 | define this to a list of base addresses for each (supported) | 683 | define this to a list of base addresses for each (supported) |
684 | port. See e.g. include/configs/versatile.h | 684 | port. See e.g. include/configs/versatile.h |
685 | 685 | ||
686 | CONFIG_PL011_SERIAL_RLCR | 686 | CONFIG_PL011_SERIAL_RLCR |
687 | 687 | ||
688 | Some vendor versions of PL011 serial ports (e.g. ST-Ericsson U8500) | 688 | Some vendor versions of PL011 serial ports (e.g. ST-Ericsson U8500) |
689 | have separate receive and transmit line control registers. Set | 689 | have separate receive and transmit line control registers. Set |
690 | this variable to initialize the extra register. | 690 | this variable to initialize the extra register. |
691 | 691 | ||
692 | CONFIG_PL011_SERIAL_FLUSH_ON_INIT | 692 | CONFIG_PL011_SERIAL_FLUSH_ON_INIT |
693 | 693 | ||
694 | On some platforms (e.g. U8500) U-Boot is loaded by a second stage | 694 | On some platforms (e.g. U8500) U-Boot is loaded by a second stage |
695 | boot loader that has already initialized the UART. Define this | 695 | boot loader that has already initialized the UART. Define this |
696 | variable to flush the UART at init time. | 696 | variable to flush the UART at init time. |
697 | 697 | ||
698 | 698 | ||
699 | - Console Interface: | 699 | - Console Interface: |
700 | Depending on board, define exactly one serial port | 700 | Depending on board, define exactly one serial port |
701 | (like CONFIG_8xx_CONS_SMC1, CONFIG_8xx_CONS_SMC2, | 701 | (like CONFIG_8xx_CONS_SMC1, CONFIG_8xx_CONS_SMC2, |
702 | CONFIG_8xx_CONS_SCC1, ...), or switch off the serial | 702 | CONFIG_8xx_CONS_SCC1, ...), or switch off the serial |
703 | console by defining CONFIG_8xx_CONS_NONE | 703 | console by defining CONFIG_8xx_CONS_NONE |
704 | 704 | ||
705 | Note: if CONFIG_8xx_CONS_NONE is defined, the serial | 705 | Note: if CONFIG_8xx_CONS_NONE is defined, the serial |
706 | port routines must be defined elsewhere | 706 | port routines must be defined elsewhere |
707 | (i.e. serial_init(), serial_getc(), ...) | 707 | (i.e. serial_init(), serial_getc(), ...) |
708 | 708 | ||
709 | CONFIG_CFB_CONSOLE | 709 | CONFIG_CFB_CONSOLE |
710 | Enables console device for a color framebuffer. Needs following | 710 | Enables console device for a color framebuffer. Needs following |
711 | defines (cf. smiLynxEM, i8042) | 711 | defines (cf. smiLynxEM, i8042) |
712 | VIDEO_FB_LITTLE_ENDIAN graphic memory organisation | 712 | VIDEO_FB_LITTLE_ENDIAN graphic memory organisation |
713 | (default big endian) | 713 | (default big endian) |
714 | VIDEO_HW_RECTFILL graphic chip supports | 714 | VIDEO_HW_RECTFILL graphic chip supports |
715 | rectangle fill | 715 | rectangle fill |
716 | (cf. smiLynxEM) | 716 | (cf. smiLynxEM) |
717 | VIDEO_HW_BITBLT graphic chip supports | 717 | VIDEO_HW_BITBLT graphic chip supports |
718 | bit-blit (cf. smiLynxEM) | 718 | bit-blit (cf. smiLynxEM) |
719 | VIDEO_VISIBLE_COLS visible pixel columns | 719 | VIDEO_VISIBLE_COLS visible pixel columns |
720 | (cols=pitch) | 720 | (cols=pitch) |
721 | VIDEO_VISIBLE_ROWS visible pixel rows | 721 | VIDEO_VISIBLE_ROWS visible pixel rows |
722 | VIDEO_PIXEL_SIZE bytes per pixel | 722 | VIDEO_PIXEL_SIZE bytes per pixel |
723 | VIDEO_DATA_FORMAT graphic data format | 723 | VIDEO_DATA_FORMAT graphic data format |
724 | (0-5, cf. cfb_console.c) | 724 | (0-5, cf. cfb_console.c) |
725 | VIDEO_FB_ADRS framebuffer address | 725 | VIDEO_FB_ADRS framebuffer address |
726 | VIDEO_KBD_INIT_FCT keyboard int fct | 726 | VIDEO_KBD_INIT_FCT keyboard int fct |
727 | (i.e. i8042_kbd_init()) | 727 | (i.e. i8042_kbd_init()) |
728 | VIDEO_TSTC_FCT test char fct | 728 | VIDEO_TSTC_FCT test char fct |
729 | (i.e. i8042_tstc) | 729 | (i.e. i8042_tstc) |
730 | VIDEO_GETC_FCT get char fct | 730 | VIDEO_GETC_FCT get char fct |
731 | (i.e. i8042_getc) | 731 | (i.e. i8042_getc) |
732 | CONFIG_CONSOLE_CURSOR cursor drawing on/off | 732 | CONFIG_CONSOLE_CURSOR cursor drawing on/off |
733 | (requires blink timer | 733 | (requires blink timer |
734 | cf. i8042.c) | 734 | cf. i8042.c) |
735 | CONFIG_SYS_CONSOLE_BLINK_COUNT blink interval (cf. i8042.c) | 735 | CONFIG_SYS_CONSOLE_BLINK_COUNT blink interval (cf. i8042.c) |
736 | CONFIG_CONSOLE_TIME display time/date info in | 736 | CONFIG_CONSOLE_TIME display time/date info in |
737 | upper right corner | 737 | upper right corner |
738 | (requires CONFIG_CMD_DATE) | 738 | (requires CONFIG_CMD_DATE) |
739 | CONFIG_VIDEO_LOGO display Linux logo in | 739 | CONFIG_VIDEO_LOGO display Linux logo in |
740 | upper left corner | 740 | upper left corner |
741 | CONFIG_VIDEO_BMP_LOGO use bmp_logo.h instead of | 741 | CONFIG_VIDEO_BMP_LOGO use bmp_logo.h instead of |
742 | linux_logo.h for logo. | 742 | linux_logo.h for logo. |
743 | Requires CONFIG_VIDEO_LOGO | 743 | Requires CONFIG_VIDEO_LOGO |
744 | CONFIG_CONSOLE_EXTRA_INFO | 744 | CONFIG_CONSOLE_EXTRA_INFO |
745 | additional board info beside | 745 | additional board info beside |
746 | the logo | 746 | the logo |
747 | 747 | ||
748 | When CONFIG_CFB_CONSOLE_ANSI is defined, console will support | 748 | When CONFIG_CFB_CONSOLE_ANSI is defined, console will support |
749 | a limited number of ANSI escape sequences (cursor control, | 749 | a limited number of ANSI escape sequences (cursor control, |
750 | erase functions and limited graphics rendition control). | 750 | erase functions and limited graphics rendition control). |
751 | 751 | ||
752 | When CONFIG_CFB_CONSOLE is defined, video console is | 752 | When CONFIG_CFB_CONSOLE is defined, video console is |
753 | default i/o. Serial console can be forced with | 753 | default i/o. Serial console can be forced with |
754 | environment 'console=serial'. | 754 | environment 'console=serial'. |
755 | 755 | ||
756 | When CONFIG_SILENT_CONSOLE is defined, all console | 756 | When CONFIG_SILENT_CONSOLE is defined, all console |
757 | messages (by U-Boot and Linux!) can be silenced with | 757 | messages (by U-Boot and Linux!) can be silenced with |
758 | the "silent" environment variable. See | 758 | the "silent" environment variable. See |
759 | doc/README.silent for more information. | 759 | doc/README.silent for more information. |
760 | 760 | ||
761 | CONFIG_SYS_CONSOLE_BG_COL: define the backgroundcolor, default | 761 | CONFIG_SYS_CONSOLE_BG_COL: define the backgroundcolor, default |
762 | is 0x00. | 762 | is 0x00. |
763 | CONFIG_SYS_CONSOLE_FG_COL: define the foregroundcolor, default | 763 | CONFIG_SYS_CONSOLE_FG_COL: define the foregroundcolor, default |
764 | is 0xa0. | 764 | is 0xa0. |
765 | 765 | ||
766 | - Console Baudrate: | 766 | - Console Baudrate: |
767 | CONFIG_BAUDRATE - in bps | 767 | CONFIG_BAUDRATE - in bps |
768 | Select one of the baudrates listed in | 768 | Select one of the baudrates listed in |
769 | CONFIG_SYS_BAUDRATE_TABLE, see below. | 769 | CONFIG_SYS_BAUDRATE_TABLE, see below. |
770 | CONFIG_SYS_BRGCLK_PRESCALE, baudrate prescale | 770 | CONFIG_SYS_BRGCLK_PRESCALE, baudrate prescale |
771 | 771 | ||
772 | - Console Rx buffer length | 772 | - Console Rx buffer length |
773 | With CONFIG_SYS_SMC_RXBUFLEN it is possible to define | 773 | With CONFIG_SYS_SMC_RXBUFLEN it is possible to define |
774 | the maximum receive buffer length for the SMC. | 774 | the maximum receive buffer length for the SMC. |
775 | This option is actual only for 82xx and 8xx possible. | 775 | This option is actual only for 82xx and 8xx possible. |
776 | If using CONFIG_SYS_SMC_RXBUFLEN also CONFIG_SYS_MAXIDLE | 776 | If using CONFIG_SYS_SMC_RXBUFLEN also CONFIG_SYS_MAXIDLE |
777 | must be defined, to setup the maximum idle timeout for | 777 | must be defined, to setup the maximum idle timeout for |
778 | the SMC. | 778 | the SMC. |
779 | 779 | ||
780 | - Pre-Console Buffer: | 780 | - Pre-Console Buffer: |
781 | Prior to the console being initialised (i.e. serial UART | 781 | Prior to the console being initialised (i.e. serial UART |
782 | initialised etc) all console output is silently discarded. | 782 | initialised etc) all console output is silently discarded. |
783 | Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to | 783 | Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to |
784 | buffer any console messages prior to the console being | 784 | buffer any console messages prior to the console being |
785 | initialised to a buffer of size CONFIG_PRE_CON_BUF_SZ | 785 | initialised to a buffer of size CONFIG_PRE_CON_BUF_SZ |
786 | bytes located at CONFIG_PRE_CON_BUF_ADDR. The buffer is | 786 | bytes located at CONFIG_PRE_CON_BUF_ADDR. The buffer is |
787 | a circular buffer, so if more than CONFIG_PRE_CON_BUF_SZ | 787 | a circular buffer, so if more than CONFIG_PRE_CON_BUF_SZ |
788 | bytes are output before the console is initialised, the | 788 | bytes are output before the console is initialised, the |
789 | earlier bytes are discarded. | 789 | earlier bytes are discarded. |
790 | 790 | ||
791 | 'Sane' compilers will generate smaller code if | 791 | 'Sane' compilers will generate smaller code if |
792 | CONFIG_PRE_CON_BUF_SZ is a power of 2 | 792 | CONFIG_PRE_CON_BUF_SZ is a power of 2 |
793 | 793 | ||
794 | - Safe printf() functions | 794 | - Safe printf() functions |
795 | Define CONFIG_SYS_VSNPRINTF to compile in safe versions of | 795 | Define CONFIG_SYS_VSNPRINTF to compile in safe versions of |
796 | the printf() functions. These are defined in | 796 | the printf() functions. These are defined in |
797 | include/vsprintf.h and include snprintf(), vsnprintf() and | 797 | include/vsprintf.h and include snprintf(), vsnprintf() and |
798 | so on. Code size increase is approximately 300-500 bytes. | 798 | so on. Code size increase is approximately 300-500 bytes. |
799 | If this option is not given then these functions will | 799 | If this option is not given then these functions will |
800 | silently discard their buffer size argument - this means | 800 | silently discard their buffer size argument - this means |
801 | you are not getting any overflow checking in this case. | 801 | you are not getting any overflow checking in this case. |
802 | 802 | ||
803 | - Boot Delay: CONFIG_BOOTDELAY - in seconds | 803 | - Boot Delay: CONFIG_BOOTDELAY - in seconds |
804 | Delay before automatically booting the default image; | 804 | Delay before automatically booting the default image; |
805 | set to -1 to disable autoboot. | 805 | set to -1 to disable autoboot. |
806 | set to -2 to autoboot with no delay and not check for abort | 806 | set to -2 to autoboot with no delay and not check for abort |
807 | (even when CONFIG_ZERO_BOOTDELAY_CHECK is defined). | 807 | (even when CONFIG_ZERO_BOOTDELAY_CHECK is defined). |
808 | 808 | ||
809 | See doc/README.autoboot for these options that | 809 | See doc/README.autoboot for these options that |
810 | work with CONFIG_BOOTDELAY. None are required. | 810 | work with CONFIG_BOOTDELAY. None are required. |
811 | CONFIG_BOOT_RETRY_TIME | 811 | CONFIG_BOOT_RETRY_TIME |
812 | CONFIG_BOOT_RETRY_MIN | 812 | CONFIG_BOOT_RETRY_MIN |
813 | CONFIG_AUTOBOOT_KEYED | 813 | CONFIG_AUTOBOOT_KEYED |
814 | CONFIG_AUTOBOOT_PROMPT | 814 | CONFIG_AUTOBOOT_PROMPT |
815 | CONFIG_AUTOBOOT_DELAY_STR | 815 | CONFIG_AUTOBOOT_DELAY_STR |
816 | CONFIG_AUTOBOOT_STOP_STR | 816 | CONFIG_AUTOBOOT_STOP_STR |
817 | CONFIG_AUTOBOOT_DELAY_STR2 | 817 | CONFIG_AUTOBOOT_DELAY_STR2 |
818 | CONFIG_AUTOBOOT_STOP_STR2 | 818 | CONFIG_AUTOBOOT_STOP_STR2 |
819 | CONFIG_ZERO_BOOTDELAY_CHECK | 819 | CONFIG_ZERO_BOOTDELAY_CHECK |
820 | CONFIG_RESET_TO_RETRY | 820 | CONFIG_RESET_TO_RETRY |
821 | 821 | ||
822 | - Autoboot Command: | 822 | - Autoboot Command: |
823 | CONFIG_BOOTCOMMAND | 823 | CONFIG_BOOTCOMMAND |
824 | Only needed when CONFIG_BOOTDELAY is enabled; | 824 | Only needed when CONFIG_BOOTDELAY is enabled; |
825 | define a command string that is automatically executed | 825 | define a command string that is automatically executed |
826 | when no character is read on the console interface | 826 | when no character is read on the console interface |
827 | within "Boot Delay" after reset. | 827 | within "Boot Delay" after reset. |
828 | 828 | ||
829 | CONFIG_BOOTARGS | 829 | CONFIG_BOOTARGS |
830 | This can be used to pass arguments to the bootm | 830 | This can be used to pass arguments to the bootm |
831 | command. The value of CONFIG_BOOTARGS goes into the | 831 | command. The value of CONFIG_BOOTARGS goes into the |
832 | environment value "bootargs". | 832 | environment value "bootargs". |
833 | 833 | ||
834 | CONFIG_RAMBOOT and CONFIG_NFSBOOT | 834 | CONFIG_RAMBOOT and CONFIG_NFSBOOT |
835 | The value of these goes into the environment as | 835 | The value of these goes into the environment as |
836 | "ramboot" and "nfsboot" respectively, and can be used | 836 | "ramboot" and "nfsboot" respectively, and can be used |
837 | as a convenience, when switching between booting from | 837 | as a convenience, when switching between booting from |
838 | RAM and NFS. | 838 | RAM and NFS. |
839 | 839 | ||
840 | - Bootcount: | 840 | - Bootcount: |
841 | CONFIG_BOOTCOUNT_LIMIT | 841 | CONFIG_BOOTCOUNT_LIMIT |
842 | Implements a mechanism for detecting a repeating reboot | 842 | Implements a mechanism for detecting a repeating reboot |
843 | cycle, see: | 843 | cycle, see: |
844 | http://www.denx.de/wiki/view/DULG/UBootBootCountLimit | 844 | http://www.denx.de/wiki/view/DULG/UBootBootCountLimit |
845 | 845 | ||
846 | CONFIG_BOOTCOUNT_ENV | 846 | CONFIG_BOOTCOUNT_ENV |
847 | If no softreset save registers are found on the hardware | 847 | If no softreset save registers are found on the hardware |
848 | "bootcount" is stored in the environment. To prevent a | 848 | "bootcount" is stored in the environment. To prevent a |
849 | saveenv on all reboots, the environment variable | 849 | saveenv on all reboots, the environment variable |
850 | "upgrade_available" is used. If "upgrade_available" is | 850 | "upgrade_available" is used. If "upgrade_available" is |
851 | 0, "bootcount" is always 0, if "upgrade_available" is | 851 | 0, "bootcount" is always 0, if "upgrade_available" is |
852 | 1 "bootcount" is incremented in the environment. | 852 | 1 "bootcount" is incremented in the environment. |
853 | So the Userspace Applikation must set the "upgrade_available" | 853 | So the Userspace Applikation must set the "upgrade_available" |
854 | and "bootcount" variable to 0, if a boot was successfully. | 854 | and "bootcount" variable to 0, if a boot was successfully. |
855 | 855 | ||
856 | - Pre-Boot Commands: | 856 | - Pre-Boot Commands: |
857 | CONFIG_PREBOOT | 857 | CONFIG_PREBOOT |
858 | 858 | ||
859 | When this option is #defined, the existence of the | 859 | When this option is #defined, the existence of the |
860 | environment variable "preboot" will be checked | 860 | environment variable "preboot" will be checked |
861 | immediately before starting the CONFIG_BOOTDELAY | 861 | immediately before starting the CONFIG_BOOTDELAY |
862 | countdown and/or running the auto-boot command resp. | 862 | countdown and/or running the auto-boot command resp. |
863 | entering interactive mode. | 863 | entering interactive mode. |
864 | 864 | ||
865 | This feature is especially useful when "preboot" is | 865 | This feature is especially useful when "preboot" is |
866 | automatically generated or modified. For an example | 866 | automatically generated or modified. For an example |
867 | see the LWMON board specific code: here "preboot" is | 867 | see the LWMON board specific code: here "preboot" is |
868 | modified when the user holds down a certain | 868 | modified when the user holds down a certain |
869 | combination of keys on the (special) keyboard when | 869 | combination of keys on the (special) keyboard when |
870 | booting the systems | 870 | booting the systems |
871 | 871 | ||
872 | - Serial Download Echo Mode: | 872 | - Serial Download Echo Mode: |
873 | CONFIG_LOADS_ECHO | 873 | CONFIG_LOADS_ECHO |
874 | If defined to 1, all characters received during a | 874 | If defined to 1, all characters received during a |
875 | serial download (using the "loads" command) are | 875 | serial download (using the "loads" command) are |
876 | echoed back. This might be needed by some terminal | 876 | echoed back. This might be needed by some terminal |
877 | emulations (like "cu"), but may as well just take | 877 | emulations (like "cu"), but may as well just take |
878 | time on others. This setting #define's the initial | 878 | time on others. This setting #define's the initial |
879 | value of the "loads_echo" environment variable. | 879 | value of the "loads_echo" environment variable. |
880 | 880 | ||
881 | - Kgdb Serial Baudrate: (if CONFIG_CMD_KGDB is defined) | 881 | - Kgdb Serial Baudrate: (if CONFIG_CMD_KGDB is defined) |
882 | CONFIG_KGDB_BAUDRATE | 882 | CONFIG_KGDB_BAUDRATE |
883 | Select one of the baudrates listed in | 883 | Select one of the baudrates listed in |
884 | CONFIG_SYS_BAUDRATE_TABLE, see below. | 884 | CONFIG_SYS_BAUDRATE_TABLE, see below. |
885 | 885 | ||
886 | - Monitor Functions: | 886 | - Monitor Functions: |
887 | Monitor commands can be included or excluded | 887 | Monitor commands can be included or excluded |
888 | from the build by using the #include files | 888 | from the build by using the #include files |
889 | <config_cmd_all.h> and #undef'ing unwanted | 889 | <config_cmd_all.h> and #undef'ing unwanted |
890 | commands, or using <config_cmd_default.h> | 890 | commands, or using <config_cmd_default.h> |
891 | and augmenting with additional #define's | 891 | and augmenting with additional #define's |
892 | for wanted commands. | 892 | for wanted commands. |
893 | 893 | ||
894 | The default command configuration includes all commands | 894 | The default command configuration includes all commands |
895 | except those marked below with a "*". | 895 | except those marked below with a "*". |
896 | 896 | ||
897 | CONFIG_CMD_ASKENV * ask for env variable | 897 | CONFIG_CMD_ASKENV * ask for env variable |
898 | CONFIG_CMD_BDI bdinfo | 898 | CONFIG_CMD_BDI bdinfo |
899 | CONFIG_CMD_BEDBUG * Include BedBug Debugger | 899 | CONFIG_CMD_BEDBUG * Include BedBug Debugger |
900 | CONFIG_CMD_BMP * BMP support | 900 | CONFIG_CMD_BMP * BMP support |
901 | CONFIG_CMD_BSP * Board specific commands | 901 | CONFIG_CMD_BSP * Board specific commands |
902 | CONFIG_CMD_BOOTD bootd | 902 | CONFIG_CMD_BOOTD bootd |
903 | CONFIG_CMD_CACHE * icache, dcache | 903 | CONFIG_CMD_CACHE * icache, dcache |
904 | CONFIG_CMD_CLK * clock command support | 904 | CONFIG_CMD_CLK * clock command support |
905 | CONFIG_CMD_CONSOLE coninfo | 905 | CONFIG_CMD_CONSOLE coninfo |
906 | CONFIG_CMD_CRC32 * crc32 | 906 | CONFIG_CMD_CRC32 * crc32 |
907 | CONFIG_CMD_DATE * support for RTC, date/time... | 907 | CONFIG_CMD_DATE * support for RTC, date/time... |
908 | CONFIG_CMD_DHCP * DHCP support | 908 | CONFIG_CMD_DHCP * DHCP support |
909 | CONFIG_CMD_DIAG * Diagnostics | 909 | CONFIG_CMD_DIAG * Diagnostics |
910 | CONFIG_CMD_DS4510 * ds4510 I2C gpio commands | 910 | CONFIG_CMD_DS4510 * ds4510 I2C gpio commands |
911 | CONFIG_CMD_DS4510_INFO * ds4510 I2C info command | 911 | CONFIG_CMD_DS4510_INFO * ds4510 I2C info command |
912 | CONFIG_CMD_DS4510_MEM * ds4510 I2C eeprom/sram commansd | 912 | CONFIG_CMD_DS4510_MEM * ds4510 I2C eeprom/sram commansd |
913 | CONFIG_CMD_DS4510_RST * ds4510 I2C rst command | 913 | CONFIG_CMD_DS4510_RST * ds4510 I2C rst command |
914 | CONFIG_CMD_DTT * Digital Therm and Thermostat | 914 | CONFIG_CMD_DTT * Digital Therm and Thermostat |
915 | CONFIG_CMD_ECHO echo arguments | 915 | CONFIG_CMD_ECHO echo arguments |
916 | CONFIG_CMD_EDITENV edit env variable | 916 | CONFIG_CMD_EDITENV edit env variable |
917 | CONFIG_CMD_EEPROM * EEPROM read/write support | 917 | CONFIG_CMD_EEPROM * EEPROM read/write support |
918 | CONFIG_CMD_ELF * bootelf, bootvx | 918 | CONFIG_CMD_ELF * bootelf, bootvx |
919 | CONFIG_CMD_ENV_CALLBACK * display details about env callbacks | 919 | CONFIG_CMD_ENV_CALLBACK * display details about env callbacks |
920 | CONFIG_CMD_ENV_FLAGS * display details about env flags | 920 | CONFIG_CMD_ENV_FLAGS * display details about env flags |
921 | CONFIG_CMD_ENV_EXISTS * check existence of env variable | 921 | CONFIG_CMD_ENV_EXISTS * check existence of env variable |
922 | CONFIG_CMD_EXPORTENV * export the environment | 922 | CONFIG_CMD_EXPORTENV * export the environment |
923 | CONFIG_CMD_EXT2 * ext2 command support | 923 | CONFIG_CMD_EXT2 * ext2 command support |
924 | CONFIG_CMD_EXT4 * ext4 command support | 924 | CONFIG_CMD_EXT4 * ext4 command support |
925 | CONFIG_CMD_FS_GENERIC * filesystem commands (e.g. load, ls) | 925 | CONFIG_CMD_FS_GENERIC * filesystem commands (e.g. load, ls) |
926 | that work for multiple fs types | 926 | that work for multiple fs types |
927 | CONFIG_CMD_SAVEENV saveenv | 927 | CONFIG_CMD_SAVEENV saveenv |
928 | CONFIG_CMD_FDC * Floppy Disk Support | 928 | CONFIG_CMD_FDC * Floppy Disk Support |
929 | CONFIG_CMD_FAT * FAT command support | 929 | CONFIG_CMD_FAT * FAT command support |
930 | CONFIG_CMD_FDOS * Dos diskette Support | 930 | CONFIG_CMD_FDOS * Dos diskette Support |
931 | CONFIG_CMD_FLASH flinfo, erase, protect | 931 | CONFIG_CMD_FLASH flinfo, erase, protect |
932 | CONFIG_CMD_FPGA FPGA device initialization support | 932 | CONFIG_CMD_FPGA FPGA device initialization support |
933 | CONFIG_CMD_FUSE * Device fuse support | 933 | CONFIG_CMD_FUSE * Device fuse support |
934 | CONFIG_CMD_GETTIME * Get time since boot | 934 | CONFIG_CMD_GETTIME * Get time since boot |
935 | CONFIG_CMD_GO * the 'go' command (exec code) | 935 | CONFIG_CMD_GO * the 'go' command (exec code) |
936 | CONFIG_CMD_GREPENV * search environment | 936 | CONFIG_CMD_GREPENV * search environment |
937 | CONFIG_CMD_HASH * calculate hash / digest | 937 | CONFIG_CMD_HASH * calculate hash / digest |
938 | CONFIG_CMD_HWFLOW * RTS/CTS hw flow control | 938 | CONFIG_CMD_HWFLOW * RTS/CTS hw flow control |
939 | CONFIG_CMD_I2C * I2C serial bus support | 939 | CONFIG_CMD_I2C * I2C serial bus support |
940 | CONFIG_CMD_IDE * IDE harddisk support | 940 | CONFIG_CMD_IDE * IDE harddisk support |
941 | CONFIG_CMD_IMI iminfo | 941 | CONFIG_CMD_IMI iminfo |
942 | CONFIG_CMD_IMLS List all images found in NOR flash | 942 | CONFIG_CMD_IMLS List all images found in NOR flash |
943 | CONFIG_CMD_IMLS_NAND * List all images found in NAND flash | 943 | CONFIG_CMD_IMLS_NAND * List all images found in NAND flash |
944 | CONFIG_CMD_IMMAP * IMMR dump support | 944 | CONFIG_CMD_IMMAP * IMMR dump support |
945 | CONFIG_CMD_IMPORTENV * import an environment | 945 | CONFIG_CMD_IMPORTENV * import an environment |
946 | CONFIG_CMD_INI * import data from an ini file into the env | 946 | CONFIG_CMD_INI * import data from an ini file into the env |
947 | CONFIG_CMD_IRQ * irqinfo | 947 | CONFIG_CMD_IRQ * irqinfo |
948 | CONFIG_CMD_ITEST Integer/string test of 2 values | 948 | CONFIG_CMD_ITEST Integer/string test of 2 values |
949 | CONFIG_CMD_JFFS2 * JFFS2 Support | 949 | CONFIG_CMD_JFFS2 * JFFS2 Support |
950 | CONFIG_CMD_KGDB * kgdb | 950 | CONFIG_CMD_KGDB * kgdb |
951 | CONFIG_CMD_LDRINFO * ldrinfo (display Blackfin loader) | 951 | CONFIG_CMD_LDRINFO * ldrinfo (display Blackfin loader) |
952 | CONFIG_CMD_LINK_LOCAL * link-local IP address auto-configuration | 952 | CONFIG_CMD_LINK_LOCAL * link-local IP address auto-configuration |
953 | (169.254.*.*) | 953 | (169.254.*.*) |
954 | CONFIG_CMD_LOADB loadb | 954 | CONFIG_CMD_LOADB loadb |
955 | CONFIG_CMD_LOADS loads | 955 | CONFIG_CMD_LOADS loads |
956 | CONFIG_CMD_MD5SUM * print md5 message digest | 956 | CONFIG_CMD_MD5SUM * print md5 message digest |
957 | (requires CONFIG_CMD_MEMORY and CONFIG_MD5) | 957 | (requires CONFIG_CMD_MEMORY and CONFIG_MD5) |
958 | CONFIG_CMD_MEMINFO * Display detailed memory information | 958 | CONFIG_CMD_MEMINFO * Display detailed memory information |
959 | CONFIG_CMD_MEMORY md, mm, nm, mw, cp, cmp, crc, base, | 959 | CONFIG_CMD_MEMORY md, mm, nm, mw, cp, cmp, crc, base, |
960 | loop, loopw | 960 | loop, loopw |
961 | CONFIG_CMD_MEMTEST * mtest | 961 | CONFIG_CMD_MEMTEST * mtest |
962 | CONFIG_CMD_MISC Misc functions like sleep etc | 962 | CONFIG_CMD_MISC Misc functions like sleep etc |
963 | CONFIG_CMD_MMC * MMC memory mapped support | 963 | CONFIG_CMD_MMC * MMC memory mapped support |
964 | CONFIG_CMD_MII * MII utility commands | 964 | CONFIG_CMD_MII * MII utility commands |
965 | CONFIG_CMD_MTDPARTS * MTD partition support | 965 | CONFIG_CMD_MTDPARTS * MTD partition support |
966 | CONFIG_CMD_NAND * NAND support | 966 | CONFIG_CMD_NAND * NAND support |
967 | CONFIG_CMD_NET bootp, tftpboot, rarpboot | 967 | CONFIG_CMD_NET bootp, tftpboot, rarpboot |
968 | CONFIG_CMD_NFS NFS support | 968 | CONFIG_CMD_NFS NFS support |
969 | CONFIG_CMD_PCA953X * PCA953x I2C gpio commands | 969 | CONFIG_CMD_PCA953X * PCA953x I2C gpio commands |
970 | CONFIG_CMD_PCA953X_INFO * PCA953x I2C gpio info command | 970 | CONFIG_CMD_PCA953X_INFO * PCA953x I2C gpio info command |
971 | CONFIG_CMD_PCI * pciinfo | 971 | CONFIG_CMD_PCI * pciinfo |
972 | CONFIG_CMD_PCMCIA * PCMCIA support | 972 | CONFIG_CMD_PCMCIA * PCMCIA support |
973 | CONFIG_CMD_PING * send ICMP ECHO_REQUEST to network | 973 | CONFIG_CMD_PING * send ICMP ECHO_REQUEST to network |
974 | host | 974 | host |
975 | CONFIG_CMD_PORTIO * Port I/O | 975 | CONFIG_CMD_PORTIO * Port I/O |
976 | CONFIG_CMD_READ * Read raw data from partition | 976 | CONFIG_CMD_READ * Read raw data from partition |
977 | CONFIG_CMD_REGINFO * Register dump | 977 | CONFIG_CMD_REGINFO * Register dump |
978 | CONFIG_CMD_RUN run command in env variable | 978 | CONFIG_CMD_RUN run command in env variable |
979 | CONFIG_CMD_SANDBOX * sb command to access sandbox features | 979 | CONFIG_CMD_SANDBOX * sb command to access sandbox features |
980 | CONFIG_CMD_SAVES * save S record dump | 980 | CONFIG_CMD_SAVES * save S record dump |
981 | CONFIG_CMD_SCSI * SCSI Support | 981 | CONFIG_CMD_SCSI * SCSI Support |
982 | CONFIG_CMD_SDRAM * print SDRAM configuration information | 982 | CONFIG_CMD_SDRAM * print SDRAM configuration information |
983 | (requires CONFIG_CMD_I2C) | 983 | (requires CONFIG_CMD_I2C) |
984 | CONFIG_CMD_SETGETDCR Support for DCR Register access | 984 | CONFIG_CMD_SETGETDCR Support for DCR Register access |
985 | (4xx only) | 985 | (4xx only) |
986 | CONFIG_CMD_SF * Read/write/erase SPI NOR flash | 986 | CONFIG_CMD_SF * Read/write/erase SPI NOR flash |
987 | CONFIG_CMD_SHA1SUM * print sha1 memory digest | 987 | CONFIG_CMD_SHA1SUM * print sha1 memory digest |
988 | (requires CONFIG_CMD_MEMORY) | 988 | (requires CONFIG_CMD_MEMORY) |
989 | CONFIG_CMD_SOFTSWITCH * Soft switch setting command for BF60x | 989 | CONFIG_CMD_SOFTSWITCH * Soft switch setting command for BF60x |
990 | CONFIG_CMD_SOURCE "source" command Support | 990 | CONFIG_CMD_SOURCE "source" command Support |
991 | CONFIG_CMD_SPI * SPI serial bus support | 991 | CONFIG_CMD_SPI * SPI serial bus support |
992 | CONFIG_CMD_TFTPSRV * TFTP transfer in server mode | 992 | CONFIG_CMD_TFTPSRV * TFTP transfer in server mode |
993 | CONFIG_CMD_TFTPPUT * TFTP put command (upload) | 993 | CONFIG_CMD_TFTPPUT * TFTP put command (upload) |
994 | CONFIG_CMD_TIME * run command and report execution time (ARM specific) | 994 | CONFIG_CMD_TIME * run command and report execution time (ARM specific) |
995 | CONFIG_CMD_TIMER * access to the system tick timer | 995 | CONFIG_CMD_TIMER * access to the system tick timer |
996 | CONFIG_CMD_USB * USB support | 996 | CONFIG_CMD_USB * USB support |
997 | CONFIG_CMD_CDP * Cisco Discover Protocol support | 997 | CONFIG_CMD_CDP * Cisco Discover Protocol support |
998 | CONFIG_CMD_MFSL * Microblaze FSL support | 998 | CONFIG_CMD_MFSL * Microblaze FSL support |
999 | CONFIG_CMD_XIMG Load part of Multi Image | 999 | CONFIG_CMD_XIMG Load part of Multi Image |
1000 | 1000 | ||
1001 | 1001 | ||
1002 | EXAMPLE: If you want all functions except of network | 1002 | EXAMPLE: If you want all functions except of network |
1003 | support you can write: | 1003 | support you can write: |
1004 | 1004 | ||
1005 | #include "config_cmd_all.h" | 1005 | #include "config_cmd_all.h" |
1006 | #undef CONFIG_CMD_NET | 1006 | #undef CONFIG_CMD_NET |
1007 | 1007 | ||
1008 | Other Commands: | 1008 | Other Commands: |
1009 | fdt (flattened device tree) command: CONFIG_OF_LIBFDT | 1009 | fdt (flattened device tree) command: CONFIG_OF_LIBFDT |
1010 | 1010 | ||
1011 | Note: Don't enable the "icache" and "dcache" commands | 1011 | Note: Don't enable the "icache" and "dcache" commands |
1012 | (configuration option CONFIG_CMD_CACHE) unless you know | 1012 | (configuration option CONFIG_CMD_CACHE) unless you know |
1013 | what you (and your U-Boot users) are doing. Data | 1013 | what you (and your U-Boot users) are doing. Data |
1014 | cache cannot be enabled on systems like the 8xx or | 1014 | cache cannot be enabled on systems like the 8xx or |
1015 | 8260 (where accesses to the IMMR region must be | 1015 | 8260 (where accesses to the IMMR region must be |
1016 | uncached), and it cannot be disabled on all other | 1016 | uncached), and it cannot be disabled on all other |
1017 | systems where we (mis-) use the data cache to hold an | 1017 | systems where we (mis-) use the data cache to hold an |
1018 | initial stack and some data. | 1018 | initial stack and some data. |
1019 | 1019 | ||
1020 | 1020 | ||
1021 | XXX - this list needs to get updated! | 1021 | XXX - this list needs to get updated! |
1022 | 1022 | ||
1023 | - Regular expression support: | 1023 | - Regular expression support: |
1024 | CONFIG_REGEX | 1024 | CONFIG_REGEX |
1025 | If this variable is defined, U-Boot is linked against | 1025 | If this variable is defined, U-Boot is linked against |
1026 | the SLRE (Super Light Regular Expression) library, | 1026 | the SLRE (Super Light Regular Expression) library, |
1027 | which adds regex support to some commands, as for | 1027 | which adds regex support to some commands, as for |
1028 | example "env grep" and "setexpr". | 1028 | example "env grep" and "setexpr". |
1029 | 1029 | ||
1030 | - Device tree: | 1030 | - Device tree: |
1031 | CONFIG_OF_CONTROL | 1031 | CONFIG_OF_CONTROL |
1032 | If this variable is defined, U-Boot will use a device tree | 1032 | If this variable is defined, U-Boot will use a device tree |
1033 | to configure its devices, instead of relying on statically | 1033 | to configure its devices, instead of relying on statically |
1034 | compiled #defines in the board file. This option is | 1034 | compiled #defines in the board file. This option is |
1035 | experimental and only available on a few boards. The device | 1035 | experimental and only available on a few boards. The device |
1036 | tree is available in the global data as gd->fdt_blob. | 1036 | tree is available in the global data as gd->fdt_blob. |
1037 | 1037 | ||
1038 | U-Boot needs to get its device tree from somewhere. This can | 1038 | U-Boot needs to get its device tree from somewhere. This can |
1039 | be done using one of the two options below: | 1039 | be done using one of the two options below: |
1040 | 1040 | ||
1041 | CONFIG_OF_EMBED | 1041 | CONFIG_OF_EMBED |
1042 | If this variable is defined, U-Boot will embed a device tree | 1042 | If this variable is defined, U-Boot will embed a device tree |
1043 | binary in its image. This device tree file should be in the | 1043 | binary in its image. This device tree file should be in the |
1044 | board directory and called <soc>-<board>.dts. The binary file | 1044 | board directory and called <soc>-<board>.dts. The binary file |
1045 | is then picked up in board_init_f() and made available through | 1045 | is then picked up in board_init_f() and made available through |
1046 | the global data structure as gd->blob. | 1046 | the global data structure as gd->blob. |
1047 | 1047 | ||
1048 | CONFIG_OF_SEPARATE | 1048 | CONFIG_OF_SEPARATE |
1049 | If this variable is defined, U-Boot will build a device tree | 1049 | If this variable is defined, U-Boot will build a device tree |
1050 | binary. It will be called u-boot.dtb. Architecture-specific | 1050 | binary. It will be called u-boot.dtb. Architecture-specific |
1051 | code will locate it at run-time. Generally this works by: | 1051 | code will locate it at run-time. Generally this works by: |
1052 | 1052 | ||
1053 | cat u-boot.bin u-boot.dtb >image.bin | 1053 | cat u-boot.bin u-boot.dtb >image.bin |
1054 | 1054 | ||
1055 | and in fact, U-Boot does this for you, creating a file called | 1055 | and in fact, U-Boot does this for you, creating a file called |
1056 | u-boot-dtb.bin which is useful in the common case. You can | 1056 | u-boot-dtb.bin which is useful in the common case. You can |
1057 | still use the individual files if you need something more | 1057 | still use the individual files if you need something more |
1058 | exotic. | 1058 | exotic. |
1059 | 1059 | ||
1060 | - Watchdog: | 1060 | - Watchdog: |
1061 | CONFIG_WATCHDOG | 1061 | CONFIG_WATCHDOG |
1062 | If this variable is defined, it enables watchdog | 1062 | If this variable is defined, it enables watchdog |
1063 | support for the SoC. There must be support in the SoC | 1063 | support for the SoC. There must be support in the SoC |
1064 | specific code for a watchdog. For the 8xx and 8260 | 1064 | specific code for a watchdog. For the 8xx and 8260 |
1065 | CPUs, the SIU Watchdog feature is enabled in the SYPCR | 1065 | CPUs, the SIU Watchdog feature is enabled in the SYPCR |
1066 | register. When supported for a specific SoC is | 1066 | register. When supported for a specific SoC is |
1067 | available, then no further board specific code should | 1067 | available, then no further board specific code should |
1068 | be needed to use it. | 1068 | be needed to use it. |
1069 | 1069 | ||
1070 | CONFIG_HW_WATCHDOG | 1070 | CONFIG_HW_WATCHDOG |
1071 | When using a watchdog circuitry external to the used | 1071 | When using a watchdog circuitry external to the used |
1072 | SoC, then define this variable and provide board | 1072 | SoC, then define this variable and provide board |
1073 | specific code for the "hw_watchdog_reset" function. | 1073 | specific code for the "hw_watchdog_reset" function. |
1074 | 1074 | ||
1075 | - U-Boot Version: | 1075 | - U-Boot Version: |
1076 | CONFIG_VERSION_VARIABLE | 1076 | CONFIG_VERSION_VARIABLE |
1077 | If this variable is defined, an environment variable | 1077 | If this variable is defined, an environment variable |
1078 | named "ver" is created by U-Boot showing the U-Boot | 1078 | named "ver" is created by U-Boot showing the U-Boot |
1079 | version as printed by the "version" command. | 1079 | version as printed by the "version" command. |
1080 | Any change to this variable will be reverted at the | 1080 | Any change to this variable will be reverted at the |
1081 | next reset. | 1081 | next reset. |
1082 | 1082 | ||
1083 | - Real-Time Clock: | 1083 | - Real-Time Clock: |
1084 | 1084 | ||
1085 | When CONFIG_CMD_DATE is selected, the type of the RTC | 1085 | When CONFIG_CMD_DATE is selected, the type of the RTC |
1086 | has to be selected, too. Define exactly one of the | 1086 | has to be selected, too. Define exactly one of the |
1087 | following options: | 1087 | following options: |
1088 | 1088 | ||
1089 | CONFIG_RTC_MPC8xx - use internal RTC of MPC8xx | 1089 | CONFIG_RTC_MPC8xx - use internal RTC of MPC8xx |
1090 | CONFIG_RTC_PCF8563 - use Philips PCF8563 RTC | 1090 | CONFIG_RTC_PCF8563 - use Philips PCF8563 RTC |
1091 | CONFIG_RTC_MC13XXX - use MC13783 or MC13892 RTC | 1091 | CONFIG_RTC_MC13XXX - use MC13783 or MC13892 RTC |
1092 | CONFIG_RTC_MC146818 - use MC146818 RTC | 1092 | CONFIG_RTC_MC146818 - use MC146818 RTC |
1093 | CONFIG_RTC_DS1307 - use Maxim, Inc. DS1307 RTC | 1093 | CONFIG_RTC_DS1307 - use Maxim, Inc. DS1307 RTC |
1094 | CONFIG_RTC_DS1337 - use Maxim, Inc. DS1337 RTC | 1094 | CONFIG_RTC_DS1337 - use Maxim, Inc. DS1337 RTC |
1095 | CONFIG_RTC_DS1338 - use Maxim, Inc. DS1338 RTC | 1095 | CONFIG_RTC_DS1338 - use Maxim, Inc. DS1338 RTC |
1096 | CONFIG_RTC_DS164x - use Dallas DS164x RTC | 1096 | CONFIG_RTC_DS164x - use Dallas DS164x RTC |
1097 | CONFIG_RTC_ISL1208 - use Intersil ISL1208 RTC | 1097 | CONFIG_RTC_ISL1208 - use Intersil ISL1208 RTC |
1098 | CONFIG_RTC_MAX6900 - use Maxim, Inc. MAX6900 RTC | 1098 | CONFIG_RTC_MAX6900 - use Maxim, Inc. MAX6900 RTC |
1099 | CONFIG_SYS_RTC_DS1337_NOOSC - Turn off the OSC output for DS1337 | 1099 | CONFIG_SYS_RTC_DS1337_NOOSC - Turn off the OSC output for DS1337 |
1100 | CONFIG_SYS_RV3029_TCR - enable trickle charger on | 1100 | CONFIG_SYS_RV3029_TCR - enable trickle charger on |
1101 | RV3029 RTC. | 1101 | RV3029 RTC. |
1102 | 1102 | ||
1103 | Note that if the RTC uses I2C, then the I2C interface | 1103 | Note that if the RTC uses I2C, then the I2C interface |
1104 | must also be configured. See I2C Support, below. | 1104 | must also be configured. See I2C Support, below. |
1105 | 1105 | ||
1106 | - GPIO Support: | 1106 | - GPIO Support: |
1107 | CONFIG_PCA953X - use NXP's PCA953X series I2C GPIO | 1107 | CONFIG_PCA953X - use NXP's PCA953X series I2C GPIO |
1108 | 1108 | ||
1109 | The CONFIG_SYS_I2C_PCA953X_WIDTH option specifies a list of | 1109 | The CONFIG_SYS_I2C_PCA953X_WIDTH option specifies a list of |
1110 | chip-ngpio pairs that tell the PCA953X driver the number of | 1110 | chip-ngpio pairs that tell the PCA953X driver the number of |
1111 | pins supported by a particular chip. | 1111 | pins supported by a particular chip. |
1112 | 1112 | ||
1113 | Note that if the GPIO device uses I2C, then the I2C interface | 1113 | Note that if the GPIO device uses I2C, then the I2C interface |
1114 | must also be configured. See I2C Support, below. | 1114 | must also be configured. See I2C Support, below. |
1115 | 1115 | ||
1116 | - Timestamp Support: | 1116 | - Timestamp Support: |
1117 | 1117 | ||
1118 | When CONFIG_TIMESTAMP is selected, the timestamp | 1118 | When CONFIG_TIMESTAMP is selected, the timestamp |
1119 | (date and time) of an image is printed by image | 1119 | (date and time) of an image is printed by image |
1120 | commands like bootm or iminfo. This option is | 1120 | commands like bootm or iminfo. This option is |
1121 | automatically enabled when you select CONFIG_CMD_DATE . | 1121 | automatically enabled when you select CONFIG_CMD_DATE . |
1122 | 1122 | ||
1123 | - Partition Labels (disklabels) Supported: | 1123 | - Partition Labels (disklabels) Supported: |
1124 | Zero or more of the following: | 1124 | Zero or more of the following: |
1125 | CONFIG_MAC_PARTITION Apple's MacOS partition table. | 1125 | CONFIG_MAC_PARTITION Apple's MacOS partition table. |
1126 | CONFIG_DOS_PARTITION MS Dos partition table, traditional on the | 1126 | CONFIG_DOS_PARTITION MS Dos partition table, traditional on the |
1127 | Intel architecture, USB sticks, etc. | 1127 | Intel architecture, USB sticks, etc. |
1128 | CONFIG_ISO_PARTITION ISO partition table, used on CDROM etc. | 1128 | CONFIG_ISO_PARTITION ISO partition table, used on CDROM etc. |
1129 | CONFIG_EFI_PARTITION GPT partition table, common when EFI is the | 1129 | CONFIG_EFI_PARTITION GPT partition table, common when EFI is the |
1130 | bootloader. Note 2TB partition limit; see | 1130 | bootloader. Note 2TB partition limit; see |
1131 | disk/part_efi.c | 1131 | disk/part_efi.c |
1132 | CONFIG_MTD_PARTITIONS Memory Technology Device partition table. | 1132 | CONFIG_MTD_PARTITIONS Memory Technology Device partition table. |
1133 | 1133 | ||
1134 | If IDE or SCSI support is enabled (CONFIG_CMD_IDE or | 1134 | If IDE or SCSI support is enabled (CONFIG_CMD_IDE or |
1135 | CONFIG_CMD_SCSI) you must configure support for at | 1135 | CONFIG_CMD_SCSI) you must configure support for at |
1136 | least one non-MTD partition type as well. | 1136 | least one non-MTD partition type as well. |
1137 | 1137 | ||
1138 | - IDE Reset method: | 1138 | - IDE Reset method: |
1139 | CONFIG_IDE_RESET_ROUTINE - this is defined in several | 1139 | CONFIG_IDE_RESET_ROUTINE - this is defined in several |
1140 | board configurations files but used nowhere! | 1140 | board configurations files but used nowhere! |
1141 | 1141 | ||
1142 | CONFIG_IDE_RESET - is this is defined, IDE Reset will | 1142 | CONFIG_IDE_RESET - is this is defined, IDE Reset will |
1143 | be performed by calling the function | 1143 | be performed by calling the function |
1144 | ide_set_reset(int reset) | 1144 | ide_set_reset(int reset) |
1145 | which has to be defined in a board specific file | 1145 | which has to be defined in a board specific file |
1146 | 1146 | ||
1147 | - ATAPI Support: | 1147 | - ATAPI Support: |
1148 | CONFIG_ATAPI | 1148 | CONFIG_ATAPI |
1149 | 1149 | ||
1150 | Set this to enable ATAPI support. | 1150 | Set this to enable ATAPI support. |
1151 | 1151 | ||
1152 | - LBA48 Support | 1152 | - LBA48 Support |
1153 | CONFIG_LBA48 | 1153 | CONFIG_LBA48 |
1154 | 1154 | ||
1155 | Set this to enable support for disks larger than 137GB | 1155 | Set this to enable support for disks larger than 137GB |
1156 | Also look at CONFIG_SYS_64BIT_LBA. | 1156 | Also look at CONFIG_SYS_64BIT_LBA. |
1157 | Whithout these , LBA48 support uses 32bit variables and will 'only' | 1157 | Whithout these , LBA48 support uses 32bit variables and will 'only' |
1158 | support disks up to 2.1TB. | 1158 | support disks up to 2.1TB. |
1159 | 1159 | ||
1160 | CONFIG_SYS_64BIT_LBA: | 1160 | CONFIG_SYS_64BIT_LBA: |
1161 | When enabled, makes the IDE subsystem use 64bit sector addresses. | 1161 | When enabled, makes the IDE subsystem use 64bit sector addresses. |
1162 | Default is 32bit. | 1162 | Default is 32bit. |
1163 | 1163 | ||
1164 | - SCSI Support: | 1164 | - SCSI Support: |
1165 | At the moment only there is only support for the | 1165 | At the moment only there is only support for the |
1166 | SYM53C8XX SCSI controller; define | 1166 | SYM53C8XX SCSI controller; define |
1167 | CONFIG_SCSI_SYM53C8XX to enable it. | 1167 | CONFIG_SCSI_SYM53C8XX to enable it. |
1168 | 1168 | ||
1169 | CONFIG_SYS_SCSI_MAX_LUN [8], CONFIG_SYS_SCSI_MAX_SCSI_ID [7] and | 1169 | CONFIG_SYS_SCSI_MAX_LUN [8], CONFIG_SYS_SCSI_MAX_SCSI_ID [7] and |
1170 | CONFIG_SYS_SCSI_MAX_DEVICE [CONFIG_SYS_SCSI_MAX_SCSI_ID * | 1170 | CONFIG_SYS_SCSI_MAX_DEVICE [CONFIG_SYS_SCSI_MAX_SCSI_ID * |
1171 | CONFIG_SYS_SCSI_MAX_LUN] can be adjusted to define the | 1171 | CONFIG_SYS_SCSI_MAX_LUN] can be adjusted to define the |
1172 | maximum numbers of LUNs, SCSI ID's and target | 1172 | maximum numbers of LUNs, SCSI ID's and target |
1173 | devices. | 1173 | devices. |
1174 | CONFIG_SYS_SCSI_SYM53C8XX_CCF to fix clock timing (80Mhz) | 1174 | CONFIG_SYS_SCSI_SYM53C8XX_CCF to fix clock timing (80Mhz) |
1175 | 1175 | ||
1176 | The environment variable 'scsidevs' is set to the number of | 1176 | The environment variable 'scsidevs' is set to the number of |
1177 | SCSI devices found during the last scan. | 1177 | SCSI devices found during the last scan. |
1178 | 1178 | ||
1179 | - NETWORK Support (PCI): | 1179 | - NETWORK Support (PCI): |
1180 | CONFIG_E1000 | 1180 | CONFIG_E1000 |
1181 | Support for Intel 8254x/8257x gigabit chips. | 1181 | Support for Intel 8254x/8257x gigabit chips. |
1182 | 1182 | ||
1183 | CONFIG_E1000_SPI | 1183 | CONFIG_E1000_SPI |
1184 | Utility code for direct access to the SPI bus on Intel 8257x. | 1184 | Utility code for direct access to the SPI bus on Intel 8257x. |
1185 | This does not do anything useful unless you set at least one | 1185 | This does not do anything useful unless you set at least one |
1186 | of CONFIG_CMD_E1000 or CONFIG_E1000_SPI_GENERIC. | 1186 | of CONFIG_CMD_E1000 or CONFIG_E1000_SPI_GENERIC. |
1187 | 1187 | ||
1188 | CONFIG_E1000_SPI_GENERIC | 1188 | CONFIG_E1000_SPI_GENERIC |
1189 | Allow generic access to the SPI bus on the Intel 8257x, for | 1189 | Allow generic access to the SPI bus on the Intel 8257x, for |
1190 | example with the "sspi" command. | 1190 | example with the "sspi" command. |
1191 | 1191 | ||
1192 | CONFIG_CMD_E1000 | 1192 | CONFIG_CMD_E1000 |
1193 | Management command for E1000 devices. When used on devices | 1193 | Management command for E1000 devices. When used on devices |
1194 | with SPI support you can reprogram the EEPROM from U-Boot. | 1194 | with SPI support you can reprogram the EEPROM from U-Boot. |
1195 | 1195 | ||
1196 | CONFIG_E1000_FALLBACK_MAC | 1196 | CONFIG_E1000_FALLBACK_MAC |
1197 | default MAC for empty EEPROM after production. | 1197 | default MAC for empty EEPROM after production. |
1198 | 1198 | ||
1199 | CONFIG_EEPRO100 | 1199 | CONFIG_EEPRO100 |
1200 | Support for Intel 82557/82559/82559ER chips. | 1200 | Support for Intel 82557/82559/82559ER chips. |
1201 | Optional CONFIG_EEPRO100_SROM_WRITE enables EEPROM | 1201 | Optional CONFIG_EEPRO100_SROM_WRITE enables EEPROM |
1202 | write routine for first time initialisation. | 1202 | write routine for first time initialisation. |
1203 | 1203 | ||
1204 | CONFIG_TULIP | 1204 | CONFIG_TULIP |
1205 | Support for Digital 2114x chips. | 1205 | Support for Digital 2114x chips. |
1206 | Optional CONFIG_TULIP_SELECT_MEDIA for board specific | 1206 | Optional CONFIG_TULIP_SELECT_MEDIA for board specific |
1207 | modem chip initialisation (KS8761/QS6611). | 1207 | modem chip initialisation (KS8761/QS6611). |
1208 | 1208 | ||
1209 | CONFIG_NATSEMI | 1209 | CONFIG_NATSEMI |
1210 | Support for National dp83815 chips. | 1210 | Support for National dp83815 chips. |
1211 | 1211 | ||
1212 | CONFIG_NS8382X | 1212 | CONFIG_NS8382X |
1213 | Support for National dp8382[01] gigabit chips. | 1213 | Support for National dp8382[01] gigabit chips. |
1214 | 1214 | ||
1215 | - NETWORK Support (other): | 1215 | - NETWORK Support (other): |
1216 | 1216 | ||
1217 | CONFIG_DRIVER_AT91EMAC | 1217 | CONFIG_DRIVER_AT91EMAC |
1218 | Support for AT91RM9200 EMAC. | 1218 | Support for AT91RM9200 EMAC. |
1219 | 1219 | ||
1220 | CONFIG_RMII | 1220 | CONFIG_RMII |
1221 | Define this to use reduced MII inteface | 1221 | Define this to use reduced MII inteface |
1222 | 1222 | ||
1223 | CONFIG_DRIVER_AT91EMAC_QUIET | 1223 | CONFIG_DRIVER_AT91EMAC_QUIET |
1224 | If this defined, the driver is quiet. | 1224 | If this defined, the driver is quiet. |
1225 | The driver doen't show link status messages. | 1225 | The driver doen't show link status messages. |
1226 | 1226 | ||
1227 | CONFIG_CALXEDA_XGMAC | 1227 | CONFIG_CALXEDA_XGMAC |
1228 | Support for the Calxeda XGMAC device | 1228 | Support for the Calxeda XGMAC device |
1229 | 1229 | ||
1230 | CONFIG_LAN91C96 | 1230 | CONFIG_LAN91C96 |
1231 | Support for SMSC's LAN91C96 chips. | 1231 | Support for SMSC's LAN91C96 chips. |
1232 | 1232 | ||
1233 | CONFIG_LAN91C96_BASE | 1233 | CONFIG_LAN91C96_BASE |
1234 | Define this to hold the physical address | 1234 | Define this to hold the physical address |
1235 | of the LAN91C96's I/O space | 1235 | of the LAN91C96's I/O space |
1236 | 1236 | ||
1237 | CONFIG_LAN91C96_USE_32_BIT | 1237 | CONFIG_LAN91C96_USE_32_BIT |
1238 | Define this to enable 32 bit addressing | 1238 | Define this to enable 32 bit addressing |
1239 | 1239 | ||
1240 | CONFIG_SMC91111 | 1240 | CONFIG_SMC91111 |
1241 | Support for SMSC's LAN91C111 chip | 1241 | Support for SMSC's LAN91C111 chip |
1242 | 1242 | ||
1243 | CONFIG_SMC91111_BASE | 1243 | CONFIG_SMC91111_BASE |
1244 | Define this to hold the physical address | 1244 | Define this to hold the physical address |
1245 | of the device (I/O space) | 1245 | of the device (I/O space) |
1246 | 1246 | ||
1247 | CONFIG_SMC_USE_32_BIT | 1247 | CONFIG_SMC_USE_32_BIT |
1248 | Define this if data bus is 32 bits | 1248 | Define this if data bus is 32 bits |
1249 | 1249 | ||
1250 | CONFIG_SMC_USE_IOFUNCS | 1250 | CONFIG_SMC_USE_IOFUNCS |
1251 | Define this to use i/o functions instead of macros | 1251 | Define this to use i/o functions instead of macros |
1252 | (some hardware wont work with macros) | 1252 | (some hardware wont work with macros) |
1253 | 1253 | ||
1254 | CONFIG_DRIVER_TI_EMAC | 1254 | CONFIG_DRIVER_TI_EMAC |
1255 | Support for davinci emac | 1255 | Support for davinci emac |
1256 | 1256 | ||
1257 | CONFIG_SYS_DAVINCI_EMAC_PHY_COUNT | 1257 | CONFIG_SYS_DAVINCI_EMAC_PHY_COUNT |
1258 | Define this if you have more then 3 PHYs. | 1258 | Define this if you have more then 3 PHYs. |
1259 | 1259 | ||
1260 | CONFIG_FTGMAC100 | 1260 | CONFIG_FTGMAC100 |
1261 | Support for Faraday's FTGMAC100 Gigabit SoC Ethernet | 1261 | Support for Faraday's FTGMAC100 Gigabit SoC Ethernet |
1262 | 1262 | ||
1263 | CONFIG_FTGMAC100_EGIGA | 1263 | CONFIG_FTGMAC100_EGIGA |
1264 | Define this to use GE link update with gigabit PHY. | 1264 | Define this to use GE link update with gigabit PHY. |
1265 | Define this if FTGMAC100 is connected to gigabit PHY. | 1265 | Define this if FTGMAC100 is connected to gigabit PHY. |
1266 | If your system has 10/100 PHY only, it might not occur | 1266 | If your system has 10/100 PHY only, it might not occur |
1267 | wrong behavior. Because PHY usually return timeout or | 1267 | wrong behavior. Because PHY usually return timeout or |
1268 | useless data when polling gigabit status and gigabit | 1268 | useless data when polling gigabit status and gigabit |
1269 | control registers. This behavior won't affect the | 1269 | control registers. This behavior won't affect the |
1270 | correctnessof 10/100 link speed update. | 1270 | correctnessof 10/100 link speed update. |
1271 | 1271 | ||
1272 | CONFIG_SMC911X | 1272 | CONFIG_SMC911X |
1273 | Support for SMSC's LAN911x and LAN921x chips | 1273 | Support for SMSC's LAN911x and LAN921x chips |
1274 | 1274 | ||
1275 | CONFIG_SMC911X_BASE | 1275 | CONFIG_SMC911X_BASE |
1276 | Define this to hold the physical address | 1276 | Define this to hold the physical address |
1277 | of the device (I/O space) | 1277 | of the device (I/O space) |
1278 | 1278 | ||
1279 | CONFIG_SMC911X_32_BIT | 1279 | CONFIG_SMC911X_32_BIT |
1280 | Define this if data bus is 32 bits | 1280 | Define this if data bus is 32 bits |
1281 | 1281 | ||
1282 | CONFIG_SMC911X_16_BIT | 1282 | CONFIG_SMC911X_16_BIT |
1283 | Define this if data bus is 16 bits. If your processor | 1283 | Define this if data bus is 16 bits. If your processor |
1284 | automatically converts one 32 bit word to two 16 bit | 1284 | automatically converts one 32 bit word to two 16 bit |
1285 | words you may also try CONFIG_SMC911X_32_BIT. | 1285 | words you may also try CONFIG_SMC911X_32_BIT. |
1286 | 1286 | ||
1287 | CONFIG_SH_ETHER | 1287 | CONFIG_SH_ETHER |
1288 | Support for Renesas on-chip Ethernet controller | 1288 | Support for Renesas on-chip Ethernet controller |
1289 | 1289 | ||
1290 | CONFIG_SH_ETHER_USE_PORT | 1290 | CONFIG_SH_ETHER_USE_PORT |
1291 | Define the number of ports to be used | 1291 | Define the number of ports to be used |
1292 | 1292 | ||
1293 | CONFIG_SH_ETHER_PHY_ADDR | 1293 | CONFIG_SH_ETHER_PHY_ADDR |
1294 | Define the ETH PHY's address | 1294 | Define the ETH PHY's address |
1295 | 1295 | ||
1296 | CONFIG_SH_ETHER_CACHE_WRITEBACK | 1296 | CONFIG_SH_ETHER_CACHE_WRITEBACK |
1297 | If this option is set, the driver enables cache flush. | 1297 | If this option is set, the driver enables cache flush. |
1298 | 1298 | ||
1299 | - TPM Support: | 1299 | - TPM Support: |
1300 | CONFIG_TPM | 1300 | CONFIG_TPM |
1301 | Support TPM devices. | 1301 | Support TPM devices. |
1302 | 1302 | ||
1303 | CONFIG_TPM_TIS_I2C | 1303 | CONFIG_TPM_TIS_I2C |
1304 | Support for i2c bus TPM devices. Only one device | 1304 | Support for i2c bus TPM devices. Only one device |
1305 | per system is supported at this time. | 1305 | per system is supported at this time. |
1306 | 1306 | ||
1307 | CONFIG_TPM_TIS_I2C_BUS_NUMBER | 1307 | CONFIG_TPM_TIS_I2C_BUS_NUMBER |
1308 | Define the the i2c bus number for the TPM device | 1308 | Define the the i2c bus number for the TPM device |
1309 | 1309 | ||
1310 | CONFIG_TPM_TIS_I2C_SLAVE_ADDRESS | 1310 | CONFIG_TPM_TIS_I2C_SLAVE_ADDRESS |
1311 | Define the TPM's address on the i2c bus | 1311 | Define the TPM's address on the i2c bus |
1312 | 1312 | ||
1313 | CONFIG_TPM_TIS_I2C_BURST_LIMITATION | 1313 | CONFIG_TPM_TIS_I2C_BURST_LIMITATION |
1314 | Define the burst count bytes upper limit | 1314 | Define the burst count bytes upper limit |
1315 | 1315 | ||
1316 | CONFIG_TPM_ATMEL_TWI | 1316 | CONFIG_TPM_ATMEL_TWI |
1317 | Support for Atmel TWI TPM device. Requires I2C support. | 1317 | Support for Atmel TWI TPM device. Requires I2C support. |
1318 | 1318 | ||
1319 | CONFIG_TPM_TIS_LPC | 1319 | CONFIG_TPM_TIS_LPC |
1320 | Support for generic parallel port TPM devices. Only one device | 1320 | Support for generic parallel port TPM devices. Only one device |
1321 | per system is supported at this time. | 1321 | per system is supported at this time. |
1322 | 1322 | ||
1323 | CONFIG_TPM_TIS_BASE_ADDRESS | 1323 | CONFIG_TPM_TIS_BASE_ADDRESS |
1324 | Base address where the generic TPM device is mapped | 1324 | Base address where the generic TPM device is mapped |
1325 | to. Contemporary x86 systems usually map it at | 1325 | to. Contemporary x86 systems usually map it at |
1326 | 0xfed40000. | 1326 | 0xfed40000. |
1327 | 1327 | ||
1328 | CONFIG_CMD_TPM | 1328 | CONFIG_CMD_TPM |
1329 | Add tpm monitor functions. | 1329 | Add tpm monitor functions. |
1330 | Requires CONFIG_TPM. If CONFIG_TPM_AUTH_SESSIONS is set, also | 1330 | Requires CONFIG_TPM. If CONFIG_TPM_AUTH_SESSIONS is set, also |
1331 | provides monitor access to authorized functions. | 1331 | provides monitor access to authorized functions. |
1332 | 1332 | ||
1333 | CONFIG_TPM | 1333 | CONFIG_TPM |
1334 | Define this to enable the TPM support library which provides | 1334 | Define this to enable the TPM support library which provides |
1335 | functional interfaces to some TPM commands. | 1335 | functional interfaces to some TPM commands. |
1336 | Requires support for a TPM device. | 1336 | Requires support for a TPM device. |
1337 | 1337 | ||
1338 | CONFIG_TPM_AUTH_SESSIONS | 1338 | CONFIG_TPM_AUTH_SESSIONS |
1339 | Define this to enable authorized functions in the TPM library. | 1339 | Define this to enable authorized functions in the TPM library. |
1340 | Requires CONFIG_TPM and CONFIG_SHA1. | 1340 | Requires CONFIG_TPM and CONFIG_SHA1. |
1341 | 1341 | ||
1342 | - USB Support: | 1342 | - USB Support: |
1343 | At the moment only the UHCI host controller is | 1343 | At the moment only the UHCI host controller is |
1344 | supported (PIP405, MIP405, MPC5200); define | 1344 | supported (PIP405, MIP405, MPC5200); define |
1345 | CONFIG_USB_UHCI to enable it. | 1345 | CONFIG_USB_UHCI to enable it. |
1346 | define CONFIG_USB_KEYBOARD to enable the USB Keyboard | 1346 | define CONFIG_USB_KEYBOARD to enable the USB Keyboard |
1347 | and define CONFIG_USB_STORAGE to enable the USB | 1347 | and define CONFIG_USB_STORAGE to enable the USB |
1348 | storage devices. | 1348 | storage devices. |
1349 | Note: | 1349 | Note: |
1350 | Supported are USB Keyboards and USB Floppy drives | 1350 | Supported are USB Keyboards and USB Floppy drives |
1351 | (TEAC FD-05PUB). | 1351 | (TEAC FD-05PUB). |
1352 | MPC5200 USB requires additional defines: | 1352 | MPC5200 USB requires additional defines: |
1353 | CONFIG_USB_CLOCK | 1353 | CONFIG_USB_CLOCK |
1354 | for 528 MHz Clock: 0x0001bbbb | 1354 | for 528 MHz Clock: 0x0001bbbb |
1355 | CONFIG_PSC3_USB | 1355 | CONFIG_PSC3_USB |
1356 | for USB on PSC3 | 1356 | for USB on PSC3 |
1357 | CONFIG_USB_CONFIG | 1357 | CONFIG_USB_CONFIG |
1358 | for differential drivers: 0x00001000 | 1358 | for differential drivers: 0x00001000 |
1359 | for single ended drivers: 0x00005000 | 1359 | for single ended drivers: 0x00005000 |
1360 | for differential drivers on PSC3: 0x00000100 | 1360 | for differential drivers on PSC3: 0x00000100 |
1361 | for single ended drivers on PSC3: 0x00004100 | 1361 | for single ended drivers on PSC3: 0x00004100 |
1362 | CONFIG_SYS_USB_EVENT_POLL | 1362 | CONFIG_SYS_USB_EVENT_POLL |
1363 | May be defined to allow interrupt polling | 1363 | May be defined to allow interrupt polling |
1364 | instead of using asynchronous interrupts | 1364 | instead of using asynchronous interrupts |
1365 | 1365 | ||
1366 | CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the | 1366 | CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the |
1367 | txfilltuning field in the EHCI controller on reset. | 1367 | txfilltuning field in the EHCI controller on reset. |
1368 | 1368 | ||
1369 | CONFIG_USB_HUB_MIN_POWER_ON_DELAY defines the minimum | 1369 | CONFIG_USB_HUB_MIN_POWER_ON_DELAY defines the minimum |
1370 | interval for usb hub power-on delay.(minimum 100msec) | 1370 | interval for usb hub power-on delay.(minimum 100msec) |
1371 | 1371 | ||
1372 | - USB Device: | 1372 | - USB Device: |
1373 | Define the below if you wish to use the USB console. | 1373 | Define the below if you wish to use the USB console. |
1374 | Once firmware is rebuilt from a serial console issue the | 1374 | Once firmware is rebuilt from a serial console issue the |
1375 | command "setenv stdin usbtty; setenv stdout usbtty" and | 1375 | command "setenv stdin usbtty; setenv stdout usbtty" and |
1376 | attach your USB cable. The Unix command "dmesg" should print | 1376 | attach your USB cable. The Unix command "dmesg" should print |
1377 | it has found a new device. The environment variable usbtty | 1377 | it has found a new device. The environment variable usbtty |
1378 | can be set to gserial or cdc_acm to enable your device to | 1378 | can be set to gserial or cdc_acm to enable your device to |
1379 | appear to a USB host as a Linux gserial device or a | 1379 | appear to a USB host as a Linux gserial device or a |
1380 | Common Device Class Abstract Control Model serial device. | 1380 | Common Device Class Abstract Control Model serial device. |
1381 | If you select usbtty = gserial you should be able to enumerate | 1381 | If you select usbtty = gserial you should be able to enumerate |
1382 | a Linux host by | 1382 | a Linux host by |
1383 | # modprobe usbserial vendor=0xVendorID product=0xProductID | 1383 | # modprobe usbserial vendor=0xVendorID product=0xProductID |
1384 | else if using cdc_acm, simply setting the environment | 1384 | else if using cdc_acm, simply setting the environment |
1385 | variable usbtty to be cdc_acm should suffice. The following | 1385 | variable usbtty to be cdc_acm should suffice. The following |
1386 | might be defined in YourBoardName.h | 1386 | might be defined in YourBoardName.h |
1387 | 1387 | ||
1388 | CONFIG_USB_DEVICE | 1388 | CONFIG_USB_DEVICE |
1389 | Define this to build a UDC device | 1389 | Define this to build a UDC device |
1390 | 1390 | ||
1391 | CONFIG_USB_TTY | 1391 | CONFIG_USB_TTY |
1392 | Define this to have a tty type of device available to | 1392 | Define this to have a tty type of device available to |
1393 | talk to the UDC device | 1393 | talk to the UDC device |
1394 | 1394 | ||
1395 | CONFIG_USBD_HS | 1395 | CONFIG_USBD_HS |
1396 | Define this to enable the high speed support for usb | 1396 | Define this to enable the high speed support for usb |
1397 | device and usbtty. If this feature is enabled, a routine | 1397 | device and usbtty. If this feature is enabled, a routine |
1398 | int is_usbd_high_speed(void) | 1398 | int is_usbd_high_speed(void) |
1399 | also needs to be defined by the driver to dynamically poll | 1399 | also needs to be defined by the driver to dynamically poll |
1400 | whether the enumeration has succeded at high speed or full | 1400 | whether the enumeration has succeded at high speed or full |
1401 | speed. | 1401 | speed. |
1402 | 1402 | ||
1403 | CONFIG_SYS_CONSOLE_IS_IN_ENV | 1403 | CONFIG_SYS_CONSOLE_IS_IN_ENV |
1404 | Define this if you want stdin, stdout &/or stderr to | 1404 | Define this if you want stdin, stdout &/or stderr to |
1405 | be set to usbtty. | 1405 | be set to usbtty. |
1406 | 1406 | ||
1407 | mpc8xx: | 1407 | mpc8xx: |
1408 | CONFIG_SYS_USB_EXTC_CLK 0xBLAH | 1408 | CONFIG_SYS_USB_EXTC_CLK 0xBLAH |
1409 | Derive USB clock from external clock "blah" | 1409 | Derive USB clock from external clock "blah" |
1410 | - CONFIG_SYS_USB_EXTC_CLK 0x02 | 1410 | - CONFIG_SYS_USB_EXTC_CLK 0x02 |
1411 | 1411 | ||
1412 | CONFIG_SYS_USB_BRG_CLK 0xBLAH | 1412 | CONFIG_SYS_USB_BRG_CLK 0xBLAH |
1413 | Derive USB clock from brgclk | 1413 | Derive USB clock from brgclk |
1414 | - CONFIG_SYS_USB_BRG_CLK 0x04 | 1414 | - CONFIG_SYS_USB_BRG_CLK 0x04 |
1415 | 1415 | ||
1416 | If you have a USB-IF assigned VendorID then you may wish to | 1416 | If you have a USB-IF assigned VendorID then you may wish to |
1417 | define your own vendor specific values either in BoardName.h | 1417 | define your own vendor specific values either in BoardName.h |
1418 | or directly in usbd_vendor_info.h. If you don't define | 1418 | or directly in usbd_vendor_info.h. If you don't define |
1419 | CONFIG_USBD_MANUFACTURER, CONFIG_USBD_PRODUCT_NAME, | 1419 | CONFIG_USBD_MANUFACTURER, CONFIG_USBD_PRODUCT_NAME, |
1420 | CONFIG_USBD_VENDORID and CONFIG_USBD_PRODUCTID, then U-Boot | 1420 | CONFIG_USBD_VENDORID and CONFIG_USBD_PRODUCTID, then U-Boot |
1421 | should pretend to be a Linux device to it's target host. | 1421 | should pretend to be a Linux device to it's target host. |
1422 | 1422 | ||
1423 | CONFIG_USBD_MANUFACTURER | 1423 | CONFIG_USBD_MANUFACTURER |
1424 | Define this string as the name of your company for | 1424 | Define this string as the name of your company for |
1425 | - CONFIG_USBD_MANUFACTURER "my company" | 1425 | - CONFIG_USBD_MANUFACTURER "my company" |
1426 | 1426 | ||
1427 | CONFIG_USBD_PRODUCT_NAME | 1427 | CONFIG_USBD_PRODUCT_NAME |
1428 | Define this string as the name of your product | 1428 | Define this string as the name of your product |
1429 | - CONFIG_USBD_PRODUCT_NAME "acme usb device" | 1429 | - CONFIG_USBD_PRODUCT_NAME "acme usb device" |
1430 | 1430 | ||
1431 | CONFIG_USBD_VENDORID | 1431 | CONFIG_USBD_VENDORID |
1432 | Define this as your assigned Vendor ID from the USB | 1432 | Define this as your assigned Vendor ID from the USB |
1433 | Implementors Forum. This *must* be a genuine Vendor ID | 1433 | Implementors Forum. This *must* be a genuine Vendor ID |
1434 | to avoid polluting the USB namespace. | 1434 | to avoid polluting the USB namespace. |
1435 | - CONFIG_USBD_VENDORID 0xFFFF | 1435 | - CONFIG_USBD_VENDORID 0xFFFF |
1436 | 1436 | ||
1437 | CONFIG_USBD_PRODUCTID | 1437 | CONFIG_USBD_PRODUCTID |
1438 | Define this as the unique Product ID | 1438 | Define this as the unique Product ID |
1439 | for your device | 1439 | for your device |
1440 | - CONFIG_USBD_PRODUCTID 0xFFFF | 1440 | - CONFIG_USBD_PRODUCTID 0xFFFF |
1441 | 1441 | ||
1442 | Some USB device drivers may need to check USB cable attachment. | 1442 | Some USB device drivers may need to check USB cable attachment. |
1443 | In this case you can enable following config in BoardName.h: | 1443 | In this case you can enable following config in BoardName.h: |
1444 | CONFIG_USB_CABLE_CHECK | 1444 | CONFIG_USB_CABLE_CHECK |
1445 | This enables function definition: | 1445 | This enables function definition: |
1446 | - usb_cable_connected() in include/usb.h | 1446 | - usb_cable_connected() in include/usb.h |
1447 | Implementation of this function is board-specific. | 1447 | Implementation of this function is board-specific. |
1448 | 1448 | ||
1449 | - ULPI Layer Support: | 1449 | - ULPI Layer Support: |
1450 | The ULPI (UTMI Low Pin (count) Interface) PHYs are supported via | 1450 | The ULPI (UTMI Low Pin (count) Interface) PHYs are supported via |
1451 | the generic ULPI layer. The generic layer accesses the ULPI PHY | 1451 | the generic ULPI layer. The generic layer accesses the ULPI PHY |
1452 | via the platform viewport, so you need both the genric layer and | 1452 | via the platform viewport, so you need both the genric layer and |
1453 | the viewport enabled. Currently only Chipidea/ARC based | 1453 | the viewport enabled. Currently only Chipidea/ARC based |
1454 | viewport is supported. | 1454 | viewport is supported. |
1455 | To enable the ULPI layer support, define CONFIG_USB_ULPI and | 1455 | To enable the ULPI layer support, define CONFIG_USB_ULPI and |
1456 | CONFIG_USB_ULPI_VIEWPORT in your board configuration file. | 1456 | CONFIG_USB_ULPI_VIEWPORT in your board configuration file. |
1457 | If your ULPI phy needs a different reference clock than the | 1457 | If your ULPI phy needs a different reference clock than the |
1458 | standard 24 MHz then you have to define CONFIG_ULPI_REF_CLK to | 1458 | standard 24 MHz then you have to define CONFIG_ULPI_REF_CLK to |
1459 | the appropriate value in Hz. | 1459 | the appropriate value in Hz. |
1460 | 1460 | ||
1461 | - MMC Support: | 1461 | - MMC Support: |
1462 | The MMC controller on the Intel PXA is supported. To | 1462 | The MMC controller on the Intel PXA is supported. To |
1463 | enable this define CONFIG_MMC. The MMC can be | 1463 | enable this define CONFIG_MMC. The MMC can be |
1464 | accessed from the boot prompt by mapping the device | 1464 | accessed from the boot prompt by mapping the device |
1465 | to physical memory similar to flash. Command line is | 1465 | to physical memory similar to flash. Command line is |
1466 | enabled with CONFIG_CMD_MMC. The MMC driver also works with | 1466 | enabled with CONFIG_CMD_MMC. The MMC driver also works with |
1467 | the FAT fs. This is enabled with CONFIG_CMD_FAT. | 1467 | the FAT fs. This is enabled with CONFIG_CMD_FAT. |
1468 | 1468 | ||
1469 | CONFIG_SH_MMCIF | 1469 | CONFIG_SH_MMCIF |
1470 | Support for Renesas on-chip MMCIF controller | 1470 | Support for Renesas on-chip MMCIF controller |
1471 | 1471 | ||
1472 | CONFIG_SH_MMCIF_ADDR | 1472 | CONFIG_SH_MMCIF_ADDR |
1473 | Define the base address of MMCIF registers | 1473 | Define the base address of MMCIF registers |
1474 | 1474 | ||
1475 | CONFIG_SH_MMCIF_CLK | 1475 | CONFIG_SH_MMCIF_CLK |
1476 | Define the clock frequency for MMCIF | 1476 | Define the clock frequency for MMCIF |
1477 | 1477 | ||
1478 | - USB Device Firmware Update (DFU) class support: | 1478 | - USB Device Firmware Update (DFU) class support: |
1479 | CONFIG_DFU_FUNCTION | 1479 | CONFIG_DFU_FUNCTION |
1480 | This enables the USB portion of the DFU USB class | 1480 | This enables the USB portion of the DFU USB class |
1481 | 1481 | ||
1482 | CONFIG_CMD_DFU | 1482 | CONFIG_CMD_DFU |
1483 | This enables the command "dfu" which is used to have | 1483 | This enables the command "dfu" which is used to have |
1484 | U-Boot create a DFU class device via USB. This command | 1484 | U-Boot create a DFU class device via USB. This command |
1485 | requires that the "dfu_alt_info" environment variable be | 1485 | requires that the "dfu_alt_info" environment variable be |
1486 | set and define the alt settings to expose to the host. | 1486 | set and define the alt settings to expose to the host. |
1487 | 1487 | ||
1488 | CONFIG_DFU_MMC | 1488 | CONFIG_DFU_MMC |
1489 | This enables support for exposing (e)MMC devices via DFU. | 1489 | This enables support for exposing (e)MMC devices via DFU. |
1490 | 1490 | ||
1491 | CONFIG_DFU_NAND | 1491 | CONFIG_DFU_NAND |
1492 | This enables support for exposing NAND devices via DFU. | 1492 | This enables support for exposing NAND devices via DFU. |
1493 | 1493 | ||
1494 | CONFIG_DFU_RAM | 1494 | CONFIG_DFU_RAM |
1495 | This enables support for exposing RAM via DFU. | 1495 | This enables support for exposing RAM via DFU. |
1496 | Note: DFU spec refer to non-volatile memory usage, but | 1496 | Note: DFU spec refer to non-volatile memory usage, but |
1497 | allow usages beyond the scope of spec - here RAM usage, | 1497 | allow usages beyond the scope of spec - here RAM usage, |
1498 | one that would help mostly the developer. | 1498 | one that would help mostly the developer. |
1499 | 1499 | ||
1500 | CONFIG_SYS_DFU_DATA_BUF_SIZE | 1500 | CONFIG_SYS_DFU_DATA_BUF_SIZE |
1501 | Dfu transfer uses a buffer before writing data to the | 1501 | Dfu transfer uses a buffer before writing data to the |
1502 | raw storage device. Make the size (in bytes) of this buffer | 1502 | raw storage device. Make the size (in bytes) of this buffer |
1503 | configurable. The size of this buffer is also configurable | 1503 | configurable. The size of this buffer is also configurable |
1504 | through the "dfu_bufsiz" environment variable. | 1504 | through the "dfu_bufsiz" environment variable. |
1505 | 1505 | ||
1506 | CONFIG_SYS_DFU_MAX_FILE_SIZE | 1506 | CONFIG_SYS_DFU_MAX_FILE_SIZE |
1507 | When updating files rather than the raw storage device, | 1507 | When updating files rather than the raw storage device, |
1508 | we use a static buffer to copy the file into and then write | 1508 | we use a static buffer to copy the file into and then write |
1509 | the buffer once we've been given the whole file. Define | 1509 | the buffer once we've been given the whole file. Define |
1510 | this to the maximum filesize (in bytes) for the buffer. | 1510 | this to the maximum filesize (in bytes) for the buffer. |
1511 | Default is 4 MiB if undefined. | 1511 | Default is 4 MiB if undefined. |
1512 | 1512 | ||
1513 | - Journaling Flash filesystem support: | 1513 | - Journaling Flash filesystem support: |
1514 | CONFIG_JFFS2_NAND, CONFIG_JFFS2_NAND_OFF, CONFIG_JFFS2_NAND_SIZE, | 1514 | CONFIG_JFFS2_NAND, CONFIG_JFFS2_NAND_OFF, CONFIG_JFFS2_NAND_SIZE, |
1515 | CONFIG_JFFS2_NAND_DEV | 1515 | CONFIG_JFFS2_NAND_DEV |
1516 | Define these for a default partition on a NAND device | 1516 | Define these for a default partition on a NAND device |
1517 | 1517 | ||
1518 | CONFIG_SYS_JFFS2_FIRST_SECTOR, | 1518 | CONFIG_SYS_JFFS2_FIRST_SECTOR, |
1519 | CONFIG_SYS_JFFS2_FIRST_BANK, CONFIG_SYS_JFFS2_NUM_BANKS | 1519 | CONFIG_SYS_JFFS2_FIRST_BANK, CONFIG_SYS_JFFS2_NUM_BANKS |
1520 | Define these for a default partition on a NOR device | 1520 | Define these for a default partition on a NOR device |
1521 | 1521 | ||
1522 | CONFIG_SYS_JFFS_CUSTOM_PART | 1522 | CONFIG_SYS_JFFS_CUSTOM_PART |
1523 | Define this to create an own partition. You have to provide a | 1523 | Define this to create an own partition. You have to provide a |
1524 | function struct part_info* jffs2_part_info(int part_num) | 1524 | function struct part_info* jffs2_part_info(int part_num) |
1525 | 1525 | ||
1526 | If you define only one JFFS2 partition you may also want to | 1526 | If you define only one JFFS2 partition you may also want to |
1527 | #define CONFIG_SYS_JFFS_SINGLE_PART 1 | 1527 | #define CONFIG_SYS_JFFS_SINGLE_PART 1 |
1528 | to disable the command chpart. This is the default when you | 1528 | to disable the command chpart. This is the default when you |
1529 | have not defined a custom partition | 1529 | have not defined a custom partition |
1530 | 1530 | ||
1531 | - FAT(File Allocation Table) filesystem write function support: | 1531 | - FAT(File Allocation Table) filesystem write function support: |
1532 | CONFIG_FAT_WRITE | 1532 | CONFIG_FAT_WRITE |
1533 | 1533 | ||
1534 | Define this to enable support for saving memory data as a | 1534 | Define this to enable support for saving memory data as a |
1535 | file in FAT formatted partition. | 1535 | file in FAT formatted partition. |
1536 | 1536 | ||
1537 | This will also enable the command "fatwrite" enabling the | 1537 | This will also enable the command "fatwrite" enabling the |
1538 | user to write files to FAT. | 1538 | user to write files to FAT. |
1539 | 1539 | ||
1540 | CBFS (Coreboot Filesystem) support | 1540 | CBFS (Coreboot Filesystem) support |
1541 | CONFIG_CMD_CBFS | 1541 | CONFIG_CMD_CBFS |
1542 | 1542 | ||
1543 | Define this to enable support for reading from a Coreboot | 1543 | Define this to enable support for reading from a Coreboot |
1544 | filesystem. Available commands are cbfsinit, cbfsinfo, cbfsls | 1544 | filesystem. Available commands are cbfsinit, cbfsinfo, cbfsls |
1545 | and cbfsload. | 1545 | and cbfsload. |
1546 | 1546 | ||
1547 | - Keyboard Support: | 1547 | - Keyboard Support: |
1548 | CONFIG_ISA_KEYBOARD | 1548 | CONFIG_ISA_KEYBOARD |
1549 | 1549 | ||
1550 | Define this to enable standard (PC-Style) keyboard | 1550 | Define this to enable standard (PC-Style) keyboard |
1551 | support | 1551 | support |
1552 | 1552 | ||
1553 | CONFIG_I8042_KBD | 1553 | CONFIG_I8042_KBD |
1554 | Standard PC keyboard driver with US (is default) and | 1554 | Standard PC keyboard driver with US (is default) and |
1555 | GERMAN key layout (switch via environment 'keymap=de') support. | 1555 | GERMAN key layout (switch via environment 'keymap=de') support. |
1556 | Export function i8042_kbd_init, i8042_tstc and i8042_getc | 1556 | Export function i8042_kbd_init, i8042_tstc and i8042_getc |
1557 | for cfb_console. Supports cursor blinking. | 1557 | for cfb_console. Supports cursor blinking. |
1558 | 1558 | ||
1559 | CONFIG_CROS_EC_KEYB | 1559 | CONFIG_CROS_EC_KEYB |
1560 | Enables a Chrome OS keyboard using the CROS_EC interface. | 1560 | Enables a Chrome OS keyboard using the CROS_EC interface. |
1561 | This uses CROS_EC to communicate with a second microcontroller | 1561 | This uses CROS_EC to communicate with a second microcontroller |
1562 | which provides key scans on request. | 1562 | which provides key scans on request. |
1563 | 1563 | ||
1564 | - Video support: | 1564 | - Video support: |
1565 | CONFIG_VIDEO | 1565 | CONFIG_VIDEO |
1566 | 1566 | ||
1567 | Define this to enable video support (for output to | 1567 | Define this to enable video support (for output to |
1568 | video). | 1568 | video). |
1569 | 1569 | ||
1570 | CONFIG_VIDEO_CT69000 | 1570 | CONFIG_VIDEO_CT69000 |
1571 | 1571 | ||
1572 | Enable Chips & Technologies 69000 Video chip | 1572 | Enable Chips & Technologies 69000 Video chip |
1573 | 1573 | ||
1574 | CONFIG_VIDEO_SMI_LYNXEM | 1574 | CONFIG_VIDEO_SMI_LYNXEM |
1575 | Enable Silicon Motion SMI 712/710/810 Video chip. The | 1575 | Enable Silicon Motion SMI 712/710/810 Video chip. The |
1576 | video output is selected via environment 'videoout' | 1576 | video output is selected via environment 'videoout' |
1577 | (1 = LCD and 2 = CRT). If videoout is undefined, CRT is | 1577 | (1 = LCD and 2 = CRT). If videoout is undefined, CRT is |
1578 | assumed. | 1578 | assumed. |
1579 | 1579 | ||
1580 | For the CT69000 and SMI_LYNXEM drivers, videomode is | 1580 | For the CT69000 and SMI_LYNXEM drivers, videomode is |
1581 | selected via environment 'videomode'. Two different ways | 1581 | selected via environment 'videomode'. Two different ways |
1582 | are possible: | 1582 | are possible: |
1583 | - "videomode=num" 'num' is a standard LiLo mode numbers. | 1583 | - "videomode=num" 'num' is a standard LiLo mode numbers. |
1584 | Following standard modes are supported (* is default): | 1584 | Following standard modes are supported (* is default): |
1585 | 1585 | ||
1586 | Colors 640x480 800x600 1024x768 1152x864 1280x1024 | 1586 | Colors 640x480 800x600 1024x768 1152x864 1280x1024 |
1587 | -------------+--------------------------------------------- | 1587 | -------------+--------------------------------------------- |
1588 | 8 bits | 0x301* 0x303 0x305 0x161 0x307 | 1588 | 8 bits | 0x301* 0x303 0x305 0x161 0x307 |
1589 | 15 bits | 0x310 0x313 0x316 0x162 0x319 | 1589 | 15 bits | 0x310 0x313 0x316 0x162 0x319 |
1590 | 16 bits | 0x311 0x314 0x317 0x163 0x31A | 1590 | 16 bits | 0x311 0x314 0x317 0x163 0x31A |
1591 | 24 bits | 0x312 0x315 0x318 ? 0x31B | 1591 | 24 bits | 0x312 0x315 0x318 ? 0x31B |
1592 | -------------+--------------------------------------------- | 1592 | -------------+--------------------------------------------- |
1593 | (i.e. setenv videomode 317; saveenv; reset;) | 1593 | (i.e. setenv videomode 317; saveenv; reset;) |
1594 | 1594 | ||
1595 | - "videomode=bootargs" all the video parameters are parsed | 1595 | - "videomode=bootargs" all the video parameters are parsed |
1596 | from the bootargs. (See drivers/video/videomodes.c) | 1596 | from the bootargs. (See drivers/video/videomodes.c) |
1597 | 1597 | ||
1598 | 1598 | ||
1599 | CONFIG_VIDEO_SED13806 | 1599 | CONFIG_VIDEO_SED13806 |
1600 | Enable Epson SED13806 driver. This driver supports 8bpp | 1600 | Enable Epson SED13806 driver. This driver supports 8bpp |
1601 | and 16bpp modes defined by CONFIG_VIDEO_SED13806_8BPP | 1601 | and 16bpp modes defined by CONFIG_VIDEO_SED13806_8BPP |
1602 | or CONFIG_VIDEO_SED13806_16BPP | 1602 | or CONFIG_VIDEO_SED13806_16BPP |
1603 | 1603 | ||
1604 | CONFIG_FSL_DIU_FB | 1604 | CONFIG_FSL_DIU_FB |
1605 | Enable the Freescale DIU video driver. Reference boards for | 1605 | Enable the Freescale DIU video driver. Reference boards for |
1606 | SOCs that have a DIU should define this macro to enable DIU | 1606 | SOCs that have a DIU should define this macro to enable DIU |
1607 | support, and should also define these other macros: | 1607 | support, and should also define these other macros: |
1608 | 1608 | ||
1609 | CONFIG_SYS_DIU_ADDR | 1609 | CONFIG_SYS_DIU_ADDR |
1610 | CONFIG_VIDEO | 1610 | CONFIG_VIDEO |
1611 | CONFIG_CMD_BMP | 1611 | CONFIG_CMD_BMP |
1612 | CONFIG_CFB_CONSOLE | 1612 | CONFIG_CFB_CONSOLE |
1613 | CONFIG_VIDEO_SW_CURSOR | 1613 | CONFIG_VIDEO_SW_CURSOR |
1614 | CONFIG_VGA_AS_SINGLE_DEVICE | 1614 | CONFIG_VGA_AS_SINGLE_DEVICE |
1615 | CONFIG_VIDEO_LOGO | 1615 | CONFIG_VIDEO_LOGO |
1616 | CONFIG_VIDEO_BMP_LOGO | 1616 | CONFIG_VIDEO_BMP_LOGO |
1617 | 1617 | ||
1618 | The DIU driver will look for the 'video-mode' environment | 1618 | The DIU driver will look for the 'video-mode' environment |
1619 | variable, and if defined, enable the DIU as a console during | 1619 | variable, and if defined, enable the DIU as a console during |
1620 | boot. See the documentation file README.video for a | 1620 | boot. See the documentation file README.video for a |
1621 | description of this variable. | 1621 | description of this variable. |
1622 | 1622 | ||
1623 | CONFIG_VIDEO_VGA | 1623 | CONFIG_VIDEO_VGA |
1624 | 1624 | ||
1625 | Enable the VGA video / BIOS for x86. The alternative if you | 1625 | Enable the VGA video / BIOS for x86. The alternative if you |
1626 | are using coreboot is to use the coreboot frame buffer | 1626 | are using coreboot is to use the coreboot frame buffer |
1627 | driver. | 1627 | driver. |
1628 | 1628 | ||
1629 | 1629 | ||
1630 | - Keyboard Support: | 1630 | - Keyboard Support: |
1631 | CONFIG_KEYBOARD | 1631 | CONFIG_KEYBOARD |
1632 | 1632 | ||
1633 | Define this to enable a custom keyboard support. | 1633 | Define this to enable a custom keyboard support. |
1634 | This simply calls drv_keyboard_init() which must be | 1634 | This simply calls drv_keyboard_init() which must be |
1635 | defined in your board-specific files. | 1635 | defined in your board-specific files. |
1636 | The only board using this so far is RBC823. | 1636 | The only board using this so far is RBC823. |
1637 | 1637 | ||
1638 | - LCD Support: CONFIG_LCD | 1638 | - LCD Support: CONFIG_LCD |
1639 | 1639 | ||
1640 | Define this to enable LCD support (for output to LCD | 1640 | Define this to enable LCD support (for output to LCD |
1641 | display); also select one of the supported displays | 1641 | display); also select one of the supported displays |
1642 | by defining one of these: | 1642 | by defining one of these: |
1643 | 1643 | ||
1644 | CONFIG_ATMEL_LCD: | 1644 | CONFIG_ATMEL_LCD: |
1645 | 1645 | ||
1646 | HITACHI TX09D70VM1CCA, 3.5", 240x320. | 1646 | HITACHI TX09D70VM1CCA, 3.5", 240x320. |
1647 | 1647 | ||
1648 | CONFIG_NEC_NL6448AC33: | 1648 | CONFIG_NEC_NL6448AC33: |
1649 | 1649 | ||
1650 | NEC NL6448AC33-18. Active, color, single scan. | 1650 | NEC NL6448AC33-18. Active, color, single scan. |
1651 | 1651 | ||
1652 | CONFIG_NEC_NL6448BC20 | 1652 | CONFIG_NEC_NL6448BC20 |
1653 | 1653 | ||
1654 | NEC NL6448BC20-08. 6.5", 640x480. | 1654 | NEC NL6448BC20-08. 6.5", 640x480. |
1655 | Active, color, single scan. | 1655 | Active, color, single scan. |
1656 | 1656 | ||
1657 | CONFIG_NEC_NL6448BC33_54 | 1657 | CONFIG_NEC_NL6448BC33_54 |
1658 | 1658 | ||
1659 | NEC NL6448BC33-54. 10.4", 640x480. | 1659 | NEC NL6448BC33-54. 10.4", 640x480. |
1660 | Active, color, single scan. | 1660 | Active, color, single scan. |
1661 | 1661 | ||
1662 | CONFIG_SHARP_16x9 | 1662 | CONFIG_SHARP_16x9 |
1663 | 1663 | ||
1664 | Sharp 320x240. Active, color, single scan. | 1664 | Sharp 320x240. Active, color, single scan. |
1665 | It isn't 16x9, and I am not sure what it is. | 1665 | It isn't 16x9, and I am not sure what it is. |
1666 | 1666 | ||
1667 | CONFIG_SHARP_LQ64D341 | 1667 | CONFIG_SHARP_LQ64D341 |
1668 | 1668 | ||
1669 | Sharp LQ64D341 display, 640x480. | 1669 | Sharp LQ64D341 display, 640x480. |
1670 | Active, color, single scan. | 1670 | Active, color, single scan. |
1671 | 1671 | ||
1672 | CONFIG_HLD1045 | 1672 | CONFIG_HLD1045 |
1673 | 1673 | ||
1674 | HLD1045 display, 640x480. | 1674 | HLD1045 display, 640x480. |
1675 | Active, color, single scan. | 1675 | Active, color, single scan. |
1676 | 1676 | ||
1677 | CONFIG_OPTREX_BW | 1677 | CONFIG_OPTREX_BW |
1678 | 1678 | ||
1679 | Optrex CBL50840-2 NF-FW 99 22 M5 | 1679 | Optrex CBL50840-2 NF-FW 99 22 M5 |
1680 | or | 1680 | or |
1681 | Hitachi LMG6912RPFC-00T | 1681 | Hitachi LMG6912RPFC-00T |
1682 | or | 1682 | or |
1683 | Hitachi SP14Q002 | 1683 | Hitachi SP14Q002 |
1684 | 1684 | ||
1685 | 320x240. Black & white. | 1685 | 320x240. Black & white. |
1686 | 1686 | ||
1687 | Normally display is black on white background; define | 1687 | Normally display is black on white background; define |
1688 | CONFIG_SYS_WHITE_ON_BLACK to get it inverted. | 1688 | CONFIG_SYS_WHITE_ON_BLACK to get it inverted. |
1689 | 1689 | ||
1690 | CONFIG_LCD_ALIGNMENT | 1690 | CONFIG_LCD_ALIGNMENT |
1691 | 1691 | ||
1692 | Normally the LCD is page-aligned (tyically 4KB). If this is | 1692 | Normally the LCD is page-aligned (tyically 4KB). If this is |
1693 | defined then the LCD will be aligned to this value instead. | 1693 | defined then the LCD will be aligned to this value instead. |
1694 | For ARM it is sometimes useful to use MMU_SECTION_SIZE | 1694 | For ARM it is sometimes useful to use MMU_SECTION_SIZE |
1695 | here, since it is cheaper to change data cache settings on | 1695 | here, since it is cheaper to change data cache settings on |
1696 | a per-section basis. | 1696 | a per-section basis. |
1697 | 1697 | ||
1698 | CONFIG_CONSOLE_SCROLL_LINES | 1698 | CONFIG_CONSOLE_SCROLL_LINES |
1699 | 1699 | ||
1700 | When the console need to be scrolled, this is the number of | 1700 | When the console need to be scrolled, this is the number of |
1701 | lines to scroll by. It defaults to 1. Increasing this makes | 1701 | lines to scroll by. It defaults to 1. Increasing this makes |
1702 | the console jump but can help speed up operation when scrolling | 1702 | the console jump but can help speed up operation when scrolling |
1703 | is slow. | 1703 | is slow. |
1704 | 1704 | ||
1705 | CONFIG_LCD_BMP_RLE8 | 1705 | CONFIG_LCD_BMP_RLE8 |
1706 | 1706 | ||
1707 | Support drawing of RLE8-compressed bitmaps on the LCD. | 1707 | Support drawing of RLE8-compressed bitmaps on the LCD. |
1708 | 1708 | ||
1709 | CONFIG_I2C_EDID | 1709 | CONFIG_I2C_EDID |
1710 | 1710 | ||
1711 | Enables an 'i2c edid' command which can read EDID | 1711 | Enables an 'i2c edid' command which can read EDID |
1712 | information over I2C from an attached LCD display. | 1712 | information over I2C from an attached LCD display. |
1713 | 1713 | ||
1714 | - Splash Screen Support: CONFIG_SPLASH_SCREEN | 1714 | - Splash Screen Support: CONFIG_SPLASH_SCREEN |
1715 | 1715 | ||
1716 | If this option is set, the environment is checked for | 1716 | If this option is set, the environment is checked for |
1717 | a variable "splashimage". If found, the usual display | 1717 | a variable "splashimage". If found, the usual display |
1718 | of logo, copyright and system information on the LCD | 1718 | of logo, copyright and system information on the LCD |
1719 | is suppressed and the BMP image at the address | 1719 | is suppressed and the BMP image at the address |
1720 | specified in "splashimage" is loaded instead. The | 1720 | specified in "splashimage" is loaded instead. The |
1721 | console is redirected to the "nulldev", too. This | 1721 | console is redirected to the "nulldev", too. This |
1722 | allows for a "silent" boot where a splash screen is | 1722 | allows for a "silent" boot where a splash screen is |
1723 | loaded very quickly after power-on. | 1723 | loaded very quickly after power-on. |
1724 | 1724 | ||
1725 | CONFIG_SPLASHIMAGE_GUARD | 1725 | CONFIG_SPLASHIMAGE_GUARD |
1726 | 1726 | ||
1727 | If this option is set, then U-Boot will prevent the environment | 1727 | If this option is set, then U-Boot will prevent the environment |
1728 | variable "splashimage" from being set to a problematic address | 1728 | variable "splashimage" from being set to a problematic address |
1729 | (see README.displaying-bmps and README.arm-unaligned-accesses). | 1729 | (see README.displaying-bmps and README.arm-unaligned-accesses). |
1730 | This option is useful for targets where, due to alignment | 1730 | This option is useful for targets where, due to alignment |
1731 | restrictions, an improperly aligned BMP image will cause a data | 1731 | restrictions, an improperly aligned BMP image will cause a data |
1732 | abort. If you think you will not have problems with unaligned | 1732 | abort. If you think you will not have problems with unaligned |
1733 | accesses (for example because your toolchain prevents them) | 1733 | accesses (for example because your toolchain prevents them) |
1734 | there is no need to set this option. | 1734 | there is no need to set this option. |
1735 | 1735 | ||
1736 | CONFIG_SPLASH_SCREEN_ALIGN | 1736 | CONFIG_SPLASH_SCREEN_ALIGN |
1737 | 1737 | ||
1738 | If this option is set the splash image can be freely positioned | 1738 | If this option is set the splash image can be freely positioned |
1739 | on the screen. Environment variable "splashpos" specifies the | 1739 | on the screen. Environment variable "splashpos" specifies the |
1740 | position as "x,y". If a positive number is given it is used as | 1740 | position as "x,y". If a positive number is given it is used as |
1741 | number of pixel from left/top. If a negative number is given it | 1741 | number of pixel from left/top. If a negative number is given it |
1742 | is used as number of pixel from right/bottom. You can also | 1742 | is used as number of pixel from right/bottom. You can also |
1743 | specify 'm' for centering the image. | 1743 | specify 'm' for centering the image. |
1744 | 1744 | ||
1745 | Example: | 1745 | Example: |
1746 | setenv splashpos m,m | 1746 | setenv splashpos m,m |
1747 | => image at center of screen | 1747 | => image at center of screen |
1748 | 1748 | ||
1749 | setenv splashpos 30,20 | 1749 | setenv splashpos 30,20 |
1750 | => image at x = 30 and y = 20 | 1750 | => image at x = 30 and y = 20 |
1751 | 1751 | ||
1752 | setenv splashpos -10,m | 1752 | setenv splashpos -10,m |
1753 | => vertically centered image | 1753 | => vertically centered image |
1754 | at x = dspWidth - bmpWidth - 9 | 1754 | at x = dspWidth - bmpWidth - 9 |
1755 | 1755 | ||
1756 | - Gzip compressed BMP image support: CONFIG_VIDEO_BMP_GZIP | 1756 | - Gzip compressed BMP image support: CONFIG_VIDEO_BMP_GZIP |
1757 | 1757 | ||
1758 | If this option is set, additionally to standard BMP | 1758 | If this option is set, additionally to standard BMP |
1759 | images, gzipped BMP images can be displayed via the | 1759 | images, gzipped BMP images can be displayed via the |
1760 | splashscreen support or the bmp command. | 1760 | splashscreen support or the bmp command. |
1761 | 1761 | ||
1762 | - Run length encoded BMP image (RLE8) support: CONFIG_VIDEO_BMP_RLE8 | 1762 | - Run length encoded BMP image (RLE8) support: CONFIG_VIDEO_BMP_RLE8 |
1763 | 1763 | ||
1764 | If this option is set, 8-bit RLE compressed BMP images | 1764 | If this option is set, 8-bit RLE compressed BMP images |
1765 | can be displayed via the splashscreen support or the | 1765 | can be displayed via the splashscreen support or the |
1766 | bmp command. | 1766 | bmp command. |
1767 | 1767 | ||
1768 | - Do compresssing for memory range: | 1768 | - Do compresssing for memory range: |
1769 | CONFIG_CMD_ZIP | 1769 | CONFIG_CMD_ZIP |
1770 | 1770 | ||
1771 | If this option is set, it would use zlib deflate method | 1771 | If this option is set, it would use zlib deflate method |
1772 | to compress the specified memory at its best effort. | 1772 | to compress the specified memory at its best effort. |
1773 | 1773 | ||
1774 | - Compression support: | 1774 | - Compression support: |
1775 | CONFIG_GZIP | 1775 | CONFIG_GZIP |
1776 | 1776 | ||
1777 | Enabled by default to support gzip compressed images. | 1777 | Enabled by default to support gzip compressed images. |
1778 | 1778 | ||
1779 | CONFIG_BZIP2 | 1779 | CONFIG_BZIP2 |
1780 | 1780 | ||
1781 | If this option is set, support for bzip2 compressed | 1781 | If this option is set, support for bzip2 compressed |
1782 | images is included. If not, only uncompressed and gzip | 1782 | images is included. If not, only uncompressed and gzip |
1783 | compressed images are supported. | 1783 | compressed images are supported. |
1784 | 1784 | ||
1785 | NOTE: the bzip2 algorithm requires a lot of RAM, so | 1785 | NOTE: the bzip2 algorithm requires a lot of RAM, so |
1786 | the malloc area (as defined by CONFIG_SYS_MALLOC_LEN) should | 1786 | the malloc area (as defined by CONFIG_SYS_MALLOC_LEN) should |
1787 | be at least 4MB. | 1787 | be at least 4MB. |
1788 | 1788 | ||
1789 | CONFIG_LZMA | 1789 | CONFIG_LZMA |
1790 | 1790 | ||
1791 | If this option is set, support for lzma compressed | 1791 | If this option is set, support for lzma compressed |
1792 | images is included. | 1792 | images is included. |
1793 | 1793 | ||
1794 | Note: The LZMA algorithm adds between 2 and 4KB of code and it | 1794 | Note: The LZMA algorithm adds between 2 and 4KB of code and it |
1795 | requires an amount of dynamic memory that is given by the | 1795 | requires an amount of dynamic memory that is given by the |
1796 | formula: | 1796 | formula: |
1797 | 1797 | ||
1798 | (1846 + 768 << (lc + lp)) * sizeof(uint16) | 1798 | (1846 + 768 << (lc + lp)) * sizeof(uint16) |
1799 | 1799 | ||
1800 | Where lc and lp stand for, respectively, Literal context bits | 1800 | Where lc and lp stand for, respectively, Literal context bits |
1801 | and Literal pos bits. | 1801 | and Literal pos bits. |
1802 | 1802 | ||
1803 | This value is upper-bounded by 14MB in the worst case. Anyway, | 1803 | This value is upper-bounded by 14MB in the worst case. Anyway, |
1804 | for a ~4MB large kernel image, we have lc=3 and lp=0 for a | 1804 | for a ~4MB large kernel image, we have lc=3 and lp=0 for a |
1805 | total amount of (1846 + 768 << (3 + 0)) * 2 = ~41KB... that is | 1805 | total amount of (1846 + 768 << (3 + 0)) * 2 = ~41KB... that is |
1806 | a very small buffer. | 1806 | a very small buffer. |
1807 | 1807 | ||
1808 | Use the lzmainfo tool to determinate the lc and lp values and | 1808 | Use the lzmainfo tool to determinate the lc and lp values and |
1809 | then calculate the amount of needed dynamic memory (ensuring | 1809 | then calculate the amount of needed dynamic memory (ensuring |
1810 | the appropriate CONFIG_SYS_MALLOC_LEN value). | 1810 | the appropriate CONFIG_SYS_MALLOC_LEN value). |
1811 | 1811 | ||
1812 | CONFIG_LZO | 1812 | CONFIG_LZO |
1813 | 1813 | ||
1814 | If this option is set, support for LZO compressed images | 1814 | If this option is set, support for LZO compressed images |
1815 | is included. | 1815 | is included. |
1816 | 1816 | ||
1817 | - MII/PHY support: | 1817 | - MII/PHY support: |
1818 | CONFIG_PHY_ADDR | 1818 | CONFIG_PHY_ADDR |
1819 | 1819 | ||
1820 | The address of PHY on MII bus. | 1820 | The address of PHY on MII bus. |
1821 | 1821 | ||
1822 | CONFIG_PHY_CLOCK_FREQ (ppc4xx) | 1822 | CONFIG_PHY_CLOCK_FREQ (ppc4xx) |
1823 | 1823 | ||
1824 | The clock frequency of the MII bus | 1824 | The clock frequency of the MII bus |
1825 | 1825 | ||
1826 | CONFIG_PHY_GIGE | 1826 | CONFIG_PHY_GIGE |
1827 | 1827 | ||
1828 | If this option is set, support for speed/duplex | 1828 | If this option is set, support for speed/duplex |
1829 | detection of gigabit PHY is included. | 1829 | detection of gigabit PHY is included. |
1830 | 1830 | ||
1831 | CONFIG_PHY_RESET_DELAY | 1831 | CONFIG_PHY_RESET_DELAY |
1832 | 1832 | ||
1833 | Some PHY like Intel LXT971A need extra delay after | 1833 | Some PHY like Intel LXT971A need extra delay after |
1834 | reset before any MII register access is possible. | 1834 | reset before any MII register access is possible. |
1835 | For such PHY, set this option to the usec delay | 1835 | For such PHY, set this option to the usec delay |
1836 | required. (minimum 300usec for LXT971A) | 1836 | required. (minimum 300usec for LXT971A) |
1837 | 1837 | ||
1838 | CONFIG_PHY_CMD_DELAY (ppc4xx) | 1838 | CONFIG_PHY_CMD_DELAY (ppc4xx) |
1839 | 1839 | ||
1840 | Some PHY like Intel LXT971A need extra delay after | 1840 | Some PHY like Intel LXT971A need extra delay after |
1841 | command issued before MII status register can be read | 1841 | command issued before MII status register can be read |
1842 | 1842 | ||
1843 | - Ethernet address: | 1843 | - Ethernet address: |
1844 | CONFIG_ETHADDR | 1844 | CONFIG_ETHADDR |
1845 | CONFIG_ETH1ADDR | 1845 | CONFIG_ETH1ADDR |
1846 | CONFIG_ETH2ADDR | 1846 | CONFIG_ETH2ADDR |
1847 | CONFIG_ETH3ADDR | 1847 | CONFIG_ETH3ADDR |
1848 | CONFIG_ETH4ADDR | 1848 | CONFIG_ETH4ADDR |
1849 | CONFIG_ETH5ADDR | 1849 | CONFIG_ETH5ADDR |
1850 | 1850 | ||
1851 | Define a default value for Ethernet address to use | 1851 | Define a default value for Ethernet address to use |
1852 | for the respective Ethernet interface, in case this | 1852 | for the respective Ethernet interface, in case this |
1853 | is not determined automatically. | 1853 | is not determined automatically. |
1854 | 1854 | ||
1855 | - IP address: | 1855 | - IP address: |
1856 | CONFIG_IPADDR | 1856 | CONFIG_IPADDR |
1857 | 1857 | ||
1858 | Define a default value for the IP address to use for | 1858 | Define a default value for the IP address to use for |
1859 | the default Ethernet interface, in case this is not | 1859 | the default Ethernet interface, in case this is not |
1860 | determined through e.g. bootp. | 1860 | determined through e.g. bootp. |
1861 | (Environment variable "ipaddr") | 1861 | (Environment variable "ipaddr") |
1862 | 1862 | ||
1863 | - Server IP address: | 1863 | - Server IP address: |
1864 | CONFIG_SERVERIP | 1864 | CONFIG_SERVERIP |
1865 | 1865 | ||
1866 | Defines a default value for the IP address of a TFTP | 1866 | Defines a default value for the IP address of a TFTP |
1867 | server to contact when using the "tftboot" command. | 1867 | server to contact when using the "tftboot" command. |
1868 | (Environment variable "serverip") | 1868 | (Environment variable "serverip") |
1869 | 1869 | ||
1870 | CONFIG_KEEP_SERVERADDR | 1870 | CONFIG_KEEP_SERVERADDR |
1871 | 1871 | ||
1872 | Keeps the server's MAC address, in the env 'serveraddr' | 1872 | Keeps the server's MAC address, in the env 'serveraddr' |
1873 | for passing to bootargs (like Linux's netconsole option) | 1873 | for passing to bootargs (like Linux's netconsole option) |
1874 | 1874 | ||
1875 | - Gateway IP address: | 1875 | - Gateway IP address: |
1876 | CONFIG_GATEWAYIP | 1876 | CONFIG_GATEWAYIP |
1877 | 1877 | ||
1878 | Defines a default value for the IP address of the | 1878 | Defines a default value for the IP address of the |
1879 | default router where packets to other networks are | 1879 | default router where packets to other networks are |
1880 | sent to. | 1880 | sent to. |
1881 | (Environment variable "gatewayip") | 1881 | (Environment variable "gatewayip") |
1882 | 1882 | ||
1883 | - Subnet mask: | 1883 | - Subnet mask: |
1884 | CONFIG_NETMASK | 1884 | CONFIG_NETMASK |
1885 | 1885 | ||
1886 | Defines a default value for the subnet mask (or | 1886 | Defines a default value for the subnet mask (or |
1887 | routing prefix) which is used to determine if an IP | 1887 | routing prefix) which is used to determine if an IP |
1888 | address belongs to the local subnet or needs to be | 1888 | address belongs to the local subnet or needs to be |
1889 | forwarded through a router. | 1889 | forwarded through a router. |
1890 | (Environment variable "netmask") | 1890 | (Environment variable "netmask") |
1891 | 1891 | ||
1892 | - Multicast TFTP Mode: | 1892 | - Multicast TFTP Mode: |
1893 | CONFIG_MCAST_TFTP | 1893 | CONFIG_MCAST_TFTP |
1894 | 1894 | ||
1895 | Defines whether you want to support multicast TFTP as per | 1895 | Defines whether you want to support multicast TFTP as per |
1896 | rfc-2090; for example to work with atftp. Lets lots of targets | 1896 | rfc-2090; for example to work with atftp. Lets lots of targets |
1897 | tftp down the same boot image concurrently. Note: the Ethernet | 1897 | tftp down the same boot image concurrently. Note: the Ethernet |
1898 | driver in use must provide a function: mcast() to join/leave a | 1898 | driver in use must provide a function: mcast() to join/leave a |
1899 | multicast group. | 1899 | multicast group. |
1900 | 1900 | ||
1901 | - BOOTP Recovery Mode: | 1901 | - BOOTP Recovery Mode: |
1902 | CONFIG_BOOTP_RANDOM_DELAY | 1902 | CONFIG_BOOTP_RANDOM_DELAY |
1903 | 1903 | ||
1904 | If you have many targets in a network that try to | 1904 | If you have many targets in a network that try to |
1905 | boot using BOOTP, you may want to avoid that all | 1905 | boot using BOOTP, you may want to avoid that all |
1906 | systems send out BOOTP requests at precisely the same | 1906 | systems send out BOOTP requests at precisely the same |
1907 | moment (which would happen for instance at recovery | 1907 | moment (which would happen for instance at recovery |
1908 | from a power failure, when all systems will try to | 1908 | from a power failure, when all systems will try to |
1909 | boot, thus flooding the BOOTP server. Defining | 1909 | boot, thus flooding the BOOTP server. Defining |
1910 | CONFIG_BOOTP_RANDOM_DELAY causes a random delay to be | 1910 | CONFIG_BOOTP_RANDOM_DELAY causes a random delay to be |
1911 | inserted before sending out BOOTP requests. The | 1911 | inserted before sending out BOOTP requests. The |
1912 | following delays are inserted then: | 1912 | following delays are inserted then: |
1913 | 1913 | ||
1914 | 1st BOOTP request: delay 0 ... 1 sec | 1914 | 1st BOOTP request: delay 0 ... 1 sec |
1915 | 2nd BOOTP request: delay 0 ... 2 sec | 1915 | 2nd BOOTP request: delay 0 ... 2 sec |
1916 | 3rd BOOTP request: delay 0 ... 4 sec | 1916 | 3rd BOOTP request: delay 0 ... 4 sec |
1917 | 4th and following | 1917 | 4th and following |
1918 | BOOTP requests: delay 0 ... 8 sec | 1918 | BOOTP requests: delay 0 ... 8 sec |
1919 | 1919 | ||
1920 | - DHCP Advanced Options: | 1920 | - DHCP Advanced Options: |
1921 | You can fine tune the DHCP functionality by defining | 1921 | You can fine tune the DHCP functionality by defining |
1922 | CONFIG_BOOTP_* symbols: | 1922 | CONFIG_BOOTP_* symbols: |
1923 | 1923 | ||
1924 | CONFIG_BOOTP_SUBNETMASK | 1924 | CONFIG_BOOTP_SUBNETMASK |
1925 | CONFIG_BOOTP_GATEWAY | 1925 | CONFIG_BOOTP_GATEWAY |
1926 | CONFIG_BOOTP_HOSTNAME | 1926 | CONFIG_BOOTP_HOSTNAME |
1927 | CONFIG_BOOTP_NISDOMAIN | 1927 | CONFIG_BOOTP_NISDOMAIN |
1928 | CONFIG_BOOTP_BOOTPATH | 1928 | CONFIG_BOOTP_BOOTPATH |
1929 | CONFIG_BOOTP_BOOTFILESIZE | 1929 | CONFIG_BOOTP_BOOTFILESIZE |
1930 | CONFIG_BOOTP_DNS | 1930 | CONFIG_BOOTP_DNS |
1931 | CONFIG_BOOTP_DNS2 | 1931 | CONFIG_BOOTP_DNS2 |
1932 | CONFIG_BOOTP_SEND_HOSTNAME | 1932 | CONFIG_BOOTP_SEND_HOSTNAME |
1933 | CONFIG_BOOTP_NTPSERVER | 1933 | CONFIG_BOOTP_NTPSERVER |
1934 | CONFIG_BOOTP_TIMEOFFSET | 1934 | CONFIG_BOOTP_TIMEOFFSET |
1935 | CONFIG_BOOTP_VENDOREX | 1935 | CONFIG_BOOTP_VENDOREX |
1936 | CONFIG_BOOTP_MAY_FAIL | 1936 | CONFIG_BOOTP_MAY_FAIL |
1937 | 1937 | ||
1938 | CONFIG_BOOTP_SERVERIP - TFTP server will be the serverip | 1938 | CONFIG_BOOTP_SERVERIP - TFTP server will be the serverip |
1939 | environment variable, not the BOOTP server. | 1939 | environment variable, not the BOOTP server. |
1940 | 1940 | ||
1941 | CONFIG_BOOTP_MAY_FAIL - If the DHCP server is not found | 1941 | CONFIG_BOOTP_MAY_FAIL - If the DHCP server is not found |
1942 | after the configured retry count, the call will fail | 1942 | after the configured retry count, the call will fail |
1943 | instead of starting over. This can be used to fail over | 1943 | instead of starting over. This can be used to fail over |
1944 | to Link-local IP address configuration if the DHCP server | 1944 | to Link-local IP address configuration if the DHCP server |
1945 | is not available. | 1945 | is not available. |
1946 | 1946 | ||
1947 | CONFIG_BOOTP_DNS2 - If a DHCP client requests the DNS | 1947 | CONFIG_BOOTP_DNS2 - If a DHCP client requests the DNS |
1948 | serverip from a DHCP server, it is possible that more | 1948 | serverip from a DHCP server, it is possible that more |
1949 | than one DNS serverip is offered to the client. | 1949 | than one DNS serverip is offered to the client. |
1950 | If CONFIG_BOOTP_DNS2 is enabled, the secondary DNS | 1950 | If CONFIG_BOOTP_DNS2 is enabled, the secondary DNS |
1951 | serverip will be stored in the additional environment | 1951 | serverip will be stored in the additional environment |
1952 | variable "dnsip2". The first DNS serverip is always | 1952 | variable "dnsip2". The first DNS serverip is always |
1953 | stored in the variable "dnsip", when CONFIG_BOOTP_DNS | 1953 | stored in the variable "dnsip", when CONFIG_BOOTP_DNS |
1954 | is defined. | 1954 | is defined. |
1955 | 1955 | ||
1956 | CONFIG_BOOTP_SEND_HOSTNAME - Some DHCP servers are capable | 1956 | CONFIG_BOOTP_SEND_HOSTNAME - Some DHCP servers are capable |
1957 | to do a dynamic update of a DNS server. To do this, they | 1957 | to do a dynamic update of a DNS server. To do this, they |
1958 | need the hostname of the DHCP requester. | 1958 | need the hostname of the DHCP requester. |
1959 | If CONFIG_BOOTP_SEND_HOSTNAME is defined, the content | 1959 | If CONFIG_BOOTP_SEND_HOSTNAME is defined, the content |
1960 | of the "hostname" environment variable is passed as | 1960 | of the "hostname" environment variable is passed as |
1961 | option 12 to the DHCP server. | 1961 | option 12 to the DHCP server. |
1962 | 1962 | ||
1963 | CONFIG_BOOTP_DHCP_REQUEST_DELAY | 1963 | CONFIG_BOOTP_DHCP_REQUEST_DELAY |
1964 | 1964 | ||
1965 | A 32bit value in microseconds for a delay between | 1965 | A 32bit value in microseconds for a delay between |
1966 | receiving a "DHCP Offer" and sending the "DHCP Request". | 1966 | receiving a "DHCP Offer" and sending the "DHCP Request". |
1967 | This fixes a problem with certain DHCP servers that don't | 1967 | This fixes a problem with certain DHCP servers that don't |
1968 | respond 100% of the time to a "DHCP request". E.g. On an | 1968 | respond 100% of the time to a "DHCP request". E.g. On an |
1969 | AT91RM9200 processor running at 180MHz, this delay needed | 1969 | AT91RM9200 processor running at 180MHz, this delay needed |
1970 | to be *at least* 15,000 usec before a Windows Server 2003 | 1970 | to be *at least* 15,000 usec before a Windows Server 2003 |
1971 | DHCP server would reply 100% of the time. I recommend at | 1971 | DHCP server would reply 100% of the time. I recommend at |
1972 | least 50,000 usec to be safe. The alternative is to hope | 1972 | least 50,000 usec to be safe. The alternative is to hope |
1973 | that one of the retries will be successful but note that | 1973 | that one of the retries will be successful but note that |
1974 | the DHCP timeout and retry process takes a longer than | 1974 | the DHCP timeout and retry process takes a longer than |
1975 | this delay. | 1975 | this delay. |
1976 | 1976 | ||
1977 | - Link-local IP address negotiation: | 1977 | - Link-local IP address negotiation: |
1978 | Negotiate with other link-local clients on the local network | 1978 | Negotiate with other link-local clients on the local network |
1979 | for an address that doesn't require explicit configuration. | 1979 | for an address that doesn't require explicit configuration. |
1980 | This is especially useful if a DHCP server cannot be guaranteed | 1980 | This is especially useful if a DHCP server cannot be guaranteed |
1981 | to exist in all environments that the device must operate. | 1981 | to exist in all environments that the device must operate. |
1982 | 1982 | ||
1983 | See doc/README.link-local for more information. | 1983 | See doc/README.link-local for more information. |
1984 | 1984 | ||
1985 | - CDP Options: | 1985 | - CDP Options: |
1986 | CONFIG_CDP_DEVICE_ID | 1986 | CONFIG_CDP_DEVICE_ID |
1987 | 1987 | ||
1988 | The device id used in CDP trigger frames. | 1988 | The device id used in CDP trigger frames. |
1989 | 1989 | ||
1990 | CONFIG_CDP_DEVICE_ID_PREFIX | 1990 | CONFIG_CDP_DEVICE_ID_PREFIX |
1991 | 1991 | ||
1992 | A two character string which is prefixed to the MAC address | 1992 | A two character string which is prefixed to the MAC address |
1993 | of the device. | 1993 | of the device. |
1994 | 1994 | ||
1995 | CONFIG_CDP_PORT_ID | 1995 | CONFIG_CDP_PORT_ID |
1996 | 1996 | ||
1997 | A printf format string which contains the ascii name of | 1997 | A printf format string which contains the ascii name of |
1998 | the port. Normally is set to "eth%d" which sets | 1998 | the port. Normally is set to "eth%d" which sets |
1999 | eth0 for the first Ethernet, eth1 for the second etc. | 1999 | eth0 for the first Ethernet, eth1 for the second etc. |
2000 | 2000 | ||
2001 | CONFIG_CDP_CAPABILITIES | 2001 | CONFIG_CDP_CAPABILITIES |
2002 | 2002 | ||
2003 | A 32bit integer which indicates the device capabilities; | 2003 | A 32bit integer which indicates the device capabilities; |
2004 | 0x00000010 for a normal host which does not forwards. | 2004 | 0x00000010 for a normal host which does not forwards. |
2005 | 2005 | ||
2006 | CONFIG_CDP_VERSION | 2006 | CONFIG_CDP_VERSION |
2007 | 2007 | ||
2008 | An ascii string containing the version of the software. | 2008 | An ascii string containing the version of the software. |
2009 | 2009 | ||
2010 | CONFIG_CDP_PLATFORM | 2010 | CONFIG_CDP_PLATFORM |
2011 | 2011 | ||
2012 | An ascii string containing the name of the platform. | 2012 | An ascii string containing the name of the platform. |
2013 | 2013 | ||
2014 | CONFIG_CDP_TRIGGER | 2014 | CONFIG_CDP_TRIGGER |
2015 | 2015 | ||
2016 | A 32bit integer sent on the trigger. | 2016 | A 32bit integer sent on the trigger. |
2017 | 2017 | ||
2018 | CONFIG_CDP_POWER_CONSUMPTION | 2018 | CONFIG_CDP_POWER_CONSUMPTION |
2019 | 2019 | ||
2020 | A 16bit integer containing the power consumption of the | 2020 | A 16bit integer containing the power consumption of the |
2021 | device in .1 of milliwatts. | 2021 | device in .1 of milliwatts. |
2022 | 2022 | ||
2023 | CONFIG_CDP_APPLIANCE_VLAN_TYPE | 2023 | CONFIG_CDP_APPLIANCE_VLAN_TYPE |
2024 | 2024 | ||
2025 | A byte containing the id of the VLAN. | 2025 | A byte containing the id of the VLAN. |
2026 | 2026 | ||
2027 | - Status LED: CONFIG_STATUS_LED | 2027 | - Status LED: CONFIG_STATUS_LED |
2028 | 2028 | ||
2029 | Several configurations allow to display the current | 2029 | Several configurations allow to display the current |
2030 | status using a LED. For instance, the LED will blink | 2030 | status using a LED. For instance, the LED will blink |
2031 | fast while running U-Boot code, stop blinking as | 2031 | fast while running U-Boot code, stop blinking as |
2032 | soon as a reply to a BOOTP request was received, and | 2032 | soon as a reply to a BOOTP request was received, and |
2033 | start blinking slow once the Linux kernel is running | 2033 | start blinking slow once the Linux kernel is running |
2034 | (supported by a status LED driver in the Linux | 2034 | (supported by a status LED driver in the Linux |
2035 | kernel). Defining CONFIG_STATUS_LED enables this | 2035 | kernel). Defining CONFIG_STATUS_LED enables this |
2036 | feature in U-Boot. | 2036 | feature in U-Boot. |
2037 | 2037 | ||
2038 | Additional options: | 2038 | Additional options: |
2039 | 2039 | ||
2040 | CONFIG_GPIO_LED | 2040 | CONFIG_GPIO_LED |
2041 | The status LED can be connected to a GPIO pin. | 2041 | The status LED can be connected to a GPIO pin. |
2042 | In such cases, the gpio_led driver can be used as a | 2042 | In such cases, the gpio_led driver can be used as a |
2043 | status LED backend implementation. Define CONFIG_GPIO_LED | 2043 | status LED backend implementation. Define CONFIG_GPIO_LED |
2044 | to include the gpio_led driver in the U-Boot binary. | 2044 | to include the gpio_led driver in the U-Boot binary. |
2045 | 2045 | ||
2046 | CONFIG_GPIO_LED_INVERTED_TABLE | 2046 | CONFIG_GPIO_LED_INVERTED_TABLE |
2047 | Some GPIO connected LEDs may have inverted polarity in which | 2047 | Some GPIO connected LEDs may have inverted polarity in which |
2048 | case the GPIO high value corresponds to LED off state and | 2048 | case the GPIO high value corresponds to LED off state and |
2049 | GPIO low value corresponds to LED on state. | 2049 | GPIO low value corresponds to LED on state. |
2050 | In such cases CONFIG_GPIO_LED_INVERTED_TABLE may be defined | 2050 | In such cases CONFIG_GPIO_LED_INVERTED_TABLE may be defined |
2051 | with a list of GPIO LEDs that have inverted polarity. | 2051 | with a list of GPIO LEDs that have inverted polarity. |
2052 | 2052 | ||
2053 | - CAN Support: CONFIG_CAN_DRIVER | 2053 | - CAN Support: CONFIG_CAN_DRIVER |
2054 | 2054 | ||
2055 | Defining CONFIG_CAN_DRIVER enables CAN driver support | 2055 | Defining CONFIG_CAN_DRIVER enables CAN driver support |
2056 | on those systems that support this (optional) | 2056 | on those systems that support this (optional) |
2057 | feature, like the TQM8xxL modules. | 2057 | feature, like the TQM8xxL modules. |
2058 | 2058 | ||
2059 | - I2C Support: CONFIG_SYS_I2C | 2059 | - I2C Support: CONFIG_SYS_I2C |
2060 | 2060 | ||
2061 | This enable the NEW i2c subsystem, and will allow you to use | 2061 | This enable the NEW i2c subsystem, and will allow you to use |
2062 | i2c commands at the u-boot command line (as long as you set | 2062 | i2c commands at the u-boot command line (as long as you set |
2063 | CONFIG_CMD_I2C in CONFIG_COMMANDS) and communicate with i2c | 2063 | CONFIG_CMD_I2C in CONFIG_COMMANDS) and communicate with i2c |
2064 | based realtime clock chips or other i2c devices. See | 2064 | based realtime clock chips or other i2c devices. See |
2065 | common/cmd_i2c.c for a description of the command line | 2065 | common/cmd_i2c.c for a description of the command line |
2066 | interface. | 2066 | interface. |
2067 | 2067 | ||
2068 | ported i2c driver to the new framework: | 2068 | ported i2c driver to the new framework: |
2069 | - drivers/i2c/soft_i2c.c: | 2069 | - drivers/i2c/soft_i2c.c: |
2070 | - activate first bus with CONFIG_SYS_I2C_SOFT define | 2070 | - activate first bus with CONFIG_SYS_I2C_SOFT define |
2071 | CONFIG_SYS_I2C_SOFT_SPEED and CONFIG_SYS_I2C_SOFT_SLAVE | 2071 | CONFIG_SYS_I2C_SOFT_SPEED and CONFIG_SYS_I2C_SOFT_SLAVE |
2072 | for defining speed and slave address | 2072 | for defining speed and slave address |
2073 | - activate second bus with I2C_SOFT_DECLARATIONS2 define | 2073 | - activate second bus with I2C_SOFT_DECLARATIONS2 define |
2074 | CONFIG_SYS_I2C_SOFT_SPEED_2 and CONFIG_SYS_I2C_SOFT_SLAVE_2 | 2074 | CONFIG_SYS_I2C_SOFT_SPEED_2 and CONFIG_SYS_I2C_SOFT_SLAVE_2 |
2075 | for defining speed and slave address | 2075 | for defining speed and slave address |
2076 | - activate third bus with I2C_SOFT_DECLARATIONS3 define | 2076 | - activate third bus with I2C_SOFT_DECLARATIONS3 define |
2077 | CONFIG_SYS_I2C_SOFT_SPEED_3 and CONFIG_SYS_I2C_SOFT_SLAVE_3 | 2077 | CONFIG_SYS_I2C_SOFT_SPEED_3 and CONFIG_SYS_I2C_SOFT_SLAVE_3 |
2078 | for defining speed and slave address | 2078 | for defining speed and slave address |
2079 | - activate fourth bus with I2C_SOFT_DECLARATIONS4 define | 2079 | - activate fourth bus with I2C_SOFT_DECLARATIONS4 define |
2080 | CONFIG_SYS_I2C_SOFT_SPEED_4 and CONFIG_SYS_I2C_SOFT_SLAVE_4 | 2080 | CONFIG_SYS_I2C_SOFT_SPEED_4 and CONFIG_SYS_I2C_SOFT_SLAVE_4 |
2081 | for defining speed and slave address | 2081 | for defining speed and slave address |
2082 | 2082 | ||
2083 | - drivers/i2c/fsl_i2c.c: | 2083 | - drivers/i2c/fsl_i2c.c: |
2084 | - activate i2c driver with CONFIG_SYS_I2C_FSL | 2084 | - activate i2c driver with CONFIG_SYS_I2C_FSL |
2085 | define CONFIG_SYS_FSL_I2C_OFFSET for setting the register | 2085 | define CONFIG_SYS_FSL_I2C_OFFSET for setting the register |
2086 | offset CONFIG_SYS_FSL_I2C_SPEED for the i2c speed and | 2086 | offset CONFIG_SYS_FSL_I2C_SPEED for the i2c speed and |
2087 | CONFIG_SYS_FSL_I2C_SLAVE for the slave addr of the first | 2087 | CONFIG_SYS_FSL_I2C_SLAVE for the slave addr of the first |
2088 | bus. | 2088 | bus. |
2089 | - If your board supports a second fsl i2c bus, define | 2089 | - If your board supports a second fsl i2c bus, define |
2090 | CONFIG_SYS_FSL_I2C2_OFFSET for the register offset | 2090 | CONFIG_SYS_FSL_I2C2_OFFSET for the register offset |
2091 | CONFIG_SYS_FSL_I2C2_SPEED for the speed and | 2091 | CONFIG_SYS_FSL_I2C2_SPEED for the speed and |
2092 | CONFIG_SYS_FSL_I2C2_SLAVE for the slave address of the | 2092 | CONFIG_SYS_FSL_I2C2_SLAVE for the slave address of the |
2093 | second bus. | 2093 | second bus. |
2094 | 2094 | ||
2095 | - drivers/i2c/tegra_i2c.c: | 2095 | - drivers/i2c/tegra_i2c.c: |
2096 | - activate this driver with CONFIG_SYS_I2C_TEGRA | 2096 | - activate this driver with CONFIG_SYS_I2C_TEGRA |
2097 | - This driver adds 4 i2c buses with a fix speed from | 2097 | - This driver adds 4 i2c buses with a fix speed from |
2098 | 100000 and the slave addr 0! | 2098 | 100000 and the slave addr 0! |
2099 | 2099 | ||
2100 | - drivers/i2c/ppc4xx_i2c.c | 2100 | - drivers/i2c/ppc4xx_i2c.c |
2101 | - activate this driver with CONFIG_SYS_I2C_PPC4XX | 2101 | - activate this driver with CONFIG_SYS_I2C_PPC4XX |
2102 | - CONFIG_SYS_I2C_PPC4XX_CH0 activate hardware channel 0 | 2102 | - CONFIG_SYS_I2C_PPC4XX_CH0 activate hardware channel 0 |
2103 | - CONFIG_SYS_I2C_PPC4XX_CH1 activate hardware channel 1 | 2103 | - CONFIG_SYS_I2C_PPC4XX_CH1 activate hardware channel 1 |
2104 | 2104 | ||
2105 | - drivers/i2c/i2c_mxc.c | 2105 | - drivers/i2c/i2c_mxc.c |
2106 | - activate this driver with CONFIG_SYS_I2C_MXC | 2106 | - activate this driver with CONFIG_SYS_I2C_MXC |
2107 | - define speed for bus 1 with CONFIG_SYS_MXC_I2C1_SPEED | 2107 | - define speed for bus 1 with CONFIG_SYS_MXC_I2C1_SPEED |
2108 | - define slave for bus 1 with CONFIG_SYS_MXC_I2C1_SLAVE | 2108 | - define slave for bus 1 with CONFIG_SYS_MXC_I2C1_SLAVE |
2109 | - define speed for bus 2 with CONFIG_SYS_MXC_I2C2_SPEED | 2109 | - define speed for bus 2 with CONFIG_SYS_MXC_I2C2_SPEED |
2110 | - define slave for bus 2 with CONFIG_SYS_MXC_I2C2_SLAVE | 2110 | - define slave for bus 2 with CONFIG_SYS_MXC_I2C2_SLAVE |
2111 | - define speed for bus 3 with CONFIG_SYS_MXC_I2C3_SPEED | 2111 | - define speed for bus 3 with CONFIG_SYS_MXC_I2C3_SPEED |
2112 | - define slave for bus 3 with CONFIG_SYS_MXC_I2C3_SLAVE | 2112 | - define slave for bus 3 with CONFIG_SYS_MXC_I2C3_SLAVE |
2113 | If thoses defines are not set, default value is 100000 | 2113 | If thoses defines are not set, default value is 100000 |
2114 | for speed, and 0 for slave. | 2114 | for speed, and 0 for slave. |
2115 | 2115 | ||
2116 | - drivers/i2c/rcar_i2c.c: | 2116 | - drivers/i2c/rcar_i2c.c: |
2117 | - activate this driver with CONFIG_SYS_I2C_RCAR | 2117 | - activate this driver with CONFIG_SYS_I2C_RCAR |
2118 | - This driver adds 4 i2c buses | 2118 | - This driver adds 4 i2c buses |
2119 | 2119 | ||
2120 | - CONFIG_SYS_RCAR_I2C0_BASE for setting the register channel 0 | 2120 | - CONFIG_SYS_RCAR_I2C0_BASE for setting the register channel 0 |
2121 | - CONFIG_SYS_RCAR_I2C0_SPEED for for the speed channel 0 | 2121 | - CONFIG_SYS_RCAR_I2C0_SPEED for for the speed channel 0 |
2122 | - CONFIG_SYS_RCAR_I2C1_BASE for setting the register channel 1 | 2122 | - CONFIG_SYS_RCAR_I2C1_BASE for setting the register channel 1 |
2123 | - CONFIG_SYS_RCAR_I2C1_SPEED for for the speed channel 1 | 2123 | - CONFIG_SYS_RCAR_I2C1_SPEED for for the speed channel 1 |
2124 | - CONFIG_SYS_RCAR_I2C2_BASE for setting the register channel 2 | 2124 | - CONFIG_SYS_RCAR_I2C2_BASE for setting the register channel 2 |
2125 | - CONFIG_SYS_RCAR_I2C2_SPEED for for the speed channel 2 | 2125 | - CONFIG_SYS_RCAR_I2C2_SPEED for for the speed channel 2 |
2126 | - CONFIG_SYS_RCAR_I2C3_BASE for setting the register channel 3 | 2126 | - CONFIG_SYS_RCAR_I2C3_BASE for setting the register channel 3 |
2127 | - CONFIG_SYS_RCAR_I2C3_SPEED for for the speed channel 3 | 2127 | - CONFIG_SYS_RCAR_I2C3_SPEED for for the speed channel 3 |
2128 | - CONFIF_SYS_RCAR_I2C_NUM_CONTROLLERS for number of i2c buses | 2128 | - CONFIF_SYS_RCAR_I2C_NUM_CONTROLLERS for number of i2c buses |
2129 | 2129 | ||
2130 | - drivers/i2c/sh_i2c.c: | 2130 | - drivers/i2c/sh_i2c.c: |
2131 | - activate this driver with CONFIG_SYS_I2C_SH | 2131 | - activate this driver with CONFIG_SYS_I2C_SH |
2132 | - This driver adds from 2 to 5 i2c buses | 2132 | - This driver adds from 2 to 5 i2c buses |
2133 | 2133 | ||
2134 | - CONFIG_SYS_I2C_SH_BASE0 for setting the register channel 0 | 2134 | - CONFIG_SYS_I2C_SH_BASE0 for setting the register channel 0 |
2135 | - CONFIG_SYS_I2C_SH_SPEED0 for for the speed channel 0 | 2135 | - CONFIG_SYS_I2C_SH_SPEED0 for for the speed channel 0 |
2136 | - CONFIG_SYS_I2C_SH_BASE1 for setting the register channel 1 | 2136 | - CONFIG_SYS_I2C_SH_BASE1 for setting the register channel 1 |
2137 | - CONFIG_SYS_I2C_SH_SPEED1 for for the speed channel 1 | 2137 | - CONFIG_SYS_I2C_SH_SPEED1 for for the speed channel 1 |
2138 | - CONFIG_SYS_I2C_SH_BASE2 for setting the register channel 2 | 2138 | - CONFIG_SYS_I2C_SH_BASE2 for setting the register channel 2 |
2139 | - CONFIG_SYS_I2C_SH_SPEED2 for for the speed channel 2 | 2139 | - CONFIG_SYS_I2C_SH_SPEED2 for for the speed channel 2 |
2140 | - CONFIG_SYS_I2C_SH_BASE3 for setting the register channel 3 | 2140 | - CONFIG_SYS_I2C_SH_BASE3 for setting the register channel 3 |
2141 | - CONFIG_SYS_I2C_SH_SPEED3 for for the speed channel 3 | 2141 | - CONFIG_SYS_I2C_SH_SPEED3 for for the speed channel 3 |
2142 | - CONFIG_SYS_I2C_SH_BASE4 for setting the register channel 4 | 2142 | - CONFIG_SYS_I2C_SH_BASE4 for setting the register channel 4 |
2143 | - CONFIG_SYS_I2C_SH_SPEED4 for for the speed channel 4 | 2143 | - CONFIG_SYS_I2C_SH_SPEED4 for for the speed channel 4 |
2144 | - CONFIG_SYS_I2C_SH_BASE5 for setting the register channel 5 | 2144 | - CONFIG_SYS_I2C_SH_BASE5 for setting the register channel 5 |
2145 | - CONFIG_SYS_I2C_SH_SPEED5 for for the speed channel 5 | 2145 | - CONFIG_SYS_I2C_SH_SPEED5 for for the speed channel 5 |
2146 | - CONFIF_SYS_I2C_SH_NUM_CONTROLLERS for nummber of i2c buses | 2146 | - CONFIF_SYS_I2C_SH_NUM_CONTROLLERS for nummber of i2c buses |
2147 | 2147 | ||
2148 | - drivers/i2c/omap24xx_i2c.c | 2148 | - drivers/i2c/omap24xx_i2c.c |
2149 | - activate this driver with CONFIG_SYS_I2C_OMAP24XX | 2149 | - activate this driver with CONFIG_SYS_I2C_OMAP24XX |
2150 | - CONFIG_SYS_OMAP24_I2C_SPEED speed channel 0 | 2150 | - CONFIG_SYS_OMAP24_I2C_SPEED speed channel 0 |
2151 | - CONFIG_SYS_OMAP24_I2C_SLAVE slave addr channel 0 | 2151 | - CONFIG_SYS_OMAP24_I2C_SLAVE slave addr channel 0 |
2152 | - CONFIG_SYS_OMAP24_I2C_SPEED1 speed channel 1 | 2152 | - CONFIG_SYS_OMAP24_I2C_SPEED1 speed channel 1 |
2153 | - CONFIG_SYS_OMAP24_I2C_SLAVE1 slave addr channel 1 | 2153 | - CONFIG_SYS_OMAP24_I2C_SLAVE1 slave addr channel 1 |
2154 | - CONFIG_SYS_OMAP24_I2C_SPEED2 speed channel 2 | 2154 | - CONFIG_SYS_OMAP24_I2C_SPEED2 speed channel 2 |
2155 | - CONFIG_SYS_OMAP24_I2C_SLAVE2 slave addr channel 2 | 2155 | - CONFIG_SYS_OMAP24_I2C_SLAVE2 slave addr channel 2 |
2156 | - CONFIG_SYS_OMAP24_I2C_SPEED3 speed channel 3 | 2156 | - CONFIG_SYS_OMAP24_I2C_SPEED3 speed channel 3 |
2157 | - CONFIG_SYS_OMAP24_I2C_SLAVE3 slave addr channel 3 | 2157 | - CONFIG_SYS_OMAP24_I2C_SLAVE3 slave addr channel 3 |
2158 | - CONFIG_SYS_OMAP24_I2C_SPEED4 speed channel 4 | 2158 | - CONFIG_SYS_OMAP24_I2C_SPEED4 speed channel 4 |
2159 | - CONFIG_SYS_OMAP24_I2C_SLAVE4 slave addr channel 4 | 2159 | - CONFIG_SYS_OMAP24_I2C_SLAVE4 slave addr channel 4 |
2160 | 2160 | ||
2161 | - drivers/i2c/zynq_i2c.c | 2161 | - drivers/i2c/zynq_i2c.c |
2162 | - activate this driver with CONFIG_SYS_I2C_ZYNQ | 2162 | - activate this driver with CONFIG_SYS_I2C_ZYNQ |
2163 | - set CONFIG_SYS_I2C_ZYNQ_SPEED for speed setting | 2163 | - set CONFIG_SYS_I2C_ZYNQ_SPEED for speed setting |
2164 | - set CONFIG_SYS_I2C_ZYNQ_SLAVE for slave addr | 2164 | - set CONFIG_SYS_I2C_ZYNQ_SLAVE for slave addr |
2165 | 2165 | ||
2166 | - drivers/i2c/s3c24x0_i2c.c: | 2166 | - drivers/i2c/s3c24x0_i2c.c: |
2167 | - activate this driver with CONFIG_SYS_I2C_S3C24X0 | 2167 | - activate this driver with CONFIG_SYS_I2C_S3C24X0 |
2168 | - This driver adds i2c buses (11 for Exynos5250, Exynos5420 | 2168 | - This driver adds i2c buses (11 for Exynos5250, Exynos5420 |
2169 | 9 i2c buses for Exynos4 and 1 for S3C24X0 SoCs from Samsung) | 2169 | 9 i2c buses for Exynos4 and 1 for S3C24X0 SoCs from Samsung) |
2170 | with a fix speed from 100000 and the slave addr 0! | 2170 | with a fix speed from 100000 and the slave addr 0! |
2171 | 2171 | ||
2172 | additional defines: | 2172 | additional defines: |
2173 | 2173 | ||
2174 | CONFIG_SYS_NUM_I2C_BUSES | 2174 | CONFIG_SYS_NUM_I2C_BUSES |
2175 | Hold the number of i2c busses you want to use. If you | 2175 | Hold the number of i2c busses you want to use. If you |
2176 | don't use/have i2c muxes on your i2c bus, this | 2176 | don't use/have i2c muxes on your i2c bus, this |
2177 | is equal to CONFIG_SYS_NUM_I2C_ADAPTERS, and you can | 2177 | is equal to CONFIG_SYS_NUM_I2C_ADAPTERS, and you can |
2178 | omit this define. | 2178 | omit this define. |
2179 | 2179 | ||
2180 | CONFIG_SYS_I2C_DIRECT_BUS | 2180 | CONFIG_SYS_I2C_DIRECT_BUS |
2181 | define this, if you don't use i2c muxes on your hardware. | 2181 | define this, if you don't use i2c muxes on your hardware. |
2182 | if CONFIG_SYS_I2C_MAX_HOPS is not defined or == 0 you can | 2182 | if CONFIG_SYS_I2C_MAX_HOPS is not defined or == 0 you can |
2183 | omit this define. | 2183 | omit this define. |
2184 | 2184 | ||
2185 | CONFIG_SYS_I2C_MAX_HOPS | 2185 | CONFIG_SYS_I2C_MAX_HOPS |
2186 | define how many muxes are maximal consecutively connected | 2186 | define how many muxes are maximal consecutively connected |
2187 | on one i2c bus. If you not use i2c muxes, omit this | 2187 | on one i2c bus. If you not use i2c muxes, omit this |
2188 | define. | 2188 | define. |
2189 | 2189 | ||
2190 | CONFIG_SYS_I2C_BUSES | 2190 | CONFIG_SYS_I2C_BUSES |
2191 | hold a list of busses you want to use, only used if | 2191 | hold a list of busses you want to use, only used if |
2192 | CONFIG_SYS_I2C_DIRECT_BUS is not defined, for example | 2192 | CONFIG_SYS_I2C_DIRECT_BUS is not defined, for example |
2193 | a board with CONFIG_SYS_I2C_MAX_HOPS = 1 and | 2193 | a board with CONFIG_SYS_I2C_MAX_HOPS = 1 and |
2194 | CONFIG_SYS_NUM_I2C_BUSES = 9: | 2194 | CONFIG_SYS_NUM_I2C_BUSES = 9: |
2195 | 2195 | ||
2196 | CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP}}, \ | 2196 | CONFIG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP}}, \ |
2197 | {0, {{I2C_MUX_PCA9547, 0x70, 1}}}, \ | 2197 | {0, {{I2C_MUX_PCA9547, 0x70, 1}}}, \ |
2198 | {0, {{I2C_MUX_PCA9547, 0x70, 2}}}, \ | 2198 | {0, {{I2C_MUX_PCA9547, 0x70, 2}}}, \ |
2199 | {0, {{I2C_MUX_PCA9547, 0x70, 3}}}, \ | 2199 | {0, {{I2C_MUX_PCA9547, 0x70, 3}}}, \ |
2200 | {0, {{I2C_MUX_PCA9547, 0x70, 4}}}, \ | 2200 | {0, {{I2C_MUX_PCA9547, 0x70, 4}}}, \ |
2201 | {0, {{I2C_MUX_PCA9547, 0x70, 5}}}, \ | 2201 | {0, {{I2C_MUX_PCA9547, 0x70, 5}}}, \ |
2202 | {1, {I2C_NULL_HOP}}, \ | 2202 | {1, {I2C_NULL_HOP}}, \ |
2203 | {1, {{I2C_MUX_PCA9544, 0x72, 1}}}, \ | 2203 | {1, {{I2C_MUX_PCA9544, 0x72, 1}}}, \ |
2204 | {1, {{I2C_MUX_PCA9544, 0x72, 2}}}, \ | 2204 | {1, {{I2C_MUX_PCA9544, 0x72, 2}}}, \ |
2205 | } | 2205 | } |
2206 | 2206 | ||
2207 | which defines | 2207 | which defines |
2208 | bus 0 on adapter 0 without a mux | 2208 | bus 0 on adapter 0 without a mux |
2209 | bus 1 on adapter 0 with a PCA9547 on address 0x70 port 1 | 2209 | bus 1 on adapter 0 with a PCA9547 on address 0x70 port 1 |
2210 | bus 2 on adapter 0 with a PCA9547 on address 0x70 port 2 | 2210 | bus 2 on adapter 0 with a PCA9547 on address 0x70 port 2 |
2211 | bus 3 on adapter 0 with a PCA9547 on address 0x70 port 3 | 2211 | bus 3 on adapter 0 with a PCA9547 on address 0x70 port 3 |
2212 | bus 4 on adapter 0 with a PCA9547 on address 0x70 port 4 | 2212 | bus 4 on adapter 0 with a PCA9547 on address 0x70 port 4 |
2213 | bus 5 on adapter 0 with a PCA9547 on address 0x70 port 5 | 2213 | bus 5 on adapter 0 with a PCA9547 on address 0x70 port 5 |
2214 | bus 6 on adapter 1 without a mux | 2214 | bus 6 on adapter 1 without a mux |
2215 | bus 7 on adapter 1 with a PCA9544 on address 0x72 port 1 | 2215 | bus 7 on adapter 1 with a PCA9544 on address 0x72 port 1 |
2216 | bus 8 on adapter 1 with a PCA9544 on address 0x72 port 2 | 2216 | bus 8 on adapter 1 with a PCA9544 on address 0x72 port 2 |
2217 | 2217 | ||
2218 | If you do not have i2c muxes on your board, omit this define. | 2218 | If you do not have i2c muxes on your board, omit this define. |
2219 | 2219 | ||
2220 | - Legacy I2C Support: CONFIG_HARD_I2C | 2220 | - Legacy I2C Support: CONFIG_HARD_I2C |
2221 | 2221 | ||
2222 | NOTE: It is intended to move drivers to CONFIG_SYS_I2C which | 2222 | NOTE: It is intended to move drivers to CONFIG_SYS_I2C which |
2223 | provides the following compelling advantages: | 2223 | provides the following compelling advantages: |
2224 | 2224 | ||
2225 | - more than one i2c adapter is usable | 2225 | - more than one i2c adapter is usable |
2226 | - approved multibus support | 2226 | - approved multibus support |
2227 | - better i2c mux support | 2227 | - better i2c mux support |
2228 | 2228 | ||
2229 | ** Please consider updating your I2C driver now. ** | 2229 | ** Please consider updating your I2C driver now. ** |
2230 | 2230 | ||
2231 | These enable legacy I2C serial bus commands. Defining | 2231 | These enable legacy I2C serial bus commands. Defining |
2232 | CONFIG_HARD_I2C will include the appropriate I2C driver | 2232 | CONFIG_HARD_I2C will include the appropriate I2C driver |
2233 | for the selected CPU. | 2233 | for the selected CPU. |
2234 | 2234 | ||
2235 | This will allow you to use i2c commands at the u-boot | 2235 | This will allow you to use i2c commands at the u-boot |
2236 | command line (as long as you set CONFIG_CMD_I2C in | 2236 | command line (as long as you set CONFIG_CMD_I2C in |
2237 | CONFIG_COMMANDS) and communicate with i2c based realtime | 2237 | CONFIG_COMMANDS) and communicate with i2c based realtime |
2238 | clock chips. See common/cmd_i2c.c for a description of the | 2238 | clock chips. See common/cmd_i2c.c for a description of the |
2239 | command line interface. | 2239 | command line interface. |
2240 | 2240 | ||
2241 | CONFIG_HARD_I2C selects a hardware I2C controller. | 2241 | CONFIG_HARD_I2C selects a hardware I2C controller. |
2242 | 2242 | ||
2243 | There are several other quantities that must also be | 2243 | There are several other quantities that must also be |
2244 | defined when you define CONFIG_HARD_I2C. | 2244 | defined when you define CONFIG_HARD_I2C. |
2245 | 2245 | ||
2246 | In both cases you will need to define CONFIG_SYS_I2C_SPEED | 2246 | In both cases you will need to define CONFIG_SYS_I2C_SPEED |
2247 | to be the frequency (in Hz) at which you wish your i2c bus | 2247 | to be the frequency (in Hz) at which you wish your i2c bus |
2248 | to run and CONFIG_SYS_I2C_SLAVE to be the address of this node (ie | 2248 | to run and CONFIG_SYS_I2C_SLAVE to be the address of this node (ie |
2249 | the CPU's i2c node address). | 2249 | the CPU's i2c node address). |
2250 | 2250 | ||
2251 | Now, the u-boot i2c code for the mpc8xx | 2251 | Now, the u-boot i2c code for the mpc8xx |
2252 | (arch/powerpc/cpu/mpc8xx/i2c.c) sets the CPU up as a master node | 2252 | (arch/powerpc/cpu/mpc8xx/i2c.c) sets the CPU up as a master node |
2253 | and so its address should therefore be cleared to 0 (See, | 2253 | and so its address should therefore be cleared to 0 (See, |
2254 | eg, MPC823e User's Manual p.16-473). So, set | 2254 | eg, MPC823e User's Manual p.16-473). So, set |
2255 | CONFIG_SYS_I2C_SLAVE to 0. | 2255 | CONFIG_SYS_I2C_SLAVE to 0. |
2256 | 2256 | ||
2257 | CONFIG_SYS_I2C_INIT_MPC5XXX | 2257 | CONFIG_SYS_I2C_INIT_MPC5XXX |
2258 | 2258 | ||
2259 | When a board is reset during an i2c bus transfer | 2259 | When a board is reset during an i2c bus transfer |
2260 | chips might think that the current transfer is still | 2260 | chips might think that the current transfer is still |
2261 | in progress. Reset the slave devices by sending start | 2261 | in progress. Reset the slave devices by sending start |
2262 | commands until the slave device responds. | 2262 | commands until the slave device responds. |
2263 | 2263 | ||
2264 | That's all that's required for CONFIG_HARD_I2C. | 2264 | That's all that's required for CONFIG_HARD_I2C. |
2265 | 2265 | ||
2266 | If you use the software i2c interface (CONFIG_SYS_I2C_SOFT) | 2266 | If you use the software i2c interface (CONFIG_SYS_I2C_SOFT) |
2267 | then the following macros need to be defined (examples are | 2267 | then the following macros need to be defined (examples are |
2268 | from include/configs/lwmon.h): | 2268 | from include/configs/lwmon.h): |
2269 | 2269 | ||
2270 | I2C_INIT | 2270 | I2C_INIT |
2271 | 2271 | ||
2272 | (Optional). Any commands necessary to enable the I2C | 2272 | (Optional). Any commands necessary to enable the I2C |
2273 | controller or configure ports. | 2273 | controller or configure ports. |
2274 | 2274 | ||
2275 | eg: #define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL) | 2275 | eg: #define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL) |
2276 | 2276 | ||
2277 | I2C_PORT | 2277 | I2C_PORT |
2278 | 2278 | ||
2279 | (Only for MPC8260 CPU). The I/O port to use (the code | 2279 | (Only for MPC8260 CPU). The I/O port to use (the code |
2280 | assumes both bits are on the same port). Valid values | 2280 | assumes both bits are on the same port). Valid values |
2281 | are 0..3 for ports A..D. | 2281 | are 0..3 for ports A..D. |
2282 | 2282 | ||
2283 | I2C_ACTIVE | 2283 | I2C_ACTIVE |
2284 | 2284 | ||
2285 | The code necessary to make the I2C data line active | 2285 | The code necessary to make the I2C data line active |
2286 | (driven). If the data line is open collector, this | 2286 | (driven). If the data line is open collector, this |
2287 | define can be null. | 2287 | define can be null. |
2288 | 2288 | ||
2289 | eg: #define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA) | 2289 | eg: #define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA) |
2290 | 2290 | ||
2291 | I2C_TRISTATE | 2291 | I2C_TRISTATE |
2292 | 2292 | ||
2293 | The code necessary to make the I2C data line tri-stated | 2293 | The code necessary to make the I2C data line tri-stated |
2294 | (inactive). If the data line is open collector, this | 2294 | (inactive). If the data line is open collector, this |
2295 | define can be null. | 2295 | define can be null. |
2296 | 2296 | ||
2297 | eg: #define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA) | 2297 | eg: #define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA) |
2298 | 2298 | ||
2299 | I2C_READ | 2299 | I2C_READ |
2300 | 2300 | ||
2301 | Code that returns true if the I2C data line is high, | 2301 | Code that returns true if the I2C data line is high, |
2302 | false if it is low. | 2302 | false if it is low. |
2303 | 2303 | ||
2304 | eg: #define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0) | 2304 | eg: #define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0) |
2305 | 2305 | ||
2306 | I2C_SDA(bit) | 2306 | I2C_SDA(bit) |
2307 | 2307 | ||
2308 | If <bit> is true, sets the I2C data line high. If it | 2308 | If <bit> is true, sets the I2C data line high. If it |
2309 | is false, it clears it (low). | 2309 | is false, it clears it (low). |
2310 | 2310 | ||
2311 | eg: #define I2C_SDA(bit) \ | 2311 | eg: #define I2C_SDA(bit) \ |
2312 | if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \ | 2312 | if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \ |
2313 | else immr->im_cpm.cp_pbdat &= ~PB_SDA | 2313 | else immr->im_cpm.cp_pbdat &= ~PB_SDA |
2314 | 2314 | ||
2315 | I2C_SCL(bit) | 2315 | I2C_SCL(bit) |
2316 | 2316 | ||
2317 | If <bit> is true, sets the I2C clock line high. If it | 2317 | If <bit> is true, sets the I2C clock line high. If it |
2318 | is false, it clears it (low). | 2318 | is false, it clears it (low). |
2319 | 2319 | ||
2320 | eg: #define I2C_SCL(bit) \ | 2320 | eg: #define I2C_SCL(bit) \ |
2321 | if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ | 2321 | if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ |
2322 | else immr->im_cpm.cp_pbdat &= ~PB_SCL | 2322 | else immr->im_cpm.cp_pbdat &= ~PB_SCL |
2323 | 2323 | ||
2324 | I2C_DELAY | 2324 | I2C_DELAY |
2325 | 2325 | ||
2326 | This delay is invoked four times per clock cycle so this | 2326 | This delay is invoked four times per clock cycle so this |
2327 | controls the rate of data transfer. The data rate thus | 2327 | controls the rate of data transfer. The data rate thus |
2328 | is 1 / (I2C_DELAY * 4). Often defined to be something | 2328 | is 1 / (I2C_DELAY * 4). Often defined to be something |
2329 | like: | 2329 | like: |
2330 | 2330 | ||
2331 | #define I2C_DELAY udelay(2) | 2331 | #define I2C_DELAY udelay(2) |
2332 | 2332 | ||
2333 | CONFIG_SOFT_I2C_GPIO_SCL / CONFIG_SOFT_I2C_GPIO_SDA | 2333 | CONFIG_SOFT_I2C_GPIO_SCL / CONFIG_SOFT_I2C_GPIO_SDA |
2334 | 2334 | ||
2335 | If your arch supports the generic GPIO framework (asm/gpio.h), | 2335 | If your arch supports the generic GPIO framework (asm/gpio.h), |
2336 | then you may alternatively define the two GPIOs that are to be | 2336 | then you may alternatively define the two GPIOs that are to be |
2337 | used as SCL / SDA. Any of the previous I2C_xxx macros will | 2337 | used as SCL / SDA. Any of the previous I2C_xxx macros will |
2338 | have GPIO-based defaults assigned to them as appropriate. | 2338 | have GPIO-based defaults assigned to them as appropriate. |
2339 | 2339 | ||
2340 | You should define these to the GPIO value as given directly to | 2340 | You should define these to the GPIO value as given directly to |
2341 | the generic GPIO functions. | 2341 | the generic GPIO functions. |
2342 | 2342 | ||
2343 | CONFIG_SYS_I2C_INIT_BOARD | 2343 | CONFIG_SYS_I2C_INIT_BOARD |
2344 | 2344 | ||
2345 | When a board is reset during an i2c bus transfer | 2345 | When a board is reset during an i2c bus transfer |
2346 | chips might think that the current transfer is still | 2346 | chips might think that the current transfer is still |
2347 | in progress. On some boards it is possible to access | 2347 | in progress. On some boards it is possible to access |
2348 | the i2c SCLK line directly, either by using the | 2348 | the i2c SCLK line directly, either by using the |
2349 | processor pin as a GPIO or by having a second pin | 2349 | processor pin as a GPIO or by having a second pin |
2350 | connected to the bus. If this option is defined a | 2350 | connected to the bus. If this option is defined a |
2351 | custom i2c_init_board() routine in boards/xxx/board.c | 2351 | custom i2c_init_board() routine in boards/xxx/board.c |
2352 | is run early in the boot sequence. | 2352 | is run early in the boot sequence. |
2353 | 2353 | ||
2354 | CONFIG_SYS_I2C_BOARD_LATE_INIT | 2354 | CONFIG_SYS_I2C_BOARD_LATE_INIT |
2355 | 2355 | ||
2356 | An alternative to CONFIG_SYS_I2C_INIT_BOARD. If this option is | 2356 | An alternative to CONFIG_SYS_I2C_INIT_BOARD. If this option is |
2357 | defined a custom i2c_board_late_init() routine in | 2357 | defined a custom i2c_board_late_init() routine in |
2358 | boards/xxx/board.c is run AFTER the operations in i2c_init() | 2358 | boards/xxx/board.c is run AFTER the operations in i2c_init() |
2359 | is completed. This callpoint can be used to unreset i2c bus | 2359 | is completed. This callpoint can be used to unreset i2c bus |
2360 | using CPU i2c controller register accesses for CPUs whose i2c | 2360 | using CPU i2c controller register accesses for CPUs whose i2c |
2361 | controller provide such a method. It is called at the end of | 2361 | controller provide such a method. It is called at the end of |
2362 | i2c_init() to allow i2c_init operations to setup the i2c bus | 2362 | i2c_init() to allow i2c_init operations to setup the i2c bus |
2363 | controller on the CPU (e.g. setting bus speed & slave address). | 2363 | controller on the CPU (e.g. setting bus speed & slave address). |
2364 | 2364 | ||
2365 | CONFIG_I2CFAST (PPC405GP|PPC405EP only) | 2365 | CONFIG_I2CFAST (PPC405GP|PPC405EP only) |
2366 | 2366 | ||
2367 | This option enables configuration of bi_iic_fast[] flags | 2367 | This option enables configuration of bi_iic_fast[] flags |
2368 | in u-boot bd_info structure based on u-boot environment | 2368 | in u-boot bd_info structure based on u-boot environment |
2369 | variable "i2cfast". (see also i2cfast) | 2369 | variable "i2cfast". (see also i2cfast) |
2370 | 2370 | ||
2371 | CONFIG_I2C_MULTI_BUS | 2371 | CONFIG_I2C_MULTI_BUS |
2372 | 2372 | ||
2373 | This option allows the use of multiple I2C buses, each of which | 2373 | This option allows the use of multiple I2C buses, each of which |
2374 | must have a controller. At any point in time, only one bus is | 2374 | must have a controller. At any point in time, only one bus is |
2375 | active. To switch to a different bus, use the 'i2c dev' command. | 2375 | active. To switch to a different bus, use the 'i2c dev' command. |
2376 | Note that bus numbering is zero-based. | 2376 | Note that bus numbering is zero-based. |
2377 | 2377 | ||
2378 | CONFIG_SYS_I2C_NOPROBES | 2378 | CONFIG_SYS_I2C_NOPROBES |
2379 | 2379 | ||
2380 | This option specifies a list of I2C devices that will be skipped | 2380 | This option specifies a list of I2C devices that will be skipped |
2381 | when the 'i2c probe' command is issued. If CONFIG_I2C_MULTI_BUS | 2381 | when the 'i2c probe' command is issued. If CONFIG_I2C_MULTI_BUS |
2382 | is set, specify a list of bus-device pairs. Otherwise, specify | 2382 | is set, specify a list of bus-device pairs. Otherwise, specify |
2383 | a 1D array of device addresses | 2383 | a 1D array of device addresses |
2384 | 2384 | ||
2385 | e.g. | 2385 | e.g. |
2386 | #undef CONFIG_I2C_MULTI_BUS | 2386 | #undef CONFIG_I2C_MULTI_BUS |
2387 | #define CONFIG_SYS_I2C_NOPROBES {0x50,0x68} | 2387 | #define CONFIG_SYS_I2C_NOPROBES {0x50,0x68} |
2388 | 2388 | ||
2389 | will skip addresses 0x50 and 0x68 on a board with one I2C bus | 2389 | will skip addresses 0x50 and 0x68 on a board with one I2C bus |
2390 | 2390 | ||
2391 | #define CONFIG_I2C_MULTI_BUS | 2391 | #define CONFIG_I2C_MULTI_BUS |
2392 | #define CONFIG_SYS_I2C_MULTI_NOPROBES {{0,0x50},{0,0x68},{1,0x54}} | 2392 | #define CONFIG_SYS_I2C_MULTI_NOPROBES {{0,0x50},{0,0x68},{1,0x54}} |
2393 | 2393 | ||
2394 | will skip addresses 0x50 and 0x68 on bus 0 and address 0x54 on bus 1 | 2394 | will skip addresses 0x50 and 0x68 on bus 0 and address 0x54 on bus 1 |
2395 | 2395 | ||
2396 | CONFIG_SYS_SPD_BUS_NUM | 2396 | CONFIG_SYS_SPD_BUS_NUM |
2397 | 2397 | ||
2398 | If defined, then this indicates the I2C bus number for DDR SPD. | 2398 | If defined, then this indicates the I2C bus number for DDR SPD. |
2399 | If not defined, then U-Boot assumes that SPD is on I2C bus 0. | 2399 | If not defined, then U-Boot assumes that SPD is on I2C bus 0. |
2400 | 2400 | ||
2401 | CONFIG_SYS_RTC_BUS_NUM | 2401 | CONFIG_SYS_RTC_BUS_NUM |
2402 | 2402 | ||
2403 | If defined, then this indicates the I2C bus number for the RTC. | 2403 | If defined, then this indicates the I2C bus number for the RTC. |
2404 | If not defined, then U-Boot assumes that RTC is on I2C bus 0. | 2404 | If not defined, then U-Boot assumes that RTC is on I2C bus 0. |
2405 | 2405 | ||
2406 | CONFIG_SYS_DTT_BUS_NUM | 2406 | CONFIG_SYS_DTT_BUS_NUM |
2407 | 2407 | ||
2408 | If defined, then this indicates the I2C bus number for the DTT. | 2408 | If defined, then this indicates the I2C bus number for the DTT. |
2409 | If not defined, then U-Boot assumes that DTT is on I2C bus 0. | 2409 | If not defined, then U-Boot assumes that DTT is on I2C bus 0. |
2410 | 2410 | ||
2411 | CONFIG_SYS_I2C_DTT_ADDR: | 2411 | CONFIG_SYS_I2C_DTT_ADDR: |
2412 | 2412 | ||
2413 | If defined, specifies the I2C address of the DTT device. | 2413 | If defined, specifies the I2C address of the DTT device. |
2414 | If not defined, then U-Boot uses predefined value for | 2414 | If not defined, then U-Boot uses predefined value for |
2415 | specified DTT device. | 2415 | specified DTT device. |
2416 | 2416 | ||
2417 | CONFIG_SOFT_I2C_READ_REPEATED_START | 2417 | CONFIG_SOFT_I2C_READ_REPEATED_START |
2418 | 2418 | ||
2419 | defining this will force the i2c_read() function in | 2419 | defining this will force the i2c_read() function in |
2420 | the soft_i2c driver to perform an I2C repeated start | 2420 | the soft_i2c driver to perform an I2C repeated start |
2421 | between writing the address pointer and reading the | 2421 | between writing the address pointer and reading the |
2422 | data. If this define is omitted the default behaviour | 2422 | data. If this define is omitted the default behaviour |
2423 | of doing a stop-start sequence will be used. Most I2C | 2423 | of doing a stop-start sequence will be used. Most I2C |
2424 | devices can use either method, but some require one or | 2424 | devices can use either method, but some require one or |
2425 | the other. | 2425 | the other. |
2426 | 2426 | ||
2427 | - SPI Support: CONFIG_SPI | 2427 | - SPI Support: CONFIG_SPI |
2428 | 2428 | ||
2429 | Enables SPI driver (so far only tested with | 2429 | Enables SPI driver (so far only tested with |
2430 | SPI EEPROM, also an instance works with Crystal A/D and | 2430 | SPI EEPROM, also an instance works with Crystal A/D and |
2431 | D/As on the SACSng board) | 2431 | D/As on the SACSng board) |
2432 | 2432 | ||
2433 | CONFIG_SH_SPI | 2433 | CONFIG_SH_SPI |
2434 | 2434 | ||
2435 | Enables the driver for SPI controller on SuperH. Currently | 2435 | Enables the driver for SPI controller on SuperH. Currently |
2436 | only SH7757 is supported. | 2436 | only SH7757 is supported. |
2437 | 2437 | ||
2438 | CONFIG_SPI_X | 2438 | CONFIG_SPI_X |
2439 | 2439 | ||
2440 | Enables extended (16-bit) SPI EEPROM addressing. | 2440 | Enables extended (16-bit) SPI EEPROM addressing. |
2441 | (symmetrical to CONFIG_I2C_X) | 2441 | (symmetrical to CONFIG_I2C_X) |
2442 | 2442 | ||
2443 | CONFIG_SOFT_SPI | 2443 | CONFIG_SOFT_SPI |
2444 | 2444 | ||
2445 | Enables a software (bit-bang) SPI driver rather than | 2445 | Enables a software (bit-bang) SPI driver rather than |
2446 | using hardware support. This is a general purpose | 2446 | using hardware support. This is a general purpose |
2447 | driver that only requires three general I/O port pins | 2447 | driver that only requires three general I/O port pins |
2448 | (two outputs, one input) to function. If this is | 2448 | (two outputs, one input) to function. If this is |
2449 | defined, the board configuration must define several | 2449 | defined, the board configuration must define several |
2450 | SPI configuration items (port pins to use, etc). For | 2450 | SPI configuration items (port pins to use, etc). For |
2451 | an example, see include/configs/sacsng.h. | 2451 | an example, see include/configs/sacsng.h. |
2452 | 2452 | ||
2453 | CONFIG_HARD_SPI | 2453 | CONFIG_HARD_SPI |
2454 | 2454 | ||
2455 | Enables a hardware SPI driver for general-purpose reads | 2455 | Enables a hardware SPI driver for general-purpose reads |
2456 | and writes. As with CONFIG_SOFT_SPI, the board configuration | 2456 | and writes. As with CONFIG_SOFT_SPI, the board configuration |
2457 | must define a list of chip-select function pointers. | 2457 | must define a list of chip-select function pointers. |
2458 | Currently supported on some MPC8xxx processors. For an | 2458 | Currently supported on some MPC8xxx processors. For an |
2459 | example, see include/configs/mpc8349emds.h. | 2459 | example, see include/configs/mpc8349emds.h. |
2460 | 2460 | ||
2461 | CONFIG_MXC_SPI | 2461 | CONFIG_MXC_SPI |
2462 | 2462 | ||
2463 | Enables the driver for the SPI controllers on i.MX and MXC | 2463 | Enables the driver for the SPI controllers on i.MX and MXC |
2464 | SoCs. Currently i.MX31/35/51 are supported. | 2464 | SoCs. Currently i.MX31/35/51 are supported. |
2465 | 2465 | ||
2466 | - FPGA Support: CONFIG_FPGA | 2466 | - FPGA Support: CONFIG_FPGA |
2467 | 2467 | ||
2468 | Enables FPGA subsystem. | 2468 | Enables FPGA subsystem. |
2469 | 2469 | ||
2470 | CONFIG_FPGA_<vendor> | 2470 | CONFIG_FPGA_<vendor> |
2471 | 2471 | ||
2472 | Enables support for specific chip vendors. | 2472 | Enables support for specific chip vendors. |
2473 | (ALTERA, XILINX) | 2473 | (ALTERA, XILINX) |
2474 | 2474 | ||
2475 | CONFIG_FPGA_<family> | 2475 | CONFIG_FPGA_<family> |
2476 | 2476 | ||
2477 | Enables support for FPGA family. | 2477 | Enables support for FPGA family. |
2478 | (SPARTAN2, SPARTAN3, VIRTEX2, CYCLONE2, ACEX1K, ACEX) | 2478 | (SPARTAN2, SPARTAN3, VIRTEX2, CYCLONE2, ACEX1K, ACEX) |
2479 | 2479 | ||
2480 | CONFIG_FPGA_COUNT | 2480 | CONFIG_FPGA_COUNT |
2481 | 2481 | ||
2482 | Specify the number of FPGA devices to support. | 2482 | Specify the number of FPGA devices to support. |
2483 | 2483 | ||
2484 | CONFIG_SYS_FPGA_PROG_FEEDBACK | 2484 | CONFIG_SYS_FPGA_PROG_FEEDBACK |
2485 | 2485 | ||
2486 | Enable printing of hash marks during FPGA configuration. | 2486 | Enable printing of hash marks during FPGA configuration. |
2487 | 2487 | ||
2488 | CONFIG_SYS_FPGA_CHECK_BUSY | 2488 | CONFIG_SYS_FPGA_CHECK_BUSY |
2489 | 2489 | ||
2490 | Enable checks on FPGA configuration interface busy | 2490 | Enable checks on FPGA configuration interface busy |
2491 | status by the configuration function. This option | 2491 | status by the configuration function. This option |
2492 | will require a board or device specific function to | 2492 | will require a board or device specific function to |
2493 | be written. | 2493 | be written. |
2494 | 2494 | ||
2495 | CONFIG_FPGA_DELAY | 2495 | CONFIG_FPGA_DELAY |
2496 | 2496 | ||
2497 | If defined, a function that provides delays in the FPGA | 2497 | If defined, a function that provides delays in the FPGA |
2498 | configuration driver. | 2498 | configuration driver. |
2499 | 2499 | ||
2500 | CONFIG_SYS_FPGA_CHECK_CTRLC | 2500 | CONFIG_SYS_FPGA_CHECK_CTRLC |
2501 | Allow Control-C to interrupt FPGA configuration | 2501 | Allow Control-C to interrupt FPGA configuration |
2502 | 2502 | ||
2503 | CONFIG_SYS_FPGA_CHECK_ERROR | 2503 | CONFIG_SYS_FPGA_CHECK_ERROR |
2504 | 2504 | ||
2505 | Check for configuration errors during FPGA bitfile | 2505 | Check for configuration errors during FPGA bitfile |
2506 | loading. For example, abort during Virtex II | 2506 | loading. For example, abort during Virtex II |
2507 | configuration if the INIT_B line goes low (which | 2507 | configuration if the INIT_B line goes low (which |
2508 | indicated a CRC error). | 2508 | indicated a CRC error). |
2509 | 2509 | ||
2510 | CONFIG_SYS_FPGA_WAIT_INIT | 2510 | CONFIG_SYS_FPGA_WAIT_INIT |
2511 | 2511 | ||
2512 | Maximum time to wait for the INIT_B line to deassert | 2512 | Maximum time to wait for the INIT_B line to deassert |
2513 | after PROB_B has been deasserted during a Virtex II | 2513 | after PROB_B has been deasserted during a Virtex II |
2514 | FPGA configuration sequence. The default time is 500 | 2514 | FPGA configuration sequence. The default time is 500 |
2515 | ms. | 2515 | ms. |
2516 | 2516 | ||
2517 | CONFIG_SYS_FPGA_WAIT_BUSY | 2517 | CONFIG_SYS_FPGA_WAIT_BUSY |
2518 | 2518 | ||
2519 | Maximum time to wait for BUSY to deassert during | 2519 | Maximum time to wait for BUSY to deassert during |
2520 | Virtex II FPGA configuration. The default is 5 ms. | 2520 | Virtex II FPGA configuration. The default is 5 ms. |
2521 | 2521 | ||
2522 | CONFIG_SYS_FPGA_WAIT_CONFIG | 2522 | CONFIG_SYS_FPGA_WAIT_CONFIG |
2523 | 2523 | ||
2524 | Time to wait after FPGA configuration. The default is | 2524 | Time to wait after FPGA configuration. The default is |
2525 | 200 ms. | 2525 | 200 ms. |
2526 | 2526 | ||
2527 | - Configuration Management: | 2527 | - Configuration Management: |
2528 | CONFIG_IDENT_STRING | 2528 | CONFIG_IDENT_STRING |
2529 | 2529 | ||
2530 | If defined, this string will be added to the U-Boot | 2530 | If defined, this string will be added to the U-Boot |
2531 | version information (U_BOOT_VERSION) | 2531 | version information (U_BOOT_VERSION) |
2532 | 2532 | ||
2533 | - Vendor Parameter Protection: | 2533 | - Vendor Parameter Protection: |
2534 | 2534 | ||
2535 | U-Boot considers the values of the environment | 2535 | U-Boot considers the values of the environment |
2536 | variables "serial#" (Board Serial Number) and | 2536 | variables "serial#" (Board Serial Number) and |
2537 | "ethaddr" (Ethernet Address) to be parameters that | 2537 | "ethaddr" (Ethernet Address) to be parameters that |
2538 | are set once by the board vendor / manufacturer, and | 2538 | are set once by the board vendor / manufacturer, and |
2539 | protects these variables from casual modification by | 2539 | protects these variables from casual modification by |
2540 | the user. Once set, these variables are read-only, | 2540 | the user. Once set, these variables are read-only, |
2541 | and write or delete attempts are rejected. You can | 2541 | and write or delete attempts are rejected. You can |
2542 | change this behaviour: | 2542 | change this behaviour: |
2543 | 2543 | ||
2544 | If CONFIG_ENV_OVERWRITE is #defined in your config | 2544 | If CONFIG_ENV_OVERWRITE is #defined in your config |
2545 | file, the write protection for vendor parameters is | 2545 | file, the write protection for vendor parameters is |
2546 | completely disabled. Anybody can change or delete | 2546 | completely disabled. Anybody can change or delete |
2547 | these parameters. | 2547 | these parameters. |
2548 | 2548 | ||
2549 | Alternatively, if you #define _both_ CONFIG_ETHADDR | 2549 | Alternatively, if you #define _both_ CONFIG_ETHADDR |
2550 | _and_ CONFIG_OVERWRITE_ETHADDR_ONCE, a default | 2550 | _and_ CONFIG_OVERWRITE_ETHADDR_ONCE, a default |
2551 | Ethernet address is installed in the environment, | 2551 | Ethernet address is installed in the environment, |
2552 | which can be changed exactly ONCE by the user. [The | 2552 | which can be changed exactly ONCE by the user. [The |
2553 | serial# is unaffected by this, i. e. it remains | 2553 | serial# is unaffected by this, i. e. it remains |
2554 | read-only.] | 2554 | read-only.] |
2555 | 2555 | ||
2556 | The same can be accomplished in a more flexible way | 2556 | The same can be accomplished in a more flexible way |
2557 | for any variable by configuring the type of access | 2557 | for any variable by configuring the type of access |
2558 | to allow for those variables in the ".flags" variable | 2558 | to allow for those variables in the ".flags" variable |
2559 | or define CONFIG_ENV_FLAGS_LIST_STATIC. | 2559 | or define CONFIG_ENV_FLAGS_LIST_STATIC. |
2560 | 2560 | ||
2561 | - Protected RAM: | 2561 | - Protected RAM: |
2562 | CONFIG_PRAM | 2562 | CONFIG_PRAM |
2563 | 2563 | ||
2564 | Define this variable to enable the reservation of | 2564 | Define this variable to enable the reservation of |
2565 | "protected RAM", i. e. RAM which is not overwritten | 2565 | "protected RAM", i. e. RAM which is not overwritten |
2566 | by U-Boot. Define CONFIG_PRAM to hold the number of | 2566 | by U-Boot. Define CONFIG_PRAM to hold the number of |
2567 | kB you want to reserve for pRAM. You can overwrite | 2567 | kB you want to reserve for pRAM. You can overwrite |
2568 | this default value by defining an environment | 2568 | this default value by defining an environment |
2569 | variable "pram" to the number of kB you want to | 2569 | variable "pram" to the number of kB you want to |
2570 | reserve. Note that the board info structure will | 2570 | reserve. Note that the board info structure will |
2571 | still show the full amount of RAM. If pRAM is | 2571 | still show the full amount of RAM. If pRAM is |
2572 | reserved, a new environment variable "mem" will | 2572 | reserved, a new environment variable "mem" will |
2573 | automatically be defined to hold the amount of | 2573 | automatically be defined to hold the amount of |
2574 | remaining RAM in a form that can be passed as boot | 2574 | remaining RAM in a form that can be passed as boot |
2575 | argument to Linux, for instance like that: | 2575 | argument to Linux, for instance like that: |
2576 | 2576 | ||
2577 | setenv bootargs ... mem=\${mem} | 2577 | setenv bootargs ... mem=\${mem} |
2578 | saveenv | 2578 | saveenv |
2579 | 2579 | ||
2580 | This way you can tell Linux not to use this memory, | 2580 | This way you can tell Linux not to use this memory, |
2581 | either, which results in a memory region that will | 2581 | either, which results in a memory region that will |
2582 | not be affected by reboots. | 2582 | not be affected by reboots. |
2583 | 2583 | ||
2584 | *WARNING* If your board configuration uses automatic | 2584 | *WARNING* If your board configuration uses automatic |
2585 | detection of the RAM size, you must make sure that | 2585 | detection of the RAM size, you must make sure that |
2586 | this memory test is non-destructive. So far, the | 2586 | this memory test is non-destructive. So far, the |
2587 | following board configurations are known to be | 2587 | following board configurations are known to be |
2588 | "pRAM-clean": | 2588 | "pRAM-clean": |
2589 | 2589 | ||
2590 | IVMS8, IVML24, SPD8xx, TQM8xxL, | 2590 | IVMS8, IVML24, SPD8xx, TQM8xxL, |
2591 | HERMES, IP860, RPXlite, LWMON, | 2591 | HERMES, IP860, RPXlite, LWMON, |
2592 | FLAGADM, TQM8260 | 2592 | FLAGADM, TQM8260 |
2593 | 2593 | ||
2594 | - Access to physical memory region (> 4GB) | 2594 | - Access to physical memory region (> 4GB) |
2595 | Some basic support is provided for operations on memory not | 2595 | Some basic support is provided for operations on memory not |
2596 | normally accessible to U-Boot - e.g. some architectures | 2596 | normally accessible to U-Boot - e.g. some architectures |
2597 | support access to more than 4GB of memory on 32-bit | 2597 | support access to more than 4GB of memory on 32-bit |
2598 | machines using physical address extension or similar. | 2598 | machines using physical address extension or similar. |
2599 | Define CONFIG_PHYSMEM to access this basic support, which | 2599 | Define CONFIG_PHYSMEM to access this basic support, which |
2600 | currently only supports clearing the memory. | 2600 | currently only supports clearing the memory. |
2601 | 2601 | ||
2602 | - Error Recovery: | 2602 | - Error Recovery: |
2603 | CONFIG_PANIC_HANG | 2603 | CONFIG_PANIC_HANG |
2604 | 2604 | ||
2605 | Define this variable to stop the system in case of a | 2605 | Define this variable to stop the system in case of a |
2606 | fatal error, so that you have to reset it manually. | 2606 | fatal error, so that you have to reset it manually. |
2607 | This is probably NOT a good idea for an embedded | 2607 | This is probably NOT a good idea for an embedded |
2608 | system where you want the system to reboot | 2608 | system where you want the system to reboot |
2609 | automatically as fast as possible, but it may be | 2609 | automatically as fast as possible, but it may be |
2610 | useful during development since you can try to debug | 2610 | useful during development since you can try to debug |
2611 | the conditions that lead to the situation. | 2611 | the conditions that lead to the situation. |
2612 | 2612 | ||
2613 | CONFIG_NET_RETRY_COUNT | 2613 | CONFIG_NET_RETRY_COUNT |
2614 | 2614 | ||
2615 | This variable defines the number of retries for | 2615 | This variable defines the number of retries for |
2616 | network operations like ARP, RARP, TFTP, or BOOTP | 2616 | network operations like ARP, RARP, TFTP, or BOOTP |
2617 | before giving up the operation. If not defined, a | 2617 | before giving up the operation. If not defined, a |
2618 | default value of 5 is used. | 2618 | default value of 5 is used. |
2619 | 2619 | ||
2620 | CONFIG_ARP_TIMEOUT | 2620 | CONFIG_ARP_TIMEOUT |
2621 | 2621 | ||
2622 | Timeout waiting for an ARP reply in milliseconds. | 2622 | Timeout waiting for an ARP reply in milliseconds. |
2623 | 2623 | ||
2624 | CONFIG_NFS_TIMEOUT | 2624 | CONFIG_NFS_TIMEOUT |
2625 | 2625 | ||
2626 | Timeout in milliseconds used in NFS protocol. | 2626 | Timeout in milliseconds used in NFS protocol. |
2627 | If you encounter "ERROR: Cannot umount" in nfs command, | 2627 | If you encounter "ERROR: Cannot umount" in nfs command, |
2628 | try longer timeout such as | 2628 | try longer timeout such as |
2629 | #define CONFIG_NFS_TIMEOUT 10000UL | 2629 | #define CONFIG_NFS_TIMEOUT 10000UL |
2630 | 2630 | ||
2631 | - Command Interpreter: | 2631 | - Command Interpreter: |
2632 | CONFIG_AUTO_COMPLETE | 2632 | CONFIG_AUTO_COMPLETE |
2633 | 2633 | ||
2634 | Enable auto completion of commands using TAB. | 2634 | Enable auto completion of commands using TAB. |
2635 | 2635 | ||
2636 | Note that this feature has NOT been implemented yet | 2636 | Note that this feature has NOT been implemented yet |
2637 | for the "hush" shell. | 2637 | for the "hush" shell. |
2638 | 2638 | ||
2639 | 2639 | ||
2640 | CONFIG_SYS_HUSH_PARSER | 2640 | CONFIG_SYS_HUSH_PARSER |
2641 | 2641 | ||
2642 | Define this variable to enable the "hush" shell (from | 2642 | Define this variable to enable the "hush" shell (from |
2643 | Busybox) as command line interpreter, thus enabling | 2643 | Busybox) as command line interpreter, thus enabling |
2644 | powerful command line syntax like | 2644 | powerful command line syntax like |
2645 | if...then...else...fi conditionals or `&&' and '||' | 2645 | if...then...else...fi conditionals or `&&' and '||' |
2646 | constructs ("shell scripts"). | 2646 | constructs ("shell scripts"). |
2647 | 2647 | ||
2648 | If undefined, you get the old, much simpler behaviour | 2648 | If undefined, you get the old, much simpler behaviour |
2649 | with a somewhat smaller memory footprint. | 2649 | with a somewhat smaller memory footprint. |
2650 | 2650 | ||
2651 | 2651 | ||
2652 | CONFIG_SYS_PROMPT_HUSH_PS2 | 2652 | CONFIG_SYS_PROMPT_HUSH_PS2 |
2653 | 2653 | ||
2654 | This defines the secondary prompt string, which is | 2654 | This defines the secondary prompt string, which is |
2655 | printed when the command interpreter needs more input | 2655 | printed when the command interpreter needs more input |
2656 | to complete a command. Usually "> ". | 2656 | to complete a command. Usually "> ". |
2657 | 2657 | ||
2658 | Note: | 2658 | Note: |
2659 | 2659 | ||
2660 | In the current implementation, the local variables | 2660 | In the current implementation, the local variables |
2661 | space and global environment variables space are | 2661 | space and global environment variables space are |
2662 | separated. Local variables are those you define by | 2662 | separated. Local variables are those you define by |
2663 | simply typing `name=value'. To access a local | 2663 | simply typing `name=value'. To access a local |
2664 | variable later on, you have write `$name' or | 2664 | variable later on, you have write `$name' or |
2665 | `${name}'; to execute the contents of a variable | 2665 | `${name}'; to execute the contents of a variable |
2666 | directly type `$name' at the command prompt. | 2666 | directly type `$name' at the command prompt. |
2667 | 2667 | ||
2668 | Global environment variables are those you use | 2668 | Global environment variables are those you use |
2669 | setenv/printenv to work with. To run a command stored | 2669 | setenv/printenv to work with. To run a command stored |
2670 | in such a variable, you need to use the run command, | 2670 | in such a variable, you need to use the run command, |
2671 | and you must not use the '$' sign to access them. | 2671 | and you must not use the '$' sign to access them. |
2672 | 2672 | ||
2673 | To store commands and special characters in a | 2673 | To store commands and special characters in a |
2674 | variable, please use double quotation marks | 2674 | variable, please use double quotation marks |
2675 | surrounding the whole text of the variable, instead | 2675 | surrounding the whole text of the variable, instead |
2676 | of the backslashes before semicolons and special | 2676 | of the backslashes before semicolons and special |
2677 | symbols. | 2677 | symbols. |
2678 | 2678 | ||
2679 | - Commandline Editing and History: | 2679 | - Commandline Editing and History: |
2680 | CONFIG_CMDLINE_EDITING | 2680 | CONFIG_CMDLINE_EDITING |
2681 | 2681 | ||
2682 | Enable editing and History functions for interactive | 2682 | Enable editing and History functions for interactive |
2683 | commandline input operations | 2683 | commandline input operations |
2684 | 2684 | ||
2685 | - Default Environment: | 2685 | - Default Environment: |
2686 | CONFIG_EXTRA_ENV_SETTINGS | 2686 | CONFIG_EXTRA_ENV_SETTINGS |
2687 | 2687 | ||
2688 | Define this to contain any number of null terminated | 2688 | Define this to contain any number of null terminated |
2689 | strings (variable = value pairs) that will be part of | 2689 | strings (variable = value pairs) that will be part of |
2690 | the default environment compiled into the boot image. | 2690 | the default environment compiled into the boot image. |
2691 | 2691 | ||
2692 | For example, place something like this in your | 2692 | For example, place something like this in your |
2693 | board's config file: | 2693 | board's config file: |
2694 | 2694 | ||
2695 | #define CONFIG_EXTRA_ENV_SETTINGS \ | 2695 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
2696 | "myvar1=value1\0" \ | 2696 | "myvar1=value1\0" \ |
2697 | "myvar2=value2\0" | 2697 | "myvar2=value2\0" |
2698 | 2698 | ||
2699 | Warning: This method is based on knowledge about the | 2699 | Warning: This method is based on knowledge about the |
2700 | internal format how the environment is stored by the | 2700 | internal format how the environment is stored by the |
2701 | U-Boot code. This is NOT an official, exported | 2701 | U-Boot code. This is NOT an official, exported |
2702 | interface! Although it is unlikely that this format | 2702 | interface! Although it is unlikely that this format |
2703 | will change soon, there is no guarantee either. | 2703 | will change soon, there is no guarantee either. |
2704 | You better know what you are doing here. | 2704 | You better know what you are doing here. |
2705 | 2705 | ||
2706 | Note: overly (ab)use of the default environment is | 2706 | Note: overly (ab)use of the default environment is |
2707 | discouraged. Make sure to check other ways to preset | 2707 | discouraged. Make sure to check other ways to preset |
2708 | the environment like the "source" command or the | 2708 | the environment like the "source" command or the |
2709 | boot command first. | 2709 | boot command first. |
2710 | 2710 | ||
2711 | CONFIG_ENV_VARS_UBOOT_CONFIG | 2711 | CONFIG_ENV_VARS_UBOOT_CONFIG |
2712 | 2712 | ||
2713 | Define this in order to add variables describing the | 2713 | Define this in order to add variables describing the |
2714 | U-Boot build configuration to the default environment. | 2714 | U-Boot build configuration to the default environment. |
2715 | These will be named arch, cpu, board, vendor, and soc. | 2715 | These will be named arch, cpu, board, vendor, and soc. |
2716 | 2716 | ||
2717 | Enabling this option will cause the following to be defined: | 2717 | Enabling this option will cause the following to be defined: |
2718 | 2718 | ||
2719 | - CONFIG_SYS_ARCH | 2719 | - CONFIG_SYS_ARCH |
2720 | - CONFIG_SYS_CPU | 2720 | - CONFIG_SYS_CPU |
2721 | - CONFIG_SYS_BOARD | 2721 | - CONFIG_SYS_BOARD |
2722 | - CONFIG_SYS_VENDOR | 2722 | - CONFIG_SYS_VENDOR |
2723 | - CONFIG_SYS_SOC | 2723 | - CONFIG_SYS_SOC |
2724 | 2724 | ||
2725 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG | 2725 | CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG |
2726 | 2726 | ||
2727 | Define this in order to add variables describing certain | 2727 | Define this in order to add variables describing certain |
2728 | run-time determined information about the hardware to the | 2728 | run-time determined information about the hardware to the |
2729 | environment. These will be named board_name, board_rev. | 2729 | environment. These will be named board_name, board_rev. |
2730 | 2730 | ||
2731 | CONFIG_DELAY_ENVIRONMENT | 2731 | CONFIG_DELAY_ENVIRONMENT |
2732 | 2732 | ||
2733 | Normally the environment is loaded when the board is | 2733 | Normally the environment is loaded when the board is |
2734 | intialised so that it is available to U-Boot. This inhibits | 2734 | intialised so that it is available to U-Boot. This inhibits |
2735 | that so that the environment is not available until | 2735 | that so that the environment is not available until |
2736 | explicitly loaded later by U-Boot code. With CONFIG_OF_CONTROL | 2736 | explicitly loaded later by U-Boot code. With CONFIG_OF_CONTROL |
2737 | this is instead controlled by the value of | 2737 | this is instead controlled by the value of |
2738 | /config/load-environment. | 2738 | /config/load-environment. |
2739 | 2739 | ||
2740 | - DataFlash Support: | 2740 | - DataFlash Support: |
2741 | CONFIG_HAS_DATAFLASH | 2741 | CONFIG_HAS_DATAFLASH |
2742 | 2742 | ||
2743 | Defining this option enables DataFlash features and | 2743 | Defining this option enables DataFlash features and |
2744 | allows to read/write in Dataflash via the standard | 2744 | allows to read/write in Dataflash via the standard |
2745 | commands cp, md... | 2745 | commands cp, md... |
2746 | 2746 | ||
2747 | - Serial Flash support | 2747 | - Serial Flash support |
2748 | CONFIG_CMD_SF | 2748 | CONFIG_CMD_SF |
2749 | 2749 | ||
2750 | Defining this option enables SPI flash commands | 2750 | Defining this option enables SPI flash commands |
2751 | 'sf probe/read/write/erase/update'. | 2751 | 'sf probe/read/write/erase/update'. |
2752 | 2752 | ||
2753 | Usage requires an initial 'probe' to define the serial | 2753 | Usage requires an initial 'probe' to define the serial |
2754 | flash parameters, followed by read/write/erase/update | 2754 | flash parameters, followed by read/write/erase/update |
2755 | commands. | 2755 | commands. |
2756 | 2756 | ||
2757 | The following defaults may be provided by the platform | 2757 | The following defaults may be provided by the platform |
2758 | to handle the common case when only a single serial | 2758 | to handle the common case when only a single serial |
2759 | flash is present on the system. | 2759 | flash is present on the system. |
2760 | 2760 | ||
2761 | CONFIG_SF_DEFAULT_BUS Bus identifier | 2761 | CONFIG_SF_DEFAULT_BUS Bus identifier |
2762 | CONFIG_SF_DEFAULT_CS Chip-select | 2762 | CONFIG_SF_DEFAULT_CS Chip-select |
2763 | CONFIG_SF_DEFAULT_MODE (see include/spi.h) | 2763 | CONFIG_SF_DEFAULT_MODE (see include/spi.h) |
2764 | CONFIG_SF_DEFAULT_SPEED in Hz | 2764 | CONFIG_SF_DEFAULT_SPEED in Hz |
2765 | 2765 | ||
2766 | CONFIG_CMD_SF_TEST | 2766 | CONFIG_CMD_SF_TEST |
2767 | 2767 | ||
2768 | Define this option to include a destructive SPI flash | 2768 | Define this option to include a destructive SPI flash |
2769 | test ('sf test'). | 2769 | test ('sf test'). |
2770 | 2770 | ||
2771 | CONFIG_SPI_FLASH_BAR Ban/Extended Addr Reg | 2771 | CONFIG_SPI_FLASH_BAR Ban/Extended Addr Reg |
2772 | 2772 | ||
2773 | Define this option to use the Bank addr/Extended addr | 2773 | Define this option to use the Bank addr/Extended addr |
2774 | support on SPI flashes which has size > 16Mbytes. | 2774 | support on SPI flashes which has size > 16Mbytes. |
2775 | 2775 | ||
2776 | CONFIG_SF_DUAL_FLASH Dual flash memories | 2776 | CONFIG_SF_DUAL_FLASH Dual flash memories |
2777 | 2777 | ||
2778 | Define this option to use dual flash support where two flash | 2778 | Define this option to use dual flash support where two flash |
2779 | memories can be connected with a given cs line. | 2779 | memories can be connected with a given cs line. |
2780 | currently Xilinx Zynq qspi support these type of connections. | 2780 | currently Xilinx Zynq qspi support these type of connections. |
2781 | 2781 | ||
2782 | - SystemACE Support: | 2782 | - SystemACE Support: |
2783 | CONFIG_SYSTEMACE | 2783 | CONFIG_SYSTEMACE |
2784 | 2784 | ||
2785 | Adding this option adds support for Xilinx SystemACE | 2785 | Adding this option adds support for Xilinx SystemACE |
2786 | chips attached via some sort of local bus. The address | 2786 | chips attached via some sort of local bus. The address |
2787 | of the chip must also be defined in the | 2787 | of the chip must also be defined in the |
2788 | CONFIG_SYS_SYSTEMACE_BASE macro. For example: | 2788 | CONFIG_SYS_SYSTEMACE_BASE macro. For example: |
2789 | 2789 | ||
2790 | #define CONFIG_SYSTEMACE | 2790 | #define CONFIG_SYSTEMACE |
2791 | #define CONFIG_SYS_SYSTEMACE_BASE 0xf0000000 | 2791 | #define CONFIG_SYS_SYSTEMACE_BASE 0xf0000000 |
2792 | 2792 | ||
2793 | When SystemACE support is added, the "ace" device type | 2793 | When SystemACE support is added, the "ace" device type |
2794 | becomes available to the fat commands, i.e. fatls. | 2794 | becomes available to the fat commands, i.e. fatls. |
2795 | 2795 | ||
2796 | - TFTP Fixed UDP Port: | 2796 | - TFTP Fixed UDP Port: |
2797 | CONFIG_TFTP_PORT | 2797 | CONFIG_TFTP_PORT |
2798 | 2798 | ||
2799 | If this is defined, the environment variable tftpsrcp | 2799 | If this is defined, the environment variable tftpsrcp |
2800 | is used to supply the TFTP UDP source port value. | 2800 | is used to supply the TFTP UDP source port value. |
2801 | If tftpsrcp isn't defined, the normal pseudo-random port | 2801 | If tftpsrcp isn't defined, the normal pseudo-random port |
2802 | number generator is used. | 2802 | number generator is used. |
2803 | 2803 | ||
2804 | Also, the environment variable tftpdstp is used to supply | 2804 | Also, the environment variable tftpdstp is used to supply |
2805 | the TFTP UDP destination port value. If tftpdstp isn't | 2805 | the TFTP UDP destination port value. If tftpdstp isn't |
2806 | defined, the normal port 69 is used. | 2806 | defined, the normal port 69 is used. |
2807 | 2807 | ||
2808 | The purpose for tftpsrcp is to allow a TFTP server to | 2808 | The purpose for tftpsrcp is to allow a TFTP server to |
2809 | blindly start the TFTP transfer using the pre-configured | 2809 | blindly start the TFTP transfer using the pre-configured |
2810 | target IP address and UDP port. This has the effect of | 2810 | target IP address and UDP port. This has the effect of |
2811 | "punching through" the (Windows XP) firewall, allowing | 2811 | "punching through" the (Windows XP) firewall, allowing |
2812 | the remainder of the TFTP transfer to proceed normally. | 2812 | the remainder of the TFTP transfer to proceed normally. |
2813 | A better solution is to properly configure the firewall, | 2813 | A better solution is to properly configure the firewall, |
2814 | but sometimes that is not allowed. | 2814 | but sometimes that is not allowed. |
2815 | 2815 | ||
2816 | - Hashing support: | 2816 | - Hashing support: |
2817 | CONFIG_CMD_HASH | 2817 | CONFIG_CMD_HASH |
2818 | 2818 | ||
2819 | This enables a generic 'hash' command which can produce | 2819 | This enables a generic 'hash' command which can produce |
2820 | hashes / digests from a few algorithms (e.g. SHA1, SHA256). | 2820 | hashes / digests from a few algorithms (e.g. SHA1, SHA256). |
2821 | 2821 | ||
2822 | CONFIG_HASH_VERIFY | 2822 | CONFIG_HASH_VERIFY |
2823 | 2823 | ||
2824 | Enable the hash verify command (hash -v). This adds to code | 2824 | Enable the hash verify command (hash -v). This adds to code |
2825 | size a little. | 2825 | size a little. |
2826 | 2826 | ||
2827 | CONFIG_SHA1 - support SHA1 hashing | 2827 | CONFIG_SHA1 - support SHA1 hashing |
2828 | CONFIG_SHA256 - support SHA256 hashing | 2828 | CONFIG_SHA256 - support SHA256 hashing |
2829 | 2829 | ||
2830 | Note: There is also a sha1sum command, which should perhaps | 2830 | Note: There is also a sha1sum command, which should perhaps |
2831 | be deprecated in favour of 'hash sha1'. | 2831 | be deprecated in favour of 'hash sha1'. |
2832 | 2832 | ||
2833 | - Freescale i.MX specific commands: | 2833 | - Freescale i.MX specific commands: |
2834 | CONFIG_CMD_HDMIDETECT | 2834 | CONFIG_CMD_HDMIDETECT |
2835 | This enables 'hdmidet' command which returns true if an | 2835 | This enables 'hdmidet' command which returns true if an |
2836 | HDMI monitor is detected. This command is i.MX 6 specific. | 2836 | HDMI monitor is detected. This command is i.MX 6 specific. |
2837 | 2837 | ||
2838 | CONFIG_CMD_BMODE | 2838 | CONFIG_CMD_BMODE |
2839 | This enables the 'bmode' (bootmode) command for forcing | 2839 | This enables the 'bmode' (bootmode) command for forcing |
2840 | a boot from specific media. | 2840 | a boot from specific media. |
2841 | 2841 | ||
2842 | This is useful for forcing the ROM's usb downloader to | 2842 | This is useful for forcing the ROM's usb downloader to |
2843 | activate upon a watchdog reset which is nice when iterating | 2843 | activate upon a watchdog reset which is nice when iterating |
2844 | on U-Boot. Using the reset button or running bmode normal | 2844 | on U-Boot. Using the reset button or running bmode normal |
2845 | will set it back to normal. This command currently | 2845 | will set it back to normal. This command currently |
2846 | supports i.MX53 and i.MX6. | 2846 | supports i.MX53 and i.MX6. |
2847 | 2847 | ||
2848 | - Signing support: | 2848 | - Signing support: |
2849 | CONFIG_RSA | 2849 | CONFIG_RSA |
2850 | 2850 | ||
2851 | This enables the RSA algorithm used for FIT image verification | 2851 | This enables the RSA algorithm used for FIT image verification |
2852 | in U-Boot. See doc/uImage.FIT/signature.txt for more information. | 2852 | in U-Boot. See doc/uImage.FIT/signature.txt for more information. |
2853 | 2853 | ||
2854 | The signing part is build into mkimage regardless of this | 2854 | The signing part is build into mkimage regardless of this |
2855 | option. | 2855 | option. |
2856 | 2856 | ||
2857 | 2857 | ||
2858 | - Show boot progress: | 2858 | - Show boot progress: |
2859 | CONFIG_SHOW_BOOT_PROGRESS | 2859 | CONFIG_SHOW_BOOT_PROGRESS |
2860 | 2860 | ||
2861 | Defining this option allows to add some board- | 2861 | Defining this option allows to add some board- |
2862 | specific code (calling a user-provided function | 2862 | specific code (calling a user-provided function |
2863 | "show_boot_progress(int)") that enables you to show | 2863 | "show_boot_progress(int)") that enables you to show |
2864 | the system's boot progress on some display (for | 2864 | the system's boot progress on some display (for |
2865 | example, some LED's) on your board. At the moment, | 2865 | example, some LED's) on your board. At the moment, |
2866 | the following checkpoints are implemented: | 2866 | the following checkpoints are implemented: |
2867 | 2867 | ||
2868 | - Detailed boot stage timing | 2868 | - Detailed boot stage timing |
2869 | CONFIG_BOOTSTAGE | 2869 | CONFIG_BOOTSTAGE |
2870 | Define this option to get detailed timing of each stage | 2870 | Define this option to get detailed timing of each stage |
2871 | of the boot process. | 2871 | of the boot process. |
2872 | 2872 | ||
2873 | CONFIG_BOOTSTAGE_USER_COUNT | 2873 | CONFIG_BOOTSTAGE_USER_COUNT |
2874 | This is the number of available user bootstage records. | 2874 | This is the number of available user bootstage records. |
2875 | Each time you call bootstage_mark(BOOTSTAGE_ID_ALLOC, ...) | 2875 | Each time you call bootstage_mark(BOOTSTAGE_ID_ALLOC, ...) |
2876 | a new ID will be allocated from this stash. If you exceed | 2876 | a new ID will be allocated from this stash. If you exceed |
2877 | the limit, recording will stop. | 2877 | the limit, recording will stop. |
2878 | 2878 | ||
2879 | CONFIG_BOOTSTAGE_REPORT | 2879 | CONFIG_BOOTSTAGE_REPORT |
2880 | Define this to print a report before boot, similar to this: | 2880 | Define this to print a report before boot, similar to this: |
2881 | 2881 | ||
2882 | Timer summary in microseconds: | 2882 | Timer summary in microseconds: |
2883 | Mark Elapsed Stage | 2883 | Mark Elapsed Stage |
2884 | 0 0 reset | 2884 | 0 0 reset |
2885 | 3,575,678 3,575,678 board_init_f start | 2885 | 3,575,678 3,575,678 board_init_f start |
2886 | 3,575,695 17 arch_cpu_init A9 | 2886 | 3,575,695 17 arch_cpu_init A9 |
2887 | 3,575,777 82 arch_cpu_init done | 2887 | 3,575,777 82 arch_cpu_init done |
2888 | 3,659,598 83,821 board_init_r start | 2888 | 3,659,598 83,821 board_init_r start |
2889 | 3,910,375 250,777 main_loop | 2889 | 3,910,375 250,777 main_loop |
2890 | 29,916,167 26,005,792 bootm_start | 2890 | 29,916,167 26,005,792 bootm_start |
2891 | 30,361,327 445,160 start_kernel | 2891 | 30,361,327 445,160 start_kernel |
2892 | 2892 | ||
2893 | CONFIG_CMD_BOOTSTAGE | 2893 | CONFIG_CMD_BOOTSTAGE |
2894 | Add a 'bootstage' command which supports printing a report | 2894 | Add a 'bootstage' command which supports printing a report |
2895 | and un/stashing of bootstage data. | 2895 | and un/stashing of bootstage data. |
2896 | 2896 | ||
2897 | CONFIG_BOOTSTAGE_FDT | 2897 | CONFIG_BOOTSTAGE_FDT |
2898 | Stash the bootstage information in the FDT. A root 'bootstage' | 2898 | Stash the bootstage information in the FDT. A root 'bootstage' |
2899 | node is created with each bootstage id as a child. Each child | 2899 | node is created with each bootstage id as a child. Each child |
2900 | has a 'name' property and either 'mark' containing the | 2900 | has a 'name' property and either 'mark' containing the |
2901 | mark time in microsecond, or 'accum' containing the | 2901 | mark time in microsecond, or 'accum' containing the |
2902 | accumulated time for that bootstage id in microseconds. | 2902 | accumulated time for that bootstage id in microseconds. |
2903 | For example: | 2903 | For example: |
2904 | 2904 | ||
2905 | bootstage { | 2905 | bootstage { |
2906 | 154 { | 2906 | 154 { |
2907 | name = "board_init_f"; | 2907 | name = "board_init_f"; |
2908 | mark = <3575678>; | 2908 | mark = <3575678>; |
2909 | }; | 2909 | }; |
2910 | 170 { | 2910 | 170 { |
2911 | name = "lcd"; | 2911 | name = "lcd"; |
2912 | accum = <33482>; | 2912 | accum = <33482>; |
2913 | }; | 2913 | }; |
2914 | }; | 2914 | }; |
2915 | 2915 | ||
2916 | Code in the Linux kernel can find this in /proc/devicetree. | 2916 | Code in the Linux kernel can find this in /proc/devicetree. |
2917 | 2917 | ||
2918 | Legacy uImage format: | 2918 | Legacy uImage format: |
2919 | 2919 | ||
2920 | Arg Where When | 2920 | Arg Where When |
2921 | 1 common/cmd_bootm.c before attempting to boot an image | 2921 | 1 common/cmd_bootm.c before attempting to boot an image |
2922 | -1 common/cmd_bootm.c Image header has bad magic number | 2922 | -1 common/cmd_bootm.c Image header has bad magic number |
2923 | 2 common/cmd_bootm.c Image header has correct magic number | 2923 | 2 common/cmd_bootm.c Image header has correct magic number |
2924 | -2 common/cmd_bootm.c Image header has bad checksum | 2924 | -2 common/cmd_bootm.c Image header has bad checksum |
2925 | 3 common/cmd_bootm.c Image header has correct checksum | 2925 | 3 common/cmd_bootm.c Image header has correct checksum |
2926 | -3 common/cmd_bootm.c Image data has bad checksum | 2926 | -3 common/cmd_bootm.c Image data has bad checksum |
2927 | 4 common/cmd_bootm.c Image data has correct checksum | 2927 | 4 common/cmd_bootm.c Image data has correct checksum |
2928 | -4 common/cmd_bootm.c Image is for unsupported architecture | 2928 | -4 common/cmd_bootm.c Image is for unsupported architecture |
2929 | 5 common/cmd_bootm.c Architecture check OK | 2929 | 5 common/cmd_bootm.c Architecture check OK |
2930 | -5 common/cmd_bootm.c Wrong Image Type (not kernel, multi) | 2930 | -5 common/cmd_bootm.c Wrong Image Type (not kernel, multi) |
2931 | 6 common/cmd_bootm.c Image Type check OK | 2931 | 6 common/cmd_bootm.c Image Type check OK |
2932 | -6 common/cmd_bootm.c gunzip uncompression error | 2932 | -6 common/cmd_bootm.c gunzip uncompression error |
2933 | -7 common/cmd_bootm.c Unimplemented compression type | 2933 | -7 common/cmd_bootm.c Unimplemented compression type |
2934 | 7 common/cmd_bootm.c Uncompression OK | 2934 | 7 common/cmd_bootm.c Uncompression OK |
2935 | 8 common/cmd_bootm.c No uncompress/copy overwrite error | 2935 | 8 common/cmd_bootm.c No uncompress/copy overwrite error |
2936 | -9 common/cmd_bootm.c Unsupported OS (not Linux, BSD, VxWorks, QNX) | 2936 | -9 common/cmd_bootm.c Unsupported OS (not Linux, BSD, VxWorks, QNX) |
2937 | 2937 | ||
2938 | 9 common/image.c Start initial ramdisk verification | 2938 | 9 common/image.c Start initial ramdisk verification |
2939 | -10 common/image.c Ramdisk header has bad magic number | 2939 | -10 common/image.c Ramdisk header has bad magic number |
2940 | -11 common/image.c Ramdisk header has bad checksum | 2940 | -11 common/image.c Ramdisk header has bad checksum |
2941 | 10 common/image.c Ramdisk header is OK | 2941 | 10 common/image.c Ramdisk header is OK |
2942 | -12 common/image.c Ramdisk data has bad checksum | 2942 | -12 common/image.c Ramdisk data has bad checksum |
2943 | 11 common/image.c Ramdisk data has correct checksum | 2943 | 11 common/image.c Ramdisk data has correct checksum |
2944 | 12 common/image.c Ramdisk verification complete, start loading | 2944 | 12 common/image.c Ramdisk verification complete, start loading |
2945 | -13 common/image.c Wrong Image Type (not PPC Linux ramdisk) | 2945 | -13 common/image.c Wrong Image Type (not PPC Linux ramdisk) |
2946 | 13 common/image.c Start multifile image verification | 2946 | 13 common/image.c Start multifile image verification |
2947 | 14 common/image.c No initial ramdisk, no multifile, continue. | 2947 | 14 common/image.c No initial ramdisk, no multifile, continue. |
2948 | 2948 | ||
2949 | 15 arch/<arch>/lib/bootm.c All preparation done, transferring control to OS | 2949 | 15 arch/<arch>/lib/bootm.c All preparation done, transferring control to OS |
2950 | 2950 | ||
2951 | -30 arch/powerpc/lib/board.c Fatal error, hang the system | 2951 | -30 arch/powerpc/lib/board.c Fatal error, hang the system |
2952 | -31 post/post.c POST test failed, detected by post_output_backlog() | 2952 | -31 post/post.c POST test failed, detected by post_output_backlog() |
2953 | -32 post/post.c POST test failed, detected by post_run_single() | 2953 | -32 post/post.c POST test failed, detected by post_run_single() |
2954 | 2954 | ||
2955 | 34 common/cmd_doc.c before loading a Image from a DOC device | 2955 | 34 common/cmd_doc.c before loading a Image from a DOC device |
2956 | -35 common/cmd_doc.c Bad usage of "doc" command | 2956 | -35 common/cmd_doc.c Bad usage of "doc" command |
2957 | 35 common/cmd_doc.c correct usage of "doc" command | 2957 | 35 common/cmd_doc.c correct usage of "doc" command |
2958 | -36 common/cmd_doc.c No boot device | 2958 | -36 common/cmd_doc.c No boot device |
2959 | 36 common/cmd_doc.c correct boot device | 2959 | 36 common/cmd_doc.c correct boot device |
2960 | -37 common/cmd_doc.c Unknown Chip ID on boot device | 2960 | -37 common/cmd_doc.c Unknown Chip ID on boot device |
2961 | 37 common/cmd_doc.c correct chip ID found, device available | 2961 | 37 common/cmd_doc.c correct chip ID found, device available |
2962 | -38 common/cmd_doc.c Read Error on boot device | 2962 | -38 common/cmd_doc.c Read Error on boot device |
2963 | 38 common/cmd_doc.c reading Image header from DOC device OK | 2963 | 38 common/cmd_doc.c reading Image header from DOC device OK |
2964 | -39 common/cmd_doc.c Image header has bad magic number | 2964 | -39 common/cmd_doc.c Image header has bad magic number |
2965 | 39 common/cmd_doc.c Image header has correct magic number | 2965 | 39 common/cmd_doc.c Image header has correct magic number |
2966 | -40 common/cmd_doc.c Error reading Image from DOC device | 2966 | -40 common/cmd_doc.c Error reading Image from DOC device |
2967 | 40 common/cmd_doc.c Image header has correct magic number | 2967 | 40 common/cmd_doc.c Image header has correct magic number |
2968 | 41 common/cmd_ide.c before loading a Image from a IDE device | 2968 | 41 common/cmd_ide.c before loading a Image from a IDE device |
2969 | -42 common/cmd_ide.c Bad usage of "ide" command | 2969 | -42 common/cmd_ide.c Bad usage of "ide" command |
2970 | 42 common/cmd_ide.c correct usage of "ide" command | 2970 | 42 common/cmd_ide.c correct usage of "ide" command |
2971 | -43 common/cmd_ide.c No boot device | 2971 | -43 common/cmd_ide.c No boot device |
2972 | 43 common/cmd_ide.c boot device found | 2972 | 43 common/cmd_ide.c boot device found |
2973 | -44 common/cmd_ide.c Device not available | 2973 | -44 common/cmd_ide.c Device not available |
2974 | 44 common/cmd_ide.c Device available | 2974 | 44 common/cmd_ide.c Device available |
2975 | -45 common/cmd_ide.c wrong partition selected | 2975 | -45 common/cmd_ide.c wrong partition selected |
2976 | 45 common/cmd_ide.c partition selected | 2976 | 45 common/cmd_ide.c partition selected |
2977 | -46 common/cmd_ide.c Unknown partition table | 2977 | -46 common/cmd_ide.c Unknown partition table |
2978 | 46 common/cmd_ide.c valid partition table found | 2978 | 46 common/cmd_ide.c valid partition table found |
2979 | -47 common/cmd_ide.c Invalid partition type | 2979 | -47 common/cmd_ide.c Invalid partition type |
2980 | 47 common/cmd_ide.c correct partition type | 2980 | 47 common/cmd_ide.c correct partition type |
2981 | -48 common/cmd_ide.c Error reading Image Header on boot device | 2981 | -48 common/cmd_ide.c Error reading Image Header on boot device |
2982 | 48 common/cmd_ide.c reading Image Header from IDE device OK | 2982 | 48 common/cmd_ide.c reading Image Header from IDE device OK |
2983 | -49 common/cmd_ide.c Image header has bad magic number | 2983 | -49 common/cmd_ide.c Image header has bad magic number |
2984 | 49 common/cmd_ide.c Image header has correct magic number | 2984 | 49 common/cmd_ide.c Image header has correct magic number |
2985 | -50 common/cmd_ide.c Image header has bad checksum | 2985 | -50 common/cmd_ide.c Image header has bad checksum |
2986 | 50 common/cmd_ide.c Image header has correct checksum | 2986 | 50 common/cmd_ide.c Image header has correct checksum |
2987 | -51 common/cmd_ide.c Error reading Image from IDE device | 2987 | -51 common/cmd_ide.c Error reading Image from IDE device |
2988 | 51 common/cmd_ide.c reading Image from IDE device OK | 2988 | 51 common/cmd_ide.c reading Image from IDE device OK |
2989 | 52 common/cmd_nand.c before loading a Image from a NAND device | 2989 | 52 common/cmd_nand.c before loading a Image from a NAND device |
2990 | -53 common/cmd_nand.c Bad usage of "nand" command | 2990 | -53 common/cmd_nand.c Bad usage of "nand" command |
2991 | 53 common/cmd_nand.c correct usage of "nand" command | 2991 | 53 common/cmd_nand.c correct usage of "nand" command |
2992 | -54 common/cmd_nand.c No boot device | 2992 | -54 common/cmd_nand.c No boot device |
2993 | 54 common/cmd_nand.c boot device found | 2993 | 54 common/cmd_nand.c boot device found |
2994 | -55 common/cmd_nand.c Unknown Chip ID on boot device | 2994 | -55 common/cmd_nand.c Unknown Chip ID on boot device |
2995 | 55 common/cmd_nand.c correct chip ID found, device available | 2995 | 55 common/cmd_nand.c correct chip ID found, device available |
2996 | -56 common/cmd_nand.c Error reading Image Header on boot device | 2996 | -56 common/cmd_nand.c Error reading Image Header on boot device |
2997 | 56 common/cmd_nand.c reading Image Header from NAND device OK | 2997 | 56 common/cmd_nand.c reading Image Header from NAND device OK |
2998 | -57 common/cmd_nand.c Image header has bad magic number | 2998 | -57 common/cmd_nand.c Image header has bad magic number |
2999 | 57 common/cmd_nand.c Image header has correct magic number | 2999 | 57 common/cmd_nand.c Image header has correct magic number |
3000 | -58 common/cmd_nand.c Error reading Image from NAND device | 3000 | -58 common/cmd_nand.c Error reading Image from NAND device |
3001 | 58 common/cmd_nand.c reading Image from NAND device OK | 3001 | 58 common/cmd_nand.c reading Image from NAND device OK |
3002 | 3002 | ||
3003 | -60 common/env_common.c Environment has a bad CRC, using default | 3003 | -60 common/env_common.c Environment has a bad CRC, using default |
3004 | 3004 | ||
3005 | 64 net/eth.c starting with Ethernet configuration. | 3005 | 64 net/eth.c starting with Ethernet configuration. |
3006 | -64 net/eth.c no Ethernet found. | 3006 | -64 net/eth.c no Ethernet found. |
3007 | 65 net/eth.c Ethernet found. | 3007 | 65 net/eth.c Ethernet found. |
3008 | 3008 | ||
3009 | -80 common/cmd_net.c usage wrong | 3009 | -80 common/cmd_net.c usage wrong |
3010 | 80 common/cmd_net.c before calling NetLoop() | 3010 | 80 common/cmd_net.c before calling NetLoop() |
3011 | -81 common/cmd_net.c some error in NetLoop() occurred | 3011 | -81 common/cmd_net.c some error in NetLoop() occurred |
3012 | 81 common/cmd_net.c NetLoop() back without error | 3012 | 81 common/cmd_net.c NetLoop() back without error |
3013 | -82 common/cmd_net.c size == 0 (File with size 0 loaded) | 3013 | -82 common/cmd_net.c size == 0 (File with size 0 loaded) |
3014 | 82 common/cmd_net.c trying automatic boot | 3014 | 82 common/cmd_net.c trying automatic boot |
3015 | 83 common/cmd_net.c running "source" command | 3015 | 83 common/cmd_net.c running "source" command |
3016 | -83 common/cmd_net.c some error in automatic boot or "source" command | 3016 | -83 common/cmd_net.c some error in automatic boot or "source" command |
3017 | 84 common/cmd_net.c end without errors | 3017 | 84 common/cmd_net.c end without errors |
3018 | 3018 | ||
3019 | FIT uImage format: | 3019 | FIT uImage format: |
3020 | 3020 | ||
3021 | Arg Where When | 3021 | Arg Where When |
3022 | 100 common/cmd_bootm.c Kernel FIT Image has correct format | 3022 | 100 common/cmd_bootm.c Kernel FIT Image has correct format |
3023 | -100 common/cmd_bootm.c Kernel FIT Image has incorrect format | 3023 | -100 common/cmd_bootm.c Kernel FIT Image has incorrect format |
3024 | 101 common/cmd_bootm.c No Kernel subimage unit name, using configuration | 3024 | 101 common/cmd_bootm.c No Kernel subimage unit name, using configuration |
3025 | -101 common/cmd_bootm.c Can't get configuration for kernel subimage | 3025 | -101 common/cmd_bootm.c Can't get configuration for kernel subimage |
3026 | 102 common/cmd_bootm.c Kernel unit name specified | 3026 | 102 common/cmd_bootm.c Kernel unit name specified |
3027 | -103 common/cmd_bootm.c Can't get kernel subimage node offset | 3027 | -103 common/cmd_bootm.c Can't get kernel subimage node offset |
3028 | 103 common/cmd_bootm.c Found configuration node | 3028 | 103 common/cmd_bootm.c Found configuration node |
3029 | 104 common/cmd_bootm.c Got kernel subimage node offset | 3029 | 104 common/cmd_bootm.c Got kernel subimage node offset |
3030 | -104 common/cmd_bootm.c Kernel subimage hash verification failed | 3030 | -104 common/cmd_bootm.c Kernel subimage hash verification failed |
3031 | 105 common/cmd_bootm.c Kernel subimage hash verification OK | 3031 | 105 common/cmd_bootm.c Kernel subimage hash verification OK |
3032 | -105 common/cmd_bootm.c Kernel subimage is for unsupported architecture | 3032 | -105 common/cmd_bootm.c Kernel subimage is for unsupported architecture |
3033 | 106 common/cmd_bootm.c Architecture check OK | 3033 | 106 common/cmd_bootm.c Architecture check OK |
3034 | -106 common/cmd_bootm.c Kernel subimage has wrong type | 3034 | -106 common/cmd_bootm.c Kernel subimage has wrong type |
3035 | 107 common/cmd_bootm.c Kernel subimage type OK | 3035 | 107 common/cmd_bootm.c Kernel subimage type OK |
3036 | -107 common/cmd_bootm.c Can't get kernel subimage data/size | 3036 | -107 common/cmd_bootm.c Can't get kernel subimage data/size |
3037 | 108 common/cmd_bootm.c Got kernel subimage data/size | 3037 | 108 common/cmd_bootm.c Got kernel subimage data/size |
3038 | -108 common/cmd_bootm.c Wrong image type (not legacy, FIT) | 3038 | -108 common/cmd_bootm.c Wrong image type (not legacy, FIT) |
3039 | -109 common/cmd_bootm.c Can't get kernel subimage type | 3039 | -109 common/cmd_bootm.c Can't get kernel subimage type |
3040 | -110 common/cmd_bootm.c Can't get kernel subimage comp | 3040 | -110 common/cmd_bootm.c Can't get kernel subimage comp |
3041 | -111 common/cmd_bootm.c Can't get kernel subimage os | 3041 | -111 common/cmd_bootm.c Can't get kernel subimage os |
3042 | -112 common/cmd_bootm.c Can't get kernel subimage load address | 3042 | -112 common/cmd_bootm.c Can't get kernel subimage load address |
3043 | -113 common/cmd_bootm.c Image uncompress/copy overwrite error | 3043 | -113 common/cmd_bootm.c Image uncompress/copy overwrite error |
3044 | 3044 | ||
3045 | 120 common/image.c Start initial ramdisk verification | 3045 | 120 common/image.c Start initial ramdisk verification |
3046 | -120 common/image.c Ramdisk FIT image has incorrect format | 3046 | -120 common/image.c Ramdisk FIT image has incorrect format |
3047 | 121 common/image.c Ramdisk FIT image has correct format | 3047 | 121 common/image.c Ramdisk FIT image has correct format |
3048 | 122 common/image.c No ramdisk subimage unit name, using configuration | 3048 | 122 common/image.c No ramdisk subimage unit name, using configuration |
3049 | -122 common/image.c Can't get configuration for ramdisk subimage | 3049 | -122 common/image.c Can't get configuration for ramdisk subimage |
3050 | 123 common/image.c Ramdisk unit name specified | 3050 | 123 common/image.c Ramdisk unit name specified |
3051 | -124 common/image.c Can't get ramdisk subimage node offset | 3051 | -124 common/image.c Can't get ramdisk subimage node offset |
3052 | 125 common/image.c Got ramdisk subimage node offset | 3052 | 125 common/image.c Got ramdisk subimage node offset |
3053 | -125 common/image.c Ramdisk subimage hash verification failed | 3053 | -125 common/image.c Ramdisk subimage hash verification failed |
3054 | 126 common/image.c Ramdisk subimage hash verification OK | 3054 | 126 common/image.c Ramdisk subimage hash verification OK |
3055 | -126 common/image.c Ramdisk subimage for unsupported architecture | 3055 | -126 common/image.c Ramdisk subimage for unsupported architecture |
3056 | 127 common/image.c Architecture check OK | 3056 | 127 common/image.c Architecture check OK |
3057 | -127 common/image.c Can't get ramdisk subimage data/size | 3057 | -127 common/image.c Can't get ramdisk subimage data/size |
3058 | 128 common/image.c Got ramdisk subimage data/size | 3058 | 128 common/image.c Got ramdisk subimage data/size |
3059 | 129 common/image.c Can't get ramdisk load address | 3059 | 129 common/image.c Can't get ramdisk load address |
3060 | -129 common/image.c Got ramdisk load address | 3060 | -129 common/image.c Got ramdisk load address |
3061 | 3061 | ||
3062 | -130 common/cmd_doc.c Incorrect FIT image format | 3062 | -130 common/cmd_doc.c Incorrect FIT image format |
3063 | 131 common/cmd_doc.c FIT image format OK | 3063 | 131 common/cmd_doc.c FIT image format OK |
3064 | 3064 | ||
3065 | -140 common/cmd_ide.c Incorrect FIT image format | 3065 | -140 common/cmd_ide.c Incorrect FIT image format |
3066 | 141 common/cmd_ide.c FIT image format OK | 3066 | 141 common/cmd_ide.c FIT image format OK |
3067 | 3067 | ||
3068 | -150 common/cmd_nand.c Incorrect FIT image format | 3068 | -150 common/cmd_nand.c Incorrect FIT image format |
3069 | 151 common/cmd_nand.c FIT image format OK | 3069 | 151 common/cmd_nand.c FIT image format OK |
3070 | 3070 | ||
3071 | - FIT image support: | 3071 | - FIT image support: |
3072 | CONFIG_FIT | 3072 | CONFIG_FIT |
3073 | Enable support for the FIT uImage format. | 3073 | Enable support for the FIT uImage format. |
3074 | 3074 | ||
3075 | CONFIG_FIT_BEST_MATCH | 3075 | CONFIG_FIT_BEST_MATCH |
3076 | When no configuration is explicitly selected, default to the | 3076 | When no configuration is explicitly selected, default to the |
3077 | one whose fdt's compatibility field best matches that of | 3077 | one whose fdt's compatibility field best matches that of |
3078 | U-Boot itself. A match is considered "best" if it matches the | 3078 | U-Boot itself. A match is considered "best" if it matches the |
3079 | most specific compatibility entry of U-Boot's fdt's root node. | 3079 | most specific compatibility entry of U-Boot's fdt's root node. |
3080 | The order of entries in the configuration's fdt is ignored. | 3080 | The order of entries in the configuration's fdt is ignored. |
3081 | 3081 | ||
3082 | CONFIG_FIT_SIGNATURE | 3082 | CONFIG_FIT_SIGNATURE |
3083 | This option enables signature verification of FIT uImages, | 3083 | This option enables signature verification of FIT uImages, |
3084 | using a hash signed and verified using RSA. See | 3084 | using a hash signed and verified using RSA. See |
3085 | doc/uImage.FIT/signature.txt for more details. | 3085 | doc/uImage.FIT/signature.txt for more details. |
3086 | 3086 | ||
3087 | - Standalone program support: | 3087 | - Standalone program support: |
3088 | CONFIG_STANDALONE_LOAD_ADDR | 3088 | CONFIG_STANDALONE_LOAD_ADDR |
3089 | 3089 | ||
3090 | This option defines a board specific value for the | 3090 | This option defines a board specific value for the |
3091 | address where standalone program gets loaded, thus | 3091 | address where standalone program gets loaded, thus |
3092 | overwriting the architecture dependent default | 3092 | overwriting the architecture dependent default |
3093 | settings. | 3093 | settings. |
3094 | 3094 | ||
3095 | - Frame Buffer Address: | 3095 | - Frame Buffer Address: |
3096 | CONFIG_FB_ADDR | 3096 | CONFIG_FB_ADDR |
3097 | 3097 | ||
3098 | Define CONFIG_FB_ADDR if you want to use specific | 3098 | Define CONFIG_FB_ADDR if you want to use specific |
3099 | address for frame buffer. This is typically the case | 3099 | address for frame buffer. This is typically the case |
3100 | when using a graphics controller has separate video | 3100 | when using a graphics controller has separate video |
3101 | memory. U-Boot will then place the frame buffer at | 3101 | memory. U-Boot will then place the frame buffer at |
3102 | the given address instead of dynamically reserving it | 3102 | the given address instead of dynamically reserving it |
3103 | in system RAM by calling lcd_setmem(), which grabs | 3103 | in system RAM by calling lcd_setmem(), which grabs |
3104 | the memory for the frame buffer depending on the | 3104 | the memory for the frame buffer depending on the |
3105 | configured panel size. | 3105 | configured panel size. |
3106 | 3106 | ||
3107 | Please see board_init_f function. | 3107 | Please see board_init_f function. |
3108 | 3108 | ||
3109 | - Automatic software updates via TFTP server | 3109 | - Automatic software updates via TFTP server |
3110 | CONFIG_UPDATE_TFTP | 3110 | CONFIG_UPDATE_TFTP |
3111 | CONFIG_UPDATE_TFTP_CNT_MAX | 3111 | CONFIG_UPDATE_TFTP_CNT_MAX |
3112 | CONFIG_UPDATE_TFTP_MSEC_MAX | 3112 | CONFIG_UPDATE_TFTP_MSEC_MAX |
3113 | 3113 | ||
3114 | These options enable and control the auto-update feature; | 3114 | These options enable and control the auto-update feature; |
3115 | for a more detailed description refer to doc/README.update. | 3115 | for a more detailed description refer to doc/README.update. |
3116 | 3116 | ||
3117 | - MTD Support (mtdparts command, UBI support) | 3117 | - MTD Support (mtdparts command, UBI support) |
3118 | CONFIG_MTD_DEVICE | 3118 | CONFIG_MTD_DEVICE |
3119 | 3119 | ||
3120 | Adds the MTD device infrastructure from the Linux kernel. | 3120 | Adds the MTD device infrastructure from the Linux kernel. |
3121 | Needed for mtdparts command support. | 3121 | Needed for mtdparts command support. |
3122 | 3122 | ||
3123 | CONFIG_MTD_PARTITIONS | 3123 | CONFIG_MTD_PARTITIONS |
3124 | 3124 | ||
3125 | Adds the MTD partitioning infrastructure from the Linux | 3125 | Adds the MTD partitioning infrastructure from the Linux |
3126 | kernel. Needed for UBI support. | 3126 | kernel. Needed for UBI support. |
3127 | 3127 | ||
3128 | - UBI support | 3128 | - UBI support |
3129 | CONFIG_CMD_UBI | 3129 | CONFIG_CMD_UBI |
3130 | 3130 | ||
3131 | Adds commands for interacting with MTD partitions formatted | 3131 | Adds commands for interacting with MTD partitions formatted |
3132 | with the UBI flash translation layer | 3132 | with the UBI flash translation layer |
3133 | 3133 | ||
3134 | Requires also defining CONFIG_RBTREE | 3134 | Requires also defining CONFIG_RBTREE |
3135 | 3135 | ||
3136 | CONFIG_UBI_SILENCE_MSG | 3136 | CONFIG_UBI_SILENCE_MSG |
3137 | 3137 | ||
3138 | Make the verbose messages from UBI stop printing. This leaves | 3138 | Make the verbose messages from UBI stop printing. This leaves |
3139 | warnings and errors enabled. | 3139 | warnings and errors enabled. |
3140 | 3140 | ||
3141 | - UBIFS support | 3141 | - UBIFS support |
3142 | CONFIG_CMD_UBIFS | 3142 | CONFIG_CMD_UBIFS |
3143 | 3143 | ||
3144 | Adds commands for interacting with UBI volumes formatted as | 3144 | Adds commands for interacting with UBI volumes formatted as |
3145 | UBIFS. UBIFS is read-only in u-boot. | 3145 | UBIFS. UBIFS is read-only in u-boot. |
3146 | 3146 | ||
3147 | Requires UBI support as well as CONFIG_LZO | 3147 | Requires UBI support as well as CONFIG_LZO |
3148 | 3148 | ||
3149 | CONFIG_UBIFS_SILENCE_MSG | 3149 | CONFIG_UBIFS_SILENCE_MSG |
3150 | 3150 | ||
3151 | Make the verbose messages from UBIFS stop printing. This leaves | 3151 | Make the verbose messages from UBIFS stop printing. This leaves |
3152 | warnings and errors enabled. | 3152 | warnings and errors enabled. |
3153 | 3153 | ||
3154 | - SPL framework | 3154 | - SPL framework |
3155 | CONFIG_SPL | 3155 | CONFIG_SPL |
3156 | Enable building of SPL globally. | 3156 | Enable building of SPL globally. |
3157 | 3157 | ||
3158 | CONFIG_SPL_LDSCRIPT | 3158 | CONFIG_SPL_LDSCRIPT |
3159 | LDSCRIPT for linking the SPL binary. | 3159 | LDSCRIPT for linking the SPL binary. |
3160 | 3160 | ||
3161 | CONFIG_SPL_MAX_FOOTPRINT | 3161 | CONFIG_SPL_MAX_FOOTPRINT |
3162 | Maximum size in memory allocated to the SPL, BSS included. | 3162 | Maximum size in memory allocated to the SPL, BSS included. |
3163 | When defined, the linker checks that the actual memory | 3163 | When defined, the linker checks that the actual memory |
3164 | used by SPL from _start to __bss_end does not exceed it. | 3164 | used by SPL from _start to __bss_end does not exceed it. |
3165 | CONFIG_SPL_MAX_FOOTPRINT and CONFIG_SPL_BSS_MAX_SIZE | 3165 | CONFIG_SPL_MAX_FOOTPRINT and CONFIG_SPL_BSS_MAX_SIZE |
3166 | must not be both defined at the same time. | 3166 | must not be both defined at the same time. |
3167 | 3167 | ||
3168 | CONFIG_SPL_MAX_SIZE | 3168 | CONFIG_SPL_MAX_SIZE |
3169 | Maximum size of the SPL image (text, data, rodata, and | 3169 | Maximum size of the SPL image (text, data, rodata, and |
3170 | linker lists sections), BSS excluded. | 3170 | linker lists sections), BSS excluded. |
3171 | When defined, the linker checks that the actual size does | 3171 | When defined, the linker checks that the actual size does |
3172 | not exceed it. | 3172 | not exceed it. |
3173 | 3173 | ||
3174 | CONFIG_SPL_TEXT_BASE | 3174 | CONFIG_SPL_TEXT_BASE |
3175 | TEXT_BASE for linking the SPL binary. | 3175 | TEXT_BASE for linking the SPL binary. |
3176 | 3176 | ||
3177 | CONFIG_SPL_RELOC_TEXT_BASE | 3177 | CONFIG_SPL_RELOC_TEXT_BASE |
3178 | Address to relocate to. If unspecified, this is equal to | 3178 | Address to relocate to. If unspecified, this is equal to |
3179 | CONFIG_SPL_TEXT_BASE (i.e. no relocation is done). | 3179 | CONFIG_SPL_TEXT_BASE (i.e. no relocation is done). |
3180 | 3180 | ||
3181 | CONFIG_SPL_BSS_START_ADDR | 3181 | CONFIG_SPL_BSS_START_ADDR |
3182 | Link address for the BSS within the SPL binary. | 3182 | Link address for the BSS within the SPL binary. |
3183 | 3183 | ||
3184 | CONFIG_SPL_BSS_MAX_SIZE | 3184 | CONFIG_SPL_BSS_MAX_SIZE |
3185 | Maximum size in memory allocated to the SPL BSS. | 3185 | Maximum size in memory allocated to the SPL BSS. |
3186 | When defined, the linker checks that the actual memory used | 3186 | When defined, the linker checks that the actual memory used |
3187 | by SPL from __bss_start to __bss_end does not exceed it. | 3187 | by SPL from __bss_start to __bss_end does not exceed it. |
3188 | CONFIG_SPL_MAX_FOOTPRINT and CONFIG_SPL_BSS_MAX_SIZE | 3188 | CONFIG_SPL_MAX_FOOTPRINT and CONFIG_SPL_BSS_MAX_SIZE |
3189 | must not be both defined at the same time. | 3189 | must not be both defined at the same time. |
3190 | 3190 | ||
3191 | CONFIG_SPL_STACK | 3191 | CONFIG_SPL_STACK |
3192 | Adress of the start of the stack SPL will use | 3192 | Adress of the start of the stack SPL will use |
3193 | 3193 | ||
3194 | CONFIG_SPL_RELOC_STACK | 3194 | CONFIG_SPL_RELOC_STACK |
3195 | Adress of the start of the stack SPL will use after | 3195 | Adress of the start of the stack SPL will use after |
3196 | relocation. If unspecified, this is equal to | 3196 | relocation. If unspecified, this is equal to |
3197 | CONFIG_SPL_STACK. | 3197 | CONFIG_SPL_STACK. |
3198 | 3198 | ||
3199 | CONFIG_SYS_SPL_MALLOC_START | 3199 | CONFIG_SYS_SPL_MALLOC_START |
3200 | Starting address of the malloc pool used in SPL. | 3200 | Starting address of the malloc pool used in SPL. |
3201 | 3201 | ||
3202 | CONFIG_SYS_SPL_MALLOC_SIZE | 3202 | CONFIG_SYS_SPL_MALLOC_SIZE |
3203 | The size of the malloc pool used in SPL. | 3203 | The size of the malloc pool used in SPL. |
3204 | 3204 | ||
3205 | CONFIG_SPL_FRAMEWORK | 3205 | CONFIG_SPL_FRAMEWORK |
3206 | Enable the SPL framework under common/. This framework | 3206 | Enable the SPL framework under common/. This framework |
3207 | supports MMC, NAND and YMODEM loading of U-Boot and NAND | 3207 | supports MMC, NAND and YMODEM loading of U-Boot and NAND |
3208 | NAND loading of the Linux Kernel. | 3208 | NAND loading of the Linux Kernel. |
3209 | 3209 | ||
3210 | CONFIG_SPL_DISPLAY_PRINT | 3210 | CONFIG_SPL_DISPLAY_PRINT |
3211 | For ARM, enable an optional function to print more information | 3211 | For ARM, enable an optional function to print more information |
3212 | about the running system. | 3212 | about the running system. |
3213 | 3213 | ||
3214 | CONFIG_SPL_INIT_MINIMAL | 3214 | CONFIG_SPL_INIT_MINIMAL |
3215 | Arch init code should be built for a very small image | 3215 | Arch init code should be built for a very small image |
3216 | 3216 | ||
3217 | CONFIG_SPL_LIBCOMMON_SUPPORT | 3217 | CONFIG_SPL_LIBCOMMON_SUPPORT |
3218 | Support for common/libcommon.o in SPL binary | 3218 | Support for common/libcommon.o in SPL binary |
3219 | 3219 | ||
3220 | CONFIG_SPL_LIBDISK_SUPPORT | 3220 | CONFIG_SPL_LIBDISK_SUPPORT |
3221 | Support for disk/libdisk.o in SPL binary | 3221 | Support for disk/libdisk.o in SPL binary |
3222 | 3222 | ||
3223 | CONFIG_SPL_I2C_SUPPORT | 3223 | CONFIG_SPL_I2C_SUPPORT |
3224 | Support for drivers/i2c/libi2c.o in SPL binary | 3224 | Support for drivers/i2c/libi2c.o in SPL binary |
3225 | 3225 | ||
3226 | CONFIG_SPL_GPIO_SUPPORT | 3226 | CONFIG_SPL_GPIO_SUPPORT |
3227 | Support for drivers/gpio/libgpio.o in SPL binary | 3227 | Support for drivers/gpio/libgpio.o in SPL binary |
3228 | 3228 | ||
3229 | CONFIG_SPL_MMC_SUPPORT | 3229 | CONFIG_SPL_MMC_SUPPORT |
3230 | Support for drivers/mmc/libmmc.o in SPL binary | 3230 | Support for drivers/mmc/libmmc.o in SPL binary |
3231 | 3231 | ||
3232 | CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, | 3232 | CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, |
3233 | CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS, | 3233 | CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS, |
3234 | CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION | 3234 | CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION |
3235 | Address, size and partition on the MMC to load U-Boot from | 3235 | Address, size and partition on the MMC to load U-Boot from |
3236 | when the MMC is being used in raw mode. | 3236 | when the MMC is being used in raw mode. |
3237 | 3237 | ||
3238 | CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR | 3238 | CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR |
3239 | Sector to load kernel uImage from when MMC is being | 3239 | Sector to load kernel uImage from when MMC is being |
3240 | used in raw mode (for Falcon mode) | 3240 | used in raw mode (for Falcon mode) |
3241 | 3241 | ||
3242 | CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, | 3242 | CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, |
3243 | CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS | 3243 | CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS |
3244 | Sector and number of sectors to load kernel argument | 3244 | Sector and number of sectors to load kernel argument |
3245 | parameters from when MMC is being used in raw mode | 3245 | parameters from when MMC is being used in raw mode |
3246 | (for falcon mode) | 3246 | (for falcon mode) |
3247 | 3247 | ||
3248 | CONFIG_SPL_FAT_SUPPORT | 3248 | CONFIG_SPL_FAT_SUPPORT |
3249 | Support for fs/fat/libfat.o in SPL binary | 3249 | Support for fs/fat/libfat.o in SPL binary |
3250 | 3250 | ||
3251 | CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME | 3251 | CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME |
3252 | Filename to read to load U-Boot when reading from FAT | 3252 | Filename to read to load U-Boot when reading from FAT |
3253 | 3253 | ||
3254 | CONFIG_SPL_FAT_LOAD_KERNEL_NAME | 3254 | CONFIG_SPL_FAT_LOAD_KERNEL_NAME |
3255 | Filename to read to load kernel uImage when reading | 3255 | Filename to read to load kernel uImage when reading |
3256 | from FAT (for Falcon mode) | 3256 | from FAT (for Falcon mode) |
3257 | 3257 | ||
3258 | CONFIG_SPL_FAT_LOAD_ARGS_NAME | 3258 | CONFIG_SPL_FAT_LOAD_ARGS_NAME |
3259 | Filename to read to load kernel argument parameters | 3259 | Filename to read to load kernel argument parameters |
3260 | when reading from FAT (for Falcon mode) | 3260 | when reading from FAT (for Falcon mode) |
3261 | 3261 | ||
3262 | CONFIG_SPL_MPC83XX_WAIT_FOR_NAND | 3262 | CONFIG_SPL_MPC83XX_WAIT_FOR_NAND |
3263 | Set this for NAND SPL on PPC mpc83xx targets, so that | 3263 | Set this for NAND SPL on PPC mpc83xx targets, so that |
3264 | start.S waits for the rest of the SPL to load before | 3264 | start.S waits for the rest of the SPL to load before |
3265 | continuing (the hardware starts execution after just | 3265 | continuing (the hardware starts execution after just |
3266 | loading the first page rather than the full 4K). | 3266 | loading the first page rather than the full 4K). |
3267 | 3267 | ||
3268 | CONFIG_SPL_NAND_BASE | 3268 | CONFIG_SPL_NAND_BASE |
3269 | Include nand_base.c in the SPL. Requires | 3269 | Include nand_base.c in the SPL. Requires |
3270 | CONFIG_SPL_NAND_DRIVERS. | 3270 | CONFIG_SPL_NAND_DRIVERS. |
3271 | 3271 | ||
3272 | CONFIG_SPL_NAND_DRIVERS | 3272 | CONFIG_SPL_NAND_DRIVERS |
3273 | SPL uses normal NAND drivers, not minimal drivers. | 3273 | SPL uses normal NAND drivers, not minimal drivers. |
3274 | 3274 | ||
3275 | CONFIG_SPL_NAND_ECC | 3275 | CONFIG_SPL_NAND_ECC |
3276 | Include standard software ECC in the SPL | 3276 | Include standard software ECC in the SPL |
3277 | 3277 | ||
3278 | CONFIG_SPL_NAND_SIMPLE | 3278 | CONFIG_SPL_NAND_SIMPLE |
3279 | Support for NAND boot using simple NAND drivers that | 3279 | Support for NAND boot using simple NAND drivers that |
3280 | expose the cmd_ctrl() interface. | 3280 | expose the cmd_ctrl() interface. |
3281 | 3281 | ||
3282 | CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT | 3282 | CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT |
3283 | Set for the SPL on PPC mpc8xxx targets, support for | 3283 | Set for the SPL on PPC mpc8xxx targets, support for |
3284 | drivers/ddr/fsl/libddr.o in SPL binary. | 3284 | drivers/ddr/fsl/libddr.o in SPL binary. |
3285 | 3285 | ||
3286 | CONFIG_SPL_COMMON_INIT_DDR | 3286 | CONFIG_SPL_COMMON_INIT_DDR |
3287 | Set for common ddr init with serial presence detect in | 3287 | Set for common ddr init with serial presence detect in |
3288 | SPL binary. | 3288 | SPL binary. |
3289 | 3289 | ||
3290 | CONFIG_SYS_NAND_5_ADDR_CYCLE, CONFIG_SYS_NAND_PAGE_COUNT, | 3290 | CONFIG_SYS_NAND_5_ADDR_CYCLE, CONFIG_SYS_NAND_PAGE_COUNT, |
3291 | CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_OOBSIZE, | 3291 | CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_OOBSIZE, |
3292 | CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_BAD_BLOCK_POS, | 3292 | CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_BAD_BLOCK_POS, |
3293 | CONFIG_SYS_NAND_ECCPOS, CONFIG_SYS_NAND_ECCSIZE, | 3293 | CONFIG_SYS_NAND_ECCPOS, CONFIG_SYS_NAND_ECCSIZE, |
3294 | CONFIG_SYS_NAND_ECCBYTES | 3294 | CONFIG_SYS_NAND_ECCBYTES |
3295 | Defines the size and behavior of the NAND that SPL uses | 3295 | Defines the size and behavior of the NAND that SPL uses |
3296 | to read U-Boot | 3296 | to read U-Boot |
3297 | 3297 | ||
3298 | CONFIG_SPL_NAND_BOOT | 3298 | CONFIG_SPL_NAND_BOOT |
3299 | Add support NAND boot | 3299 | Add support NAND boot |
3300 | 3300 | ||
3301 | CONFIG_SYS_NAND_U_BOOT_OFFS | 3301 | CONFIG_SYS_NAND_U_BOOT_OFFS |
3302 | Location in NAND to read U-Boot from | 3302 | Location in NAND to read U-Boot from |
3303 | 3303 | ||
3304 | CONFIG_SYS_NAND_U_BOOT_DST | 3304 | CONFIG_SYS_NAND_U_BOOT_DST |
3305 | Location in memory to load U-Boot to | 3305 | Location in memory to load U-Boot to |
3306 | 3306 | ||
3307 | CONFIG_SYS_NAND_U_BOOT_SIZE | 3307 | CONFIG_SYS_NAND_U_BOOT_SIZE |
3308 | Size of image to load | 3308 | Size of image to load |
3309 | 3309 | ||
3310 | CONFIG_SYS_NAND_U_BOOT_START | 3310 | CONFIG_SYS_NAND_U_BOOT_START |
3311 | Entry point in loaded image to jump to | 3311 | Entry point in loaded image to jump to |
3312 | 3312 | ||
3313 | CONFIG_SYS_NAND_HW_ECC_OOBFIRST | 3313 | CONFIG_SYS_NAND_HW_ECC_OOBFIRST |
3314 | Define this if you need to first read the OOB and then the | 3314 | Define this if you need to first read the OOB and then the |
3315 | data. This is used for example on davinci plattforms. | 3315 | data. This is used for example on davinci plattforms. |
3316 | 3316 | ||
3317 | CONFIG_SPL_OMAP3_ID_NAND | 3317 | CONFIG_SPL_OMAP3_ID_NAND |
3318 | Support for an OMAP3-specific set of functions to return the | 3318 | Support for an OMAP3-specific set of functions to return the |
3319 | ID and MFR of the first attached NAND chip, if present. | 3319 | ID and MFR of the first attached NAND chip, if present. |
3320 | 3320 | ||
3321 | CONFIG_SPL_SERIAL_SUPPORT | 3321 | CONFIG_SPL_SERIAL_SUPPORT |
3322 | Support for drivers/serial/libserial.o in SPL binary | 3322 | Support for drivers/serial/libserial.o in SPL binary |
3323 | 3323 | ||
3324 | CONFIG_SPL_SPI_FLASH_SUPPORT | 3324 | CONFIG_SPL_SPI_FLASH_SUPPORT |
3325 | Support for drivers/mtd/spi/libspi_flash.o in SPL binary | 3325 | Support for drivers/mtd/spi/libspi_flash.o in SPL binary |
3326 | 3326 | ||
3327 | CONFIG_SPL_SPI_SUPPORT | 3327 | CONFIG_SPL_SPI_SUPPORT |
3328 | Support for drivers/spi/libspi.o in SPL binary | 3328 | Support for drivers/spi/libspi.o in SPL binary |
3329 | 3329 | ||
3330 | CONFIG_SPL_RAM_DEVICE | 3330 | CONFIG_SPL_RAM_DEVICE |
3331 | Support for running image already present in ram, in SPL binary | 3331 | Support for running image already present in ram, in SPL binary |
3332 | 3332 | ||
3333 | CONFIG_SPL_LIBGENERIC_SUPPORT | 3333 | CONFIG_SPL_LIBGENERIC_SUPPORT |
3334 | Support for lib/libgeneric.o in SPL binary | 3334 | Support for lib/libgeneric.o in SPL binary |
3335 | 3335 | ||
3336 | CONFIG_SPL_ENV_SUPPORT | 3336 | CONFIG_SPL_ENV_SUPPORT |
3337 | Support for the environment operating in SPL binary | 3337 | Support for the environment operating in SPL binary |
3338 | 3338 | ||
3339 | CONFIG_SPL_NET_SUPPORT | 3339 | CONFIG_SPL_NET_SUPPORT |
3340 | Support for the net/libnet.o in SPL binary. | 3340 | Support for the net/libnet.o in SPL binary. |
3341 | It conflicts with SPL env from storage medium specified by | 3341 | It conflicts with SPL env from storage medium specified by |
3342 | CONFIG_ENV_IS_xxx but CONFIG_ENV_IS_NOWHERE | 3342 | CONFIG_ENV_IS_xxx but CONFIG_ENV_IS_NOWHERE |
3343 | 3343 | ||
3344 | CONFIG_SPL_PAD_TO | 3344 | CONFIG_SPL_PAD_TO |
3345 | Image offset to which the SPL should be padded before appending | 3345 | Image offset to which the SPL should be padded before appending |
3346 | the SPL payload. By default, this is defined as | 3346 | the SPL payload. By default, this is defined as |
3347 | CONFIG_SPL_MAX_SIZE, or 0 if CONFIG_SPL_MAX_SIZE is undefined. | 3347 | CONFIG_SPL_MAX_SIZE, or 0 if CONFIG_SPL_MAX_SIZE is undefined. |
3348 | CONFIG_SPL_PAD_TO must be either 0, meaning to append the SPL | 3348 | CONFIG_SPL_PAD_TO must be either 0, meaning to append the SPL |
3349 | payload without any padding, or >= CONFIG_SPL_MAX_SIZE. | 3349 | payload without any padding, or >= CONFIG_SPL_MAX_SIZE. |
3350 | 3350 | ||
3351 | CONFIG_SPL_TARGET | 3351 | CONFIG_SPL_TARGET |
3352 | Final target image containing SPL and payload. Some SPLs | 3352 | Final target image containing SPL and payload. Some SPLs |
3353 | use an arch-specific makefile fragment instead, for | 3353 | use an arch-specific makefile fragment instead, for |
3354 | example if more than one image needs to be produced. | 3354 | example if more than one image needs to be produced. |
3355 | 3355 | ||
3356 | CONFIG_FIT_SPL_PRINT | 3356 | CONFIG_FIT_SPL_PRINT |
3357 | Printing information about a FIT image adds quite a bit of | 3357 | Printing information about a FIT image adds quite a bit of |
3358 | code to SPL. So this is normally disabled in SPL. Use this | 3358 | code to SPL. So this is normally disabled in SPL. Use this |
3359 | option to re-enable it. This will affect the output of the | 3359 | option to re-enable it. This will affect the output of the |
3360 | bootm command when booting a FIT image. | 3360 | bootm command when booting a FIT image. |
3361 | 3361 | ||
3362 | - TPL framework | 3362 | - TPL framework |
3363 | CONFIG_TPL | 3363 | CONFIG_TPL |
3364 | Enable building of TPL globally. | 3364 | Enable building of TPL globally. |
3365 | 3365 | ||
3366 | CONFIG_TPL_PAD_TO | 3366 | CONFIG_TPL_PAD_TO |
3367 | Image offset to which the TPL should be padded before appending | 3367 | Image offset to which the TPL should be padded before appending |
3368 | the TPL payload. By default, this is defined as | 3368 | the TPL payload. By default, this is defined as |
3369 | CONFIG_SPL_MAX_SIZE, or 0 if CONFIG_SPL_MAX_SIZE is undefined. | 3369 | CONFIG_SPL_MAX_SIZE, or 0 if CONFIG_SPL_MAX_SIZE is undefined. |
3370 | CONFIG_SPL_PAD_TO must be either 0, meaning to append the SPL | 3370 | CONFIG_SPL_PAD_TO must be either 0, meaning to append the SPL |
3371 | payload without any padding, or >= CONFIG_SPL_MAX_SIZE. | 3371 | payload without any padding, or >= CONFIG_SPL_MAX_SIZE. |
3372 | 3372 | ||
3373 | Modem Support: | 3373 | Modem Support: |
3374 | -------------- | 3374 | -------------- |
3375 | 3375 | ||
3376 | [so far only for SMDK2400 boards] | 3376 | [so far only for SMDK2400 boards] |
3377 | 3377 | ||
3378 | - Modem support enable: | 3378 | - Modem support enable: |
3379 | CONFIG_MODEM_SUPPORT | 3379 | CONFIG_MODEM_SUPPORT |
3380 | 3380 | ||
3381 | - RTS/CTS Flow control enable: | 3381 | - RTS/CTS Flow control enable: |
3382 | CONFIG_HWFLOW | 3382 | CONFIG_HWFLOW |
3383 | 3383 | ||
3384 | - Modem debug support: | 3384 | - Modem debug support: |
3385 | CONFIG_MODEM_SUPPORT_DEBUG | 3385 | CONFIG_MODEM_SUPPORT_DEBUG |
3386 | 3386 | ||
3387 | Enables debugging stuff (char screen[1024], dbg()) | 3387 | Enables debugging stuff (char screen[1024], dbg()) |
3388 | for modem support. Useful only with BDI2000. | 3388 | for modem support. Useful only with BDI2000. |
3389 | 3389 | ||
3390 | - Interrupt support (PPC): | 3390 | - Interrupt support (PPC): |
3391 | 3391 | ||
3392 | There are common interrupt_init() and timer_interrupt() | 3392 | There are common interrupt_init() and timer_interrupt() |
3393 | for all PPC archs. interrupt_init() calls interrupt_init_cpu() | 3393 | for all PPC archs. interrupt_init() calls interrupt_init_cpu() |
3394 | for CPU specific initialization. interrupt_init_cpu() | 3394 | for CPU specific initialization. interrupt_init_cpu() |
3395 | should set decrementer_count to appropriate value. If | 3395 | should set decrementer_count to appropriate value. If |
3396 | CPU resets decrementer automatically after interrupt | 3396 | CPU resets decrementer automatically after interrupt |
3397 | (ppc4xx) it should set decrementer_count to zero. | 3397 | (ppc4xx) it should set decrementer_count to zero. |
3398 | timer_interrupt() calls timer_interrupt_cpu() for CPU | 3398 | timer_interrupt() calls timer_interrupt_cpu() for CPU |
3399 | specific handling. If board has watchdog / status_led | 3399 | specific handling. If board has watchdog / status_led |
3400 | / other_activity_monitor it works automatically from | 3400 | / other_activity_monitor it works automatically from |
3401 | general timer_interrupt(). | 3401 | general timer_interrupt(). |
3402 | 3402 | ||
3403 | - General: | 3403 | - General: |
3404 | 3404 | ||
3405 | In the target system modem support is enabled when a | 3405 | In the target system modem support is enabled when a |
3406 | specific key (key combination) is pressed during | 3406 | specific key (key combination) is pressed during |
3407 | power-on. Otherwise U-Boot will boot normally | 3407 | power-on. Otherwise U-Boot will boot normally |
3408 | (autoboot). The key_pressed() function is called from | 3408 | (autoboot). The key_pressed() function is called from |
3409 | board_init(). Currently key_pressed() is a dummy | 3409 | board_init(). Currently key_pressed() is a dummy |
3410 | function, returning 1 and thus enabling modem | 3410 | function, returning 1 and thus enabling modem |
3411 | initialization. | 3411 | initialization. |
3412 | 3412 | ||
3413 | If there are no modem init strings in the | 3413 | If there are no modem init strings in the |
3414 | environment, U-Boot proceed to autoboot; the | 3414 | environment, U-Boot proceed to autoboot; the |
3415 | previous output (banner, info printfs) will be | 3415 | previous output (banner, info printfs) will be |
3416 | suppressed, though. | 3416 | suppressed, though. |
3417 | 3417 | ||
3418 | See also: doc/README.Modem | 3418 | See also: doc/README.Modem |
3419 | 3419 | ||
3420 | Board initialization settings: | 3420 | Board initialization settings: |
3421 | ------------------------------ | 3421 | ------------------------------ |
3422 | 3422 | ||
3423 | During Initialization u-boot calls a number of board specific functions | 3423 | During Initialization u-boot calls a number of board specific functions |
3424 | to allow the preparation of board specific prerequisites, e.g. pin setup | 3424 | to allow the preparation of board specific prerequisites, e.g. pin setup |
3425 | before drivers are initialized. To enable these callbacks the | 3425 | before drivers are initialized. To enable these callbacks the |
3426 | following configuration macros have to be defined. Currently this is | 3426 | following configuration macros have to be defined. Currently this is |
3427 | architecture specific, so please check arch/your_architecture/lib/board.c | 3427 | architecture specific, so please check arch/your_architecture/lib/board.c |
3428 | typically in board_init_f() and board_init_r(). | 3428 | typically in board_init_f() and board_init_r(). |
3429 | 3429 | ||
3430 | - CONFIG_BOARD_EARLY_INIT_F: Call board_early_init_f() | 3430 | - CONFIG_BOARD_EARLY_INIT_F: Call board_early_init_f() |
3431 | - CONFIG_BOARD_EARLY_INIT_R: Call board_early_init_r() | 3431 | - CONFIG_BOARD_EARLY_INIT_R: Call board_early_init_r() |
3432 | - CONFIG_BOARD_LATE_INIT: Call board_late_init() | 3432 | - CONFIG_BOARD_LATE_INIT: Call board_late_init() |
3433 | - CONFIG_BOARD_POSTCLK_INIT: Call board_postclk_init() | 3433 | - CONFIG_BOARD_POSTCLK_INIT: Call board_postclk_init() |
3434 | 3434 | ||
3435 | Configuration Settings: | 3435 | Configuration Settings: |
3436 | ----------------------- | 3436 | ----------------------- |
3437 | 3437 | ||
3438 | - CONFIG_SYS_LONGHELP: Defined when you want long help messages included; | 3438 | - CONFIG_SYS_LONGHELP: Defined when you want long help messages included; |
3439 | undefine this when you're short of memory. | 3439 | undefine this when you're short of memory. |
3440 | 3440 | ||
3441 | - CONFIG_SYS_HELP_CMD_WIDTH: Defined when you want to override the default | 3441 | - CONFIG_SYS_HELP_CMD_WIDTH: Defined when you want to override the default |
3442 | width of the commands listed in the 'help' command output. | 3442 | width of the commands listed in the 'help' command output. |
3443 | 3443 | ||
3444 | - CONFIG_SYS_PROMPT: This is what U-Boot prints on the console to | 3444 | - CONFIG_SYS_PROMPT: This is what U-Boot prints on the console to |
3445 | prompt for user input. | 3445 | prompt for user input. |
3446 | 3446 | ||
3447 | - CONFIG_SYS_CBSIZE: Buffer size for input from the Console | 3447 | - CONFIG_SYS_CBSIZE: Buffer size for input from the Console |
3448 | 3448 | ||
3449 | - CONFIG_SYS_PBSIZE: Buffer size for Console output | 3449 | - CONFIG_SYS_PBSIZE: Buffer size for Console output |
3450 | 3450 | ||
3451 | - CONFIG_SYS_MAXARGS: max. Number of arguments accepted for monitor commands | 3451 | - CONFIG_SYS_MAXARGS: max. Number of arguments accepted for monitor commands |
3452 | 3452 | ||
3453 | - CONFIG_SYS_BARGSIZE: Buffer size for Boot Arguments which are passed to | 3453 | - CONFIG_SYS_BARGSIZE: Buffer size for Boot Arguments which are passed to |
3454 | the application (usually a Linux kernel) when it is | 3454 | the application (usually a Linux kernel) when it is |
3455 | booted | 3455 | booted |
3456 | 3456 | ||
3457 | - CONFIG_SYS_BAUDRATE_TABLE: | 3457 | - CONFIG_SYS_BAUDRATE_TABLE: |
3458 | List of legal baudrate settings for this board. | 3458 | List of legal baudrate settings for this board. |
3459 | 3459 | ||
3460 | - CONFIG_SYS_CONSOLE_INFO_QUIET | 3460 | - CONFIG_SYS_CONSOLE_INFO_QUIET |
3461 | Suppress display of console information at boot. | 3461 | Suppress display of console information at boot. |
3462 | 3462 | ||
3463 | - CONFIG_SYS_CONSOLE_IS_IN_ENV | 3463 | - CONFIG_SYS_CONSOLE_IS_IN_ENV |
3464 | If the board specific function | 3464 | If the board specific function |
3465 | extern int overwrite_console (void); | 3465 | extern int overwrite_console (void); |
3466 | returns 1, the stdin, stderr and stdout are switched to the | 3466 | returns 1, the stdin, stderr and stdout are switched to the |
3467 | serial port, else the settings in the environment are used. | 3467 | serial port, else the settings in the environment are used. |
3468 | 3468 | ||
3469 | - CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE | 3469 | - CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE |
3470 | Enable the call to overwrite_console(). | 3470 | Enable the call to overwrite_console(). |
3471 | 3471 | ||
3472 | - CONFIG_SYS_CONSOLE_ENV_OVERWRITE | 3472 | - CONFIG_SYS_CONSOLE_ENV_OVERWRITE |
3473 | Enable overwrite of previous console environment settings. | 3473 | Enable overwrite of previous console environment settings. |
3474 | 3474 | ||
3475 | - CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END: | 3475 | - CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END: |
3476 | Begin and End addresses of the area used by the | 3476 | Begin and End addresses of the area used by the |
3477 | simple memory test. | 3477 | simple memory test. |
3478 | 3478 | ||
3479 | - CONFIG_SYS_ALT_MEMTEST: | 3479 | - CONFIG_SYS_ALT_MEMTEST: |
3480 | Enable an alternate, more extensive memory test. | 3480 | Enable an alternate, more extensive memory test. |
3481 | 3481 | ||
3482 | - CONFIG_SYS_MEMTEST_SCRATCH: | 3482 | - CONFIG_SYS_MEMTEST_SCRATCH: |
3483 | Scratch address used by the alternate memory test | 3483 | Scratch address used by the alternate memory test |
3484 | You only need to set this if address zero isn't writeable | 3484 | You only need to set this if address zero isn't writeable |
3485 | 3485 | ||
3486 | - CONFIG_SYS_MEM_TOP_HIDE (PPC only): | 3486 | - CONFIG_SYS_MEM_TOP_HIDE (PPC only): |
3487 | If CONFIG_SYS_MEM_TOP_HIDE is defined in the board config header, | 3487 | If CONFIG_SYS_MEM_TOP_HIDE is defined in the board config header, |
3488 | this specified memory area will get subtracted from the top | 3488 | this specified memory area will get subtracted from the top |
3489 | (end) of RAM and won't get "touched" at all by U-Boot. By | 3489 | (end) of RAM and won't get "touched" at all by U-Boot. By |
3490 | fixing up gd->ram_size the Linux kernel should gets passed | 3490 | fixing up gd->ram_size the Linux kernel should gets passed |
3491 | the now "corrected" memory size and won't touch it either. | 3491 | the now "corrected" memory size and won't touch it either. |
3492 | This should work for arch/ppc and arch/powerpc. Only Linux | 3492 | This should work for arch/ppc and arch/powerpc. Only Linux |
3493 | board ports in arch/powerpc with bootwrapper support that | 3493 | board ports in arch/powerpc with bootwrapper support that |
3494 | recalculate the memory size from the SDRAM controller setup | 3494 | recalculate the memory size from the SDRAM controller setup |
3495 | will have to get fixed in Linux additionally. | 3495 | will have to get fixed in Linux additionally. |
3496 | 3496 | ||
3497 | This option can be used as a workaround for the 440EPx/GRx | 3497 | This option can be used as a workaround for the 440EPx/GRx |
3498 | CHIP 11 errata where the last 256 bytes in SDRAM shouldn't | 3498 | CHIP 11 errata where the last 256 bytes in SDRAM shouldn't |
3499 | be touched. | 3499 | be touched. |
3500 | 3500 | ||
3501 | WARNING: Please make sure that this value is a multiple of | 3501 | WARNING: Please make sure that this value is a multiple of |
3502 | the Linux page size (normally 4k). If this is not the case, | 3502 | the Linux page size (normally 4k). If this is not the case, |
3503 | then the end address of the Linux memory will be located at a | 3503 | then the end address of the Linux memory will be located at a |
3504 | non page size aligned address and this could cause major | 3504 | non page size aligned address and this could cause major |
3505 | problems. | 3505 | problems. |
3506 | 3506 | ||
3507 | - CONFIG_SYS_LOADS_BAUD_CHANGE: | 3507 | - CONFIG_SYS_LOADS_BAUD_CHANGE: |
3508 | Enable temporary baudrate change while serial download | 3508 | Enable temporary baudrate change while serial download |
3509 | 3509 | ||
3510 | - CONFIG_SYS_SDRAM_BASE: | 3510 | - CONFIG_SYS_SDRAM_BASE: |
3511 | Physical start address of SDRAM. _Must_ be 0 here. | 3511 | Physical start address of SDRAM. _Must_ be 0 here. |
3512 | 3512 | ||
3513 | - CONFIG_SYS_MBIO_BASE: | 3513 | - CONFIG_SYS_MBIO_BASE: |
3514 | Physical start address of Motherboard I/O (if using a | 3514 | Physical start address of Motherboard I/O (if using a |
3515 | Cogent motherboard) | 3515 | Cogent motherboard) |
3516 | 3516 | ||
3517 | - CONFIG_SYS_FLASH_BASE: | 3517 | - CONFIG_SYS_FLASH_BASE: |
3518 | Physical start address of Flash memory. | 3518 | Physical start address of Flash memory. |
3519 | 3519 | ||
3520 | - CONFIG_SYS_MONITOR_BASE: | 3520 | - CONFIG_SYS_MONITOR_BASE: |
3521 | Physical start address of boot monitor code (set by | 3521 | Physical start address of boot monitor code (set by |
3522 | make config files to be same as the text base address | 3522 | make config files to be same as the text base address |
3523 | (CONFIG_SYS_TEXT_BASE) used when linking) - same as | 3523 | (CONFIG_SYS_TEXT_BASE) used when linking) - same as |
3524 | CONFIG_SYS_FLASH_BASE when booting from flash. | 3524 | CONFIG_SYS_FLASH_BASE when booting from flash. |
3525 | 3525 | ||
3526 | - CONFIG_SYS_MONITOR_LEN: | 3526 | - CONFIG_SYS_MONITOR_LEN: |
3527 | Size of memory reserved for monitor code, used to | 3527 | Size of memory reserved for monitor code, used to |
3528 | determine _at_compile_time_ (!) if the environment is | 3528 | determine _at_compile_time_ (!) if the environment is |
3529 | embedded within the U-Boot image, or in a separate | 3529 | embedded within the U-Boot image, or in a separate |
3530 | flash sector. | 3530 | flash sector. |
3531 | 3531 | ||
3532 | - CONFIG_SYS_MALLOC_LEN: | 3532 | - CONFIG_SYS_MALLOC_LEN: |
3533 | Size of DRAM reserved for malloc() use. | 3533 | Size of DRAM reserved for malloc() use. |
3534 | 3534 | ||
3535 | - CONFIG_SYS_BOOTM_LEN: | 3535 | - CONFIG_SYS_BOOTM_LEN: |
3536 | Normally compressed uImages are limited to an | 3536 | Normally compressed uImages are limited to an |
3537 | uncompressed size of 8 MBytes. If this is not enough, | 3537 | uncompressed size of 8 MBytes. If this is not enough, |
3538 | you can define CONFIG_SYS_BOOTM_LEN in your board config file | 3538 | you can define CONFIG_SYS_BOOTM_LEN in your board config file |
3539 | to adjust this setting to your needs. | 3539 | to adjust this setting to your needs. |
3540 | 3540 | ||
3541 | - CONFIG_SYS_BOOTMAPSZ: | 3541 | - CONFIG_SYS_BOOTMAPSZ: |
3542 | Maximum size of memory mapped by the startup code of | 3542 | Maximum size of memory mapped by the startup code of |
3543 | the Linux kernel; all data that must be processed by | 3543 | the Linux kernel; all data that must be processed by |
3544 | the Linux kernel (bd_info, boot arguments, FDT blob if | 3544 | the Linux kernel (bd_info, boot arguments, FDT blob if |
3545 | used) must be put below this limit, unless "bootm_low" | 3545 | used) must be put below this limit, unless "bootm_low" |
3546 | environment variable is defined and non-zero. In such case | 3546 | environment variable is defined and non-zero. In such case |
3547 | all data for the Linux kernel must be between "bootm_low" | 3547 | all data for the Linux kernel must be between "bootm_low" |
3548 | and "bootm_low" + CONFIG_SYS_BOOTMAPSZ. The environment | 3548 | and "bootm_low" + CONFIG_SYS_BOOTMAPSZ. The environment |
3549 | variable "bootm_mapsize" will override the value of | 3549 | variable "bootm_mapsize" will override the value of |
3550 | CONFIG_SYS_BOOTMAPSZ. If CONFIG_SYS_BOOTMAPSZ is undefined, | 3550 | CONFIG_SYS_BOOTMAPSZ. If CONFIG_SYS_BOOTMAPSZ is undefined, |
3551 | then the value in "bootm_size" will be used instead. | 3551 | then the value in "bootm_size" will be used instead. |
3552 | 3552 | ||
3553 | - CONFIG_SYS_BOOT_RAMDISK_HIGH: | 3553 | - CONFIG_SYS_BOOT_RAMDISK_HIGH: |
3554 | Enable initrd_high functionality. If defined then the | 3554 | Enable initrd_high functionality. If defined then the |
3555 | initrd_high feature is enabled and the bootm ramdisk subcommand | 3555 | initrd_high feature is enabled and the bootm ramdisk subcommand |
3556 | is enabled. | 3556 | is enabled. |
3557 | 3557 | ||
3558 | - CONFIG_SYS_BOOT_GET_CMDLINE: | 3558 | - CONFIG_SYS_BOOT_GET_CMDLINE: |
3559 | Enables allocating and saving kernel cmdline in space between | 3559 | Enables allocating and saving kernel cmdline in space between |
3560 | "bootm_low" and "bootm_low" + BOOTMAPSZ. | 3560 | "bootm_low" and "bootm_low" + BOOTMAPSZ. |
3561 | 3561 | ||
3562 | - CONFIG_SYS_BOOT_GET_KBD: | 3562 | - CONFIG_SYS_BOOT_GET_KBD: |
3563 | Enables allocating and saving a kernel copy of the bd_info in | 3563 | Enables allocating and saving a kernel copy of the bd_info in |
3564 | space between "bootm_low" and "bootm_low" + BOOTMAPSZ. | 3564 | space between "bootm_low" and "bootm_low" + BOOTMAPSZ. |
3565 | 3565 | ||
3566 | - CONFIG_SYS_MAX_FLASH_BANKS: | 3566 | - CONFIG_SYS_MAX_FLASH_BANKS: |
3567 | Max number of Flash memory banks | 3567 | Max number of Flash memory banks |
3568 | 3568 | ||
3569 | - CONFIG_SYS_MAX_FLASH_SECT: | 3569 | - CONFIG_SYS_MAX_FLASH_SECT: |
3570 | Max number of sectors on a Flash chip | 3570 | Max number of sectors on a Flash chip |
3571 | 3571 | ||
3572 | - CONFIG_SYS_FLASH_ERASE_TOUT: | 3572 | - CONFIG_SYS_FLASH_ERASE_TOUT: |
3573 | Timeout for Flash erase operations (in ms) | 3573 | Timeout for Flash erase operations (in ms) |
3574 | 3574 | ||
3575 | - CONFIG_SYS_FLASH_WRITE_TOUT: | 3575 | - CONFIG_SYS_FLASH_WRITE_TOUT: |
3576 | Timeout for Flash write operations (in ms) | 3576 | Timeout for Flash write operations (in ms) |
3577 | 3577 | ||
3578 | - CONFIG_SYS_FLASH_LOCK_TOUT | 3578 | - CONFIG_SYS_FLASH_LOCK_TOUT |
3579 | Timeout for Flash set sector lock bit operation (in ms) | 3579 | Timeout for Flash set sector lock bit operation (in ms) |
3580 | 3580 | ||
3581 | - CONFIG_SYS_FLASH_UNLOCK_TOUT | 3581 | - CONFIG_SYS_FLASH_UNLOCK_TOUT |
3582 | Timeout for Flash clear lock bits operation (in ms) | 3582 | Timeout for Flash clear lock bits operation (in ms) |
3583 | 3583 | ||
3584 | - CONFIG_SYS_FLASH_PROTECTION | 3584 | - CONFIG_SYS_FLASH_PROTECTION |
3585 | If defined, hardware flash sectors protection is used | 3585 | If defined, hardware flash sectors protection is used |
3586 | instead of U-Boot software protection. | 3586 | instead of U-Boot software protection. |
3587 | 3587 | ||
3588 | - CONFIG_SYS_DIRECT_FLASH_TFTP: | 3588 | - CONFIG_SYS_DIRECT_FLASH_TFTP: |
3589 | 3589 | ||
3590 | Enable TFTP transfers directly to flash memory; | 3590 | Enable TFTP transfers directly to flash memory; |
3591 | without this option such a download has to be | 3591 | without this option such a download has to be |
3592 | performed in two steps: (1) download to RAM, and (2) | 3592 | performed in two steps: (1) download to RAM, and (2) |
3593 | copy from RAM to flash. | 3593 | copy from RAM to flash. |
3594 | 3594 | ||
3595 | The two-step approach is usually more reliable, since | 3595 | The two-step approach is usually more reliable, since |
3596 | you can check if the download worked before you erase | 3596 | you can check if the download worked before you erase |
3597 | the flash, but in some situations (when system RAM is | 3597 | the flash, but in some situations (when system RAM is |
3598 | too limited to allow for a temporary copy of the | 3598 | too limited to allow for a temporary copy of the |
3599 | downloaded image) this option may be very useful. | 3599 | downloaded image) this option may be very useful. |
3600 | 3600 | ||
3601 | - CONFIG_SYS_FLASH_CFI: | 3601 | - CONFIG_SYS_FLASH_CFI: |
3602 | Define if the flash driver uses extra elements in the | 3602 | Define if the flash driver uses extra elements in the |
3603 | common flash structure for storing flash geometry. | 3603 | common flash structure for storing flash geometry. |
3604 | 3604 | ||
3605 | - CONFIG_FLASH_CFI_DRIVER | 3605 | - CONFIG_FLASH_CFI_DRIVER |
3606 | This option also enables the building of the cfi_flash driver | 3606 | This option also enables the building of the cfi_flash driver |
3607 | in the drivers directory | 3607 | in the drivers directory |
3608 | 3608 | ||
3609 | - CONFIG_FLASH_CFI_MTD | 3609 | - CONFIG_FLASH_CFI_MTD |
3610 | This option enables the building of the cfi_mtd driver | 3610 | This option enables the building of the cfi_mtd driver |
3611 | in the drivers directory. The driver exports CFI flash | 3611 | in the drivers directory. The driver exports CFI flash |
3612 | to the MTD layer. | 3612 | to the MTD layer. |
3613 | 3613 | ||
3614 | - CONFIG_SYS_FLASH_USE_BUFFER_WRITE | 3614 | - CONFIG_SYS_FLASH_USE_BUFFER_WRITE |
3615 | Use buffered writes to flash. | 3615 | Use buffered writes to flash. |
3616 | 3616 | ||
3617 | - CONFIG_FLASH_SPANSION_S29WS_N | 3617 | - CONFIG_FLASH_SPANSION_S29WS_N |
3618 | s29ws-n MirrorBit flash has non-standard addresses for buffered | 3618 | s29ws-n MirrorBit flash has non-standard addresses for buffered |
3619 | write commands. | 3619 | write commands. |
3620 | 3620 | ||
3621 | - CONFIG_SYS_FLASH_QUIET_TEST | 3621 | - CONFIG_SYS_FLASH_QUIET_TEST |
3622 | If this option is defined, the common CFI flash doesn't | 3622 | If this option is defined, the common CFI flash doesn't |
3623 | print it's warning upon not recognized FLASH banks. This | 3623 | print it's warning upon not recognized FLASH banks. This |
3624 | is useful, if some of the configured banks are only | 3624 | is useful, if some of the configured banks are only |
3625 | optionally available. | 3625 | optionally available. |
3626 | 3626 | ||
3627 | - CONFIG_FLASH_SHOW_PROGRESS | 3627 | - CONFIG_FLASH_SHOW_PROGRESS |
3628 | If defined (must be an integer), print out countdown | 3628 | If defined (must be an integer), print out countdown |
3629 | digits and dots. Recommended value: 45 (9..1) for 80 | 3629 | digits and dots. Recommended value: 45 (9..1) for 80 |
3630 | column displays, 15 (3..1) for 40 column displays. | 3630 | column displays, 15 (3..1) for 40 column displays. |
3631 | 3631 | ||
3632 | - CONFIG_FLASH_VERIFY | 3632 | - CONFIG_FLASH_VERIFY |
3633 | If defined, the content of the flash (destination) is compared | 3633 | If defined, the content of the flash (destination) is compared |
3634 | against the source after the write operation. An error message | 3634 | against the source after the write operation. An error message |
3635 | will be printed when the contents are not identical. | 3635 | will be printed when the contents are not identical. |
3636 | Please note that this option is useless in nearly all cases, | 3636 | Please note that this option is useless in nearly all cases, |
3637 | since such flash programming errors usually are detected earlier | 3637 | since such flash programming errors usually are detected earlier |
3638 | while unprotecting/erasing/programming. Please only enable | 3638 | while unprotecting/erasing/programming. Please only enable |
3639 | this option if you really know what you are doing. | 3639 | this option if you really know what you are doing. |
3640 | 3640 | ||
3641 | - CONFIG_SYS_RX_ETH_BUFFER: | 3641 | - CONFIG_SYS_RX_ETH_BUFFER: |
3642 | Defines the number of Ethernet receive buffers. On some | 3642 | Defines the number of Ethernet receive buffers. On some |
3643 | Ethernet controllers it is recommended to set this value | 3643 | Ethernet controllers it is recommended to set this value |
3644 | to 8 or even higher (EEPRO100 or 405 EMAC), since all | 3644 | to 8 or even higher (EEPRO100 or 405 EMAC), since all |
3645 | buffers can be full shortly after enabling the interface | 3645 | buffers can be full shortly after enabling the interface |
3646 | on high Ethernet traffic. | 3646 | on high Ethernet traffic. |
3647 | Defaults to 4 if not defined. | 3647 | Defaults to 4 if not defined. |
3648 | 3648 | ||
3649 | - CONFIG_ENV_MAX_ENTRIES | 3649 | - CONFIG_ENV_MAX_ENTRIES |
3650 | 3650 | ||
3651 | Maximum number of entries in the hash table that is used | 3651 | Maximum number of entries in the hash table that is used |
3652 | internally to store the environment settings. The default | 3652 | internally to store the environment settings. The default |
3653 | setting is supposed to be generous and should work in most | 3653 | setting is supposed to be generous and should work in most |
3654 | cases. This setting can be used to tune behaviour; see | 3654 | cases. This setting can be used to tune behaviour; see |
3655 | lib/hashtable.c for details. | 3655 | lib/hashtable.c for details. |
3656 | 3656 | ||
3657 | - CONFIG_ENV_FLAGS_LIST_DEFAULT | 3657 | - CONFIG_ENV_FLAGS_LIST_DEFAULT |
3658 | - CONFIG_ENV_FLAGS_LIST_STATIC | 3658 | - CONFIG_ENV_FLAGS_LIST_STATIC |
3659 | Enable validation of the values given to environment variables when | 3659 | Enable validation of the values given to environment variables when |
3660 | calling env set. Variables can be restricted to only decimal, | 3660 | calling env set. Variables can be restricted to only decimal, |
3661 | hexadecimal, or boolean. If CONFIG_CMD_NET is also defined, | 3661 | hexadecimal, or boolean. If CONFIG_CMD_NET is also defined, |
3662 | the variables can also be restricted to IP address or MAC address. | 3662 | the variables can also be restricted to IP address or MAC address. |
3663 | 3663 | ||
3664 | The format of the list is: | 3664 | The format of the list is: |
3665 | type_attribute = [s|d|x|b|i|m] | 3665 | type_attribute = [s|d|x|b|i|m] |
3666 | access_atribute = [a|r|o|c] | 3666 | access_atribute = [a|r|o|c] |
3667 | attributes = type_attribute[access_atribute] | 3667 | attributes = type_attribute[access_atribute] |
3668 | entry = variable_name[:attributes] | 3668 | entry = variable_name[:attributes] |
3669 | list = entry[,list] | 3669 | list = entry[,list] |
3670 | 3670 | ||
3671 | The type attributes are: | 3671 | The type attributes are: |
3672 | s - String (default) | 3672 | s - String (default) |
3673 | d - Decimal | 3673 | d - Decimal |
3674 | x - Hexadecimal | 3674 | x - Hexadecimal |
3675 | b - Boolean ([1yYtT|0nNfF]) | 3675 | b - Boolean ([1yYtT|0nNfF]) |
3676 | i - IP address | 3676 | i - IP address |
3677 | m - MAC address | 3677 | m - MAC address |
3678 | 3678 | ||
3679 | The access attributes are: | 3679 | The access attributes are: |
3680 | a - Any (default) | 3680 | a - Any (default) |
3681 | r - Read-only | 3681 | r - Read-only |
3682 | o - Write-once | 3682 | o - Write-once |
3683 | c - Change-default | 3683 | c - Change-default |
3684 | 3684 | ||
3685 | - CONFIG_ENV_FLAGS_LIST_DEFAULT | 3685 | - CONFIG_ENV_FLAGS_LIST_DEFAULT |
3686 | Define this to a list (string) to define the ".flags" | 3686 | Define this to a list (string) to define the ".flags" |
3687 | envirnoment variable in the default or embedded environment. | 3687 | envirnoment variable in the default or embedded environment. |
3688 | 3688 | ||
3689 | - CONFIG_ENV_FLAGS_LIST_STATIC | 3689 | - CONFIG_ENV_FLAGS_LIST_STATIC |
3690 | Define this to a list (string) to define validation that | 3690 | Define this to a list (string) to define validation that |
3691 | should be done if an entry is not found in the ".flags" | 3691 | should be done if an entry is not found in the ".flags" |
3692 | environment variable. To override a setting in the static | 3692 | environment variable. To override a setting in the static |
3693 | list, simply add an entry for the same variable name to the | 3693 | list, simply add an entry for the same variable name to the |
3694 | ".flags" variable. | 3694 | ".flags" variable. |
3695 | 3695 | ||
3696 | - CONFIG_ENV_ACCESS_IGNORE_FORCE | 3696 | - CONFIG_ENV_ACCESS_IGNORE_FORCE |
3697 | If defined, don't allow the -f switch to env set override variable | 3697 | If defined, don't allow the -f switch to env set override variable |
3698 | access flags. | 3698 | access flags. |
3699 | 3699 | ||
3700 | - CONFIG_SYS_GENERIC_BOARD | 3700 | - CONFIG_SYS_GENERIC_BOARD |
3701 | This selects the architecture-generic board system instead of the | 3701 | This selects the architecture-generic board system instead of the |
3702 | architecture-specific board files. It is intended to move boards | 3702 | architecture-specific board files. It is intended to move boards |
3703 | to this new framework over time. Defining this will disable the | 3703 | to this new framework over time. Defining this will disable the |
3704 | arch/foo/lib/board.c file and use common/board_f.c and | 3704 | arch/foo/lib/board.c file and use common/board_f.c and |
3705 | common/board_r.c instead. To use this option your architecture | 3705 | common/board_r.c instead. To use this option your architecture |
3706 | must support it (i.e. must define __HAVE_ARCH_GENERIC_BOARD in | 3706 | must support it (i.e. must define __HAVE_ARCH_GENERIC_BOARD in |
3707 | its config.mk file). If you find problems enabling this option on | 3707 | its config.mk file). If you find problems enabling this option on |
3708 | your board please report the problem and send patches! | 3708 | your board please report the problem and send patches! |
3709 | 3709 | ||
3710 | - CONFIG_SYS_SYM_OFFSETS | ||
3711 | This is set by architectures that use offsets for link symbols | ||
3712 | instead of absolute values. So bss_start is obtained using an | ||
3713 | offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than | ||
3714 | directly. You should not need to touch this setting. | ||
3715 | |||
3716 | - CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC (OMAP only) | 3710 | - CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC (OMAP only) |
3717 | This is set by OMAP boards for the max time that reset should | 3711 | This is set by OMAP boards for the max time that reset should |
3718 | be asserted. See doc/README.omap-reset-time for details on how | 3712 | be asserted. See doc/README.omap-reset-time for details on how |
3719 | the value can be calulated on a given board. | 3713 | the value can be calulated on a given board. |
3720 | 3714 | ||
3721 | The following definitions that deal with the placement and management | 3715 | The following definitions that deal with the placement and management |
3722 | of environment data (variable area); in general, we support the | 3716 | of environment data (variable area); in general, we support the |
3723 | following configurations: | 3717 | following configurations: |
3724 | 3718 | ||
3725 | - CONFIG_BUILD_ENVCRC: | 3719 | - CONFIG_BUILD_ENVCRC: |
3726 | 3720 | ||
3727 | Builds up envcrc with the target environment so that external utils | 3721 | Builds up envcrc with the target environment so that external utils |
3728 | may easily extract it and embed it in final U-Boot images. | 3722 | may easily extract it and embed it in final U-Boot images. |
3729 | 3723 | ||
3730 | - CONFIG_ENV_IS_IN_FLASH: | 3724 | - CONFIG_ENV_IS_IN_FLASH: |
3731 | 3725 | ||
3732 | Define this if the environment is in flash memory. | 3726 | Define this if the environment is in flash memory. |
3733 | 3727 | ||
3734 | a) The environment occupies one whole flash sector, which is | 3728 | a) The environment occupies one whole flash sector, which is |
3735 | "embedded" in the text segment with the U-Boot code. This | 3729 | "embedded" in the text segment with the U-Boot code. This |
3736 | happens usually with "bottom boot sector" or "top boot | 3730 | happens usually with "bottom boot sector" or "top boot |
3737 | sector" type flash chips, which have several smaller | 3731 | sector" type flash chips, which have several smaller |
3738 | sectors at the start or the end. For instance, such a | 3732 | sectors at the start or the end. For instance, such a |
3739 | layout can have sector sizes of 8, 2x4, 16, Nx32 kB. In | 3733 | layout can have sector sizes of 8, 2x4, 16, Nx32 kB. In |
3740 | such a case you would place the environment in one of the | 3734 | such a case you would place the environment in one of the |
3741 | 4 kB sectors - with U-Boot code before and after it. With | 3735 | 4 kB sectors - with U-Boot code before and after it. With |
3742 | "top boot sector" type flash chips, you would put the | 3736 | "top boot sector" type flash chips, you would put the |
3743 | environment in one of the last sectors, leaving a gap | 3737 | environment in one of the last sectors, leaving a gap |
3744 | between U-Boot and the environment. | 3738 | between U-Boot and the environment. |
3745 | 3739 | ||
3746 | - CONFIG_ENV_OFFSET: | 3740 | - CONFIG_ENV_OFFSET: |
3747 | 3741 | ||
3748 | Offset of environment data (variable area) to the | 3742 | Offset of environment data (variable area) to the |
3749 | beginning of flash memory; for instance, with bottom boot | 3743 | beginning of flash memory; for instance, with bottom boot |
3750 | type flash chips the second sector can be used: the offset | 3744 | type flash chips the second sector can be used: the offset |
3751 | for this sector is given here. | 3745 | for this sector is given here. |
3752 | 3746 | ||
3753 | CONFIG_ENV_OFFSET is used relative to CONFIG_SYS_FLASH_BASE. | 3747 | CONFIG_ENV_OFFSET is used relative to CONFIG_SYS_FLASH_BASE. |
3754 | 3748 | ||
3755 | - CONFIG_ENV_ADDR: | 3749 | - CONFIG_ENV_ADDR: |
3756 | 3750 | ||
3757 | This is just another way to specify the start address of | 3751 | This is just another way to specify the start address of |
3758 | the flash sector containing the environment (instead of | 3752 | the flash sector containing the environment (instead of |
3759 | CONFIG_ENV_OFFSET). | 3753 | CONFIG_ENV_OFFSET). |
3760 | 3754 | ||
3761 | - CONFIG_ENV_SECT_SIZE: | 3755 | - CONFIG_ENV_SECT_SIZE: |
3762 | 3756 | ||
3763 | Size of the sector containing the environment. | 3757 | Size of the sector containing the environment. |
3764 | 3758 | ||
3765 | 3759 | ||
3766 | b) Sometimes flash chips have few, equal sized, BIG sectors. | 3760 | b) Sometimes flash chips have few, equal sized, BIG sectors. |
3767 | In such a case you don't want to spend a whole sector for | 3761 | In such a case you don't want to spend a whole sector for |
3768 | the environment. | 3762 | the environment. |
3769 | 3763 | ||
3770 | - CONFIG_ENV_SIZE: | 3764 | - CONFIG_ENV_SIZE: |
3771 | 3765 | ||
3772 | If you use this in combination with CONFIG_ENV_IS_IN_FLASH | 3766 | If you use this in combination with CONFIG_ENV_IS_IN_FLASH |
3773 | and CONFIG_ENV_SECT_SIZE, you can specify to use only a part | 3767 | and CONFIG_ENV_SECT_SIZE, you can specify to use only a part |
3774 | of this flash sector for the environment. This saves | 3768 | of this flash sector for the environment. This saves |
3775 | memory for the RAM copy of the environment. | 3769 | memory for the RAM copy of the environment. |
3776 | 3770 | ||
3777 | It may also save flash memory if you decide to use this | 3771 | It may also save flash memory if you decide to use this |
3778 | when your environment is "embedded" within U-Boot code, | 3772 | when your environment is "embedded" within U-Boot code, |
3779 | since then the remainder of the flash sector could be used | 3773 | since then the remainder of the flash sector could be used |
3780 | for U-Boot code. It should be pointed out that this is | 3774 | for U-Boot code. It should be pointed out that this is |
3781 | STRONGLY DISCOURAGED from a robustness point of view: | 3775 | STRONGLY DISCOURAGED from a robustness point of view: |
3782 | updating the environment in flash makes it always | 3776 | updating the environment in flash makes it always |
3783 | necessary to erase the WHOLE sector. If something goes | 3777 | necessary to erase the WHOLE sector. If something goes |
3784 | wrong before the contents has been restored from a copy in | 3778 | wrong before the contents has been restored from a copy in |
3785 | RAM, your target system will be dead. | 3779 | RAM, your target system will be dead. |
3786 | 3780 | ||
3787 | - CONFIG_ENV_ADDR_REDUND | 3781 | - CONFIG_ENV_ADDR_REDUND |
3788 | CONFIG_ENV_SIZE_REDUND | 3782 | CONFIG_ENV_SIZE_REDUND |
3789 | 3783 | ||
3790 | These settings describe a second storage area used to hold | 3784 | These settings describe a second storage area used to hold |
3791 | a redundant copy of the environment data, so that there is | 3785 | a redundant copy of the environment data, so that there is |
3792 | a valid backup copy in case there is a power failure during | 3786 | a valid backup copy in case there is a power failure during |
3793 | a "saveenv" operation. | 3787 | a "saveenv" operation. |
3794 | 3788 | ||
3795 | BE CAREFUL! Any changes to the flash layout, and some changes to the | 3789 | BE CAREFUL! Any changes to the flash layout, and some changes to the |
3796 | source code will make it necessary to adapt <board>/u-boot.lds* | 3790 | source code will make it necessary to adapt <board>/u-boot.lds* |
3797 | accordingly! | 3791 | accordingly! |
3798 | 3792 | ||
3799 | 3793 | ||
3800 | - CONFIG_ENV_IS_IN_NVRAM: | 3794 | - CONFIG_ENV_IS_IN_NVRAM: |
3801 | 3795 | ||
3802 | Define this if you have some non-volatile memory device | 3796 | Define this if you have some non-volatile memory device |
3803 | (NVRAM, battery buffered SRAM) which you want to use for the | 3797 | (NVRAM, battery buffered SRAM) which you want to use for the |
3804 | environment. | 3798 | environment. |
3805 | 3799 | ||
3806 | - CONFIG_ENV_ADDR: | 3800 | - CONFIG_ENV_ADDR: |
3807 | - CONFIG_ENV_SIZE: | 3801 | - CONFIG_ENV_SIZE: |
3808 | 3802 | ||
3809 | These two #defines are used to determine the memory area you | 3803 | These two #defines are used to determine the memory area you |
3810 | want to use for environment. It is assumed that this memory | 3804 | want to use for environment. It is assumed that this memory |
3811 | can just be read and written to, without any special | 3805 | can just be read and written to, without any special |
3812 | provision. | 3806 | provision. |
3813 | 3807 | ||
3814 | BE CAREFUL! The first access to the environment happens quite early | 3808 | BE CAREFUL! The first access to the environment happens quite early |
3815 | in U-Boot initalization (when we try to get the setting of for the | 3809 | in U-Boot initalization (when we try to get the setting of for the |
3816 | console baudrate). You *MUST* have mapped your NVRAM area then, or | 3810 | console baudrate). You *MUST* have mapped your NVRAM area then, or |
3817 | U-Boot will hang. | 3811 | U-Boot will hang. |
3818 | 3812 | ||
3819 | Please note that even with NVRAM we still use a copy of the | 3813 | Please note that even with NVRAM we still use a copy of the |
3820 | environment in RAM: we could work on NVRAM directly, but we want to | 3814 | environment in RAM: we could work on NVRAM directly, but we want to |
3821 | keep settings there always unmodified except somebody uses "saveenv" | 3815 | keep settings there always unmodified except somebody uses "saveenv" |
3822 | to save the current settings. | 3816 | to save the current settings. |
3823 | 3817 | ||
3824 | 3818 | ||
3825 | - CONFIG_ENV_IS_IN_EEPROM: | 3819 | - CONFIG_ENV_IS_IN_EEPROM: |
3826 | 3820 | ||
3827 | Use this if you have an EEPROM or similar serial access | 3821 | Use this if you have an EEPROM or similar serial access |
3828 | device and a driver for it. | 3822 | device and a driver for it. |
3829 | 3823 | ||
3830 | - CONFIG_ENV_OFFSET: | 3824 | - CONFIG_ENV_OFFSET: |
3831 | - CONFIG_ENV_SIZE: | 3825 | - CONFIG_ENV_SIZE: |
3832 | 3826 | ||
3833 | These two #defines specify the offset and size of the | 3827 | These two #defines specify the offset and size of the |
3834 | environment area within the total memory of your EEPROM. | 3828 | environment area within the total memory of your EEPROM. |
3835 | 3829 | ||
3836 | - CONFIG_SYS_I2C_EEPROM_ADDR: | 3830 | - CONFIG_SYS_I2C_EEPROM_ADDR: |
3837 | If defined, specified the chip address of the EEPROM device. | 3831 | If defined, specified the chip address of the EEPROM device. |
3838 | The default address is zero. | 3832 | The default address is zero. |
3839 | 3833 | ||
3840 | - CONFIG_SYS_EEPROM_PAGE_WRITE_BITS: | 3834 | - CONFIG_SYS_EEPROM_PAGE_WRITE_BITS: |
3841 | If defined, the number of bits used to address bytes in a | 3835 | If defined, the number of bits used to address bytes in a |
3842 | single page in the EEPROM device. A 64 byte page, for example | 3836 | single page in the EEPROM device. A 64 byte page, for example |
3843 | would require six bits. | 3837 | would require six bits. |
3844 | 3838 | ||
3845 | - CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS: | 3839 | - CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS: |
3846 | If defined, the number of milliseconds to delay between | 3840 | If defined, the number of milliseconds to delay between |
3847 | page writes. The default is zero milliseconds. | 3841 | page writes. The default is zero milliseconds. |
3848 | 3842 | ||
3849 | - CONFIG_SYS_I2C_EEPROM_ADDR_LEN: | 3843 | - CONFIG_SYS_I2C_EEPROM_ADDR_LEN: |
3850 | The length in bytes of the EEPROM memory array address. Note | 3844 | The length in bytes of the EEPROM memory array address. Note |
3851 | that this is NOT the chip address length! | 3845 | that this is NOT the chip address length! |
3852 | 3846 | ||
3853 | - CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW: | 3847 | - CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW: |
3854 | EEPROM chips that implement "address overflow" are ones | 3848 | EEPROM chips that implement "address overflow" are ones |
3855 | like Catalyst 24WC04/08/16 which has 9/10/11 bits of | 3849 | like Catalyst 24WC04/08/16 which has 9/10/11 bits of |
3856 | address and the extra bits end up in the "chip address" bit | 3850 | address and the extra bits end up in the "chip address" bit |
3857 | slots. This makes a 24WC08 (1Kbyte) chip look like four 256 | 3851 | slots. This makes a 24WC08 (1Kbyte) chip look like four 256 |
3858 | byte chips. | 3852 | byte chips. |
3859 | 3853 | ||
3860 | Note that we consider the length of the address field to | 3854 | Note that we consider the length of the address field to |
3861 | still be one byte because the extra address bits are hidden | 3855 | still be one byte because the extra address bits are hidden |
3862 | in the chip address. | 3856 | in the chip address. |
3863 | 3857 | ||
3864 | - CONFIG_SYS_EEPROM_SIZE: | 3858 | - CONFIG_SYS_EEPROM_SIZE: |
3865 | The size in bytes of the EEPROM device. | 3859 | The size in bytes of the EEPROM device. |
3866 | 3860 | ||
3867 | - CONFIG_ENV_EEPROM_IS_ON_I2C | 3861 | - CONFIG_ENV_EEPROM_IS_ON_I2C |
3868 | define this, if you have I2C and SPI activated, and your | 3862 | define this, if you have I2C and SPI activated, and your |
3869 | EEPROM, which holds the environment, is on the I2C bus. | 3863 | EEPROM, which holds the environment, is on the I2C bus. |
3870 | 3864 | ||
3871 | - CONFIG_I2C_ENV_EEPROM_BUS | 3865 | - CONFIG_I2C_ENV_EEPROM_BUS |
3872 | if you have an Environment on an EEPROM reached over | 3866 | if you have an Environment on an EEPROM reached over |
3873 | I2C muxes, you can define here, how to reach this | 3867 | I2C muxes, you can define here, how to reach this |
3874 | EEPROM. For example: | 3868 | EEPROM. For example: |
3875 | 3869 | ||
3876 | #define CONFIG_I2C_ENV_EEPROM_BUS 1 | 3870 | #define CONFIG_I2C_ENV_EEPROM_BUS 1 |
3877 | 3871 | ||
3878 | EEPROM which holds the environment, is reached over | 3872 | EEPROM which holds the environment, is reached over |
3879 | a pca9547 i2c mux with address 0x70, channel 3. | 3873 | a pca9547 i2c mux with address 0x70, channel 3. |
3880 | 3874 | ||
3881 | - CONFIG_ENV_IS_IN_DATAFLASH: | 3875 | - CONFIG_ENV_IS_IN_DATAFLASH: |
3882 | 3876 | ||
3883 | Define this if you have a DataFlash memory device which you | 3877 | Define this if you have a DataFlash memory device which you |
3884 | want to use for the environment. | 3878 | want to use for the environment. |
3885 | 3879 | ||
3886 | - CONFIG_ENV_OFFSET: | 3880 | - CONFIG_ENV_OFFSET: |
3887 | - CONFIG_ENV_ADDR: | 3881 | - CONFIG_ENV_ADDR: |
3888 | - CONFIG_ENV_SIZE: | 3882 | - CONFIG_ENV_SIZE: |
3889 | 3883 | ||
3890 | These three #defines specify the offset and size of the | 3884 | These three #defines specify the offset and size of the |
3891 | environment area within the total memory of your DataFlash placed | 3885 | environment area within the total memory of your DataFlash placed |
3892 | at the specified address. | 3886 | at the specified address. |
3893 | 3887 | ||
3894 | - CONFIG_ENV_IS_IN_REMOTE: | 3888 | - CONFIG_ENV_IS_IN_REMOTE: |
3895 | 3889 | ||
3896 | Define this if you have a remote memory space which you | 3890 | Define this if you have a remote memory space which you |
3897 | want to use for the local device's environment. | 3891 | want to use for the local device's environment. |
3898 | 3892 | ||
3899 | - CONFIG_ENV_ADDR: | 3893 | - CONFIG_ENV_ADDR: |
3900 | - CONFIG_ENV_SIZE: | 3894 | - CONFIG_ENV_SIZE: |
3901 | 3895 | ||
3902 | These two #defines specify the address and size of the | 3896 | These two #defines specify the address and size of the |
3903 | environment area within the remote memory space. The | 3897 | environment area within the remote memory space. The |
3904 | local device can get the environment from remote memory | 3898 | local device can get the environment from remote memory |
3905 | space by SRIO or PCIE links. | 3899 | space by SRIO or PCIE links. |
3906 | 3900 | ||
3907 | BE CAREFUL! For some special cases, the local device can not use | 3901 | BE CAREFUL! For some special cases, the local device can not use |
3908 | "saveenv" command. For example, the local device will get the | 3902 | "saveenv" command. For example, the local device will get the |
3909 | environment stored in a remote NOR flash by SRIO or PCIE link, | 3903 | environment stored in a remote NOR flash by SRIO or PCIE link, |
3910 | but it can not erase, write this NOR flash by SRIO or PCIE interface. | 3904 | but it can not erase, write this NOR flash by SRIO or PCIE interface. |
3911 | 3905 | ||
3912 | - CONFIG_ENV_IS_IN_NAND: | 3906 | - CONFIG_ENV_IS_IN_NAND: |
3913 | 3907 | ||
3914 | Define this if you have a NAND device which you want to use | 3908 | Define this if you have a NAND device which you want to use |
3915 | for the environment. | 3909 | for the environment. |
3916 | 3910 | ||
3917 | - CONFIG_ENV_OFFSET: | 3911 | - CONFIG_ENV_OFFSET: |
3918 | - CONFIG_ENV_SIZE: | 3912 | - CONFIG_ENV_SIZE: |
3919 | 3913 | ||
3920 | These two #defines specify the offset and size of the environment | 3914 | These two #defines specify the offset and size of the environment |
3921 | area within the first NAND device. CONFIG_ENV_OFFSET must be | 3915 | area within the first NAND device. CONFIG_ENV_OFFSET must be |
3922 | aligned to an erase block boundary. | 3916 | aligned to an erase block boundary. |
3923 | 3917 | ||
3924 | - CONFIG_ENV_OFFSET_REDUND (optional): | 3918 | - CONFIG_ENV_OFFSET_REDUND (optional): |
3925 | 3919 | ||
3926 | This setting describes a second storage area of CONFIG_ENV_SIZE | 3920 | This setting describes a second storage area of CONFIG_ENV_SIZE |
3927 | size used to hold a redundant copy of the environment data, so | 3921 | size used to hold a redundant copy of the environment data, so |
3928 | that there is a valid backup copy in case there is a power failure | 3922 | that there is a valid backup copy in case there is a power failure |
3929 | during a "saveenv" operation. CONFIG_ENV_OFFSET_RENDUND must be | 3923 | during a "saveenv" operation. CONFIG_ENV_OFFSET_RENDUND must be |
3930 | aligned to an erase block boundary. | 3924 | aligned to an erase block boundary. |
3931 | 3925 | ||
3932 | - CONFIG_ENV_RANGE (optional): | 3926 | - CONFIG_ENV_RANGE (optional): |
3933 | 3927 | ||
3934 | Specifies the length of the region in which the environment | 3928 | Specifies the length of the region in which the environment |
3935 | can be written. This should be a multiple of the NAND device's | 3929 | can be written. This should be a multiple of the NAND device's |
3936 | block size. Specifying a range with more erase blocks than | 3930 | block size. Specifying a range with more erase blocks than |
3937 | are needed to hold CONFIG_ENV_SIZE allows bad blocks within | 3931 | are needed to hold CONFIG_ENV_SIZE allows bad blocks within |
3938 | the range to be avoided. | 3932 | the range to be avoided. |
3939 | 3933 | ||
3940 | - CONFIG_ENV_OFFSET_OOB (optional): | 3934 | - CONFIG_ENV_OFFSET_OOB (optional): |
3941 | 3935 | ||
3942 | Enables support for dynamically retrieving the offset of the | 3936 | Enables support for dynamically retrieving the offset of the |
3943 | environment from block zero's out-of-band data. The | 3937 | environment from block zero's out-of-band data. The |
3944 | "nand env.oob" command can be used to record this offset. | 3938 | "nand env.oob" command can be used to record this offset. |
3945 | Currently, CONFIG_ENV_OFFSET_REDUND is not supported when | 3939 | Currently, CONFIG_ENV_OFFSET_REDUND is not supported when |
3946 | using CONFIG_ENV_OFFSET_OOB. | 3940 | using CONFIG_ENV_OFFSET_OOB. |
3947 | 3941 | ||
3948 | - CONFIG_NAND_ENV_DST | 3942 | - CONFIG_NAND_ENV_DST |
3949 | 3943 | ||
3950 | Defines address in RAM to which the nand_spl code should copy the | 3944 | Defines address in RAM to which the nand_spl code should copy the |
3951 | environment. If redundant environment is used, it will be copied to | 3945 | environment. If redundant environment is used, it will be copied to |
3952 | CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE. | 3946 | CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE. |
3953 | 3947 | ||
3954 | - CONFIG_ENV_IS_IN_UBI: | 3948 | - CONFIG_ENV_IS_IN_UBI: |
3955 | 3949 | ||
3956 | Define this if you have an UBI volume that you want to use for the | 3950 | Define this if you have an UBI volume that you want to use for the |
3957 | environment. This has the benefit of wear-leveling the environment | 3951 | environment. This has the benefit of wear-leveling the environment |
3958 | accesses, which is important on NAND. | 3952 | accesses, which is important on NAND. |
3959 | 3953 | ||
3960 | - CONFIG_ENV_UBI_PART: | 3954 | - CONFIG_ENV_UBI_PART: |
3961 | 3955 | ||
3962 | Define this to a string that is the mtd partition containing the UBI. | 3956 | Define this to a string that is the mtd partition containing the UBI. |
3963 | 3957 | ||
3964 | - CONFIG_ENV_UBI_VOLUME: | 3958 | - CONFIG_ENV_UBI_VOLUME: |
3965 | 3959 | ||
3966 | Define this to the name of the volume that you want to store the | 3960 | Define this to the name of the volume that you want to store the |
3967 | environment in. | 3961 | environment in. |
3968 | 3962 | ||
3969 | - CONFIG_ENV_UBI_VOLUME_REDUND: | 3963 | - CONFIG_ENV_UBI_VOLUME_REDUND: |
3970 | 3964 | ||
3971 | Define this to the name of another volume to store a second copy of | 3965 | Define this to the name of another volume to store a second copy of |
3972 | the environment in. This will enable redundant environments in UBI. | 3966 | the environment in. This will enable redundant environments in UBI. |
3973 | It is assumed that both volumes are in the same MTD partition. | 3967 | It is assumed that both volumes are in the same MTD partition. |
3974 | 3968 | ||
3975 | - CONFIG_UBI_SILENCE_MSG | 3969 | - CONFIG_UBI_SILENCE_MSG |
3976 | - CONFIG_UBIFS_SILENCE_MSG | 3970 | - CONFIG_UBIFS_SILENCE_MSG |
3977 | 3971 | ||
3978 | You will probably want to define these to avoid a really noisy system | 3972 | You will probably want to define these to avoid a really noisy system |
3979 | when storing the env in UBI. | 3973 | when storing the env in UBI. |
3980 | 3974 | ||
3981 | - CONFIG_ENV_IS_IN_MMC: | 3975 | - CONFIG_ENV_IS_IN_MMC: |
3982 | 3976 | ||
3983 | Define this if you have an MMC device which you want to use for the | 3977 | Define this if you have an MMC device which you want to use for the |
3984 | environment. | 3978 | environment. |
3985 | 3979 | ||
3986 | - CONFIG_SYS_MMC_ENV_DEV: | 3980 | - CONFIG_SYS_MMC_ENV_DEV: |
3987 | 3981 | ||
3988 | Specifies which MMC device the environment is stored in. | 3982 | Specifies which MMC device the environment is stored in. |
3989 | 3983 | ||
3990 | - CONFIG_SYS_MMC_ENV_PART (optional): | 3984 | - CONFIG_SYS_MMC_ENV_PART (optional): |
3991 | 3985 | ||
3992 | Specifies which MMC partition the environment is stored in. If not | 3986 | Specifies which MMC partition the environment is stored in. If not |
3993 | set, defaults to partition 0, the user area. Common values might be | 3987 | set, defaults to partition 0, the user area. Common values might be |
3994 | 1 (first MMC boot partition), 2 (second MMC boot partition). | 3988 | 1 (first MMC boot partition), 2 (second MMC boot partition). |
3995 | 3989 | ||
3996 | - CONFIG_ENV_OFFSET: | 3990 | - CONFIG_ENV_OFFSET: |
3997 | - CONFIG_ENV_SIZE: | 3991 | - CONFIG_ENV_SIZE: |
3998 | 3992 | ||
3999 | These two #defines specify the offset and size of the environment | 3993 | These two #defines specify the offset and size of the environment |
4000 | area within the specified MMC device. | 3994 | area within the specified MMC device. |
4001 | 3995 | ||
4002 | If offset is positive (the usual case), it is treated as relative to | 3996 | If offset is positive (the usual case), it is treated as relative to |
4003 | the start of the MMC partition. If offset is negative, it is treated | 3997 | the start of the MMC partition. If offset is negative, it is treated |
4004 | as relative to the end of the MMC partition. This can be useful if | 3998 | as relative to the end of the MMC partition. This can be useful if |
4005 | your board may be fitted with different MMC devices, which have | 3999 | your board may be fitted with different MMC devices, which have |
4006 | different sizes for the MMC partitions, and you always want the | 4000 | different sizes for the MMC partitions, and you always want the |
4007 | environment placed at the very end of the partition, to leave the | 4001 | environment placed at the very end of the partition, to leave the |
4008 | maximum possible space before it, to store other data. | 4002 | maximum possible space before it, to store other data. |
4009 | 4003 | ||
4010 | These two values are in units of bytes, but must be aligned to an | 4004 | These two values are in units of bytes, but must be aligned to an |
4011 | MMC sector boundary. | 4005 | MMC sector boundary. |
4012 | 4006 | ||
4013 | - CONFIG_ENV_OFFSET_REDUND (optional): | 4007 | - CONFIG_ENV_OFFSET_REDUND (optional): |
4014 | 4008 | ||
4015 | Specifies a second storage area, of CONFIG_ENV_SIZE size, used to | 4009 | Specifies a second storage area, of CONFIG_ENV_SIZE size, used to |
4016 | hold a redundant copy of the environment data. This provides a | 4010 | hold a redundant copy of the environment data. This provides a |
4017 | valid backup copy in case the other copy is corrupted, e.g. due | 4011 | valid backup copy in case the other copy is corrupted, e.g. due |
4018 | to a power failure during a "saveenv" operation. | 4012 | to a power failure during a "saveenv" operation. |
4019 | 4013 | ||
4020 | This value may also be positive or negative; this is handled in the | 4014 | This value may also be positive or negative; this is handled in the |
4021 | same way as CONFIG_ENV_OFFSET. | 4015 | same way as CONFIG_ENV_OFFSET. |
4022 | 4016 | ||
4023 | This value is also in units of bytes, but must also be aligned to | 4017 | This value is also in units of bytes, but must also be aligned to |
4024 | an MMC sector boundary. | 4018 | an MMC sector boundary. |
4025 | 4019 | ||
4026 | - CONFIG_ENV_SIZE_REDUND (optional): | 4020 | - CONFIG_ENV_SIZE_REDUND (optional): |
4027 | 4021 | ||
4028 | This value need not be set, even when CONFIG_ENV_OFFSET_REDUND is | 4022 | This value need not be set, even when CONFIG_ENV_OFFSET_REDUND is |
4029 | set. If this value is set, it must be set to the same value as | 4023 | set. If this value is set, it must be set to the same value as |
4030 | CONFIG_ENV_SIZE. | 4024 | CONFIG_ENV_SIZE. |
4031 | 4025 | ||
4032 | - CONFIG_SYS_SPI_INIT_OFFSET | 4026 | - CONFIG_SYS_SPI_INIT_OFFSET |
4033 | 4027 | ||
4034 | Defines offset to the initial SPI buffer area in DPRAM. The | 4028 | Defines offset to the initial SPI buffer area in DPRAM. The |
4035 | area is used at an early stage (ROM part) if the environment | 4029 | area is used at an early stage (ROM part) if the environment |
4036 | is configured to reside in the SPI EEPROM: We need a 520 byte | 4030 | is configured to reside in the SPI EEPROM: We need a 520 byte |
4037 | scratch DPRAM area. It is used between the two initialization | 4031 | scratch DPRAM area. It is used between the two initialization |
4038 | calls (spi_init_f() and spi_init_r()). A value of 0xB00 seems | 4032 | calls (spi_init_f() and spi_init_r()). A value of 0xB00 seems |
4039 | to be a good choice since it makes it far enough from the | 4033 | to be a good choice since it makes it far enough from the |
4040 | start of the data area as well as from the stack pointer. | 4034 | start of the data area as well as from the stack pointer. |
4041 | 4035 | ||
4042 | Please note that the environment is read-only until the monitor | 4036 | Please note that the environment is read-only until the monitor |
4043 | has been relocated to RAM and a RAM copy of the environment has been | 4037 | has been relocated to RAM and a RAM copy of the environment has been |
4044 | created; also, when using EEPROM you will have to use getenv_f() | 4038 | created; also, when using EEPROM you will have to use getenv_f() |
4045 | until then to read environment variables. | 4039 | until then to read environment variables. |
4046 | 4040 | ||
4047 | The environment is protected by a CRC32 checksum. Before the monitor | 4041 | The environment is protected by a CRC32 checksum. Before the monitor |
4048 | is relocated into RAM, as a result of a bad CRC you will be working | 4042 | is relocated into RAM, as a result of a bad CRC you will be working |
4049 | with the compiled-in default environment - *silently*!!! [This is | 4043 | with the compiled-in default environment - *silently*!!! [This is |
4050 | necessary, because the first environment variable we need is the | 4044 | necessary, because the first environment variable we need is the |
4051 | "baudrate" setting for the console - if we have a bad CRC, we don't | 4045 | "baudrate" setting for the console - if we have a bad CRC, we don't |
4052 | have any device yet where we could complain.] | 4046 | have any device yet where we could complain.] |
4053 | 4047 | ||
4054 | Note: once the monitor has been relocated, then it will complain if | 4048 | Note: once the monitor has been relocated, then it will complain if |
4055 | the default environment is used; a new CRC is computed as soon as you | 4049 | the default environment is used; a new CRC is computed as soon as you |
4056 | use the "saveenv" command to store a valid environment. | 4050 | use the "saveenv" command to store a valid environment. |
4057 | 4051 | ||
4058 | - CONFIG_SYS_FAULT_ECHO_LINK_DOWN: | 4052 | - CONFIG_SYS_FAULT_ECHO_LINK_DOWN: |
4059 | Echo the inverted Ethernet link state to the fault LED. | 4053 | Echo the inverted Ethernet link state to the fault LED. |
4060 | 4054 | ||
4061 | Note: If this option is active, then CONFIG_SYS_FAULT_MII_ADDR | 4055 | Note: If this option is active, then CONFIG_SYS_FAULT_MII_ADDR |
4062 | also needs to be defined. | 4056 | also needs to be defined. |
4063 | 4057 | ||
4064 | - CONFIG_SYS_FAULT_MII_ADDR: | 4058 | - CONFIG_SYS_FAULT_MII_ADDR: |
4065 | MII address of the PHY to check for the Ethernet link state. | 4059 | MII address of the PHY to check for the Ethernet link state. |
4066 | 4060 | ||
4067 | - CONFIG_NS16550_MIN_FUNCTIONS: | 4061 | - CONFIG_NS16550_MIN_FUNCTIONS: |
4068 | Define this if you desire to only have use of the NS16550_init | 4062 | Define this if you desire to only have use of the NS16550_init |
4069 | and NS16550_putc functions for the serial driver located at | 4063 | and NS16550_putc functions for the serial driver located at |
4070 | drivers/serial/ns16550.c. This option is useful for saving | 4064 | drivers/serial/ns16550.c. This option is useful for saving |
4071 | space for already greatly restricted images, including but not | 4065 | space for already greatly restricted images, including but not |
4072 | limited to NAND_SPL configurations. | 4066 | limited to NAND_SPL configurations. |
4073 | 4067 | ||
4074 | - CONFIG_DISPLAY_BOARDINFO | 4068 | - CONFIG_DISPLAY_BOARDINFO |
4075 | Display information about the board that U-Boot is running on | 4069 | Display information about the board that U-Boot is running on |
4076 | when U-Boot starts up. The board function checkboard() is called | 4070 | when U-Boot starts up. The board function checkboard() is called |
4077 | to do this. | 4071 | to do this. |
4078 | 4072 | ||
4079 | - CONFIG_DISPLAY_BOARDINFO_LATE | 4073 | - CONFIG_DISPLAY_BOARDINFO_LATE |
4080 | Similar to the previous option, but display this information | 4074 | Similar to the previous option, but display this information |
4081 | later, once stdio is running and output goes to the LCD, if | 4075 | later, once stdio is running and output goes to the LCD, if |
4082 | present. | 4076 | present. |
4083 | 4077 | ||
4084 | Low Level (hardware related) configuration options: | 4078 | Low Level (hardware related) configuration options: |
4085 | --------------------------------------------------- | 4079 | --------------------------------------------------- |
4086 | 4080 | ||
4087 | - CONFIG_SYS_CACHELINE_SIZE: | 4081 | - CONFIG_SYS_CACHELINE_SIZE: |
4088 | Cache Line Size of the CPU. | 4082 | Cache Line Size of the CPU. |
4089 | 4083 | ||
4090 | - CONFIG_SYS_DEFAULT_IMMR: | 4084 | - CONFIG_SYS_DEFAULT_IMMR: |
4091 | Default address of the IMMR after system reset. | 4085 | Default address of the IMMR after system reset. |
4092 | 4086 | ||
4093 | Needed on some 8260 systems (MPC8260ADS, PQ2FADS-ZU, | 4087 | Needed on some 8260 systems (MPC8260ADS, PQ2FADS-ZU, |
4094 | and RPXsuper) to be able to adjust the position of | 4088 | and RPXsuper) to be able to adjust the position of |
4095 | the IMMR register after a reset. | 4089 | the IMMR register after a reset. |
4096 | 4090 | ||
4097 | - CONFIG_SYS_CCSRBAR_DEFAULT: | 4091 | - CONFIG_SYS_CCSRBAR_DEFAULT: |
4098 | Default (power-on reset) physical address of CCSR on Freescale | 4092 | Default (power-on reset) physical address of CCSR on Freescale |
4099 | PowerPC SOCs. | 4093 | PowerPC SOCs. |
4100 | 4094 | ||
4101 | - CONFIG_SYS_CCSRBAR: | 4095 | - CONFIG_SYS_CCSRBAR: |
4102 | Virtual address of CCSR. On a 32-bit build, this is typically | 4096 | Virtual address of CCSR. On a 32-bit build, this is typically |
4103 | the same value as CONFIG_SYS_CCSRBAR_DEFAULT. | 4097 | the same value as CONFIG_SYS_CCSRBAR_DEFAULT. |
4104 | 4098 | ||
4105 | CONFIG_SYS_DEFAULT_IMMR must also be set to this value, | 4099 | CONFIG_SYS_DEFAULT_IMMR must also be set to this value, |
4106 | for cross-platform code that uses that macro instead. | 4100 | for cross-platform code that uses that macro instead. |
4107 | 4101 | ||
4108 | - CONFIG_SYS_CCSRBAR_PHYS: | 4102 | - CONFIG_SYS_CCSRBAR_PHYS: |
4109 | Physical address of CCSR. CCSR can be relocated to a new | 4103 | Physical address of CCSR. CCSR can be relocated to a new |
4110 | physical address, if desired. In this case, this macro should | 4104 | physical address, if desired. In this case, this macro should |
4111 | be set to that address. Otherwise, it should be set to the | 4105 | be set to that address. Otherwise, it should be set to the |
4112 | same value as CONFIG_SYS_CCSRBAR_DEFAULT. For example, CCSR | 4106 | same value as CONFIG_SYS_CCSRBAR_DEFAULT. For example, CCSR |
4113 | is typically relocated on 36-bit builds. It is recommended | 4107 | is typically relocated on 36-bit builds. It is recommended |
4114 | that this macro be defined via the _HIGH and _LOW macros: | 4108 | that this macro be defined via the _HIGH and _LOW macros: |
4115 | 4109 | ||
4116 | #define CONFIG_SYS_CCSRBAR_PHYS ((CONFIG_SYS_CCSRBAR_PHYS_HIGH | 4110 | #define CONFIG_SYS_CCSRBAR_PHYS ((CONFIG_SYS_CCSRBAR_PHYS_HIGH |
4117 | * 1ull) << 32 | CONFIG_SYS_CCSRBAR_PHYS_LOW) | 4111 | * 1ull) << 32 | CONFIG_SYS_CCSRBAR_PHYS_LOW) |
4118 | 4112 | ||
4119 | - CONFIG_SYS_CCSRBAR_PHYS_HIGH: | 4113 | - CONFIG_SYS_CCSRBAR_PHYS_HIGH: |
4120 | Bits 33-36 of CONFIG_SYS_CCSRBAR_PHYS. This value is typically | 4114 | Bits 33-36 of CONFIG_SYS_CCSRBAR_PHYS. This value is typically |
4121 | either 0 (32-bit build) or 0xF (36-bit build). This macro is | 4115 | either 0 (32-bit build) or 0xF (36-bit build). This macro is |
4122 | used in assembly code, so it must not contain typecasts or | 4116 | used in assembly code, so it must not contain typecasts or |
4123 | integer size suffixes (e.g. "ULL"). | 4117 | integer size suffixes (e.g. "ULL"). |
4124 | 4118 | ||
4125 | - CONFIG_SYS_CCSRBAR_PHYS_LOW: | 4119 | - CONFIG_SYS_CCSRBAR_PHYS_LOW: |
4126 | Lower 32-bits of CONFIG_SYS_CCSRBAR_PHYS. This macro is | 4120 | Lower 32-bits of CONFIG_SYS_CCSRBAR_PHYS. This macro is |
4127 | used in assembly code, so it must not contain typecasts or | 4121 | used in assembly code, so it must not contain typecasts or |
4128 | integer size suffixes (e.g. "ULL"). | 4122 | integer size suffixes (e.g. "ULL"). |
4129 | 4123 | ||
4130 | - CONFIG_SYS_CCSR_DO_NOT_RELOCATE: | 4124 | - CONFIG_SYS_CCSR_DO_NOT_RELOCATE: |
4131 | If this macro is defined, then CONFIG_SYS_CCSRBAR_PHYS will be | 4125 | If this macro is defined, then CONFIG_SYS_CCSRBAR_PHYS will be |
4132 | forced to a value that ensures that CCSR is not relocated. | 4126 | forced to a value that ensures that CCSR is not relocated. |
4133 | 4127 | ||
4134 | - Floppy Disk Support: | 4128 | - Floppy Disk Support: |
4135 | CONFIG_SYS_FDC_DRIVE_NUMBER | 4129 | CONFIG_SYS_FDC_DRIVE_NUMBER |
4136 | 4130 | ||
4137 | the default drive number (default value 0) | 4131 | the default drive number (default value 0) |
4138 | 4132 | ||
4139 | CONFIG_SYS_ISA_IO_STRIDE | 4133 | CONFIG_SYS_ISA_IO_STRIDE |
4140 | 4134 | ||
4141 | defines the spacing between FDC chipset registers | 4135 | defines the spacing between FDC chipset registers |
4142 | (default value 1) | 4136 | (default value 1) |
4143 | 4137 | ||
4144 | CONFIG_SYS_ISA_IO_OFFSET | 4138 | CONFIG_SYS_ISA_IO_OFFSET |
4145 | 4139 | ||
4146 | defines the offset of register from address. It | 4140 | defines the offset of register from address. It |
4147 | depends on which part of the data bus is connected to | 4141 | depends on which part of the data bus is connected to |
4148 | the FDC chipset. (default value 0) | 4142 | the FDC chipset. (default value 0) |
4149 | 4143 | ||
4150 | If CONFIG_SYS_ISA_IO_STRIDE CONFIG_SYS_ISA_IO_OFFSET and | 4144 | If CONFIG_SYS_ISA_IO_STRIDE CONFIG_SYS_ISA_IO_OFFSET and |
4151 | CONFIG_SYS_FDC_DRIVE_NUMBER are undefined, they take their | 4145 | CONFIG_SYS_FDC_DRIVE_NUMBER are undefined, they take their |
4152 | default value. | 4146 | default value. |
4153 | 4147 | ||
4154 | if CONFIG_SYS_FDC_HW_INIT is defined, then the function | 4148 | if CONFIG_SYS_FDC_HW_INIT is defined, then the function |
4155 | fdc_hw_init() is called at the beginning of the FDC | 4149 | fdc_hw_init() is called at the beginning of the FDC |
4156 | setup. fdc_hw_init() must be provided by the board | 4150 | setup. fdc_hw_init() must be provided by the board |
4157 | source code. It is used to make hardware dependant | 4151 | source code. It is used to make hardware dependant |
4158 | initializations. | 4152 | initializations. |
4159 | 4153 | ||
4160 | - CONFIG_IDE_AHB: | 4154 | - CONFIG_IDE_AHB: |
4161 | Most IDE controllers were designed to be connected with PCI | 4155 | Most IDE controllers were designed to be connected with PCI |
4162 | interface. Only few of them were designed for AHB interface. | 4156 | interface. Only few of them were designed for AHB interface. |
4163 | When software is doing ATA command and data transfer to | 4157 | When software is doing ATA command and data transfer to |
4164 | IDE devices through IDE-AHB controller, some additional | 4158 | IDE devices through IDE-AHB controller, some additional |
4165 | registers accessing to these kind of IDE-AHB controller | 4159 | registers accessing to these kind of IDE-AHB controller |
4166 | is requierd. | 4160 | is requierd. |
4167 | 4161 | ||
4168 | - CONFIG_SYS_IMMR: Physical address of the Internal Memory. | 4162 | - CONFIG_SYS_IMMR: Physical address of the Internal Memory. |
4169 | DO NOT CHANGE unless you know exactly what you're | 4163 | DO NOT CHANGE unless you know exactly what you're |
4170 | doing! (11-4) [MPC8xx/82xx systems only] | 4164 | doing! (11-4) [MPC8xx/82xx systems only] |
4171 | 4165 | ||
4172 | - CONFIG_SYS_INIT_RAM_ADDR: | 4166 | - CONFIG_SYS_INIT_RAM_ADDR: |
4173 | 4167 | ||
4174 | Start address of memory area that can be used for | 4168 | Start address of memory area that can be used for |
4175 | initial data and stack; please note that this must be | 4169 | initial data and stack; please note that this must be |
4176 | writable memory that is working WITHOUT special | 4170 | writable memory that is working WITHOUT special |
4177 | initialization, i. e. you CANNOT use normal RAM which | 4171 | initialization, i. e. you CANNOT use normal RAM which |
4178 | will become available only after programming the | 4172 | will become available only after programming the |
4179 | memory controller and running certain initialization | 4173 | memory controller and running certain initialization |
4180 | sequences. | 4174 | sequences. |
4181 | 4175 | ||
4182 | U-Boot uses the following memory types: | 4176 | U-Boot uses the following memory types: |
4183 | - MPC8xx and MPC8260: IMMR (internal memory of the CPU) | 4177 | - MPC8xx and MPC8260: IMMR (internal memory of the CPU) |
4184 | - MPC824X: data cache | 4178 | - MPC824X: data cache |
4185 | - PPC4xx: data cache | 4179 | - PPC4xx: data cache |
4186 | 4180 | ||
4187 | - CONFIG_SYS_GBL_DATA_OFFSET: | 4181 | - CONFIG_SYS_GBL_DATA_OFFSET: |
4188 | 4182 | ||
4189 | Offset of the initial data structure in the memory | 4183 | Offset of the initial data structure in the memory |
4190 | area defined by CONFIG_SYS_INIT_RAM_ADDR. Usually | 4184 | area defined by CONFIG_SYS_INIT_RAM_ADDR. Usually |
4191 | CONFIG_SYS_GBL_DATA_OFFSET is chosen such that the initial | 4185 | CONFIG_SYS_GBL_DATA_OFFSET is chosen such that the initial |
4192 | data is located at the end of the available space | 4186 | data is located at the end of the available space |
4193 | (sometimes written as (CONFIG_SYS_INIT_RAM_SIZE - | 4187 | (sometimes written as (CONFIG_SYS_INIT_RAM_SIZE - |
4194 | CONFIG_SYS_INIT_DATA_SIZE), and the initial stack is just | 4188 | CONFIG_SYS_INIT_DATA_SIZE), and the initial stack is just |
4195 | below that area (growing from (CONFIG_SYS_INIT_RAM_ADDR + | 4189 | below that area (growing from (CONFIG_SYS_INIT_RAM_ADDR + |
4196 | CONFIG_SYS_GBL_DATA_OFFSET) downward. | 4190 | CONFIG_SYS_GBL_DATA_OFFSET) downward. |
4197 | 4191 | ||
4198 | Note: | 4192 | Note: |
4199 | On the MPC824X (or other systems that use the data | 4193 | On the MPC824X (or other systems that use the data |
4200 | cache for initial memory) the address chosen for | 4194 | cache for initial memory) the address chosen for |
4201 | CONFIG_SYS_INIT_RAM_ADDR is basically arbitrary - it must | 4195 | CONFIG_SYS_INIT_RAM_ADDR is basically arbitrary - it must |
4202 | point to an otherwise UNUSED address space between | 4196 | point to an otherwise UNUSED address space between |
4203 | the top of RAM and the start of the PCI space. | 4197 | the top of RAM and the start of the PCI space. |
4204 | 4198 | ||
4205 | - CONFIG_SYS_SIUMCR: SIU Module Configuration (11-6) | 4199 | - CONFIG_SYS_SIUMCR: SIU Module Configuration (11-6) |
4206 | 4200 | ||
4207 | - CONFIG_SYS_SYPCR: System Protection Control (11-9) | 4201 | - CONFIG_SYS_SYPCR: System Protection Control (11-9) |
4208 | 4202 | ||
4209 | - CONFIG_SYS_TBSCR: Time Base Status and Control (11-26) | 4203 | - CONFIG_SYS_TBSCR: Time Base Status and Control (11-26) |
4210 | 4204 | ||
4211 | - CONFIG_SYS_PISCR: Periodic Interrupt Status and Control (11-31) | 4205 | - CONFIG_SYS_PISCR: Periodic Interrupt Status and Control (11-31) |
4212 | 4206 | ||
4213 | - CONFIG_SYS_PLPRCR: PLL, Low-Power, and Reset Control Register (15-30) | 4207 | - CONFIG_SYS_PLPRCR: PLL, Low-Power, and Reset Control Register (15-30) |
4214 | 4208 | ||
4215 | - CONFIG_SYS_SCCR: System Clock and reset Control Register (15-27) | 4209 | - CONFIG_SYS_SCCR: System Clock and reset Control Register (15-27) |
4216 | 4210 | ||
4217 | - CONFIG_SYS_OR_TIMING_SDRAM: | 4211 | - CONFIG_SYS_OR_TIMING_SDRAM: |
4218 | SDRAM timing | 4212 | SDRAM timing |
4219 | 4213 | ||
4220 | - CONFIG_SYS_MAMR_PTA: | 4214 | - CONFIG_SYS_MAMR_PTA: |
4221 | periodic timer for refresh | 4215 | periodic timer for refresh |
4222 | 4216 | ||
4223 | - CONFIG_SYS_DER: Debug Event Register (37-47) | 4217 | - CONFIG_SYS_DER: Debug Event Register (37-47) |
4224 | 4218 | ||
4225 | - FLASH_BASE0_PRELIM, FLASH_BASE1_PRELIM, CONFIG_SYS_REMAP_OR_AM, | 4219 | - FLASH_BASE0_PRELIM, FLASH_BASE1_PRELIM, CONFIG_SYS_REMAP_OR_AM, |
4226 | CONFIG_SYS_PRELIM_OR_AM, CONFIG_SYS_OR_TIMING_FLASH, CONFIG_SYS_OR0_REMAP, | 4220 | CONFIG_SYS_PRELIM_OR_AM, CONFIG_SYS_OR_TIMING_FLASH, CONFIG_SYS_OR0_REMAP, |
4227 | CONFIG_SYS_OR0_PRELIM, CONFIG_SYS_BR0_PRELIM, CONFIG_SYS_OR1_REMAP, CONFIG_SYS_OR1_PRELIM, | 4221 | CONFIG_SYS_OR0_PRELIM, CONFIG_SYS_BR0_PRELIM, CONFIG_SYS_OR1_REMAP, CONFIG_SYS_OR1_PRELIM, |
4228 | CONFIG_SYS_BR1_PRELIM: | 4222 | CONFIG_SYS_BR1_PRELIM: |
4229 | Memory Controller Definitions: BR0/1 and OR0/1 (FLASH) | 4223 | Memory Controller Definitions: BR0/1 and OR0/1 (FLASH) |
4230 | 4224 | ||
4231 | - SDRAM_BASE2_PRELIM, SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE, | 4225 | - SDRAM_BASE2_PRELIM, SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE, |
4232 | CONFIG_SYS_OR_TIMING_SDRAM, CONFIG_SYS_OR2_PRELIM, CONFIG_SYS_BR2_PRELIM, | 4226 | CONFIG_SYS_OR_TIMING_SDRAM, CONFIG_SYS_OR2_PRELIM, CONFIG_SYS_BR2_PRELIM, |
4233 | CONFIG_SYS_OR3_PRELIM, CONFIG_SYS_BR3_PRELIM: | 4227 | CONFIG_SYS_OR3_PRELIM, CONFIG_SYS_BR3_PRELIM: |
4234 | Memory Controller Definitions: BR2/3 and OR2/3 (SDRAM) | 4228 | Memory Controller Definitions: BR2/3 and OR2/3 (SDRAM) |
4235 | 4229 | ||
4236 | - CONFIG_SYS_MAMR_PTA, CONFIG_SYS_MPTPR_2BK_4K, CONFIG_SYS_MPTPR_1BK_4K, CONFIG_SYS_MPTPR_2BK_8K, | 4230 | - CONFIG_SYS_MAMR_PTA, CONFIG_SYS_MPTPR_2BK_4K, CONFIG_SYS_MPTPR_1BK_4K, CONFIG_SYS_MPTPR_2BK_8K, |
4237 | CONFIG_SYS_MPTPR_1BK_8K, CONFIG_SYS_MAMR_8COL, CONFIG_SYS_MAMR_9COL: | 4231 | CONFIG_SYS_MPTPR_1BK_8K, CONFIG_SYS_MAMR_8COL, CONFIG_SYS_MAMR_9COL: |
4238 | Machine Mode Register and Memory Periodic Timer | 4232 | Machine Mode Register and Memory Periodic Timer |
4239 | Prescaler definitions (SDRAM timing) | 4233 | Prescaler definitions (SDRAM timing) |
4240 | 4234 | ||
4241 | - CONFIG_SYS_I2C_UCODE_PATCH, CONFIG_SYS_I2C_DPMEM_OFFSET [0x1FC0]: | 4235 | - CONFIG_SYS_I2C_UCODE_PATCH, CONFIG_SYS_I2C_DPMEM_OFFSET [0x1FC0]: |
4242 | enable I2C microcode relocation patch (MPC8xx); | 4236 | enable I2C microcode relocation patch (MPC8xx); |
4243 | define relocation offset in DPRAM [DSP2] | 4237 | define relocation offset in DPRAM [DSP2] |
4244 | 4238 | ||
4245 | - CONFIG_SYS_SMC_UCODE_PATCH, CONFIG_SYS_SMC_DPMEM_OFFSET [0x1FC0]: | 4239 | - CONFIG_SYS_SMC_UCODE_PATCH, CONFIG_SYS_SMC_DPMEM_OFFSET [0x1FC0]: |
4246 | enable SMC microcode relocation patch (MPC8xx); | 4240 | enable SMC microcode relocation patch (MPC8xx); |
4247 | define relocation offset in DPRAM [SMC1] | 4241 | define relocation offset in DPRAM [SMC1] |
4248 | 4242 | ||
4249 | - CONFIG_SYS_SPI_UCODE_PATCH, CONFIG_SYS_SPI_DPMEM_OFFSET [0x1FC0]: | 4243 | - CONFIG_SYS_SPI_UCODE_PATCH, CONFIG_SYS_SPI_DPMEM_OFFSET [0x1FC0]: |
4250 | enable SPI microcode relocation patch (MPC8xx); | 4244 | enable SPI microcode relocation patch (MPC8xx); |
4251 | define relocation offset in DPRAM [SCC4] | 4245 | define relocation offset in DPRAM [SCC4] |
4252 | 4246 | ||
4253 | - CONFIG_SYS_USE_OSCCLK: | 4247 | - CONFIG_SYS_USE_OSCCLK: |
4254 | Use OSCM clock mode on MBX8xx board. Be careful, | 4248 | Use OSCM clock mode on MBX8xx board. Be careful, |
4255 | wrong setting might damage your board. Read | 4249 | wrong setting might damage your board. Read |
4256 | doc/README.MBX before setting this variable! | 4250 | doc/README.MBX before setting this variable! |
4257 | 4251 | ||
4258 | - CONFIG_SYS_CPM_POST_WORD_ADDR: (MPC8xx, MPC8260 only) | 4252 | - CONFIG_SYS_CPM_POST_WORD_ADDR: (MPC8xx, MPC8260 only) |
4259 | Offset of the bootmode word in DPRAM used by post | 4253 | Offset of the bootmode word in DPRAM used by post |
4260 | (Power On Self Tests). This definition overrides | 4254 | (Power On Self Tests). This definition overrides |
4261 | #define'd default value in commproc.h resp. | 4255 | #define'd default value in commproc.h resp. |
4262 | cpm_8260.h. | 4256 | cpm_8260.h. |
4263 | 4257 | ||
4264 | - CONFIG_SYS_PCI_SLV_MEM_LOCAL, CONFIG_SYS_PCI_SLV_MEM_BUS, CONFIG_SYS_PICMR0_MASK_ATTRIB, | 4258 | - CONFIG_SYS_PCI_SLV_MEM_LOCAL, CONFIG_SYS_PCI_SLV_MEM_BUS, CONFIG_SYS_PICMR0_MASK_ATTRIB, |
4265 | CONFIG_SYS_PCI_MSTR0_LOCAL, CONFIG_SYS_PCIMSK0_MASK, CONFIG_SYS_PCI_MSTR1_LOCAL, | 4259 | CONFIG_SYS_PCI_MSTR0_LOCAL, CONFIG_SYS_PCIMSK0_MASK, CONFIG_SYS_PCI_MSTR1_LOCAL, |
4266 | CONFIG_SYS_PCIMSK1_MASK, CONFIG_SYS_PCI_MSTR_MEM_LOCAL, CONFIG_SYS_PCI_MSTR_MEM_BUS, | 4260 | CONFIG_SYS_PCIMSK1_MASK, CONFIG_SYS_PCI_MSTR_MEM_LOCAL, CONFIG_SYS_PCI_MSTR_MEM_BUS, |
4267 | CONFIG_SYS_CPU_PCI_MEM_START, CONFIG_SYS_PCI_MSTR_MEM_SIZE, CONFIG_SYS_POCMR0_MASK_ATTRIB, | 4261 | CONFIG_SYS_CPU_PCI_MEM_START, CONFIG_SYS_PCI_MSTR_MEM_SIZE, CONFIG_SYS_POCMR0_MASK_ATTRIB, |
4268 | CONFIG_SYS_PCI_MSTR_MEMIO_LOCAL, CONFIG_SYS_PCI_MSTR_MEMIO_BUS, CPU_PCI_MEMIO_START, | 4262 | CONFIG_SYS_PCI_MSTR_MEMIO_LOCAL, CONFIG_SYS_PCI_MSTR_MEMIO_BUS, CPU_PCI_MEMIO_START, |
4269 | CONFIG_SYS_PCI_MSTR_MEMIO_SIZE, CONFIG_SYS_POCMR1_MASK_ATTRIB, CONFIG_SYS_PCI_MSTR_IO_LOCAL, | 4263 | CONFIG_SYS_PCI_MSTR_MEMIO_SIZE, CONFIG_SYS_POCMR1_MASK_ATTRIB, CONFIG_SYS_PCI_MSTR_IO_LOCAL, |
4270 | CONFIG_SYS_PCI_MSTR_IO_BUS, CONFIG_SYS_CPU_PCI_IO_START, CONFIG_SYS_PCI_MSTR_IO_SIZE, | 4264 | CONFIG_SYS_PCI_MSTR_IO_BUS, CONFIG_SYS_CPU_PCI_IO_START, CONFIG_SYS_PCI_MSTR_IO_SIZE, |
4271 | CONFIG_SYS_POCMR2_MASK_ATTRIB: (MPC826x only) | 4265 | CONFIG_SYS_POCMR2_MASK_ATTRIB: (MPC826x only) |
4272 | Overrides the default PCI memory map in arch/powerpc/cpu/mpc8260/pci.c if set. | 4266 | Overrides the default PCI memory map in arch/powerpc/cpu/mpc8260/pci.c if set. |
4273 | 4267 | ||
4274 | - CONFIG_PCI_DISABLE_PCIE: | 4268 | - CONFIG_PCI_DISABLE_PCIE: |
4275 | Disable PCI-Express on systems where it is supported but not | 4269 | Disable PCI-Express on systems where it is supported but not |
4276 | required. | 4270 | required. |
4277 | 4271 | ||
4278 | - CONFIG_PCI_ENUM_ONLY | 4272 | - CONFIG_PCI_ENUM_ONLY |
4279 | Only scan through and get the devices on the busses. | 4273 | Only scan through and get the devices on the busses. |
4280 | Don't do any setup work, presumably because someone or | 4274 | Don't do any setup work, presumably because someone or |
4281 | something has already done it, and we don't need to do it | 4275 | something has already done it, and we don't need to do it |
4282 | a second time. Useful for platforms that are pre-booted | 4276 | a second time. Useful for platforms that are pre-booted |
4283 | by coreboot or similar. | 4277 | by coreboot or similar. |
4284 | 4278 | ||
4285 | - CONFIG_PCI_INDIRECT_BRIDGE: | 4279 | - CONFIG_PCI_INDIRECT_BRIDGE: |
4286 | Enable support for indirect PCI bridges. | 4280 | Enable support for indirect PCI bridges. |
4287 | 4281 | ||
4288 | - CONFIG_SYS_SRIO: | 4282 | - CONFIG_SYS_SRIO: |
4289 | Chip has SRIO or not | 4283 | Chip has SRIO or not |
4290 | 4284 | ||
4291 | - CONFIG_SRIO1: | 4285 | - CONFIG_SRIO1: |
4292 | Board has SRIO 1 port available | 4286 | Board has SRIO 1 port available |
4293 | 4287 | ||
4294 | - CONFIG_SRIO2: | 4288 | - CONFIG_SRIO2: |
4295 | Board has SRIO 2 port available | 4289 | Board has SRIO 2 port available |
4296 | 4290 | ||
4297 | - CONFIG_SRIO_PCIE_BOOT_MASTER | 4291 | - CONFIG_SRIO_PCIE_BOOT_MASTER |
4298 | Board can support master function for Boot from SRIO and PCIE | 4292 | Board can support master function for Boot from SRIO and PCIE |
4299 | 4293 | ||
4300 | - CONFIG_SYS_SRIOn_MEM_VIRT: | 4294 | - CONFIG_SYS_SRIOn_MEM_VIRT: |
4301 | Virtual Address of SRIO port 'n' memory region | 4295 | Virtual Address of SRIO port 'n' memory region |
4302 | 4296 | ||
4303 | - CONFIG_SYS_SRIOn_MEM_PHYS: | 4297 | - CONFIG_SYS_SRIOn_MEM_PHYS: |
4304 | Physical Address of SRIO port 'n' memory region | 4298 | Physical Address of SRIO port 'n' memory region |
4305 | 4299 | ||
4306 | - CONFIG_SYS_SRIOn_MEM_SIZE: | 4300 | - CONFIG_SYS_SRIOn_MEM_SIZE: |
4307 | Size of SRIO port 'n' memory region | 4301 | Size of SRIO port 'n' memory region |
4308 | 4302 | ||
4309 | - CONFIG_SYS_NAND_BUSWIDTH_16BIT | 4303 | - CONFIG_SYS_NAND_BUSWIDTH_16BIT |
4310 | Defined to tell the NAND controller that the NAND chip is using | 4304 | Defined to tell the NAND controller that the NAND chip is using |
4311 | a 16 bit bus. | 4305 | a 16 bit bus. |
4312 | Not all NAND drivers use this symbol. | 4306 | Not all NAND drivers use this symbol. |
4313 | Example of drivers that use it: | 4307 | Example of drivers that use it: |
4314 | - drivers/mtd/nand/ndfc.c | 4308 | - drivers/mtd/nand/ndfc.c |
4315 | - drivers/mtd/nand/mxc_nand.c | 4309 | - drivers/mtd/nand/mxc_nand.c |
4316 | 4310 | ||
4317 | - CONFIG_SYS_NDFC_EBC0_CFG | 4311 | - CONFIG_SYS_NDFC_EBC0_CFG |
4318 | Sets the EBC0_CFG register for the NDFC. If not defined | 4312 | Sets the EBC0_CFG register for the NDFC. If not defined |
4319 | a default value will be used. | 4313 | a default value will be used. |
4320 | 4314 | ||
4321 | - CONFIG_SPD_EEPROM | 4315 | - CONFIG_SPD_EEPROM |
4322 | Get DDR timing information from an I2C EEPROM. Common | 4316 | Get DDR timing information from an I2C EEPROM. Common |
4323 | with pluggable memory modules such as SODIMMs | 4317 | with pluggable memory modules such as SODIMMs |
4324 | 4318 | ||
4325 | SPD_EEPROM_ADDRESS | 4319 | SPD_EEPROM_ADDRESS |
4326 | I2C address of the SPD EEPROM | 4320 | I2C address of the SPD EEPROM |
4327 | 4321 | ||
4328 | - CONFIG_SYS_SPD_BUS_NUM | 4322 | - CONFIG_SYS_SPD_BUS_NUM |
4329 | If SPD EEPROM is on an I2C bus other than the first | 4323 | If SPD EEPROM is on an I2C bus other than the first |
4330 | one, specify here. Note that the value must resolve | 4324 | one, specify here. Note that the value must resolve |
4331 | to something your driver can deal with. | 4325 | to something your driver can deal with. |
4332 | 4326 | ||
4333 | - CONFIG_SYS_DDR_RAW_TIMING | 4327 | - CONFIG_SYS_DDR_RAW_TIMING |
4334 | Get DDR timing information from other than SPD. Common with | 4328 | Get DDR timing information from other than SPD. Common with |
4335 | soldered DDR chips onboard without SPD. DDR raw timing | 4329 | soldered DDR chips onboard without SPD. DDR raw timing |
4336 | parameters are extracted from datasheet and hard-coded into | 4330 | parameters are extracted from datasheet and hard-coded into |
4337 | header files or board specific files. | 4331 | header files or board specific files. |
4338 | 4332 | ||
4339 | - CONFIG_FSL_DDR_INTERACTIVE | 4333 | - CONFIG_FSL_DDR_INTERACTIVE |
4340 | Enable interactive DDR debugging. See doc/README.fsl-ddr. | 4334 | Enable interactive DDR debugging. See doc/README.fsl-ddr. |
4341 | 4335 | ||
4342 | - CONFIG_SYS_83XX_DDR_USES_CS0 | 4336 | - CONFIG_SYS_83XX_DDR_USES_CS0 |
4343 | Only for 83xx systems. If specified, then DDR should | 4337 | Only for 83xx systems. If specified, then DDR should |
4344 | be configured using CS0 and CS1 instead of CS2 and CS3. | 4338 | be configured using CS0 and CS1 instead of CS2 and CS3. |
4345 | 4339 | ||
4346 | - CONFIG_ETHER_ON_FEC[12] | 4340 | - CONFIG_ETHER_ON_FEC[12] |
4347 | Define to enable FEC[12] on a 8xx series processor. | 4341 | Define to enable FEC[12] on a 8xx series processor. |
4348 | 4342 | ||
4349 | - CONFIG_FEC[12]_PHY | 4343 | - CONFIG_FEC[12]_PHY |
4350 | Define to the hardcoded PHY address which corresponds | 4344 | Define to the hardcoded PHY address which corresponds |
4351 | to the given FEC; i. e. | 4345 | to the given FEC; i. e. |
4352 | #define CONFIG_FEC1_PHY 4 | 4346 | #define CONFIG_FEC1_PHY 4 |
4353 | means that the PHY with address 4 is connected to FEC1 | 4347 | means that the PHY with address 4 is connected to FEC1 |
4354 | 4348 | ||
4355 | When set to -1, means to probe for first available. | 4349 | When set to -1, means to probe for first available. |
4356 | 4350 | ||
4357 | - CONFIG_FEC[12]_PHY_NORXERR | 4351 | - CONFIG_FEC[12]_PHY_NORXERR |
4358 | The PHY does not have a RXERR line (RMII only). | 4352 | The PHY does not have a RXERR line (RMII only). |
4359 | (so program the FEC to ignore it). | 4353 | (so program the FEC to ignore it). |
4360 | 4354 | ||
4361 | - CONFIG_RMII | 4355 | - CONFIG_RMII |
4362 | Enable RMII mode for all FECs. | 4356 | Enable RMII mode for all FECs. |
4363 | Note that this is a global option, we can't | 4357 | Note that this is a global option, we can't |
4364 | have one FEC in standard MII mode and another in RMII mode. | 4358 | have one FEC in standard MII mode and another in RMII mode. |
4365 | 4359 | ||
4366 | - CONFIG_CRC32_VERIFY | 4360 | - CONFIG_CRC32_VERIFY |
4367 | Add a verify option to the crc32 command. | 4361 | Add a verify option to the crc32 command. |
4368 | The syntax is: | 4362 | The syntax is: |
4369 | 4363 | ||
4370 | => crc32 -v <address> <count> <crc32> | 4364 | => crc32 -v <address> <count> <crc32> |
4371 | 4365 | ||
4372 | Where address/count indicate a memory area | 4366 | Where address/count indicate a memory area |
4373 | and crc32 is the correct crc32 which the | 4367 | and crc32 is the correct crc32 which the |
4374 | area should have. | 4368 | area should have. |
4375 | 4369 | ||
4376 | - CONFIG_LOOPW | 4370 | - CONFIG_LOOPW |
4377 | Add the "loopw" memory command. This only takes effect if | 4371 | Add the "loopw" memory command. This only takes effect if |
4378 | the memory commands are activated globally (CONFIG_CMD_MEM). | 4372 | the memory commands are activated globally (CONFIG_CMD_MEM). |
4379 | 4373 | ||
4380 | - CONFIG_MX_CYCLIC | 4374 | - CONFIG_MX_CYCLIC |
4381 | Add the "mdc" and "mwc" memory commands. These are cyclic | 4375 | Add the "mdc" and "mwc" memory commands. These are cyclic |
4382 | "md/mw" commands. | 4376 | "md/mw" commands. |
4383 | Examples: | 4377 | Examples: |
4384 | 4378 | ||
4385 | => mdc.b 10 4 500 | 4379 | => mdc.b 10 4 500 |
4386 | This command will print 4 bytes (10,11,12,13) each 500 ms. | 4380 | This command will print 4 bytes (10,11,12,13) each 500 ms. |
4387 | 4381 | ||
4388 | => mwc.l 100 12345678 10 | 4382 | => mwc.l 100 12345678 10 |
4389 | This command will write 12345678 to address 100 all 10 ms. | 4383 | This command will write 12345678 to address 100 all 10 ms. |
4390 | 4384 | ||
4391 | This only takes effect if the memory commands are activated | 4385 | This only takes effect if the memory commands are activated |
4392 | globally (CONFIG_CMD_MEM). | 4386 | globally (CONFIG_CMD_MEM). |
4393 | 4387 | ||
4394 | - CONFIG_SKIP_LOWLEVEL_INIT | 4388 | - CONFIG_SKIP_LOWLEVEL_INIT |
4395 | [ARM, NDS32, MIPS only] If this variable is defined, then certain | 4389 | [ARM, NDS32, MIPS only] If this variable is defined, then certain |
4396 | low level initializations (like setting up the memory | 4390 | low level initializations (like setting up the memory |
4397 | controller) are omitted and/or U-Boot does not | 4391 | controller) are omitted and/or U-Boot does not |
4398 | relocate itself into RAM. | 4392 | relocate itself into RAM. |
4399 | 4393 | ||
4400 | Normally this variable MUST NOT be defined. The only | 4394 | Normally this variable MUST NOT be defined. The only |
4401 | exception is when U-Boot is loaded (to RAM) by some | 4395 | exception is when U-Boot is loaded (to RAM) by some |
4402 | other boot loader or by a debugger which performs | 4396 | other boot loader or by a debugger which performs |
4403 | these initializations itself. | 4397 | these initializations itself. |
4404 | 4398 | ||
4405 | - CONFIG_SPL_BUILD | 4399 | - CONFIG_SPL_BUILD |
4406 | Modifies the behaviour of start.S when compiling a loader | 4400 | Modifies the behaviour of start.S when compiling a loader |
4407 | that is executed before the actual U-Boot. E.g. when | 4401 | that is executed before the actual U-Boot. E.g. when |
4408 | compiling a NAND SPL. | 4402 | compiling a NAND SPL. |
4409 | 4403 | ||
4410 | - CONFIG_TPL_BUILD | 4404 | - CONFIG_TPL_BUILD |
4411 | Modifies the behaviour of start.S when compiling a loader | 4405 | Modifies the behaviour of start.S when compiling a loader |
4412 | that is executed after the SPL and before the actual U-Boot. | 4406 | that is executed after the SPL and before the actual U-Boot. |
4413 | It is loaded by the SPL. | 4407 | It is loaded by the SPL. |
4414 | 4408 | ||
4415 | - CONFIG_SYS_MPC85XX_NO_RESETVEC | 4409 | - CONFIG_SYS_MPC85XX_NO_RESETVEC |
4416 | Only for 85xx systems. If this variable is specified, the section | 4410 | Only for 85xx systems. If this variable is specified, the section |
4417 | .resetvec is not kept and the section .bootpg is placed in the | 4411 | .resetvec is not kept and the section .bootpg is placed in the |
4418 | previous 4k of the .text section. | 4412 | previous 4k of the .text section. |
4419 | 4413 | ||
4420 | - CONFIG_ARCH_MAP_SYSMEM | 4414 | - CONFIG_ARCH_MAP_SYSMEM |
4421 | Generally U-Boot (and in particular the md command) uses | 4415 | Generally U-Boot (and in particular the md command) uses |
4422 | effective address. It is therefore not necessary to regard | 4416 | effective address. It is therefore not necessary to regard |
4423 | U-Boot address as virtual addresses that need to be translated | 4417 | U-Boot address as virtual addresses that need to be translated |
4424 | to physical addresses. However, sandbox requires this, since | 4418 | to physical addresses. However, sandbox requires this, since |
4425 | it maintains its own little RAM buffer which contains all | 4419 | it maintains its own little RAM buffer which contains all |
4426 | addressable memory. This option causes some memory accesses | 4420 | addressable memory. This option causes some memory accesses |
4427 | to be mapped through map_sysmem() / unmap_sysmem(). | 4421 | to be mapped through map_sysmem() / unmap_sysmem(). |
4428 | 4422 | ||
4429 | - CONFIG_USE_ARCH_MEMCPY | 4423 | - CONFIG_USE_ARCH_MEMCPY |
4430 | CONFIG_USE_ARCH_MEMSET | 4424 | CONFIG_USE_ARCH_MEMSET |
4431 | If these options are used a optimized version of memcpy/memset will | 4425 | If these options are used a optimized version of memcpy/memset will |
4432 | be used if available. These functions may be faster under some | 4426 | be used if available. These functions may be faster under some |
4433 | conditions but may increase the binary size. | 4427 | conditions but may increase the binary size. |
4434 | 4428 | ||
4435 | - CONFIG_X86_RESET_VECTOR | 4429 | - CONFIG_X86_RESET_VECTOR |
4436 | If defined, the x86 reset vector code is included. This is not | 4430 | If defined, the x86 reset vector code is included. This is not |
4437 | needed when U-Boot is running from Coreboot. | 4431 | needed when U-Boot is running from Coreboot. |
4438 | 4432 | ||
4439 | - CONFIG_SYS_MPUCLK | 4433 | - CONFIG_SYS_MPUCLK |
4440 | Defines the MPU clock speed (in MHz). | 4434 | Defines the MPU clock speed (in MHz). |
4441 | 4435 | ||
4442 | NOTE : currently only supported on AM335x platforms. | 4436 | NOTE : currently only supported on AM335x platforms. |
4443 | 4437 | ||
4444 | - CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC: | 4438 | - CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC: |
4445 | Enables the RTC32K OSC on AM33xx based plattforms | 4439 | Enables the RTC32K OSC on AM33xx based plattforms |
4446 | 4440 | ||
4447 | Freescale QE/FMAN Firmware Support: | 4441 | Freescale QE/FMAN Firmware Support: |
4448 | ----------------------------------- | 4442 | ----------------------------------- |
4449 | 4443 | ||
4450 | The Freescale QUICCEngine (QE) and Frame Manager (FMAN) both support the | 4444 | The Freescale QUICCEngine (QE) and Frame Manager (FMAN) both support the |
4451 | loading of "firmware", which is encoded in the QE firmware binary format. | 4445 | loading of "firmware", which is encoded in the QE firmware binary format. |
4452 | This firmware often needs to be loaded during U-Boot booting, so macros | 4446 | This firmware often needs to be loaded during U-Boot booting, so macros |
4453 | are used to identify the storage device (NOR flash, SPI, etc) and the address | 4447 | are used to identify the storage device (NOR flash, SPI, etc) and the address |
4454 | within that device. | 4448 | within that device. |
4455 | 4449 | ||
4456 | - CONFIG_SYS_QE_FMAN_FW_ADDR | 4450 | - CONFIG_SYS_QE_FMAN_FW_ADDR |
4457 | The address in the storage device where the firmware is located. The | 4451 | The address in the storage device where the firmware is located. The |
4458 | meaning of this address depends on which CONFIG_SYS_QE_FW_IN_xxx macro | 4452 | meaning of this address depends on which CONFIG_SYS_QE_FW_IN_xxx macro |
4459 | is also specified. | 4453 | is also specified. |
4460 | 4454 | ||
4461 | - CONFIG_SYS_QE_FMAN_FW_LENGTH | 4455 | - CONFIG_SYS_QE_FMAN_FW_LENGTH |
4462 | The maximum possible size of the firmware. The firmware binary format | 4456 | The maximum possible size of the firmware. The firmware binary format |
4463 | has a field that specifies the actual size of the firmware, but it | 4457 | has a field that specifies the actual size of the firmware, but it |
4464 | might not be possible to read any part of the firmware unless some | 4458 | might not be possible to read any part of the firmware unless some |
4465 | local storage is allocated to hold the entire firmware first. | 4459 | local storage is allocated to hold the entire firmware first. |
4466 | 4460 | ||
4467 | - CONFIG_SYS_QE_FMAN_FW_IN_NOR | 4461 | - CONFIG_SYS_QE_FMAN_FW_IN_NOR |
4468 | Specifies that QE/FMAN firmware is located in NOR flash, mapped as | 4462 | Specifies that QE/FMAN firmware is located in NOR flash, mapped as |
4469 | normal addressable memory via the LBC. CONFIG_SYS_FMAN_FW_ADDR is the | 4463 | normal addressable memory via the LBC. CONFIG_SYS_FMAN_FW_ADDR is the |
4470 | virtual address in NOR flash. | 4464 | virtual address in NOR flash. |
4471 | 4465 | ||
4472 | - CONFIG_SYS_QE_FMAN_FW_IN_NAND | 4466 | - CONFIG_SYS_QE_FMAN_FW_IN_NAND |
4473 | Specifies that QE/FMAN firmware is located in NAND flash. | 4467 | Specifies that QE/FMAN firmware is located in NAND flash. |
4474 | CONFIG_SYS_FMAN_FW_ADDR is the offset within NAND flash. | 4468 | CONFIG_SYS_FMAN_FW_ADDR is the offset within NAND flash. |
4475 | 4469 | ||
4476 | - CONFIG_SYS_QE_FMAN_FW_IN_MMC | 4470 | - CONFIG_SYS_QE_FMAN_FW_IN_MMC |
4477 | Specifies that QE/FMAN firmware is located on the primary SD/MMC | 4471 | Specifies that QE/FMAN firmware is located on the primary SD/MMC |
4478 | device. CONFIG_SYS_FMAN_FW_ADDR is the byte offset on that device. | 4472 | device. CONFIG_SYS_FMAN_FW_ADDR is the byte offset on that device. |
4479 | 4473 | ||
4480 | - CONFIG_SYS_QE_FMAN_FW_IN_SPIFLASH | 4474 | - CONFIG_SYS_QE_FMAN_FW_IN_SPIFLASH |
4481 | Specifies that QE/FMAN firmware is located on the primary SPI | 4475 | Specifies that QE/FMAN firmware is located on the primary SPI |
4482 | device. CONFIG_SYS_FMAN_FW_ADDR is the byte offset on that device. | 4476 | device. CONFIG_SYS_FMAN_FW_ADDR is the byte offset on that device. |
4483 | 4477 | ||
4484 | - CONFIG_SYS_QE_FMAN_FW_IN_REMOTE | 4478 | - CONFIG_SYS_QE_FMAN_FW_IN_REMOTE |
4485 | Specifies that QE/FMAN firmware is located in the remote (master) | 4479 | Specifies that QE/FMAN firmware is located in the remote (master) |
4486 | memory space. CONFIG_SYS_FMAN_FW_ADDR is a virtual address which | 4480 | memory space. CONFIG_SYS_FMAN_FW_ADDR is a virtual address which |
4487 | can be mapped from slave TLB->slave LAW->slave SRIO or PCIE outbound | 4481 | can be mapped from slave TLB->slave LAW->slave SRIO or PCIE outbound |
4488 | window->master inbound window->master LAW->the ucode address in | 4482 | window->master inbound window->master LAW->the ucode address in |
4489 | master's memory space. | 4483 | master's memory space. |
4490 | 4484 | ||
4491 | Building the Software: | 4485 | Building the Software: |
4492 | ====================== | 4486 | ====================== |
4493 | 4487 | ||
4494 | Building U-Boot has been tested in several native build environments | 4488 | Building U-Boot has been tested in several native build environments |
4495 | and in many different cross environments. Of course we cannot support | 4489 | and in many different cross environments. Of course we cannot support |
4496 | all possibly existing versions of cross development tools in all | 4490 | all possibly existing versions of cross development tools in all |
4497 | (potentially obsolete) versions. In case of tool chain problems we | 4491 | (potentially obsolete) versions. In case of tool chain problems we |
4498 | recommend to use the ELDK (see http://www.denx.de/wiki/DULG/ELDK) | 4492 | recommend to use the ELDK (see http://www.denx.de/wiki/DULG/ELDK) |
4499 | which is extensively used to build and test U-Boot. | 4493 | which is extensively used to build and test U-Boot. |
4500 | 4494 | ||
4501 | If you are not using a native environment, it is assumed that you | 4495 | If you are not using a native environment, it is assumed that you |
4502 | have GNU cross compiling tools available in your path. In this case, | 4496 | have GNU cross compiling tools available in your path. In this case, |
4503 | you must set the environment variable CROSS_COMPILE in your shell. | 4497 | you must set the environment variable CROSS_COMPILE in your shell. |
4504 | Note that no changes to the Makefile or any other source files are | 4498 | Note that no changes to the Makefile or any other source files are |
4505 | necessary. For example using the ELDK on a 4xx CPU, please enter: | 4499 | necessary. For example using the ELDK on a 4xx CPU, please enter: |
4506 | 4500 | ||
4507 | $ CROSS_COMPILE=ppc_4xx- | 4501 | $ CROSS_COMPILE=ppc_4xx- |
4508 | $ export CROSS_COMPILE | 4502 | $ export CROSS_COMPILE |
4509 | 4503 | ||
4510 | Note: If you wish to generate Windows versions of the utilities in | 4504 | Note: If you wish to generate Windows versions of the utilities in |
4511 | the tools directory you can use the MinGW toolchain | 4505 | the tools directory you can use the MinGW toolchain |
4512 | (http://www.mingw.org). Set your HOST tools to the MinGW | 4506 | (http://www.mingw.org). Set your HOST tools to the MinGW |
4513 | toolchain and execute 'make tools'. For example: | 4507 | toolchain and execute 'make tools'. For example: |
4514 | 4508 | ||
4515 | $ make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools | 4509 | $ make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools |
4516 | 4510 | ||
4517 | Binaries such as tools/mkimage.exe will be created which can | 4511 | Binaries such as tools/mkimage.exe will be created which can |
4518 | be executed on computers running Windows. | 4512 | be executed on computers running Windows. |
4519 | 4513 | ||
4520 | U-Boot is intended to be simple to build. After installing the | 4514 | U-Boot is intended to be simple to build. After installing the |
4521 | sources you must configure U-Boot for one specific board type. This | 4515 | sources you must configure U-Boot for one specific board type. This |
4522 | is done by typing: | 4516 | is done by typing: |
4523 | 4517 | ||
4524 | make NAME_config | 4518 | make NAME_config |
4525 | 4519 | ||
4526 | where "NAME_config" is the name of one of the existing configu- | 4520 | where "NAME_config" is the name of one of the existing configu- |
4527 | rations; see boards.cfg for supported names. | 4521 | rations; see boards.cfg for supported names. |
4528 | 4522 | ||
4529 | Note: for some board special configuration names may exist; check if | 4523 | Note: for some board special configuration names may exist; check if |
4530 | additional information is available from the board vendor; for | 4524 | additional information is available from the board vendor; for |
4531 | instance, the TQM823L systems are available without (standard) | 4525 | instance, the TQM823L systems are available without (standard) |
4532 | or with LCD support. You can select such additional "features" | 4526 | or with LCD support. You can select such additional "features" |
4533 | when choosing the configuration, i. e. | 4527 | when choosing the configuration, i. e. |
4534 | 4528 | ||
4535 | make TQM823L_config | 4529 | make TQM823L_config |
4536 | - will configure for a plain TQM823L, i. e. no LCD support | 4530 | - will configure for a plain TQM823L, i. e. no LCD support |
4537 | 4531 | ||
4538 | make TQM823L_LCD_config | 4532 | make TQM823L_LCD_config |
4539 | - will configure for a TQM823L with U-Boot console on LCD | 4533 | - will configure for a TQM823L with U-Boot console on LCD |
4540 | 4534 | ||
4541 | etc. | 4535 | etc. |
4542 | 4536 | ||
4543 | 4537 | ||
4544 | Finally, type "make all", and you should get some working U-Boot | 4538 | Finally, type "make all", and you should get some working U-Boot |
4545 | images ready for download to / installation on your system: | 4539 | images ready for download to / installation on your system: |
4546 | 4540 | ||
4547 | - "u-boot.bin" is a raw binary image | 4541 | - "u-boot.bin" is a raw binary image |
4548 | - "u-boot" is an image in ELF binary format | 4542 | - "u-boot" is an image in ELF binary format |
4549 | - "u-boot.srec" is in Motorola S-Record format | 4543 | - "u-boot.srec" is in Motorola S-Record format |
4550 | 4544 | ||
4551 | By default the build is performed locally and the objects are saved | 4545 | By default the build is performed locally and the objects are saved |
4552 | in the source directory. One of the two methods can be used to change | 4546 | in the source directory. One of the two methods can be used to change |
4553 | this behavior and build U-Boot to some external directory: | 4547 | this behavior and build U-Boot to some external directory: |
4554 | 4548 | ||
4555 | 1. Add O= to the make command line invocations: | 4549 | 1. Add O= to the make command line invocations: |
4556 | 4550 | ||
4557 | make O=/tmp/build distclean | 4551 | make O=/tmp/build distclean |
4558 | make O=/tmp/build NAME_config | 4552 | make O=/tmp/build NAME_config |
4559 | make O=/tmp/build all | 4553 | make O=/tmp/build all |
4560 | 4554 | ||
4561 | 2. Set environment variable BUILD_DIR to point to the desired location: | 4555 | 2. Set environment variable BUILD_DIR to point to the desired location: |
4562 | 4556 | ||
4563 | export BUILD_DIR=/tmp/build | 4557 | export BUILD_DIR=/tmp/build |
4564 | make distclean | 4558 | make distclean |
4565 | make NAME_config | 4559 | make NAME_config |
4566 | make all | 4560 | make all |
4567 | 4561 | ||
4568 | Note that the command line "O=" setting overrides the BUILD_DIR environment | 4562 | Note that the command line "O=" setting overrides the BUILD_DIR environment |
4569 | variable. | 4563 | variable. |
4570 | 4564 | ||
4571 | 4565 | ||
4572 | Please be aware that the Makefiles assume you are using GNU make, so | 4566 | Please be aware that the Makefiles assume you are using GNU make, so |
4573 | for instance on NetBSD you might need to use "gmake" instead of | 4567 | for instance on NetBSD you might need to use "gmake" instead of |
4574 | native "make". | 4568 | native "make". |
4575 | 4569 | ||
4576 | 4570 | ||
4577 | If the system board that you have is not listed, then you will need | 4571 | If the system board that you have is not listed, then you will need |
4578 | to port U-Boot to your hardware platform. To do this, follow these | 4572 | to port U-Boot to your hardware platform. To do this, follow these |
4579 | steps: | 4573 | steps: |
4580 | 4574 | ||
4581 | 1. Add a new configuration option for your board to the toplevel | 4575 | 1. Add a new configuration option for your board to the toplevel |
4582 | "boards.cfg" file, using the existing entries as examples. | 4576 | "boards.cfg" file, using the existing entries as examples. |
4583 | Follow the instructions there to keep the boards in order. | 4577 | Follow the instructions there to keep the boards in order. |
4584 | 2. Create a new directory to hold your board specific code. Add any | 4578 | 2. Create a new directory to hold your board specific code. Add any |
4585 | files you need. In your board directory, you will need at least | 4579 | files you need. In your board directory, you will need at least |
4586 | the "Makefile", a "<board>.c", "flash.c" and "u-boot.lds". | 4580 | the "Makefile", a "<board>.c", "flash.c" and "u-boot.lds". |
4587 | 3. Create a new configuration file "include/configs/<board>.h" for | 4581 | 3. Create a new configuration file "include/configs/<board>.h" for |
4588 | your board | 4582 | your board |
4589 | 3. If you're porting U-Boot to a new CPU, then also create a new | 4583 | 3. If you're porting U-Boot to a new CPU, then also create a new |
4590 | directory to hold your CPU specific code. Add any files you need. | 4584 | directory to hold your CPU specific code. Add any files you need. |
4591 | 4. Run "make <board>_config" with your new name. | 4585 | 4. Run "make <board>_config" with your new name. |
4592 | 5. Type "make", and you should get a working "u-boot.srec" file | 4586 | 5. Type "make", and you should get a working "u-boot.srec" file |
4593 | to be installed on your target system. | 4587 | to be installed on your target system. |
4594 | 6. Debug and solve any problems that might arise. | 4588 | 6. Debug and solve any problems that might arise. |
4595 | [Of course, this last step is much harder than it sounds.] | 4589 | [Of course, this last step is much harder than it sounds.] |
4596 | 4590 | ||
4597 | 4591 | ||
4598 | Testing of U-Boot Modifications, Ports to New Hardware, etc.: | 4592 | Testing of U-Boot Modifications, Ports to New Hardware, etc.: |
4599 | ============================================================== | 4593 | ============================================================== |
4600 | 4594 | ||
4601 | If you have modified U-Boot sources (for instance added a new board | 4595 | If you have modified U-Boot sources (for instance added a new board |
4602 | or support for new devices, a new CPU, etc.) you are expected to | 4596 | or support for new devices, a new CPU, etc.) you are expected to |
4603 | provide feedback to the other developers. The feedback normally takes | 4597 | provide feedback to the other developers. The feedback normally takes |
4604 | the form of a "patch", i. e. a context diff against a certain (latest | 4598 | the form of a "patch", i. e. a context diff against a certain (latest |
4605 | official or latest in the git repository) version of U-Boot sources. | 4599 | official or latest in the git repository) version of U-Boot sources. |
4606 | 4600 | ||
4607 | But before you submit such a patch, please verify that your modifi- | 4601 | But before you submit such a patch, please verify that your modifi- |
4608 | cation did not break existing code. At least make sure that *ALL* of | 4602 | cation did not break existing code. At least make sure that *ALL* of |
4609 | the supported boards compile WITHOUT ANY compiler warnings. To do so, | 4603 | the supported boards compile WITHOUT ANY compiler warnings. To do so, |
4610 | just run the "MAKEALL" script, which will configure and build U-Boot | 4604 | just run the "MAKEALL" script, which will configure and build U-Boot |
4611 | for ALL supported system. Be warned, this will take a while. You can | 4605 | for ALL supported system. Be warned, this will take a while. You can |
4612 | select which (cross) compiler to use by passing a `CROSS_COMPILE' | 4606 | select which (cross) compiler to use by passing a `CROSS_COMPILE' |
4613 | environment variable to the script, i. e. to use the ELDK cross tools | 4607 | environment variable to the script, i. e. to use the ELDK cross tools |
4614 | you can type | 4608 | you can type |
4615 | 4609 | ||
4616 | CROSS_COMPILE=ppc_8xx- MAKEALL | 4610 | CROSS_COMPILE=ppc_8xx- MAKEALL |
4617 | 4611 | ||
4618 | or to build on a native PowerPC system you can type | 4612 | or to build on a native PowerPC system you can type |
4619 | 4613 | ||
4620 | CROSS_COMPILE=' ' MAKEALL | 4614 | CROSS_COMPILE=' ' MAKEALL |
4621 | 4615 | ||
4622 | When using the MAKEALL script, the default behaviour is to build | 4616 | When using the MAKEALL script, the default behaviour is to build |
4623 | U-Boot in the source directory. This location can be changed by | 4617 | U-Boot in the source directory. This location can be changed by |
4624 | setting the BUILD_DIR environment variable. Also, for each target | 4618 | setting the BUILD_DIR environment variable. Also, for each target |
4625 | built, the MAKEALL script saves two log files (<target>.ERR and | 4619 | built, the MAKEALL script saves two log files (<target>.ERR and |
4626 | <target>.MAKEALL) in the <source dir>/LOG directory. This default | 4620 | <target>.MAKEALL) in the <source dir>/LOG directory. This default |
4627 | location can be changed by setting the MAKEALL_LOGDIR environment | 4621 | location can be changed by setting the MAKEALL_LOGDIR environment |
4628 | variable. For example: | 4622 | variable. For example: |
4629 | 4623 | ||
4630 | export BUILD_DIR=/tmp/build | 4624 | export BUILD_DIR=/tmp/build |
4631 | export MAKEALL_LOGDIR=/tmp/log | 4625 | export MAKEALL_LOGDIR=/tmp/log |
4632 | CROSS_COMPILE=ppc_8xx- MAKEALL | 4626 | CROSS_COMPILE=ppc_8xx- MAKEALL |
4633 | 4627 | ||
4634 | With the above settings build objects are saved in the /tmp/build, | 4628 | With the above settings build objects are saved in the /tmp/build, |
4635 | log files are saved in the /tmp/log and the source tree remains clean | 4629 | log files are saved in the /tmp/log and the source tree remains clean |
4636 | during the whole build process. | 4630 | during the whole build process. |
4637 | 4631 | ||
4638 | 4632 | ||
4639 | See also "U-Boot Porting Guide" below. | 4633 | See also "U-Boot Porting Guide" below. |
4640 | 4634 | ||
4641 | 4635 | ||
4642 | Monitor Commands - Overview: | 4636 | Monitor Commands - Overview: |
4643 | ============================ | 4637 | ============================ |
4644 | 4638 | ||
4645 | go - start application at address 'addr' | 4639 | go - start application at address 'addr' |
4646 | run - run commands in an environment variable | 4640 | run - run commands in an environment variable |
4647 | bootm - boot application image from memory | 4641 | bootm - boot application image from memory |
4648 | bootp - boot image via network using BootP/TFTP protocol | 4642 | bootp - boot image via network using BootP/TFTP protocol |
4649 | bootz - boot zImage from memory | 4643 | bootz - boot zImage from memory |
4650 | tftpboot- boot image via network using TFTP protocol | 4644 | tftpboot- boot image via network using TFTP protocol |
4651 | and env variables "ipaddr" and "serverip" | 4645 | and env variables "ipaddr" and "serverip" |
4652 | (and eventually "gatewayip") | 4646 | (and eventually "gatewayip") |
4653 | tftpput - upload a file via network using TFTP protocol | 4647 | tftpput - upload a file via network using TFTP protocol |
4654 | rarpboot- boot image via network using RARP/TFTP protocol | 4648 | rarpboot- boot image via network using RARP/TFTP protocol |
4655 | diskboot- boot from IDE devicebootd - boot default, i.e., run 'bootcmd' | 4649 | diskboot- boot from IDE devicebootd - boot default, i.e., run 'bootcmd' |
4656 | loads - load S-Record file over serial line | 4650 | loads - load S-Record file over serial line |
4657 | loadb - load binary file over serial line (kermit mode) | 4651 | loadb - load binary file over serial line (kermit mode) |
4658 | md - memory display | 4652 | md - memory display |
4659 | mm - memory modify (auto-incrementing) | 4653 | mm - memory modify (auto-incrementing) |
4660 | nm - memory modify (constant address) | 4654 | nm - memory modify (constant address) |
4661 | mw - memory write (fill) | 4655 | mw - memory write (fill) |
4662 | cp - memory copy | 4656 | cp - memory copy |
4663 | cmp - memory compare | 4657 | cmp - memory compare |
4664 | crc32 - checksum calculation | 4658 | crc32 - checksum calculation |
4665 | i2c - I2C sub-system | 4659 | i2c - I2C sub-system |
4666 | sspi - SPI utility commands | 4660 | sspi - SPI utility commands |
4667 | base - print or set address offset | 4661 | base - print or set address offset |
4668 | printenv- print environment variables | 4662 | printenv- print environment variables |
4669 | setenv - set environment variables | 4663 | setenv - set environment variables |
4670 | saveenv - save environment variables to persistent storage | 4664 | saveenv - save environment variables to persistent storage |
4671 | protect - enable or disable FLASH write protection | 4665 | protect - enable or disable FLASH write protection |
4672 | erase - erase FLASH memory | 4666 | erase - erase FLASH memory |
4673 | flinfo - print FLASH memory information | 4667 | flinfo - print FLASH memory information |
4674 | nand - NAND memory operations (see doc/README.nand) | 4668 | nand - NAND memory operations (see doc/README.nand) |
4675 | bdinfo - print Board Info structure | 4669 | bdinfo - print Board Info structure |
4676 | iminfo - print header information for application image | 4670 | iminfo - print header information for application image |
4677 | coninfo - print console devices and informations | 4671 | coninfo - print console devices and informations |
4678 | ide - IDE sub-system | 4672 | ide - IDE sub-system |
4679 | loop - infinite loop on address range | 4673 | loop - infinite loop on address range |
4680 | loopw - infinite write loop on address range | 4674 | loopw - infinite write loop on address range |
4681 | mtest - simple RAM test | 4675 | mtest - simple RAM test |
4682 | icache - enable or disable instruction cache | 4676 | icache - enable or disable instruction cache |
4683 | dcache - enable or disable data cache | 4677 | dcache - enable or disable data cache |
4684 | reset - Perform RESET of the CPU | 4678 | reset - Perform RESET of the CPU |
4685 | echo - echo args to console | 4679 | echo - echo args to console |
4686 | version - print monitor version | 4680 | version - print monitor version |
4687 | help - print online help | 4681 | help - print online help |
4688 | ? - alias for 'help' | 4682 | ? - alias for 'help' |
4689 | 4683 | ||
4690 | 4684 | ||
4691 | Monitor Commands - Detailed Description: | 4685 | Monitor Commands - Detailed Description: |
4692 | ======================================== | 4686 | ======================================== |
4693 | 4687 | ||
4694 | TODO. | 4688 | TODO. |
4695 | 4689 | ||
4696 | For now: just type "help <command>". | 4690 | For now: just type "help <command>". |
4697 | 4691 | ||
4698 | 4692 | ||
4699 | Environment Variables: | 4693 | Environment Variables: |
4700 | ====================== | 4694 | ====================== |
4701 | 4695 | ||
4702 | U-Boot supports user configuration using Environment Variables which | 4696 | U-Boot supports user configuration using Environment Variables which |
4703 | can be made persistent by saving to Flash memory. | 4697 | can be made persistent by saving to Flash memory. |
4704 | 4698 | ||
4705 | Environment Variables are set using "setenv", printed using | 4699 | Environment Variables are set using "setenv", printed using |
4706 | "printenv", and saved to Flash using "saveenv". Using "setenv" | 4700 | "printenv", and saved to Flash using "saveenv". Using "setenv" |
4707 | without a value can be used to delete a variable from the | 4701 | without a value can be used to delete a variable from the |
4708 | environment. As long as you don't save the environment you are | 4702 | environment. As long as you don't save the environment you are |
4709 | working with an in-memory copy. In case the Flash area containing the | 4703 | working with an in-memory copy. In case the Flash area containing the |
4710 | environment is erased by accident, a default environment is provided. | 4704 | environment is erased by accident, a default environment is provided. |
4711 | 4705 | ||
4712 | Some configuration options can be set using Environment Variables. | 4706 | Some configuration options can be set using Environment Variables. |
4713 | 4707 | ||
4714 | List of environment variables (most likely not complete): | 4708 | List of environment variables (most likely not complete): |
4715 | 4709 | ||
4716 | baudrate - see CONFIG_BAUDRATE | 4710 | baudrate - see CONFIG_BAUDRATE |
4717 | 4711 | ||
4718 | bootdelay - see CONFIG_BOOTDELAY | 4712 | bootdelay - see CONFIG_BOOTDELAY |
4719 | 4713 | ||
4720 | bootcmd - see CONFIG_BOOTCOMMAND | 4714 | bootcmd - see CONFIG_BOOTCOMMAND |
4721 | 4715 | ||
4722 | bootargs - Boot arguments when booting an RTOS image | 4716 | bootargs - Boot arguments when booting an RTOS image |
4723 | 4717 | ||
4724 | bootfile - Name of the image to load with TFTP | 4718 | bootfile - Name of the image to load with TFTP |
4725 | 4719 | ||
4726 | bootm_low - Memory range available for image processing in the bootm | 4720 | bootm_low - Memory range available for image processing in the bootm |
4727 | command can be restricted. This variable is given as | 4721 | command can be restricted. This variable is given as |
4728 | a hexadecimal number and defines lowest address allowed | 4722 | a hexadecimal number and defines lowest address allowed |
4729 | for use by the bootm command. See also "bootm_size" | 4723 | for use by the bootm command. See also "bootm_size" |
4730 | environment variable. Address defined by "bootm_low" is | 4724 | environment variable. Address defined by "bootm_low" is |
4731 | also the base of the initial memory mapping for the Linux | 4725 | also the base of the initial memory mapping for the Linux |
4732 | kernel -- see the description of CONFIG_SYS_BOOTMAPSZ and | 4726 | kernel -- see the description of CONFIG_SYS_BOOTMAPSZ and |
4733 | bootm_mapsize. | 4727 | bootm_mapsize. |
4734 | 4728 | ||
4735 | bootm_mapsize - Size of the initial memory mapping for the Linux kernel. | 4729 | bootm_mapsize - Size of the initial memory mapping for the Linux kernel. |
4736 | This variable is given as a hexadecimal number and it | 4730 | This variable is given as a hexadecimal number and it |
4737 | defines the size of the memory region starting at base | 4731 | defines the size of the memory region starting at base |
4738 | address bootm_low that is accessible by the Linux kernel | 4732 | address bootm_low that is accessible by the Linux kernel |
4739 | during early boot. If unset, CONFIG_SYS_BOOTMAPSZ is used | 4733 | during early boot. If unset, CONFIG_SYS_BOOTMAPSZ is used |
4740 | as the default value if it is defined, and bootm_size is | 4734 | as the default value if it is defined, and bootm_size is |
4741 | used otherwise. | 4735 | used otherwise. |
4742 | 4736 | ||
4743 | bootm_size - Memory range available for image processing in the bootm | 4737 | bootm_size - Memory range available for image processing in the bootm |
4744 | command can be restricted. This variable is given as | 4738 | command can be restricted. This variable is given as |
4745 | a hexadecimal number and defines the size of the region | 4739 | a hexadecimal number and defines the size of the region |
4746 | allowed for use by the bootm command. See also "bootm_low" | 4740 | allowed for use by the bootm command. See also "bootm_low" |
4747 | environment variable. | 4741 | environment variable. |
4748 | 4742 | ||
4749 | updatefile - Location of the software update file on a TFTP server, used | 4743 | updatefile - Location of the software update file on a TFTP server, used |
4750 | by the automatic software update feature. Please refer to | 4744 | by the automatic software update feature. Please refer to |
4751 | documentation in doc/README.update for more details. | 4745 | documentation in doc/README.update for more details. |
4752 | 4746 | ||
4753 | autoload - if set to "no" (any string beginning with 'n'), | 4747 | autoload - if set to "no" (any string beginning with 'n'), |
4754 | "bootp" will just load perform a lookup of the | 4748 | "bootp" will just load perform a lookup of the |
4755 | configuration from the BOOTP server, but not try to | 4749 | configuration from the BOOTP server, but not try to |
4756 | load any image using TFTP | 4750 | load any image using TFTP |
4757 | 4751 | ||
4758 | autostart - if set to "yes", an image loaded using the "bootp", | 4752 | autostart - if set to "yes", an image loaded using the "bootp", |
4759 | "rarpboot", "tftpboot" or "diskboot" commands will | 4753 | "rarpboot", "tftpboot" or "diskboot" commands will |
4760 | be automatically started (by internally calling | 4754 | be automatically started (by internally calling |
4761 | "bootm") | 4755 | "bootm") |
4762 | 4756 | ||
4763 | If set to "no", a standalone image passed to the | 4757 | If set to "no", a standalone image passed to the |
4764 | "bootm" command will be copied to the load address | 4758 | "bootm" command will be copied to the load address |
4765 | (and eventually uncompressed), but NOT be started. | 4759 | (and eventually uncompressed), but NOT be started. |
4766 | This can be used to load and uncompress arbitrary | 4760 | This can be used to load and uncompress arbitrary |
4767 | data. | 4761 | data. |
4768 | 4762 | ||
4769 | fdt_high - if set this restricts the maximum address that the | 4763 | fdt_high - if set this restricts the maximum address that the |
4770 | flattened device tree will be copied into upon boot. | 4764 | flattened device tree will be copied into upon boot. |
4771 | For example, if you have a system with 1 GB memory | 4765 | For example, if you have a system with 1 GB memory |
4772 | at physical address 0x10000000, while Linux kernel | 4766 | at physical address 0x10000000, while Linux kernel |
4773 | only recognizes the first 704 MB as low memory, you | 4767 | only recognizes the first 704 MB as low memory, you |
4774 | may need to set fdt_high as 0x3C000000 to have the | 4768 | may need to set fdt_high as 0x3C000000 to have the |
4775 | device tree blob be copied to the maximum address | 4769 | device tree blob be copied to the maximum address |
4776 | of the 704 MB low memory, so that Linux kernel can | 4770 | of the 704 MB low memory, so that Linux kernel can |
4777 | access it during the boot procedure. | 4771 | access it during the boot procedure. |
4778 | 4772 | ||
4779 | If this is set to the special value 0xFFFFFFFF then | 4773 | If this is set to the special value 0xFFFFFFFF then |
4780 | the fdt will not be copied at all on boot. For this | 4774 | the fdt will not be copied at all on boot. For this |
4781 | to work it must reside in writable memory, have | 4775 | to work it must reside in writable memory, have |
4782 | sufficient padding on the end of it for u-boot to | 4776 | sufficient padding on the end of it for u-boot to |
4783 | add the information it needs into it, and the memory | 4777 | add the information it needs into it, and the memory |
4784 | must be accessible by the kernel. | 4778 | must be accessible by the kernel. |
4785 | 4779 | ||
4786 | fdtcontroladdr- if set this is the address of the control flattened | 4780 | fdtcontroladdr- if set this is the address of the control flattened |
4787 | device tree used by U-Boot when CONFIG_OF_CONTROL is | 4781 | device tree used by U-Boot when CONFIG_OF_CONTROL is |
4788 | defined. | 4782 | defined. |
4789 | 4783 | ||
4790 | i2cfast - (PPC405GP|PPC405EP only) | 4784 | i2cfast - (PPC405GP|PPC405EP only) |
4791 | if set to 'y' configures Linux I2C driver for fast | 4785 | if set to 'y' configures Linux I2C driver for fast |
4792 | mode (400kHZ). This environment variable is used in | 4786 | mode (400kHZ). This environment variable is used in |
4793 | initialization code. So, for changes to be effective | 4787 | initialization code. So, for changes to be effective |
4794 | it must be saved and board must be reset. | 4788 | it must be saved and board must be reset. |
4795 | 4789 | ||
4796 | initrd_high - restrict positioning of initrd images: | 4790 | initrd_high - restrict positioning of initrd images: |
4797 | If this variable is not set, initrd images will be | 4791 | If this variable is not set, initrd images will be |
4798 | copied to the highest possible address in RAM; this | 4792 | copied to the highest possible address in RAM; this |
4799 | is usually what you want since it allows for | 4793 | is usually what you want since it allows for |
4800 | maximum initrd size. If for some reason you want to | 4794 | maximum initrd size. If for some reason you want to |
4801 | make sure that the initrd image is loaded below the | 4795 | make sure that the initrd image is loaded below the |
4802 | CONFIG_SYS_BOOTMAPSZ limit, you can set this environment | 4796 | CONFIG_SYS_BOOTMAPSZ limit, you can set this environment |
4803 | variable to a value of "no" or "off" or "0". | 4797 | variable to a value of "no" or "off" or "0". |
4804 | Alternatively, you can set it to a maximum upper | 4798 | Alternatively, you can set it to a maximum upper |
4805 | address to use (U-Boot will still check that it | 4799 | address to use (U-Boot will still check that it |
4806 | does not overwrite the U-Boot stack and data). | 4800 | does not overwrite the U-Boot stack and data). |
4807 | 4801 | ||
4808 | For instance, when you have a system with 16 MB | 4802 | For instance, when you have a system with 16 MB |
4809 | RAM, and want to reserve 4 MB from use by Linux, | 4803 | RAM, and want to reserve 4 MB from use by Linux, |
4810 | you can do this by adding "mem=12M" to the value of | 4804 | you can do this by adding "mem=12M" to the value of |
4811 | the "bootargs" variable. However, now you must make | 4805 | the "bootargs" variable. However, now you must make |
4812 | sure that the initrd image is placed in the first | 4806 | sure that the initrd image is placed in the first |
4813 | 12 MB as well - this can be done with | 4807 | 12 MB as well - this can be done with |
4814 | 4808 | ||
4815 | setenv initrd_high 00c00000 | 4809 | setenv initrd_high 00c00000 |
4816 | 4810 | ||
4817 | If you set initrd_high to 0xFFFFFFFF, this is an | 4811 | If you set initrd_high to 0xFFFFFFFF, this is an |
4818 | indication to U-Boot that all addresses are legal | 4812 | indication to U-Boot that all addresses are legal |
4819 | for the Linux kernel, including addresses in flash | 4813 | for the Linux kernel, including addresses in flash |
4820 | memory. In this case U-Boot will NOT COPY the | 4814 | memory. In this case U-Boot will NOT COPY the |
4821 | ramdisk at all. This may be useful to reduce the | 4815 | ramdisk at all. This may be useful to reduce the |
4822 | boot time on your system, but requires that this | 4816 | boot time on your system, but requires that this |
4823 | feature is supported by your Linux kernel. | 4817 | feature is supported by your Linux kernel. |
4824 | 4818 | ||
4825 | ipaddr - IP address; needed for tftpboot command | 4819 | ipaddr - IP address; needed for tftpboot command |
4826 | 4820 | ||
4827 | loadaddr - Default load address for commands like "bootp", | 4821 | loadaddr - Default load address for commands like "bootp", |
4828 | "rarpboot", "tftpboot", "loadb" or "diskboot" | 4822 | "rarpboot", "tftpboot", "loadb" or "diskboot" |
4829 | 4823 | ||
4830 | loads_echo - see CONFIG_LOADS_ECHO | 4824 | loads_echo - see CONFIG_LOADS_ECHO |
4831 | 4825 | ||
4832 | serverip - TFTP server IP address; needed for tftpboot command | 4826 | serverip - TFTP server IP address; needed for tftpboot command |
4833 | 4827 | ||
4834 | bootretry - see CONFIG_BOOT_RETRY_TIME | 4828 | bootretry - see CONFIG_BOOT_RETRY_TIME |
4835 | 4829 | ||
4836 | bootdelaykey - see CONFIG_AUTOBOOT_DELAY_STR | 4830 | bootdelaykey - see CONFIG_AUTOBOOT_DELAY_STR |
4837 | 4831 | ||
4838 | bootstopkey - see CONFIG_AUTOBOOT_STOP_STR | 4832 | bootstopkey - see CONFIG_AUTOBOOT_STOP_STR |
4839 | 4833 | ||
4840 | ethprime - controls which interface is used first. | 4834 | ethprime - controls which interface is used first. |
4841 | 4835 | ||
4842 | ethact - controls which interface is currently active. | 4836 | ethact - controls which interface is currently active. |
4843 | For example you can do the following | 4837 | For example you can do the following |
4844 | 4838 | ||
4845 | => setenv ethact FEC | 4839 | => setenv ethact FEC |
4846 | => ping 192.168.0.1 # traffic sent on FEC | 4840 | => ping 192.168.0.1 # traffic sent on FEC |
4847 | => setenv ethact SCC | 4841 | => setenv ethact SCC |
4848 | => ping 10.0.0.1 # traffic sent on SCC | 4842 | => ping 10.0.0.1 # traffic sent on SCC |
4849 | 4843 | ||
4850 | ethrotate - When set to "no" U-Boot does not go through all | 4844 | ethrotate - When set to "no" U-Boot does not go through all |
4851 | available network interfaces. | 4845 | available network interfaces. |
4852 | It just stays at the currently selected interface. | 4846 | It just stays at the currently selected interface. |
4853 | 4847 | ||
4854 | netretry - When set to "no" each network operation will | 4848 | netretry - When set to "no" each network operation will |
4855 | either succeed or fail without retrying. | 4849 | either succeed or fail without retrying. |
4856 | When set to "once" the network operation will | 4850 | When set to "once" the network operation will |
4857 | fail when all the available network interfaces | 4851 | fail when all the available network interfaces |
4858 | are tried once without success. | 4852 | are tried once without success. |
4859 | Useful on scripts which control the retry operation | 4853 | Useful on scripts which control the retry operation |
4860 | themselves. | 4854 | themselves. |
4861 | 4855 | ||
4862 | npe_ucode - set load address for the NPE microcode | 4856 | npe_ucode - set load address for the NPE microcode |
4863 | 4857 | ||
4864 | silent_linux - If set then linux will be told to boot silently, by | 4858 | silent_linux - If set then linux will be told to boot silently, by |
4865 | changing the console to be empty. If "yes" it will be | 4859 | changing the console to be empty. If "yes" it will be |
4866 | made silent. If "no" it will not be made silent. If | 4860 | made silent. If "no" it will not be made silent. If |
4867 | unset, then it will be made silent if the U-Boot console | 4861 | unset, then it will be made silent if the U-Boot console |
4868 | is silent. | 4862 | is silent. |
4869 | 4863 | ||
4870 | tftpsrcport - If this is set, the value is used for TFTP's | 4864 | tftpsrcport - If this is set, the value is used for TFTP's |
4871 | UDP source port. | 4865 | UDP source port. |
4872 | 4866 | ||
4873 | tftpdstport - If this is set, the value is used for TFTP's UDP | 4867 | tftpdstport - If this is set, the value is used for TFTP's UDP |
4874 | destination port instead of the Well Know Port 69. | 4868 | destination port instead of the Well Know Port 69. |
4875 | 4869 | ||
4876 | tftpblocksize - Block size to use for TFTP transfers; if not set, | 4870 | tftpblocksize - Block size to use for TFTP transfers; if not set, |
4877 | we use the TFTP server's default block size | 4871 | we use the TFTP server's default block size |
4878 | 4872 | ||
4879 | tftptimeout - Retransmission timeout for TFTP packets (in milli- | 4873 | tftptimeout - Retransmission timeout for TFTP packets (in milli- |
4880 | seconds, minimum value is 1000 = 1 second). Defines | 4874 | seconds, minimum value is 1000 = 1 second). Defines |
4881 | when a packet is considered to be lost so it has to | 4875 | when a packet is considered to be lost so it has to |
4882 | be retransmitted. The default is 5000 = 5 seconds. | 4876 | be retransmitted. The default is 5000 = 5 seconds. |
4883 | Lowering this value may make downloads succeed | 4877 | Lowering this value may make downloads succeed |
4884 | faster in networks with high packet loss rates or | 4878 | faster in networks with high packet loss rates or |
4885 | with unreliable TFTP servers. | 4879 | with unreliable TFTP servers. |
4886 | 4880 | ||
4887 | vlan - When set to a value < 4095 the traffic over | 4881 | vlan - When set to a value < 4095 the traffic over |
4888 | Ethernet is encapsulated/received over 802.1q | 4882 | Ethernet is encapsulated/received over 802.1q |
4889 | VLAN tagged frames. | 4883 | VLAN tagged frames. |
4890 | 4884 | ||
4891 | The following image location variables contain the location of images | 4885 | The following image location variables contain the location of images |
4892 | used in booting. The "Image" column gives the role of the image and is | 4886 | used in booting. The "Image" column gives the role of the image and is |
4893 | not an environment variable name. The other columns are environment | 4887 | not an environment variable name. The other columns are environment |
4894 | variable names. "File Name" gives the name of the file on a TFTP | 4888 | variable names. "File Name" gives the name of the file on a TFTP |
4895 | server, "RAM Address" gives the location in RAM the image will be | 4889 | server, "RAM Address" gives the location in RAM the image will be |
4896 | loaded to, and "Flash Location" gives the image's address in NOR | 4890 | loaded to, and "Flash Location" gives the image's address in NOR |
4897 | flash or offset in NAND flash. | 4891 | flash or offset in NAND flash. |
4898 | 4892 | ||
4899 | *Note* - these variables don't have to be defined for all boards, some | 4893 | *Note* - these variables don't have to be defined for all boards, some |
4900 | boards currenlty use other variables for these purposes, and some | 4894 | boards currenlty use other variables for these purposes, and some |
4901 | boards use these variables for other purposes. | 4895 | boards use these variables for other purposes. |
4902 | 4896 | ||
4903 | Image File Name RAM Address Flash Location | 4897 | Image File Name RAM Address Flash Location |
4904 | ----- --------- ----------- -------------- | 4898 | ----- --------- ----------- -------------- |
4905 | u-boot u-boot u-boot_addr_r u-boot_addr | 4899 | u-boot u-boot u-boot_addr_r u-boot_addr |
4906 | Linux kernel bootfile kernel_addr_r kernel_addr | 4900 | Linux kernel bootfile kernel_addr_r kernel_addr |
4907 | device tree blob fdtfile fdt_addr_r fdt_addr | 4901 | device tree blob fdtfile fdt_addr_r fdt_addr |
4908 | ramdisk ramdiskfile ramdisk_addr_r ramdisk_addr | 4902 | ramdisk ramdiskfile ramdisk_addr_r ramdisk_addr |
4909 | 4903 | ||
4910 | The following environment variables may be used and automatically | 4904 | The following environment variables may be used and automatically |
4911 | updated by the network boot commands ("bootp" and "rarpboot"), | 4905 | updated by the network boot commands ("bootp" and "rarpboot"), |
4912 | depending the information provided by your boot server: | 4906 | depending the information provided by your boot server: |
4913 | 4907 | ||
4914 | bootfile - see above | 4908 | bootfile - see above |
4915 | dnsip - IP address of your Domain Name Server | 4909 | dnsip - IP address of your Domain Name Server |
4916 | dnsip2 - IP address of your secondary Domain Name Server | 4910 | dnsip2 - IP address of your secondary Domain Name Server |
4917 | gatewayip - IP address of the Gateway (Router) to use | 4911 | gatewayip - IP address of the Gateway (Router) to use |
4918 | hostname - Target hostname | 4912 | hostname - Target hostname |
4919 | ipaddr - see above | 4913 | ipaddr - see above |
4920 | netmask - Subnet Mask | 4914 | netmask - Subnet Mask |
4921 | rootpath - Pathname of the root filesystem on the NFS server | 4915 | rootpath - Pathname of the root filesystem on the NFS server |
4922 | serverip - see above | 4916 | serverip - see above |
4923 | 4917 | ||
4924 | 4918 | ||
4925 | There are two special Environment Variables: | 4919 | There are two special Environment Variables: |
4926 | 4920 | ||
4927 | serial# - contains hardware identification information such | 4921 | serial# - contains hardware identification information such |
4928 | as type string and/or serial number | 4922 | as type string and/or serial number |
4929 | ethaddr - Ethernet address | 4923 | ethaddr - Ethernet address |
4930 | 4924 | ||
4931 | These variables can be set only once (usually during manufacturing of | 4925 | These variables can be set only once (usually during manufacturing of |
4932 | the board). U-Boot refuses to delete or overwrite these variables | 4926 | the board). U-Boot refuses to delete or overwrite these variables |
4933 | once they have been set once. | 4927 | once they have been set once. |
4934 | 4928 | ||
4935 | 4929 | ||
4936 | Further special Environment Variables: | 4930 | Further special Environment Variables: |
4937 | 4931 | ||
4938 | ver - Contains the U-Boot version string as printed | 4932 | ver - Contains the U-Boot version string as printed |
4939 | with the "version" command. This variable is | 4933 | with the "version" command. This variable is |
4940 | readonly (see CONFIG_VERSION_VARIABLE). | 4934 | readonly (see CONFIG_VERSION_VARIABLE). |
4941 | 4935 | ||
4942 | 4936 | ||
4943 | Please note that changes to some configuration parameters may take | 4937 | Please note that changes to some configuration parameters may take |
4944 | only effect after the next boot (yes, that's just like Windoze :-). | 4938 | only effect after the next boot (yes, that's just like Windoze :-). |
4945 | 4939 | ||
4946 | 4940 | ||
4947 | Callback functions for environment variables: | 4941 | Callback functions for environment variables: |
4948 | --------------------------------------------- | 4942 | --------------------------------------------- |
4949 | 4943 | ||
4950 | For some environment variables, the behavior of u-boot needs to change | 4944 | For some environment variables, the behavior of u-boot needs to change |
4951 | when their values are changed. This functionailty allows functions to | 4945 | when their values are changed. This functionailty allows functions to |
4952 | be associated with arbitrary variables. On creation, overwrite, or | 4946 | be associated with arbitrary variables. On creation, overwrite, or |
4953 | deletion, the callback will provide the opportunity for some side | 4947 | deletion, the callback will provide the opportunity for some side |
4954 | effect to happen or for the change to be rejected. | 4948 | effect to happen or for the change to be rejected. |
4955 | 4949 | ||
4956 | The callbacks are named and associated with a function using the | 4950 | The callbacks are named and associated with a function using the |
4957 | U_BOOT_ENV_CALLBACK macro in your board or driver code. | 4951 | U_BOOT_ENV_CALLBACK macro in your board or driver code. |
4958 | 4952 | ||
4959 | These callbacks are associated with variables in one of two ways. The | 4953 | These callbacks are associated with variables in one of two ways. The |
4960 | static list can be added to by defining CONFIG_ENV_CALLBACK_LIST_STATIC | 4954 | static list can be added to by defining CONFIG_ENV_CALLBACK_LIST_STATIC |
4961 | in the board configuration to a string that defines a list of | 4955 | in the board configuration to a string that defines a list of |
4962 | associations. The list must be in the following format: | 4956 | associations. The list must be in the following format: |
4963 | 4957 | ||
4964 | entry = variable_name[:callback_name] | 4958 | entry = variable_name[:callback_name] |
4965 | list = entry[,list] | 4959 | list = entry[,list] |
4966 | 4960 | ||
4967 | If the callback name is not specified, then the callback is deleted. | 4961 | If the callback name is not specified, then the callback is deleted. |
4968 | Spaces are also allowed anywhere in the list. | 4962 | Spaces are also allowed anywhere in the list. |
4969 | 4963 | ||
4970 | Callbacks can also be associated by defining the ".callbacks" variable | 4964 | Callbacks can also be associated by defining the ".callbacks" variable |
4971 | with the same list format above. Any association in ".callbacks" will | 4965 | with the same list format above. Any association in ".callbacks" will |
4972 | override any association in the static list. You can define | 4966 | override any association in the static list. You can define |
4973 | CONFIG_ENV_CALLBACK_LIST_DEFAULT to a list (string) to define the | 4967 | CONFIG_ENV_CALLBACK_LIST_DEFAULT to a list (string) to define the |
4974 | ".callbacks" envirnoment variable in the default or embedded environment. | 4968 | ".callbacks" envirnoment variable in the default or embedded environment. |
4975 | 4969 | ||
4976 | 4970 | ||
4977 | Command Line Parsing: | 4971 | Command Line Parsing: |
4978 | ===================== | 4972 | ===================== |
4979 | 4973 | ||
4980 | There are two different command line parsers available with U-Boot: | 4974 | There are two different command line parsers available with U-Boot: |
4981 | the old "simple" one, and the much more powerful "hush" shell: | 4975 | the old "simple" one, and the much more powerful "hush" shell: |
4982 | 4976 | ||
4983 | Old, simple command line parser: | 4977 | Old, simple command line parser: |
4984 | -------------------------------- | 4978 | -------------------------------- |
4985 | 4979 | ||
4986 | - supports environment variables (through setenv / saveenv commands) | 4980 | - supports environment variables (through setenv / saveenv commands) |
4987 | - several commands on one line, separated by ';' | 4981 | - several commands on one line, separated by ';' |
4988 | - variable substitution using "... ${name} ..." syntax | 4982 | - variable substitution using "... ${name} ..." syntax |
4989 | - special characters ('$', ';') can be escaped by prefixing with '\', | 4983 | - special characters ('$', ';') can be escaped by prefixing with '\', |
4990 | for example: | 4984 | for example: |
4991 | setenv bootcmd bootm \${address} | 4985 | setenv bootcmd bootm \${address} |
4992 | - You can also escape text by enclosing in single apostrophes, for example: | 4986 | - You can also escape text by enclosing in single apostrophes, for example: |
4993 | setenv addip 'setenv bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off' | 4987 | setenv addip 'setenv bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off' |
4994 | 4988 | ||
4995 | Hush shell: | 4989 | Hush shell: |
4996 | ----------- | 4990 | ----------- |
4997 | 4991 | ||
4998 | - similar to Bourne shell, with control structures like | 4992 | - similar to Bourne shell, with control structures like |
4999 | if...then...else...fi, for...do...done; while...do...done, | 4993 | if...then...else...fi, for...do...done; while...do...done, |
5000 | until...do...done, ... | 4994 | until...do...done, ... |
5001 | - supports environment ("global") variables (through setenv / saveenv | 4995 | - supports environment ("global") variables (through setenv / saveenv |
5002 | commands) and local shell variables (through standard shell syntax | 4996 | commands) and local shell variables (through standard shell syntax |
5003 | "name=value"); only environment variables can be used with "run" | 4997 | "name=value"); only environment variables can be used with "run" |
5004 | command | 4998 | command |
5005 | 4999 | ||
5006 | General rules: | 5000 | General rules: |
5007 | -------------- | 5001 | -------------- |
5008 | 5002 | ||
5009 | (1) If a command line (or an environment variable executed by a "run" | 5003 | (1) If a command line (or an environment variable executed by a "run" |
5010 | command) contains several commands separated by semicolon, and | 5004 | command) contains several commands separated by semicolon, and |
5011 | one of these commands fails, then the remaining commands will be | 5005 | one of these commands fails, then the remaining commands will be |
5012 | executed anyway. | 5006 | executed anyway. |
5013 | 5007 | ||
5014 | (2) If you execute several variables with one call to run (i. e. | 5008 | (2) If you execute several variables with one call to run (i. e. |
5015 | calling run with a list of variables as arguments), any failing | 5009 | calling run with a list of variables as arguments), any failing |
5016 | command will cause "run" to terminate, i. e. the remaining | 5010 | command will cause "run" to terminate, i. e. the remaining |
5017 | variables are not executed. | 5011 | variables are not executed. |
5018 | 5012 | ||
5019 | Note for Redundant Ethernet Interfaces: | 5013 | Note for Redundant Ethernet Interfaces: |
5020 | ======================================= | 5014 | ======================================= |
5021 | 5015 | ||
5022 | Some boards come with redundant Ethernet interfaces; U-Boot supports | 5016 | Some boards come with redundant Ethernet interfaces; U-Boot supports |
5023 | such configurations and is capable of automatic selection of a | 5017 | such configurations and is capable of automatic selection of a |
5024 | "working" interface when needed. MAC assignment works as follows: | 5018 | "working" interface when needed. MAC assignment works as follows: |
5025 | 5019 | ||
5026 | Network interfaces are numbered eth0, eth1, eth2, ... Corresponding | 5020 | Network interfaces are numbered eth0, eth1, eth2, ... Corresponding |
5027 | MAC addresses can be stored in the environment as "ethaddr" (=>eth0), | 5021 | MAC addresses can be stored in the environment as "ethaddr" (=>eth0), |
5028 | "eth1addr" (=>eth1), "eth2addr", ... | 5022 | "eth1addr" (=>eth1), "eth2addr", ... |
5029 | 5023 | ||
5030 | If the network interface stores some valid MAC address (for instance | 5024 | If the network interface stores some valid MAC address (for instance |
5031 | in SROM), this is used as default address if there is NO correspon- | 5025 | in SROM), this is used as default address if there is NO correspon- |
5032 | ding setting in the environment; if the corresponding environment | 5026 | ding setting in the environment; if the corresponding environment |
5033 | variable is set, this overrides the settings in the card; that means: | 5027 | variable is set, this overrides the settings in the card; that means: |
5034 | 5028 | ||
5035 | o If the SROM has a valid MAC address, and there is no address in the | 5029 | o If the SROM has a valid MAC address, and there is no address in the |
5036 | environment, the SROM's address is used. | 5030 | environment, the SROM's address is used. |
5037 | 5031 | ||
5038 | o If there is no valid address in the SROM, and a definition in the | 5032 | o If there is no valid address in the SROM, and a definition in the |
5039 | environment exists, then the value from the environment variable is | 5033 | environment exists, then the value from the environment variable is |
5040 | used. | 5034 | used. |
5041 | 5035 | ||
5042 | o If both the SROM and the environment contain a MAC address, and | 5036 | o If both the SROM and the environment contain a MAC address, and |
5043 | both addresses are the same, this MAC address is used. | 5037 | both addresses are the same, this MAC address is used. |
5044 | 5038 | ||
5045 | o If both the SROM and the environment contain a MAC address, and the | 5039 | o If both the SROM and the environment contain a MAC address, and the |
5046 | addresses differ, the value from the environment is used and a | 5040 | addresses differ, the value from the environment is used and a |
5047 | warning is printed. | 5041 | warning is printed. |
5048 | 5042 | ||
5049 | o If neither SROM nor the environment contain a MAC address, an error | 5043 | o If neither SROM nor the environment contain a MAC address, an error |
5050 | is raised. | 5044 | is raised. |
5051 | 5045 | ||
5052 | If Ethernet drivers implement the 'write_hwaddr' function, valid MAC addresses | 5046 | If Ethernet drivers implement the 'write_hwaddr' function, valid MAC addresses |
5053 | will be programmed into hardware as part of the initialization process. This | 5047 | will be programmed into hardware as part of the initialization process. This |
5054 | may be skipped by setting the appropriate 'ethmacskip' environment variable. | 5048 | may be skipped by setting the appropriate 'ethmacskip' environment variable. |
5055 | The naming convention is as follows: | 5049 | The naming convention is as follows: |
5056 | "ethmacskip" (=>eth0), "eth1macskip" (=>eth1) etc. | 5050 | "ethmacskip" (=>eth0), "eth1macskip" (=>eth1) etc. |
5057 | 5051 | ||
5058 | Image Formats: | 5052 | Image Formats: |
5059 | ============== | 5053 | ============== |
5060 | 5054 | ||
5061 | U-Boot is capable of booting (and performing other auxiliary operations on) | 5055 | U-Boot is capable of booting (and performing other auxiliary operations on) |
5062 | images in two formats: | 5056 | images in two formats: |
5063 | 5057 | ||
5064 | New uImage format (FIT) | 5058 | New uImage format (FIT) |
5065 | ----------------------- | 5059 | ----------------------- |
5066 | 5060 | ||
5067 | Flexible and powerful format based on Flattened Image Tree -- FIT (similar | 5061 | Flexible and powerful format based on Flattened Image Tree -- FIT (similar |
5068 | to Flattened Device Tree). It allows the use of images with multiple | 5062 | to Flattened Device Tree). It allows the use of images with multiple |
5069 | components (several kernels, ramdisks, etc.), with contents protected by | 5063 | components (several kernels, ramdisks, etc.), with contents protected by |
5070 | SHA1, MD5 or CRC32. More details are found in the doc/uImage.FIT directory. | 5064 | SHA1, MD5 or CRC32. More details are found in the doc/uImage.FIT directory. |
5071 | 5065 | ||
5072 | 5066 | ||
5073 | Old uImage format | 5067 | Old uImage format |
5074 | ----------------- | 5068 | ----------------- |
5075 | 5069 | ||
5076 | Old image format is based on binary files which can be basically anything, | 5070 | Old image format is based on binary files which can be basically anything, |
5077 | preceded by a special header; see the definitions in include/image.h for | 5071 | preceded by a special header; see the definitions in include/image.h for |
5078 | details; basically, the header defines the following image properties: | 5072 | details; basically, the header defines the following image properties: |
5079 | 5073 | ||
5080 | * Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD, | 5074 | * Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD, |
5081 | 4.4BSD, Linux, SVR4, Esix, Solaris, Irix, SCO, Dell, NCR, VxWorks, | 5075 | 4.4BSD, Linux, SVR4, Esix, Solaris, Irix, SCO, Dell, NCR, VxWorks, |
5082 | LynxOS, pSOS, QNX, RTEMS, INTEGRITY; | 5076 | LynxOS, pSOS, QNX, RTEMS, INTEGRITY; |
5083 | Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, LynxOS, | 5077 | Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, LynxOS, |
5084 | INTEGRITY). | 5078 | INTEGRITY). |
5085 | * Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86, | 5079 | * Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86, |
5086 | IA64, MIPS, NDS32, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit; | 5080 | IA64, MIPS, NDS32, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit; |
5087 | Currently supported: ARM, AVR32, Intel x86, MIPS, NDS32, Nios II, PowerPC). | 5081 | Currently supported: ARM, AVR32, Intel x86, MIPS, NDS32, Nios II, PowerPC). |
5088 | * Compression Type (uncompressed, gzip, bzip2) | 5082 | * Compression Type (uncompressed, gzip, bzip2) |
5089 | * Load Address | 5083 | * Load Address |
5090 | * Entry Point | 5084 | * Entry Point |
5091 | * Image Name | 5085 | * Image Name |
5092 | * Image Timestamp | 5086 | * Image Timestamp |
5093 | 5087 | ||
5094 | The header is marked by a special Magic Number, and both the header | 5088 | The header is marked by a special Magic Number, and both the header |
5095 | and the data portions of the image are secured against corruption by | 5089 | and the data portions of the image are secured against corruption by |
5096 | CRC32 checksums. | 5090 | CRC32 checksums. |
5097 | 5091 | ||
5098 | 5092 | ||
5099 | Linux Support: | 5093 | Linux Support: |
5100 | ============== | 5094 | ============== |
5101 | 5095 | ||
5102 | Although U-Boot should support any OS or standalone application | 5096 | Although U-Boot should support any OS or standalone application |
5103 | easily, the main focus has always been on Linux during the design of | 5097 | easily, the main focus has always been on Linux during the design of |
5104 | U-Boot. | 5098 | U-Boot. |
5105 | 5099 | ||
5106 | U-Boot includes many features that so far have been part of some | 5100 | U-Boot includes many features that so far have been part of some |
5107 | special "boot loader" code within the Linux kernel. Also, any | 5101 | special "boot loader" code within the Linux kernel. Also, any |
5108 | "initrd" images to be used are no longer part of one big Linux image; | 5102 | "initrd" images to be used are no longer part of one big Linux image; |
5109 | instead, kernel and "initrd" are separate images. This implementation | 5103 | instead, kernel and "initrd" are separate images. This implementation |
5110 | serves several purposes: | 5104 | serves several purposes: |
5111 | 5105 | ||
5112 | - the same features can be used for other OS or standalone | 5106 | - the same features can be used for other OS or standalone |
5113 | applications (for instance: using compressed images to reduce the | 5107 | applications (for instance: using compressed images to reduce the |
5114 | Flash memory footprint) | 5108 | Flash memory footprint) |
5115 | 5109 | ||
5116 | - it becomes much easier to port new Linux kernel versions because | 5110 | - it becomes much easier to port new Linux kernel versions because |
5117 | lots of low-level, hardware dependent stuff are done by U-Boot | 5111 | lots of low-level, hardware dependent stuff are done by U-Boot |
5118 | 5112 | ||
5119 | - the same Linux kernel image can now be used with different "initrd" | 5113 | - the same Linux kernel image can now be used with different "initrd" |
5120 | images; of course this also means that different kernel images can | 5114 | images; of course this also means that different kernel images can |
5121 | be run with the same "initrd". This makes testing easier (you don't | 5115 | be run with the same "initrd". This makes testing easier (you don't |
5122 | have to build a new "zImage.initrd" Linux image when you just | 5116 | have to build a new "zImage.initrd" Linux image when you just |
5123 | change a file in your "initrd"). Also, a field-upgrade of the | 5117 | change a file in your "initrd"). Also, a field-upgrade of the |
5124 | software is easier now. | 5118 | software is easier now. |
5125 | 5119 | ||
5126 | 5120 | ||
5127 | Linux HOWTO: | 5121 | Linux HOWTO: |
5128 | ============ | 5122 | ============ |
5129 | 5123 | ||
5130 | Porting Linux to U-Boot based systems: | 5124 | Porting Linux to U-Boot based systems: |
5131 | --------------------------------------- | 5125 | --------------------------------------- |
5132 | 5126 | ||
5133 | U-Boot cannot save you from doing all the necessary modifications to | 5127 | U-Boot cannot save you from doing all the necessary modifications to |
5134 | configure the Linux device drivers for use with your target hardware | 5128 | configure the Linux device drivers for use with your target hardware |
5135 | (no, we don't intend to provide a full virtual machine interface to | 5129 | (no, we don't intend to provide a full virtual machine interface to |
5136 | Linux :-). | 5130 | Linux :-). |
5137 | 5131 | ||
5138 | But now you can ignore ALL boot loader code (in arch/powerpc/mbxboot). | 5132 | But now you can ignore ALL boot loader code (in arch/powerpc/mbxboot). |
5139 | 5133 | ||
5140 | Just make sure your machine specific header file (for instance | 5134 | Just make sure your machine specific header file (for instance |
5141 | include/asm-ppc/tqm8xx.h) includes the same definition of the Board | 5135 | include/asm-ppc/tqm8xx.h) includes the same definition of the Board |
5142 | Information structure as we define in include/asm-<arch>/u-boot.h, | 5136 | Information structure as we define in include/asm-<arch>/u-boot.h, |
5143 | and make sure that your definition of IMAP_ADDR uses the same value | 5137 | and make sure that your definition of IMAP_ADDR uses the same value |
5144 | as your U-Boot configuration in CONFIG_SYS_IMMR. | 5138 | as your U-Boot configuration in CONFIG_SYS_IMMR. |
5145 | 5139 | ||
5146 | 5140 | ||
5147 | Configuring the Linux kernel: | 5141 | Configuring the Linux kernel: |
5148 | ----------------------------- | 5142 | ----------------------------- |
5149 | 5143 | ||
5150 | No specific requirements for U-Boot. Make sure you have some root | 5144 | No specific requirements for U-Boot. Make sure you have some root |
5151 | device (initial ramdisk, NFS) for your target system. | 5145 | device (initial ramdisk, NFS) for your target system. |
5152 | 5146 | ||
5153 | 5147 | ||
5154 | Building a Linux Image: | 5148 | Building a Linux Image: |
5155 | ----------------------- | 5149 | ----------------------- |
5156 | 5150 | ||
5157 | With U-Boot, "normal" build targets like "zImage" or "bzImage" are | 5151 | With U-Boot, "normal" build targets like "zImage" or "bzImage" are |
5158 | not used. If you use recent kernel source, a new build target | 5152 | not used. If you use recent kernel source, a new build target |
5159 | "uImage" will exist which automatically builds an image usable by | 5153 | "uImage" will exist which automatically builds an image usable by |
5160 | U-Boot. Most older kernels also have support for a "pImage" target, | 5154 | U-Boot. Most older kernels also have support for a "pImage" target, |
5161 | which was introduced for our predecessor project PPCBoot and uses a | 5155 | which was introduced for our predecessor project PPCBoot and uses a |
5162 | 100% compatible format. | 5156 | 100% compatible format. |
5163 | 5157 | ||
5164 | Example: | 5158 | Example: |
5165 | 5159 | ||
5166 | make TQM850L_config | 5160 | make TQM850L_config |
5167 | make oldconfig | 5161 | make oldconfig |
5168 | make dep | 5162 | make dep |
5169 | make uImage | 5163 | make uImage |
5170 | 5164 | ||
5171 | The "uImage" build target uses a special tool (in 'tools/mkimage') to | 5165 | The "uImage" build target uses a special tool (in 'tools/mkimage') to |
5172 | encapsulate a compressed Linux kernel image with header information, | 5166 | encapsulate a compressed Linux kernel image with header information, |
5173 | CRC32 checksum etc. for use with U-Boot. This is what we are doing: | 5167 | CRC32 checksum etc. for use with U-Boot. This is what we are doing: |
5174 | 5168 | ||
5175 | * build a standard "vmlinux" kernel image (in ELF binary format): | 5169 | * build a standard "vmlinux" kernel image (in ELF binary format): |
5176 | 5170 | ||
5177 | * convert the kernel into a raw binary image: | 5171 | * convert the kernel into a raw binary image: |
5178 | 5172 | ||
5179 | ${CROSS_COMPILE}-objcopy -O binary \ | 5173 | ${CROSS_COMPILE}-objcopy -O binary \ |
5180 | -R .note -R .comment \ | 5174 | -R .note -R .comment \ |
5181 | -S vmlinux linux.bin | 5175 | -S vmlinux linux.bin |
5182 | 5176 | ||
5183 | * compress the binary image: | 5177 | * compress the binary image: |
5184 | 5178 | ||
5185 | gzip -9 linux.bin | 5179 | gzip -9 linux.bin |
5186 | 5180 | ||
5187 | * package compressed binary image for U-Boot: | 5181 | * package compressed binary image for U-Boot: |
5188 | 5182 | ||
5189 | mkimage -A ppc -O linux -T kernel -C gzip \ | 5183 | mkimage -A ppc -O linux -T kernel -C gzip \ |
5190 | -a 0 -e 0 -n "Linux Kernel Image" \ | 5184 | -a 0 -e 0 -n "Linux Kernel Image" \ |
5191 | -d linux.bin.gz uImage | 5185 | -d linux.bin.gz uImage |
5192 | 5186 | ||
5193 | 5187 | ||
5194 | The "mkimage" tool can also be used to create ramdisk images for use | 5188 | The "mkimage" tool can also be used to create ramdisk images for use |
5195 | with U-Boot, either separated from the Linux kernel image, or | 5189 | with U-Boot, either separated from the Linux kernel image, or |
5196 | combined into one file. "mkimage" encapsulates the images with a 64 | 5190 | combined into one file. "mkimage" encapsulates the images with a 64 |
5197 | byte header containing information about target architecture, | 5191 | byte header containing information about target architecture, |
5198 | operating system, image type, compression method, entry points, time | 5192 | operating system, image type, compression method, entry points, time |
5199 | stamp, CRC32 checksums, etc. | 5193 | stamp, CRC32 checksums, etc. |
5200 | 5194 | ||
5201 | "mkimage" can be called in two ways: to verify existing images and | 5195 | "mkimage" can be called in two ways: to verify existing images and |
5202 | print the header information, or to build new images. | 5196 | print the header information, or to build new images. |
5203 | 5197 | ||
5204 | In the first form (with "-l" option) mkimage lists the information | 5198 | In the first form (with "-l" option) mkimage lists the information |
5205 | contained in the header of an existing U-Boot image; this includes | 5199 | contained in the header of an existing U-Boot image; this includes |
5206 | checksum verification: | 5200 | checksum verification: |
5207 | 5201 | ||
5208 | tools/mkimage -l image | 5202 | tools/mkimage -l image |
5209 | -l ==> list image header information | 5203 | -l ==> list image header information |
5210 | 5204 | ||
5211 | The second form (with "-d" option) is used to build a U-Boot image | 5205 | The second form (with "-d" option) is used to build a U-Boot image |
5212 | from a "data file" which is used as image payload: | 5206 | from a "data file" which is used as image payload: |
5213 | 5207 | ||
5214 | tools/mkimage -A arch -O os -T type -C comp -a addr -e ep \ | 5208 | tools/mkimage -A arch -O os -T type -C comp -a addr -e ep \ |
5215 | -n name -d data_file image | 5209 | -n name -d data_file image |
5216 | -A ==> set architecture to 'arch' | 5210 | -A ==> set architecture to 'arch' |
5217 | -O ==> set operating system to 'os' | 5211 | -O ==> set operating system to 'os' |
5218 | -T ==> set image type to 'type' | 5212 | -T ==> set image type to 'type' |
5219 | -C ==> set compression type 'comp' | 5213 | -C ==> set compression type 'comp' |
5220 | -a ==> set load address to 'addr' (hex) | 5214 | -a ==> set load address to 'addr' (hex) |
5221 | -e ==> set entry point to 'ep' (hex) | 5215 | -e ==> set entry point to 'ep' (hex) |
5222 | -n ==> set image name to 'name' | 5216 | -n ==> set image name to 'name' |
5223 | -d ==> use image data from 'datafile' | 5217 | -d ==> use image data from 'datafile' |
5224 | 5218 | ||
5225 | Right now, all Linux kernels for PowerPC systems use the same load | 5219 | Right now, all Linux kernels for PowerPC systems use the same load |
5226 | address (0x00000000), but the entry point address depends on the | 5220 | address (0x00000000), but the entry point address depends on the |
5227 | kernel version: | 5221 | kernel version: |
5228 | 5222 | ||
5229 | - 2.2.x kernels have the entry point at 0x0000000C, | 5223 | - 2.2.x kernels have the entry point at 0x0000000C, |
5230 | - 2.3.x and later kernels have the entry point at 0x00000000. | 5224 | - 2.3.x and later kernels have the entry point at 0x00000000. |
5231 | 5225 | ||
5232 | So a typical call to build a U-Boot image would read: | 5226 | So a typical call to build a U-Boot image would read: |
5233 | 5227 | ||
5234 | -> tools/mkimage -n '2.4.4 kernel for TQM850L' \ | 5228 | -> tools/mkimage -n '2.4.4 kernel for TQM850L' \ |
5235 | > -A ppc -O linux -T kernel -C gzip -a 0 -e 0 \ | 5229 | > -A ppc -O linux -T kernel -C gzip -a 0 -e 0 \ |
5236 | > -d /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/powerpc/coffboot/vmlinux.gz \ | 5230 | > -d /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/powerpc/coffboot/vmlinux.gz \ |
5237 | > examples/uImage.TQM850L | 5231 | > examples/uImage.TQM850L |
5238 | Image Name: 2.4.4 kernel for TQM850L | 5232 | Image Name: 2.4.4 kernel for TQM850L |
5239 | Created: Wed Jul 19 02:34:59 2000 | 5233 | Created: Wed Jul 19 02:34:59 2000 |
5240 | Image Type: PowerPC Linux Kernel Image (gzip compressed) | 5234 | Image Type: PowerPC Linux Kernel Image (gzip compressed) |
5241 | Data Size: 335725 Bytes = 327.86 kB = 0.32 MB | 5235 | Data Size: 335725 Bytes = 327.86 kB = 0.32 MB |
5242 | Load Address: 0x00000000 | 5236 | Load Address: 0x00000000 |
5243 | Entry Point: 0x00000000 | 5237 | Entry Point: 0x00000000 |
5244 | 5238 | ||
5245 | To verify the contents of the image (or check for corruption): | 5239 | To verify the contents of the image (or check for corruption): |
5246 | 5240 | ||
5247 | -> tools/mkimage -l examples/uImage.TQM850L | 5241 | -> tools/mkimage -l examples/uImage.TQM850L |
5248 | Image Name: 2.4.4 kernel for TQM850L | 5242 | Image Name: 2.4.4 kernel for TQM850L |
5249 | Created: Wed Jul 19 02:34:59 2000 | 5243 | Created: Wed Jul 19 02:34:59 2000 |
5250 | Image Type: PowerPC Linux Kernel Image (gzip compressed) | 5244 | Image Type: PowerPC Linux Kernel Image (gzip compressed) |
5251 | Data Size: 335725 Bytes = 327.86 kB = 0.32 MB | 5245 | Data Size: 335725 Bytes = 327.86 kB = 0.32 MB |
5252 | Load Address: 0x00000000 | 5246 | Load Address: 0x00000000 |
5253 | Entry Point: 0x00000000 | 5247 | Entry Point: 0x00000000 |
5254 | 5248 | ||
5255 | NOTE: for embedded systems where boot time is critical you can trade | 5249 | NOTE: for embedded systems where boot time is critical you can trade |
5256 | speed for memory and install an UNCOMPRESSED image instead: this | 5250 | speed for memory and install an UNCOMPRESSED image instead: this |
5257 | needs more space in Flash, but boots much faster since it does not | 5251 | needs more space in Flash, but boots much faster since it does not |
5258 | need to be uncompressed: | 5252 | need to be uncompressed: |
5259 | 5253 | ||
5260 | -> gunzip /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/powerpc/coffboot/vmlinux.gz | 5254 | -> gunzip /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/powerpc/coffboot/vmlinux.gz |
5261 | -> tools/mkimage -n '2.4.4 kernel for TQM850L' \ | 5255 | -> tools/mkimage -n '2.4.4 kernel for TQM850L' \ |
5262 | > -A ppc -O linux -T kernel -C none -a 0 -e 0 \ | 5256 | > -A ppc -O linux -T kernel -C none -a 0 -e 0 \ |
5263 | > -d /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/powerpc/coffboot/vmlinux \ | 5257 | > -d /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/powerpc/coffboot/vmlinux \ |
5264 | > examples/uImage.TQM850L-uncompressed | 5258 | > examples/uImage.TQM850L-uncompressed |
5265 | Image Name: 2.4.4 kernel for TQM850L | 5259 | Image Name: 2.4.4 kernel for TQM850L |
5266 | Created: Wed Jul 19 02:34:59 2000 | 5260 | Created: Wed Jul 19 02:34:59 2000 |
5267 | Image Type: PowerPC Linux Kernel Image (uncompressed) | 5261 | Image Type: PowerPC Linux Kernel Image (uncompressed) |
5268 | Data Size: 792160 Bytes = 773.59 kB = 0.76 MB | 5262 | Data Size: 792160 Bytes = 773.59 kB = 0.76 MB |
5269 | Load Address: 0x00000000 | 5263 | Load Address: 0x00000000 |
5270 | Entry Point: 0x00000000 | 5264 | Entry Point: 0x00000000 |
5271 | 5265 | ||
5272 | 5266 | ||
5273 | Similar you can build U-Boot images from a 'ramdisk.image.gz' file | 5267 | Similar you can build U-Boot images from a 'ramdisk.image.gz' file |
5274 | when your kernel is intended to use an initial ramdisk: | 5268 | when your kernel is intended to use an initial ramdisk: |
5275 | 5269 | ||
5276 | -> tools/mkimage -n 'Simple Ramdisk Image' \ | 5270 | -> tools/mkimage -n 'Simple Ramdisk Image' \ |
5277 | > -A ppc -O linux -T ramdisk -C gzip \ | 5271 | > -A ppc -O linux -T ramdisk -C gzip \ |
5278 | > -d /LinuxPPC/images/SIMPLE-ramdisk.image.gz examples/simple-initrd | 5272 | > -d /LinuxPPC/images/SIMPLE-ramdisk.image.gz examples/simple-initrd |
5279 | Image Name: Simple Ramdisk Image | 5273 | Image Name: Simple Ramdisk Image |
5280 | Created: Wed Jan 12 14:01:50 2000 | 5274 | Created: Wed Jan 12 14:01:50 2000 |
5281 | Image Type: PowerPC Linux RAMDisk Image (gzip compressed) | 5275 | Image Type: PowerPC Linux RAMDisk Image (gzip compressed) |
5282 | Data Size: 566530 Bytes = 553.25 kB = 0.54 MB | 5276 | Data Size: 566530 Bytes = 553.25 kB = 0.54 MB |
5283 | Load Address: 0x00000000 | 5277 | Load Address: 0x00000000 |
5284 | Entry Point: 0x00000000 | 5278 | Entry Point: 0x00000000 |
5285 | 5279 | ||
5286 | The "dumpimage" is a tool to disassemble images built by mkimage. Its "-i" | 5280 | The "dumpimage" is a tool to disassemble images built by mkimage. Its "-i" |
5287 | option performs the converse operation of the mkimage's second form (the "-d" | 5281 | option performs the converse operation of the mkimage's second form (the "-d" |
5288 | option). Given an image built by mkimage, the dumpimage extracts a "data file" | 5282 | option). Given an image built by mkimage, the dumpimage extracts a "data file" |
5289 | from the image: | 5283 | from the image: |
5290 | 5284 | ||
5291 | tools/dumpimage -i image -p position data_file | 5285 | tools/dumpimage -i image -p position data_file |
5292 | -i ==> extract from the 'image' a specific 'data_file', \ | 5286 | -i ==> extract from the 'image' a specific 'data_file', \ |
5293 | indexed by 'position' | 5287 | indexed by 'position' |
5294 | 5288 | ||
5295 | 5289 | ||
5296 | Installing a Linux Image: | 5290 | Installing a Linux Image: |
5297 | ------------------------- | 5291 | ------------------------- |
5298 | 5292 | ||
5299 | To downloading a U-Boot image over the serial (console) interface, | 5293 | To downloading a U-Boot image over the serial (console) interface, |
5300 | you must convert the image to S-Record format: | 5294 | you must convert the image to S-Record format: |
5301 | 5295 | ||
5302 | objcopy -I binary -O srec examples/image examples/image.srec | 5296 | objcopy -I binary -O srec examples/image examples/image.srec |
5303 | 5297 | ||
5304 | The 'objcopy' does not understand the information in the U-Boot | 5298 | The 'objcopy' does not understand the information in the U-Boot |
5305 | image header, so the resulting S-Record file will be relative to | 5299 | image header, so the resulting S-Record file will be relative to |
5306 | address 0x00000000. To load it to a given address, you need to | 5300 | address 0x00000000. To load it to a given address, you need to |
5307 | specify the target address as 'offset' parameter with the 'loads' | 5301 | specify the target address as 'offset' parameter with the 'loads' |
5308 | command. | 5302 | command. |
5309 | 5303 | ||
5310 | Example: install the image to address 0x40100000 (which on the | 5304 | Example: install the image to address 0x40100000 (which on the |
5311 | TQM8xxL is in the first Flash bank): | 5305 | TQM8xxL is in the first Flash bank): |
5312 | 5306 | ||
5313 | => erase 40100000 401FFFFF | 5307 | => erase 40100000 401FFFFF |
5314 | 5308 | ||
5315 | .......... done | 5309 | .......... done |
5316 | Erased 8 sectors | 5310 | Erased 8 sectors |
5317 | 5311 | ||
5318 | => loads 40100000 | 5312 | => loads 40100000 |
5319 | ## Ready for S-Record download ... | 5313 | ## Ready for S-Record download ... |
5320 | ~>examples/image.srec | 5314 | ~>examples/image.srec |
5321 | 1 2 3 4 5 6 7 8 9 10 11 12 13 ... | 5315 | 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
5322 | ... | 5316 | ... |
5323 | 15989 15990 15991 15992 | 5317 | 15989 15990 15991 15992 |
5324 | [file transfer complete] | 5318 | [file transfer complete] |
5325 | [connected] | 5319 | [connected] |
5326 | ## Start Addr = 0x00000000 | 5320 | ## Start Addr = 0x00000000 |
5327 | 5321 | ||
5328 | 5322 | ||
5329 | You can check the success of the download using the 'iminfo' command; | 5323 | You can check the success of the download using the 'iminfo' command; |
5330 | this includes a checksum verification so you can be sure no data | 5324 | this includes a checksum verification so you can be sure no data |
5331 | corruption happened: | 5325 | corruption happened: |
5332 | 5326 | ||
5333 | => imi 40100000 | 5327 | => imi 40100000 |
5334 | 5328 | ||
5335 | ## Checking Image at 40100000 ... | 5329 | ## Checking Image at 40100000 ... |
5336 | Image Name: 2.2.13 for initrd on TQM850L | 5330 | Image Name: 2.2.13 for initrd on TQM850L |
5337 | Image Type: PowerPC Linux Kernel Image (gzip compressed) | 5331 | Image Type: PowerPC Linux Kernel Image (gzip compressed) |
5338 | Data Size: 335725 Bytes = 327 kB = 0 MB | 5332 | Data Size: 335725 Bytes = 327 kB = 0 MB |
5339 | Load Address: 00000000 | 5333 | Load Address: 00000000 |
5340 | Entry Point: 0000000c | 5334 | Entry Point: 0000000c |
5341 | Verifying Checksum ... OK | 5335 | Verifying Checksum ... OK |
5342 | 5336 | ||
5343 | 5337 | ||
5344 | Boot Linux: | 5338 | Boot Linux: |
5345 | ----------- | 5339 | ----------- |
5346 | 5340 | ||
5347 | The "bootm" command is used to boot an application that is stored in | 5341 | The "bootm" command is used to boot an application that is stored in |
5348 | memory (RAM or Flash). In case of a Linux kernel image, the contents | 5342 | memory (RAM or Flash). In case of a Linux kernel image, the contents |
5349 | of the "bootargs" environment variable is passed to the kernel as | 5343 | of the "bootargs" environment variable is passed to the kernel as |
5350 | parameters. You can check and modify this variable using the | 5344 | parameters. You can check and modify this variable using the |
5351 | "printenv" and "setenv" commands: | 5345 | "printenv" and "setenv" commands: |
5352 | 5346 | ||
5353 | 5347 | ||
5354 | => printenv bootargs | 5348 | => printenv bootargs |
5355 | bootargs=root=/dev/ram | 5349 | bootargs=root=/dev/ram |
5356 | 5350 | ||
5357 | => setenv bootargs root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2 | 5351 | => setenv bootargs root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2 |
5358 | 5352 | ||
5359 | => printenv bootargs | 5353 | => printenv bootargs |
5360 | bootargs=root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2 | 5354 | bootargs=root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2 |
5361 | 5355 | ||
5362 | => bootm 40020000 | 5356 | => bootm 40020000 |
5363 | ## Booting Linux kernel at 40020000 ... | 5357 | ## Booting Linux kernel at 40020000 ... |
5364 | Image Name: 2.2.13 for NFS on TQM850L | 5358 | Image Name: 2.2.13 for NFS on TQM850L |
5365 | Image Type: PowerPC Linux Kernel Image (gzip compressed) | 5359 | Image Type: PowerPC Linux Kernel Image (gzip compressed) |
5366 | Data Size: 381681 Bytes = 372 kB = 0 MB | 5360 | Data Size: 381681 Bytes = 372 kB = 0 MB |
5367 | Load Address: 00000000 | 5361 | Load Address: 00000000 |
5368 | Entry Point: 0000000c | 5362 | Entry Point: 0000000c |
5369 | Verifying Checksum ... OK | 5363 | Verifying Checksum ... OK |
5370 | Uncompressing Kernel Image ... OK | 5364 | Uncompressing Kernel Image ... OK |
5371 | Linux version 2.2.13 (wd@denx.local.net) (gcc version 2.95.2 19991024 (release)) #1 Wed Jul 19 02:35:17 MEST 2000 | 5365 | Linux version 2.2.13 (wd@denx.local.net) (gcc version 2.95.2 19991024 (release)) #1 Wed Jul 19 02:35:17 MEST 2000 |
5372 | Boot arguments: root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2 | 5366 | Boot arguments: root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2 |
5373 | time_init: decrementer frequency = 187500000/60 | 5367 | time_init: decrementer frequency = 187500000/60 |
5374 | Calibrating delay loop... 49.77 BogoMIPS | 5368 | Calibrating delay loop... 49.77 BogoMIPS |
5375 | Memory: 15208k available (700k kernel code, 444k data, 32k init) [c0000000,c1000000] | 5369 | Memory: 15208k available (700k kernel code, 444k data, 32k init) [c0000000,c1000000] |
5376 | ... | 5370 | ... |
5377 | 5371 | ||
5378 | If you want to boot a Linux kernel with initial RAM disk, you pass | 5372 | If you want to boot a Linux kernel with initial RAM disk, you pass |
5379 | the memory addresses of both the kernel and the initrd image (PPBCOOT | 5373 | the memory addresses of both the kernel and the initrd image (PPBCOOT |
5380 | format!) to the "bootm" command: | 5374 | format!) to the "bootm" command: |
5381 | 5375 | ||
5382 | => imi 40100000 40200000 | 5376 | => imi 40100000 40200000 |
5383 | 5377 | ||
5384 | ## Checking Image at 40100000 ... | 5378 | ## Checking Image at 40100000 ... |
5385 | Image Name: 2.2.13 for initrd on TQM850L | 5379 | Image Name: 2.2.13 for initrd on TQM850L |
5386 | Image Type: PowerPC Linux Kernel Image (gzip compressed) | 5380 | Image Type: PowerPC Linux Kernel Image (gzip compressed) |
5387 | Data Size: 335725 Bytes = 327 kB = 0 MB | 5381 | Data Size: 335725 Bytes = 327 kB = 0 MB |
5388 | Load Address: 00000000 | 5382 | Load Address: 00000000 |
5389 | Entry Point: 0000000c | 5383 | Entry Point: 0000000c |
5390 | Verifying Checksum ... OK | 5384 | Verifying Checksum ... OK |
5391 | 5385 | ||
5392 | ## Checking Image at 40200000 ... | 5386 | ## Checking Image at 40200000 ... |
5393 | Image Name: Simple Ramdisk Image | 5387 | Image Name: Simple Ramdisk Image |
5394 | Image Type: PowerPC Linux RAMDisk Image (gzip compressed) | 5388 | Image Type: PowerPC Linux RAMDisk Image (gzip compressed) |
5395 | Data Size: 566530 Bytes = 553 kB = 0 MB | 5389 | Data Size: 566530 Bytes = 553 kB = 0 MB |
5396 | Load Address: 00000000 | 5390 | Load Address: 00000000 |
5397 | Entry Point: 00000000 | 5391 | Entry Point: 00000000 |
5398 | Verifying Checksum ... OK | 5392 | Verifying Checksum ... OK |
5399 | 5393 | ||
5400 | => bootm 40100000 40200000 | 5394 | => bootm 40100000 40200000 |
5401 | ## Booting Linux kernel at 40100000 ... | 5395 | ## Booting Linux kernel at 40100000 ... |
5402 | Image Name: 2.2.13 for initrd on TQM850L | 5396 | Image Name: 2.2.13 for initrd on TQM850L |
5403 | Image Type: PowerPC Linux Kernel Image (gzip compressed) | 5397 | Image Type: PowerPC Linux Kernel Image (gzip compressed) |
5404 | Data Size: 335725 Bytes = 327 kB = 0 MB | 5398 | Data Size: 335725 Bytes = 327 kB = 0 MB |
5405 | Load Address: 00000000 | 5399 | Load Address: 00000000 |
5406 | Entry Point: 0000000c | 5400 | Entry Point: 0000000c |
5407 | Verifying Checksum ... OK | 5401 | Verifying Checksum ... OK |
5408 | Uncompressing Kernel Image ... OK | 5402 | Uncompressing Kernel Image ... OK |
5409 | ## Loading RAMDisk Image at 40200000 ... | 5403 | ## Loading RAMDisk Image at 40200000 ... |
5410 | Image Name: Simple Ramdisk Image | 5404 | Image Name: Simple Ramdisk Image |
5411 | Image Type: PowerPC Linux RAMDisk Image (gzip compressed) | 5405 | Image Type: PowerPC Linux RAMDisk Image (gzip compressed) |
5412 | Data Size: 566530 Bytes = 553 kB = 0 MB | 5406 | Data Size: 566530 Bytes = 553 kB = 0 MB |
5413 | Load Address: 00000000 | 5407 | Load Address: 00000000 |
5414 | Entry Point: 00000000 | 5408 | Entry Point: 00000000 |
5415 | Verifying Checksum ... OK | 5409 | Verifying Checksum ... OK |
5416 | Loading Ramdisk ... OK | 5410 | Loading Ramdisk ... OK |
5417 | Linux version 2.2.13 (wd@denx.local.net) (gcc version 2.95.2 19991024 (release)) #1 Wed Jul 19 02:32:08 MEST 2000 | 5411 | Linux version 2.2.13 (wd@denx.local.net) (gcc version 2.95.2 19991024 (release)) #1 Wed Jul 19 02:32:08 MEST 2000 |
5418 | Boot arguments: root=/dev/ram | 5412 | Boot arguments: root=/dev/ram |
5419 | time_init: decrementer frequency = 187500000/60 | 5413 | time_init: decrementer frequency = 187500000/60 |
5420 | Calibrating delay loop... 49.77 BogoMIPS | 5414 | Calibrating delay loop... 49.77 BogoMIPS |
5421 | ... | 5415 | ... |
5422 | RAMDISK: Compressed image found at block 0 | 5416 | RAMDISK: Compressed image found at block 0 |
5423 | VFS: Mounted root (ext2 filesystem). | 5417 | VFS: Mounted root (ext2 filesystem). |
5424 | 5418 | ||
5425 | bash# | 5419 | bash# |
5426 | 5420 | ||
5427 | Boot Linux and pass a flat device tree: | 5421 | Boot Linux and pass a flat device tree: |
5428 | ----------- | 5422 | ----------- |
5429 | 5423 | ||
5430 | First, U-Boot must be compiled with the appropriate defines. See the section | 5424 | First, U-Boot must be compiled with the appropriate defines. See the section |
5431 | titled "Linux Kernel Interface" above for a more in depth explanation. The | 5425 | titled "Linux Kernel Interface" above for a more in depth explanation. The |
5432 | following is an example of how to start a kernel and pass an updated | 5426 | following is an example of how to start a kernel and pass an updated |
5433 | flat device tree: | 5427 | flat device tree: |
5434 | 5428 | ||
5435 | => print oftaddr | 5429 | => print oftaddr |
5436 | oftaddr=0x300000 | 5430 | oftaddr=0x300000 |
5437 | => print oft | 5431 | => print oft |
5438 | oft=oftrees/mpc8540ads.dtb | 5432 | oft=oftrees/mpc8540ads.dtb |
5439 | => tftp $oftaddr $oft | 5433 | => tftp $oftaddr $oft |
5440 | Speed: 1000, full duplex | 5434 | Speed: 1000, full duplex |
5441 | Using TSEC0 device | 5435 | Using TSEC0 device |
5442 | TFTP from server 192.168.1.1; our IP address is 192.168.1.101 | 5436 | TFTP from server 192.168.1.1; our IP address is 192.168.1.101 |
5443 | Filename 'oftrees/mpc8540ads.dtb'. | 5437 | Filename 'oftrees/mpc8540ads.dtb'. |
5444 | Load address: 0x300000 | 5438 | Load address: 0x300000 |
5445 | Loading: # | 5439 | Loading: # |
5446 | done | 5440 | done |
5447 | Bytes transferred = 4106 (100a hex) | 5441 | Bytes transferred = 4106 (100a hex) |
5448 | => tftp $loadaddr $bootfile | 5442 | => tftp $loadaddr $bootfile |
5449 | Speed: 1000, full duplex | 5443 | Speed: 1000, full duplex |
5450 | Using TSEC0 device | 5444 | Using TSEC0 device |
5451 | TFTP from server 192.168.1.1; our IP address is 192.168.1.2 | 5445 | TFTP from server 192.168.1.1; our IP address is 192.168.1.2 |
5452 | Filename 'uImage'. | 5446 | Filename 'uImage'. |
5453 | Load address: 0x200000 | 5447 | Load address: 0x200000 |
5454 | Loading:############ | 5448 | Loading:############ |
5455 | done | 5449 | done |
5456 | Bytes transferred = 1029407 (fb51f hex) | 5450 | Bytes transferred = 1029407 (fb51f hex) |
5457 | => print loadaddr | 5451 | => print loadaddr |
5458 | loadaddr=200000 | 5452 | loadaddr=200000 |
5459 | => print oftaddr | 5453 | => print oftaddr |
5460 | oftaddr=0x300000 | 5454 | oftaddr=0x300000 |
5461 | => bootm $loadaddr - $oftaddr | 5455 | => bootm $loadaddr - $oftaddr |
5462 | ## Booting image at 00200000 ... | 5456 | ## Booting image at 00200000 ... |
5463 | Image Name: Linux-2.6.17-dirty | 5457 | Image Name: Linux-2.6.17-dirty |
5464 | Image Type: PowerPC Linux Kernel Image (gzip compressed) | 5458 | Image Type: PowerPC Linux Kernel Image (gzip compressed) |
5465 | Data Size: 1029343 Bytes = 1005.2 kB | 5459 | Data Size: 1029343 Bytes = 1005.2 kB |
5466 | Load Address: 00000000 | 5460 | Load Address: 00000000 |
5467 | Entry Point: 00000000 | 5461 | Entry Point: 00000000 |
5468 | Verifying Checksum ... OK | 5462 | Verifying Checksum ... OK |
5469 | Uncompressing Kernel Image ... OK | 5463 | Uncompressing Kernel Image ... OK |
5470 | Booting using flat device tree at 0x300000 | 5464 | Booting using flat device tree at 0x300000 |
5471 | Using MPC85xx ADS machine description | 5465 | Using MPC85xx ADS machine description |
5472 | Memory CAM mapping: CAM0=256Mb, CAM1=256Mb, CAM2=0Mb residual: 0Mb | 5466 | Memory CAM mapping: CAM0=256Mb, CAM1=256Mb, CAM2=0Mb residual: 0Mb |
5473 | [snip] | 5467 | [snip] |
5474 | 5468 | ||
5475 | 5469 | ||
5476 | More About U-Boot Image Types: | 5470 | More About U-Boot Image Types: |
5477 | ------------------------------ | 5471 | ------------------------------ |
5478 | 5472 | ||
5479 | U-Boot supports the following image types: | 5473 | U-Boot supports the following image types: |
5480 | 5474 | ||
5481 | "Standalone Programs" are directly runnable in the environment | 5475 | "Standalone Programs" are directly runnable in the environment |
5482 | provided by U-Boot; it is expected that (if they behave | 5476 | provided by U-Boot; it is expected that (if they behave |
5483 | well) you can continue to work in U-Boot after return from | 5477 | well) you can continue to work in U-Boot after return from |
5484 | the Standalone Program. | 5478 | the Standalone Program. |
5485 | "OS Kernel Images" are usually images of some Embedded OS which | 5479 | "OS Kernel Images" are usually images of some Embedded OS which |
5486 | will take over control completely. Usually these programs | 5480 | will take over control completely. Usually these programs |
5487 | will install their own set of exception handlers, device | 5481 | will install their own set of exception handlers, device |
5488 | drivers, set up the MMU, etc. - this means, that you cannot | 5482 | drivers, set up the MMU, etc. - this means, that you cannot |
5489 | expect to re-enter U-Boot except by resetting the CPU. | 5483 | expect to re-enter U-Boot except by resetting the CPU. |
5490 | "RAMDisk Images" are more or less just data blocks, and their | 5484 | "RAMDisk Images" are more or less just data blocks, and their |
5491 | parameters (address, size) are passed to an OS kernel that is | 5485 | parameters (address, size) are passed to an OS kernel that is |
5492 | being started. | 5486 | being started. |
5493 | "Multi-File Images" contain several images, typically an OS | 5487 | "Multi-File Images" contain several images, typically an OS |
5494 | (Linux) kernel image and one or more data images like | 5488 | (Linux) kernel image and one or more data images like |
5495 | RAMDisks. This construct is useful for instance when you want | 5489 | RAMDisks. This construct is useful for instance when you want |
5496 | to boot over the network using BOOTP etc., where the boot | 5490 | to boot over the network using BOOTP etc., where the boot |
5497 | server provides just a single image file, but you want to get | 5491 | server provides just a single image file, but you want to get |
5498 | for instance an OS kernel and a RAMDisk image. | 5492 | for instance an OS kernel and a RAMDisk image. |
5499 | 5493 | ||
5500 | "Multi-File Images" start with a list of image sizes, each | 5494 | "Multi-File Images" start with a list of image sizes, each |
5501 | image size (in bytes) specified by an "uint32_t" in network | 5495 | image size (in bytes) specified by an "uint32_t" in network |
5502 | byte order. This list is terminated by an "(uint32_t)0". | 5496 | byte order. This list is terminated by an "(uint32_t)0". |
5503 | Immediately after the terminating 0 follow the images, one by | 5497 | Immediately after the terminating 0 follow the images, one by |
5504 | one, all aligned on "uint32_t" boundaries (size rounded up to | 5498 | one, all aligned on "uint32_t" boundaries (size rounded up to |
5505 | a multiple of 4 bytes). | 5499 | a multiple of 4 bytes). |
5506 | 5500 | ||
5507 | "Firmware Images" are binary images containing firmware (like | 5501 | "Firmware Images" are binary images containing firmware (like |
5508 | U-Boot or FPGA images) which usually will be programmed to | 5502 | U-Boot or FPGA images) which usually will be programmed to |
5509 | flash memory. | 5503 | flash memory. |
5510 | 5504 | ||
5511 | "Script files" are command sequences that will be executed by | 5505 | "Script files" are command sequences that will be executed by |
5512 | U-Boot's command interpreter; this feature is especially | 5506 | U-Boot's command interpreter; this feature is especially |
5513 | useful when you configure U-Boot to use a real shell (hush) | 5507 | useful when you configure U-Boot to use a real shell (hush) |
5514 | as command interpreter. | 5508 | as command interpreter. |
5515 | 5509 | ||
5516 | Booting the Linux zImage: | 5510 | Booting the Linux zImage: |
5517 | ------------------------- | 5511 | ------------------------- |
5518 | 5512 | ||
5519 | On some platforms, it's possible to boot Linux zImage. This is done | 5513 | On some platforms, it's possible to boot Linux zImage. This is done |
5520 | using the "bootz" command. The syntax of "bootz" command is the same | 5514 | using the "bootz" command. The syntax of "bootz" command is the same |
5521 | as the syntax of "bootm" command. | 5515 | as the syntax of "bootm" command. |
5522 | 5516 | ||
5523 | Note, defining the CONFIG_SUPPORT_RAW_INITRD allows user to supply | 5517 | Note, defining the CONFIG_SUPPORT_RAW_INITRD allows user to supply |
5524 | kernel with raw initrd images. The syntax is slightly different, the | 5518 | kernel with raw initrd images. The syntax is slightly different, the |
5525 | address of the initrd must be augmented by it's size, in the following | 5519 | address of the initrd must be augmented by it's size, in the following |
5526 | format: "<initrd addres>:<initrd size>". | 5520 | format: "<initrd addres>:<initrd size>". |
5527 | 5521 | ||
5528 | 5522 | ||
5529 | Standalone HOWTO: | 5523 | Standalone HOWTO: |
5530 | ================= | 5524 | ================= |
5531 | 5525 | ||
5532 | One of the features of U-Boot is that you can dynamically load and | 5526 | One of the features of U-Boot is that you can dynamically load and |
5533 | run "standalone" applications, which can use some resources of | 5527 | run "standalone" applications, which can use some resources of |
5534 | U-Boot like console I/O functions or interrupt services. | 5528 | U-Boot like console I/O functions or interrupt services. |
5535 | 5529 | ||
5536 | Two simple examples are included with the sources: | 5530 | Two simple examples are included with the sources: |
5537 | 5531 | ||
5538 | "Hello World" Demo: | 5532 | "Hello World" Demo: |
5539 | ------------------- | 5533 | ------------------- |
5540 | 5534 | ||
5541 | 'examples/hello_world.c' contains a small "Hello World" Demo | 5535 | 'examples/hello_world.c' contains a small "Hello World" Demo |
5542 | application; it is automatically compiled when you build U-Boot. | 5536 | application; it is automatically compiled when you build U-Boot. |
5543 | It's configured to run at address 0x00040004, so you can play with it | 5537 | It's configured to run at address 0x00040004, so you can play with it |
5544 | like that: | 5538 | like that: |
5545 | 5539 | ||
5546 | => loads | 5540 | => loads |
5547 | ## Ready for S-Record download ... | 5541 | ## Ready for S-Record download ... |
5548 | ~>examples/hello_world.srec | 5542 | ~>examples/hello_world.srec |
5549 | 1 2 3 4 5 6 7 8 9 10 11 ... | 5543 | 1 2 3 4 5 6 7 8 9 10 11 ... |
5550 | [file transfer complete] | 5544 | [file transfer complete] |
5551 | [connected] | 5545 | [connected] |
5552 | ## Start Addr = 0x00040004 | 5546 | ## Start Addr = 0x00040004 |
5553 | 5547 | ||
5554 | => go 40004 Hello World! This is a test. | 5548 | => go 40004 Hello World! This is a test. |
5555 | ## Starting application at 0x00040004 ... | 5549 | ## Starting application at 0x00040004 ... |
5556 | Hello World | 5550 | Hello World |
5557 | argc = 7 | 5551 | argc = 7 |
5558 | argv[0] = "40004" | 5552 | argv[0] = "40004" |
5559 | argv[1] = "Hello" | 5553 | argv[1] = "Hello" |
5560 | argv[2] = "World!" | 5554 | argv[2] = "World!" |
5561 | argv[3] = "This" | 5555 | argv[3] = "This" |
5562 | argv[4] = "is" | 5556 | argv[4] = "is" |
5563 | argv[5] = "a" | 5557 | argv[5] = "a" |
5564 | argv[6] = "test." | 5558 | argv[6] = "test." |
5565 | argv[7] = "<NULL>" | 5559 | argv[7] = "<NULL>" |
5566 | Hit any key to exit ... | 5560 | Hit any key to exit ... |
5567 | 5561 | ||
5568 | ## Application terminated, rc = 0x0 | 5562 | ## Application terminated, rc = 0x0 |
5569 | 5563 | ||
5570 | Another example, which demonstrates how to register a CPM interrupt | 5564 | Another example, which demonstrates how to register a CPM interrupt |
5571 | handler with the U-Boot code, can be found in 'examples/timer.c'. | 5565 | handler with the U-Boot code, can be found in 'examples/timer.c'. |
5572 | Here, a CPM timer is set up to generate an interrupt every second. | 5566 | Here, a CPM timer is set up to generate an interrupt every second. |
5573 | The interrupt service routine is trivial, just printing a '.' | 5567 | The interrupt service routine is trivial, just printing a '.' |
5574 | character, but this is just a demo program. The application can be | 5568 | character, but this is just a demo program. The application can be |
5575 | controlled by the following keys: | 5569 | controlled by the following keys: |
5576 | 5570 | ||
5577 | ? - print current values og the CPM Timer registers | 5571 | ? - print current values og the CPM Timer registers |
5578 | b - enable interrupts and start timer | 5572 | b - enable interrupts and start timer |
5579 | e - stop timer and disable interrupts | 5573 | e - stop timer and disable interrupts |
5580 | q - quit application | 5574 | q - quit application |
5581 | 5575 | ||
5582 | => loads | 5576 | => loads |
5583 | ## Ready for S-Record download ... | 5577 | ## Ready for S-Record download ... |
5584 | ~>examples/timer.srec | 5578 | ~>examples/timer.srec |
5585 | 1 2 3 4 5 6 7 8 9 10 11 ... | 5579 | 1 2 3 4 5 6 7 8 9 10 11 ... |
5586 | [file transfer complete] | 5580 | [file transfer complete] |
5587 | [connected] | 5581 | [connected] |
5588 | ## Start Addr = 0x00040004 | 5582 | ## Start Addr = 0x00040004 |
5589 | 5583 | ||
5590 | => go 40004 | 5584 | => go 40004 |
5591 | ## Starting application at 0x00040004 ... | 5585 | ## Starting application at 0x00040004 ... |
5592 | TIMERS=0xfff00980 | 5586 | TIMERS=0xfff00980 |
5593 | Using timer 1 | 5587 | Using timer 1 |
5594 | tgcr @ 0xfff00980, tmr @ 0xfff00990, trr @ 0xfff00994, tcr @ 0xfff00998, tcn @ 0xfff0099c, ter @ 0xfff009b0 | 5588 | tgcr @ 0xfff00980, tmr @ 0xfff00990, trr @ 0xfff00994, tcr @ 0xfff00998, tcn @ 0xfff0099c, ter @ 0xfff009b0 |
5595 | 5589 | ||
5596 | Hit 'b': | 5590 | Hit 'b': |
5597 | [q, b, e, ?] Set interval 1000000 us | 5591 | [q, b, e, ?] Set interval 1000000 us |
5598 | Enabling timer | 5592 | Enabling timer |
5599 | Hit '?': | 5593 | Hit '?': |
5600 | [q, b, e, ?] ........ | 5594 | [q, b, e, ?] ........ |
5601 | tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0xef6, ter=0x0 | 5595 | tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0xef6, ter=0x0 |
5602 | Hit '?': | 5596 | Hit '?': |
5603 | [q, b, e, ?] . | 5597 | [q, b, e, ?] . |
5604 | tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0x2ad4, ter=0x0 | 5598 | tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0x2ad4, ter=0x0 |
5605 | Hit '?': | 5599 | Hit '?': |
5606 | [q, b, e, ?] . | 5600 | [q, b, e, ?] . |
5607 | tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0x1efc, ter=0x0 | 5601 | tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0x1efc, ter=0x0 |
5608 | Hit '?': | 5602 | Hit '?': |
5609 | [q, b, e, ?] . | 5603 | [q, b, e, ?] . |
5610 | tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0x169d, ter=0x0 | 5604 | tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0x169d, ter=0x0 |
5611 | Hit 'e': | 5605 | Hit 'e': |
5612 | [q, b, e, ?] ...Stopping timer | 5606 | [q, b, e, ?] ...Stopping timer |
5613 | Hit 'q': | 5607 | Hit 'q': |
5614 | [q, b, e, ?] ## Application terminated, rc = 0x0 | 5608 | [q, b, e, ?] ## Application terminated, rc = 0x0 |
5615 | 5609 | ||
5616 | 5610 | ||
5617 | Minicom warning: | 5611 | Minicom warning: |
5618 | ================ | 5612 | ================ |
5619 | 5613 | ||
5620 | Over time, many people have reported problems when trying to use the | 5614 | Over time, many people have reported problems when trying to use the |
5621 | "minicom" terminal emulation program for serial download. I (wd) | 5615 | "minicom" terminal emulation program for serial download. I (wd) |
5622 | consider minicom to be broken, and recommend not to use it. Under | 5616 | consider minicom to be broken, and recommend not to use it. Under |
5623 | Unix, I recommend to use C-Kermit for general purpose use (and | 5617 | Unix, I recommend to use C-Kermit for general purpose use (and |
5624 | especially for kermit binary protocol download ("loadb" command), and | 5618 | especially for kermit binary protocol download ("loadb" command), and |
5625 | use "cu" for S-Record download ("loads" command). See | 5619 | use "cu" for S-Record download ("loads" command). See |
5626 | http://www.denx.de/wiki/view/DULG/SystemSetup#Section_4.3. | 5620 | http://www.denx.de/wiki/view/DULG/SystemSetup#Section_4.3. |
5627 | for help with kermit. | 5621 | for help with kermit. |
5628 | 5622 | ||
5629 | 5623 | ||
5630 | Nevertheless, if you absolutely want to use it try adding this | 5624 | Nevertheless, if you absolutely want to use it try adding this |
5631 | configuration to your "File transfer protocols" section: | 5625 | configuration to your "File transfer protocols" section: |
5632 | 5626 | ||
5633 | Name Program Name U/D FullScr IO-Red. Multi | 5627 | Name Program Name U/D FullScr IO-Red. Multi |
5634 | X kermit /usr/bin/kermit -i -l %l -s Y U Y N N | 5628 | X kermit /usr/bin/kermit -i -l %l -s Y U Y N N |
5635 | Y kermit /usr/bin/kermit -i -l %l -r N D Y N N | 5629 | Y kermit /usr/bin/kermit -i -l %l -r N D Y N N |
5636 | 5630 | ||
5637 | 5631 | ||
5638 | NetBSD Notes: | 5632 | NetBSD Notes: |
5639 | ============= | 5633 | ============= |
5640 | 5634 | ||
5641 | Starting at version 0.9.2, U-Boot supports NetBSD both as host | 5635 | Starting at version 0.9.2, U-Boot supports NetBSD both as host |
5642 | (build U-Boot) and target system (boots NetBSD/mpc8xx). | 5636 | (build U-Boot) and target system (boots NetBSD/mpc8xx). |
5643 | 5637 | ||
5644 | Building requires a cross environment; it is known to work on | 5638 | Building requires a cross environment; it is known to work on |
5645 | NetBSD/i386 with the cross-powerpc-netbsd-1.3 package (you will also | 5639 | NetBSD/i386 with the cross-powerpc-netbsd-1.3 package (you will also |
5646 | need gmake since the Makefiles are not compatible with BSD make). | 5640 | need gmake since the Makefiles are not compatible with BSD make). |
5647 | Note that the cross-powerpc package does not install include files; | 5641 | Note that the cross-powerpc package does not install include files; |
5648 | attempting to build U-Boot will fail because <machine/ansi.h> is | 5642 | attempting to build U-Boot will fail because <machine/ansi.h> is |
5649 | missing. This file has to be installed and patched manually: | 5643 | missing. This file has to be installed and patched manually: |
5650 | 5644 | ||
5651 | # cd /usr/pkg/cross/powerpc-netbsd/include | 5645 | # cd /usr/pkg/cross/powerpc-netbsd/include |
5652 | # mkdir powerpc | 5646 | # mkdir powerpc |
5653 | # ln -s powerpc machine | 5647 | # ln -s powerpc machine |
5654 | # cp /usr/src/sys/arch/powerpc/include/ansi.h powerpc/ansi.h | 5648 | # cp /usr/src/sys/arch/powerpc/include/ansi.h powerpc/ansi.h |
5655 | # ${EDIT} powerpc/ansi.h ## must remove __va_list, _BSD_VA_LIST | 5649 | # ${EDIT} powerpc/ansi.h ## must remove __va_list, _BSD_VA_LIST |
5656 | 5650 | ||
5657 | Native builds *don't* work due to incompatibilities between native | 5651 | Native builds *don't* work due to incompatibilities between native |
5658 | and U-Boot include files. | 5652 | and U-Boot include files. |
5659 | 5653 | ||
5660 | Booting assumes that (the first part of) the image booted is a | 5654 | Booting assumes that (the first part of) the image booted is a |
5661 | stage-2 loader which in turn loads and then invokes the kernel | 5655 | stage-2 loader which in turn loads and then invokes the kernel |
5662 | proper. Loader sources will eventually appear in the NetBSD source | 5656 | proper. Loader sources will eventually appear in the NetBSD source |
5663 | tree (probably in sys/arc/mpc8xx/stand/u-boot_stage2/); in the | 5657 | tree (probably in sys/arc/mpc8xx/stand/u-boot_stage2/); in the |
5664 | meantime, see ftp://ftp.denx.de/pub/u-boot/ppcboot_stage2.tar.gz | 5658 | meantime, see ftp://ftp.denx.de/pub/u-boot/ppcboot_stage2.tar.gz |
5665 | 5659 | ||
5666 | 5660 | ||
5667 | Implementation Internals: | 5661 | Implementation Internals: |
5668 | ========================= | 5662 | ========================= |
5669 | 5663 | ||
5670 | The following is not intended to be a complete description of every | 5664 | The following is not intended to be a complete description of every |
5671 | implementation detail. However, it should help to understand the | 5665 | implementation detail. However, it should help to understand the |
5672 | inner workings of U-Boot and make it easier to port it to custom | 5666 | inner workings of U-Boot and make it easier to port it to custom |
5673 | hardware. | 5667 | hardware. |
5674 | 5668 | ||
5675 | 5669 | ||
5676 | Initial Stack, Global Data: | 5670 | Initial Stack, Global Data: |
5677 | --------------------------- | 5671 | --------------------------- |
5678 | 5672 | ||
5679 | The implementation of U-Boot is complicated by the fact that U-Boot | 5673 | The implementation of U-Boot is complicated by the fact that U-Boot |
5680 | starts running out of ROM (flash memory), usually without access to | 5674 | starts running out of ROM (flash memory), usually without access to |
5681 | system RAM (because the memory controller is not initialized yet). | 5675 | system RAM (because the memory controller is not initialized yet). |
5682 | This means that we don't have writable Data or BSS segments, and BSS | 5676 | This means that we don't have writable Data or BSS segments, and BSS |
5683 | is not initialized as zero. To be able to get a C environment working | 5677 | is not initialized as zero. To be able to get a C environment working |
5684 | at all, we have to allocate at least a minimal stack. Implementation | 5678 | at all, we have to allocate at least a minimal stack. Implementation |
5685 | options for this are defined and restricted by the CPU used: Some CPU | 5679 | options for this are defined and restricted by the CPU used: Some CPU |
5686 | models provide on-chip memory (like the IMMR area on MPC8xx and | 5680 | models provide on-chip memory (like the IMMR area on MPC8xx and |
5687 | MPC826x processors), on others (parts of) the data cache can be | 5681 | MPC826x processors), on others (parts of) the data cache can be |
5688 | locked as (mis-) used as memory, etc. | 5682 | locked as (mis-) used as memory, etc. |
5689 | 5683 | ||
5690 | Chris Hallinan posted a good summary of these issues to the | 5684 | Chris Hallinan posted a good summary of these issues to the |
5691 | U-Boot mailing list: | 5685 | U-Boot mailing list: |
5692 | 5686 | ||
5693 | Subject: RE: [U-Boot-Users] RE: More On Memory Bank x (nothingness)? | 5687 | Subject: RE: [U-Boot-Users] RE: More On Memory Bank x (nothingness)? |
5694 | From: "Chris Hallinan" <clh@net1plus.com> | 5688 | From: "Chris Hallinan" <clh@net1plus.com> |
5695 | Date: Mon, 10 Feb 2003 16:43:46 -0500 (22:43 MET) | 5689 | Date: Mon, 10 Feb 2003 16:43:46 -0500 (22:43 MET) |
5696 | ... | 5690 | ... |
5697 | 5691 | ||
5698 | Correct me if I'm wrong, folks, but the way I understand it | 5692 | Correct me if I'm wrong, folks, but the way I understand it |
5699 | is this: Using DCACHE as initial RAM for Stack, etc, does not | 5693 | is this: Using DCACHE as initial RAM for Stack, etc, does not |
5700 | require any physical RAM backing up the cache. The cleverness | 5694 | require any physical RAM backing up the cache. The cleverness |
5701 | is that the cache is being used as a temporary supply of | 5695 | is that the cache is being used as a temporary supply of |
5702 | necessary storage before the SDRAM controller is setup. It's | 5696 | necessary storage before the SDRAM controller is setup. It's |
5703 | beyond the scope of this list to explain the details, but you | 5697 | beyond the scope of this list to explain the details, but you |
5704 | can see how this works by studying the cache architecture and | 5698 | can see how this works by studying the cache architecture and |
5705 | operation in the architecture and processor-specific manuals. | 5699 | operation in the architecture and processor-specific manuals. |
5706 | 5700 | ||
5707 | OCM is On Chip Memory, which I believe the 405GP has 4K. It | 5701 | OCM is On Chip Memory, which I believe the 405GP has 4K. It |
5708 | is another option for the system designer to use as an | 5702 | is another option for the system designer to use as an |
5709 | initial stack/RAM area prior to SDRAM being available. Either | 5703 | initial stack/RAM area prior to SDRAM being available. Either |
5710 | option should work for you. Using CS 4 should be fine if your | 5704 | option should work for you. Using CS 4 should be fine if your |
5711 | board designers haven't used it for something that would | 5705 | board designers haven't used it for something that would |
5712 | cause you grief during the initial boot! It is frequently not | 5706 | cause you grief during the initial boot! It is frequently not |
5713 | used. | 5707 | used. |
5714 | 5708 | ||
5715 | CONFIG_SYS_INIT_RAM_ADDR should be somewhere that won't interfere | 5709 | CONFIG_SYS_INIT_RAM_ADDR should be somewhere that won't interfere |
5716 | with your processor/board/system design. The default value | 5710 | with your processor/board/system design. The default value |
5717 | you will find in any recent u-boot distribution in | 5711 | you will find in any recent u-boot distribution in |
5718 | walnut.h should work for you. I'd set it to a value larger | 5712 | walnut.h should work for you. I'd set it to a value larger |
5719 | than your SDRAM module. If you have a 64MB SDRAM module, set | 5713 | than your SDRAM module. If you have a 64MB SDRAM module, set |
5720 | it above 400_0000. Just make sure your board has no resources | 5714 | it above 400_0000. Just make sure your board has no resources |
5721 | that are supposed to respond to that address! That code in | 5715 | that are supposed to respond to that address! That code in |
5722 | start.S has been around a while and should work as is when | 5716 | start.S has been around a while and should work as is when |
5723 | you get the config right. | 5717 | you get the config right. |
5724 | 5718 | ||
5725 | -Chris Hallinan | 5719 | -Chris Hallinan |
5726 | DS4.COM, Inc. | 5720 | DS4.COM, Inc. |
5727 | 5721 | ||
5728 | It is essential to remember this, since it has some impact on the C | 5722 | It is essential to remember this, since it has some impact on the C |
5729 | code for the initialization procedures: | 5723 | code for the initialization procedures: |
5730 | 5724 | ||
5731 | * Initialized global data (data segment) is read-only. Do not attempt | 5725 | * Initialized global data (data segment) is read-only. Do not attempt |
5732 | to write it. | 5726 | to write it. |
5733 | 5727 | ||
5734 | * Do not use any uninitialized global data (or implicitely initialized | 5728 | * Do not use any uninitialized global data (or implicitely initialized |
5735 | as zero data - BSS segment) at all - this is undefined, initiali- | 5729 | as zero data - BSS segment) at all - this is undefined, initiali- |
5736 | zation is performed later (when relocating to RAM). | 5730 | zation is performed later (when relocating to RAM). |
5737 | 5731 | ||
5738 | * Stack space is very limited. Avoid big data buffers or things like | 5732 | * Stack space is very limited. Avoid big data buffers or things like |
5739 | that. | 5733 | that. |
5740 | 5734 | ||
5741 | Having only the stack as writable memory limits means we cannot use | 5735 | Having only the stack as writable memory limits means we cannot use |
5742 | normal global data to share information beween the code. But it | 5736 | normal global data to share information beween the code. But it |
5743 | turned out that the implementation of U-Boot can be greatly | 5737 | turned out that the implementation of U-Boot can be greatly |
5744 | simplified by making a global data structure (gd_t) available to all | 5738 | simplified by making a global data structure (gd_t) available to all |
5745 | functions. We could pass a pointer to this data as argument to _all_ | 5739 | functions. We could pass a pointer to this data as argument to _all_ |
5746 | functions, but this would bloat the code. Instead we use a feature of | 5740 | functions, but this would bloat the code. Instead we use a feature of |
5747 | the GCC compiler (Global Register Variables) to share the data: we | 5741 | the GCC compiler (Global Register Variables) to share the data: we |
5748 | place a pointer (gd) to the global data into a register which we | 5742 | place a pointer (gd) to the global data into a register which we |
5749 | reserve for this purpose. | 5743 | reserve for this purpose. |
5750 | 5744 | ||
5751 | When choosing a register for such a purpose we are restricted by the | 5745 | When choosing a register for such a purpose we are restricted by the |
5752 | relevant (E)ABI specifications for the current architecture, and by | 5746 | relevant (E)ABI specifications for the current architecture, and by |
5753 | GCC's implementation. | 5747 | GCC's implementation. |
5754 | 5748 | ||
5755 | For PowerPC, the following registers have specific use: | 5749 | For PowerPC, the following registers have specific use: |
5756 | R1: stack pointer | 5750 | R1: stack pointer |
5757 | R2: reserved for system use | 5751 | R2: reserved for system use |
5758 | R3-R4: parameter passing and return values | 5752 | R3-R4: parameter passing and return values |
5759 | R5-R10: parameter passing | 5753 | R5-R10: parameter passing |
5760 | R13: small data area pointer | 5754 | R13: small data area pointer |
5761 | R30: GOT pointer | 5755 | R30: GOT pointer |
5762 | R31: frame pointer | 5756 | R31: frame pointer |
5763 | 5757 | ||
5764 | (U-Boot also uses R12 as internal GOT pointer. r12 | 5758 | (U-Boot also uses R12 as internal GOT pointer. r12 |
5765 | is a volatile register so r12 needs to be reset when | 5759 | is a volatile register so r12 needs to be reset when |
5766 | going back and forth between asm and C) | 5760 | going back and forth between asm and C) |
5767 | 5761 | ||
5768 | ==> U-Boot will use R2 to hold a pointer to the global data | 5762 | ==> U-Boot will use R2 to hold a pointer to the global data |
5769 | 5763 | ||
5770 | Note: on PPC, we could use a static initializer (since the | 5764 | Note: on PPC, we could use a static initializer (since the |
5771 | address of the global data structure is known at compile time), | 5765 | address of the global data structure is known at compile time), |
5772 | but it turned out that reserving a register results in somewhat | 5766 | but it turned out that reserving a register results in somewhat |
5773 | smaller code - although the code savings are not that big (on | 5767 | smaller code - although the code savings are not that big (on |
5774 | average for all boards 752 bytes for the whole U-Boot image, | 5768 | average for all boards 752 bytes for the whole U-Boot image, |
5775 | 624 text + 127 data). | 5769 | 624 text + 127 data). |
5776 | 5770 | ||
5777 | On Blackfin, the normal C ABI (except for P3) is followed as documented here: | 5771 | On Blackfin, the normal C ABI (except for P3) is followed as documented here: |
5778 | http://docs.blackfin.uclinux.org/doku.php?id=application_binary_interface | 5772 | http://docs.blackfin.uclinux.org/doku.php?id=application_binary_interface |
5779 | 5773 | ||
5780 | ==> U-Boot will use P3 to hold a pointer to the global data | 5774 | ==> U-Boot will use P3 to hold a pointer to the global data |
5781 | 5775 | ||
5782 | On ARM, the following registers are used: | 5776 | On ARM, the following registers are used: |
5783 | 5777 | ||
5784 | R0: function argument word/integer result | 5778 | R0: function argument word/integer result |
5785 | R1-R3: function argument word | 5779 | R1-R3: function argument word |
5786 | R9: platform specific | 5780 | R9: platform specific |
5787 | R10: stack limit (used only if stack checking is enabled) | 5781 | R10: stack limit (used only if stack checking is enabled) |
5788 | R11: argument (frame) pointer | 5782 | R11: argument (frame) pointer |
5789 | R12: temporary workspace | 5783 | R12: temporary workspace |
5790 | R13: stack pointer | 5784 | R13: stack pointer |
5791 | R14: link register | 5785 | R14: link register |
5792 | R15: program counter | 5786 | R15: program counter |
5793 | 5787 | ||
5794 | ==> U-Boot will use R9 to hold a pointer to the global data | 5788 | ==> U-Boot will use R9 to hold a pointer to the global data |
5795 | 5789 | ||
5796 | Note: on ARM, only R_ARM_RELATIVE relocations are supported. | 5790 | Note: on ARM, only R_ARM_RELATIVE relocations are supported. |
5797 | 5791 | ||
5798 | On Nios II, the ABI is documented here: | 5792 | On Nios II, the ABI is documented here: |
5799 | http://www.altera.com/literature/hb/nios2/n2cpu_nii51016.pdf | 5793 | http://www.altera.com/literature/hb/nios2/n2cpu_nii51016.pdf |
5800 | 5794 | ||
5801 | ==> U-Boot will use gp to hold a pointer to the global data | 5795 | ==> U-Boot will use gp to hold a pointer to the global data |
5802 | 5796 | ||
5803 | Note: on Nios II, we give "-G0" option to gcc and don't use gp | 5797 | Note: on Nios II, we give "-G0" option to gcc and don't use gp |
5804 | to access small data sections, so gp is free. | 5798 | to access small data sections, so gp is free. |
5805 | 5799 | ||
5806 | On NDS32, the following registers are used: | 5800 | On NDS32, the following registers are used: |
5807 | 5801 | ||
5808 | R0-R1: argument/return | 5802 | R0-R1: argument/return |
5809 | R2-R5: argument | 5803 | R2-R5: argument |
5810 | R15: temporary register for assembler | 5804 | R15: temporary register for assembler |
5811 | R16: trampoline register | 5805 | R16: trampoline register |
5812 | R28: frame pointer (FP) | 5806 | R28: frame pointer (FP) |
5813 | R29: global pointer (GP) | 5807 | R29: global pointer (GP) |
5814 | R30: link register (LP) | 5808 | R30: link register (LP) |
5815 | R31: stack pointer (SP) | 5809 | R31: stack pointer (SP) |
5816 | PC: program counter (PC) | 5810 | PC: program counter (PC) |
5817 | 5811 | ||
5818 | ==> U-Boot will use R10 to hold a pointer to the global data | 5812 | ==> U-Boot will use R10 to hold a pointer to the global data |
5819 | 5813 | ||
5820 | NOTE: DECLARE_GLOBAL_DATA_PTR must be used with file-global scope, | 5814 | NOTE: DECLARE_GLOBAL_DATA_PTR must be used with file-global scope, |
5821 | or current versions of GCC may "optimize" the code too much. | 5815 | or current versions of GCC may "optimize" the code too much. |
5822 | 5816 | ||
5823 | Memory Management: | 5817 | Memory Management: |
5824 | ------------------ | 5818 | ------------------ |
5825 | 5819 | ||
5826 | U-Boot runs in system state and uses physical addresses, i.e. the | 5820 | U-Boot runs in system state and uses physical addresses, i.e. the |
5827 | MMU is not used either for address mapping nor for memory protection. | 5821 | MMU is not used either for address mapping nor for memory protection. |
5828 | 5822 | ||
5829 | The available memory is mapped to fixed addresses using the memory | 5823 | The available memory is mapped to fixed addresses using the memory |
5830 | controller. In this process, a contiguous block is formed for each | 5824 | controller. In this process, a contiguous block is formed for each |
5831 | memory type (Flash, SDRAM, SRAM), even when it consists of several | 5825 | memory type (Flash, SDRAM, SRAM), even when it consists of several |
5832 | physical memory banks. | 5826 | physical memory banks. |
5833 | 5827 | ||
5834 | U-Boot is installed in the first 128 kB of the first Flash bank (on | 5828 | U-Boot is installed in the first 128 kB of the first Flash bank (on |
5835 | TQM8xxL modules this is the range 0x40000000 ... 0x4001FFFF). After | 5829 | TQM8xxL modules this is the range 0x40000000 ... 0x4001FFFF). After |
5836 | booting and sizing and initializing DRAM, the code relocates itself | 5830 | booting and sizing and initializing DRAM, the code relocates itself |
5837 | to the upper end of DRAM. Immediately below the U-Boot code some | 5831 | to the upper end of DRAM. Immediately below the U-Boot code some |
5838 | memory is reserved for use by malloc() [see CONFIG_SYS_MALLOC_LEN | 5832 | memory is reserved for use by malloc() [see CONFIG_SYS_MALLOC_LEN |
5839 | configuration setting]. Below that, a structure with global Board | 5833 | configuration setting]. Below that, a structure with global Board |
5840 | Info data is placed, followed by the stack (growing downward). | 5834 | Info data is placed, followed by the stack (growing downward). |
5841 | 5835 | ||
5842 | Additionally, some exception handler code is copied to the low 8 kB | 5836 | Additionally, some exception handler code is copied to the low 8 kB |
5843 | of DRAM (0x00000000 ... 0x00001FFF). | 5837 | of DRAM (0x00000000 ... 0x00001FFF). |
5844 | 5838 | ||
5845 | So a typical memory configuration with 16 MB of DRAM could look like | 5839 | So a typical memory configuration with 16 MB of DRAM could look like |
5846 | this: | 5840 | this: |
5847 | 5841 | ||
5848 | 0x0000 0000 Exception Vector code | 5842 | 0x0000 0000 Exception Vector code |
5849 | : | 5843 | : |
5850 | 0x0000 1FFF | 5844 | 0x0000 1FFF |
5851 | 0x0000 2000 Free for Application Use | 5845 | 0x0000 2000 Free for Application Use |
5852 | : | 5846 | : |
5853 | : | 5847 | : |
5854 | 5848 | ||
5855 | : | 5849 | : |
5856 | : | 5850 | : |
5857 | 0x00FB FF20 Monitor Stack (Growing downward) | 5851 | 0x00FB FF20 Monitor Stack (Growing downward) |
5858 | 0x00FB FFAC Board Info Data and permanent copy of global data | 5852 | 0x00FB FFAC Board Info Data and permanent copy of global data |
5859 | 0x00FC 0000 Malloc Arena | 5853 | 0x00FC 0000 Malloc Arena |
5860 | : | 5854 | : |
5861 | 0x00FD FFFF | 5855 | 0x00FD FFFF |
5862 | 0x00FE 0000 RAM Copy of Monitor Code | 5856 | 0x00FE 0000 RAM Copy of Monitor Code |
5863 | ... eventually: LCD or video framebuffer | 5857 | ... eventually: LCD or video framebuffer |
5864 | ... eventually: pRAM (Protected RAM - unchanged by reset) | 5858 | ... eventually: pRAM (Protected RAM - unchanged by reset) |
5865 | 0x00FF FFFF [End of RAM] | 5859 | 0x00FF FFFF [End of RAM] |
5866 | 5860 | ||
5867 | 5861 | ||
5868 | System Initialization: | 5862 | System Initialization: |
5869 | ---------------------- | 5863 | ---------------------- |
5870 | 5864 | ||
5871 | In the reset configuration, U-Boot starts at the reset entry point | 5865 | In the reset configuration, U-Boot starts at the reset entry point |
5872 | (on most PowerPC systems at address 0x00000100). Because of the reset | 5866 | (on most PowerPC systems at address 0x00000100). Because of the reset |
5873 | configuration for CS0# this is a mirror of the onboard Flash memory. | 5867 | configuration for CS0# this is a mirror of the onboard Flash memory. |
5874 | To be able to re-map memory U-Boot then jumps to its link address. | 5868 | To be able to re-map memory U-Boot then jumps to its link address. |
5875 | To be able to implement the initialization code in C, a (small!) | 5869 | To be able to implement the initialization code in C, a (small!) |
5876 | initial stack is set up in the internal Dual Ported RAM (in case CPUs | 5870 | initial stack is set up in the internal Dual Ported RAM (in case CPUs |
5877 | which provide such a feature like MPC8xx or MPC8260), or in a locked | 5871 | which provide such a feature like MPC8xx or MPC8260), or in a locked |
5878 | part of the data cache. After that, U-Boot initializes the CPU core, | 5872 | part of the data cache. After that, U-Boot initializes the CPU core, |
5879 | the caches and the SIU. | 5873 | the caches and the SIU. |
5880 | 5874 | ||
5881 | Next, all (potentially) available memory banks are mapped using a | 5875 | Next, all (potentially) available memory banks are mapped using a |
5882 | preliminary mapping. For example, we put them on 512 MB boundaries | 5876 | preliminary mapping. For example, we put them on 512 MB boundaries |
5883 | (multiples of 0x20000000: SDRAM on 0x00000000 and 0x20000000, Flash | 5877 | (multiples of 0x20000000: SDRAM on 0x00000000 and 0x20000000, Flash |
5884 | on 0x40000000 and 0x60000000, SRAM on 0x80000000). Then UPM A is | 5878 | on 0x40000000 and 0x60000000, SRAM on 0x80000000). Then UPM A is |
5885 | programmed for SDRAM access. Using the temporary configuration, a | 5879 | programmed for SDRAM access. Using the temporary configuration, a |
5886 | simple memory test is run that determines the size of the SDRAM | 5880 | simple memory test is run that determines the size of the SDRAM |
5887 | banks. | 5881 | banks. |
5888 | 5882 | ||
5889 | When there is more than one SDRAM bank, and the banks are of | 5883 | When there is more than one SDRAM bank, and the banks are of |
5890 | different size, the largest is mapped first. For equal size, the first | 5884 | different size, the largest is mapped first. For equal size, the first |
5891 | bank (CS2#) is mapped first. The first mapping is always for address | 5885 | bank (CS2#) is mapped first. The first mapping is always for address |
5892 | 0x00000000, with any additional banks following immediately to create | 5886 | 0x00000000, with any additional banks following immediately to create |
5893 | contiguous memory starting from 0. | 5887 | contiguous memory starting from 0. |
5894 | 5888 | ||
5895 | Then, the monitor installs itself at the upper end of the SDRAM area | 5889 | Then, the monitor installs itself at the upper end of the SDRAM area |
5896 | and allocates memory for use by malloc() and for the global Board | 5890 | and allocates memory for use by malloc() and for the global Board |
5897 | Info data; also, the exception vector code is copied to the low RAM | 5891 | Info data; also, the exception vector code is copied to the low RAM |
5898 | pages, and the final stack is set up. | 5892 | pages, and the final stack is set up. |
5899 | 5893 | ||
5900 | Only after this relocation will you have a "normal" C environment; | 5894 | Only after this relocation will you have a "normal" C environment; |
5901 | until that you are restricted in several ways, mostly because you are | 5895 | until that you are restricted in several ways, mostly because you are |
5902 | running from ROM, and because the code will have to be relocated to a | 5896 | running from ROM, and because the code will have to be relocated to a |
5903 | new address in RAM. | 5897 | new address in RAM. |
5904 | 5898 | ||
5905 | 5899 | ||
5906 | U-Boot Porting Guide: | 5900 | U-Boot Porting Guide: |
5907 | ---------------------- | 5901 | ---------------------- |
5908 | 5902 | ||
5909 | [Based on messages by Jerry Van Baren in the U-Boot-Users mailing | 5903 | [Based on messages by Jerry Van Baren in the U-Boot-Users mailing |
5910 | list, October 2002] | 5904 | list, October 2002] |
5911 | 5905 | ||
5912 | 5906 | ||
5913 | int main(int argc, char *argv[]) | 5907 | int main(int argc, char *argv[]) |
5914 | { | 5908 | { |
5915 | sighandler_t no_more_time; | 5909 | sighandler_t no_more_time; |
5916 | 5910 | ||
5917 | signal(SIGALRM, no_more_time); | 5911 | signal(SIGALRM, no_more_time); |
5918 | alarm(PROJECT_DEADLINE - toSec (3 * WEEK)); | 5912 | alarm(PROJECT_DEADLINE - toSec (3 * WEEK)); |
5919 | 5913 | ||
5920 | if (available_money > available_manpower) { | 5914 | if (available_money > available_manpower) { |
5921 | Pay consultant to port U-Boot; | 5915 | Pay consultant to port U-Boot; |
5922 | return 0; | 5916 | return 0; |
5923 | } | 5917 | } |
5924 | 5918 | ||
5925 | Download latest U-Boot source; | 5919 | Download latest U-Boot source; |
5926 | 5920 | ||
5927 | Subscribe to u-boot mailing list; | 5921 | Subscribe to u-boot mailing list; |
5928 | 5922 | ||
5929 | if (clueless) | 5923 | if (clueless) |
5930 | email("Hi, I am new to U-Boot, how do I get started?"); | 5924 | email("Hi, I am new to U-Boot, how do I get started?"); |
5931 | 5925 | ||
5932 | while (learning) { | 5926 | while (learning) { |
5933 | Read the README file in the top level directory; | 5927 | Read the README file in the top level directory; |
5934 | Read http://www.denx.de/twiki/bin/view/DULG/Manual; | 5928 | Read http://www.denx.de/twiki/bin/view/DULG/Manual; |
5935 | Read applicable doc/*.README; | 5929 | Read applicable doc/*.README; |
5936 | Read the source, Luke; | 5930 | Read the source, Luke; |
5937 | /* find . -name "*.[chS]" | xargs grep -i <keyword> */ | 5931 | /* find . -name "*.[chS]" | xargs grep -i <keyword> */ |
5938 | } | 5932 | } |
5939 | 5933 | ||
5940 | if (available_money > toLocalCurrency ($2500)) | 5934 | if (available_money > toLocalCurrency ($2500)) |
5941 | Buy a BDI3000; | 5935 | Buy a BDI3000; |
5942 | else | 5936 | else |
5943 | Add a lot of aggravation and time; | 5937 | Add a lot of aggravation and time; |
5944 | 5938 | ||
5945 | if (a similar board exists) { /* hopefully... */ | 5939 | if (a similar board exists) { /* hopefully... */ |
5946 | cp -a board/<similar> board/<myboard> | 5940 | cp -a board/<similar> board/<myboard> |
5947 | cp include/configs/<similar>.h include/configs/<myboard>.h | 5941 | cp include/configs/<similar>.h include/configs/<myboard>.h |
5948 | } else { | 5942 | } else { |
5949 | Create your own board support subdirectory; | 5943 | Create your own board support subdirectory; |
5950 | Create your own board include/configs/<myboard>.h file; | 5944 | Create your own board include/configs/<myboard>.h file; |
5951 | } | 5945 | } |
5952 | Edit new board/<myboard> files | 5946 | Edit new board/<myboard> files |
5953 | Edit new include/configs/<myboard>.h | 5947 | Edit new include/configs/<myboard>.h |
5954 | 5948 | ||
5955 | while (!accepted) { | 5949 | while (!accepted) { |
5956 | while (!running) { | 5950 | while (!running) { |
5957 | do { | 5951 | do { |
5958 | Add / modify source code; | 5952 | Add / modify source code; |
5959 | } until (compiles); | 5953 | } until (compiles); |
5960 | Debug; | 5954 | Debug; |
5961 | if (clueless) | 5955 | if (clueless) |
5962 | email("Hi, I am having problems..."); | 5956 | email("Hi, I am having problems..."); |
5963 | } | 5957 | } |
5964 | Send patch file to the U-Boot email list; | 5958 | Send patch file to the U-Boot email list; |
5965 | if (reasonable critiques) | 5959 | if (reasonable critiques) |
5966 | Incorporate improvements from email list code review; | 5960 | Incorporate improvements from email list code review; |
5967 | else | 5961 | else |
5968 | Defend code as written; | 5962 | Defend code as written; |
5969 | } | 5963 | } |
5970 | 5964 | ||
5971 | return 0; | 5965 | return 0; |
5972 | } | 5966 | } |
5973 | 5967 | ||
5974 | void no_more_time (int sig) | 5968 | void no_more_time (int sig) |
5975 | { | 5969 | { |
5976 | hire_a_guru(); | 5970 | hire_a_guru(); |
5977 | } | 5971 | } |
5978 | 5972 | ||
5979 | 5973 | ||
5980 | Coding Standards: | 5974 | Coding Standards: |
5981 | ----------------- | 5975 | ----------------- |
5982 | 5976 | ||
5983 | All contributions to U-Boot should conform to the Linux kernel | 5977 | All contributions to U-Boot should conform to the Linux kernel |
5984 | coding style; see the file "Documentation/CodingStyle" and the script | 5978 | coding style; see the file "Documentation/CodingStyle" and the script |
5985 | "scripts/Lindent" in your Linux kernel source directory. | 5979 | "scripts/Lindent" in your Linux kernel source directory. |
5986 | 5980 | ||
5987 | Source files originating from a different project (for example the | 5981 | Source files originating from a different project (for example the |
5988 | MTD subsystem) are generally exempt from these guidelines and are not | 5982 | MTD subsystem) are generally exempt from these guidelines and are not |
5989 | reformated to ease subsequent migration to newer versions of those | 5983 | reformated to ease subsequent migration to newer versions of those |
5990 | sources. | 5984 | sources. |
5991 | 5985 | ||
5992 | Please note that U-Boot is implemented in C (and to some small parts in | 5986 | Please note that U-Boot is implemented in C (and to some small parts in |
5993 | Assembler); no C++ is used, so please do not use C++ style comments (//) | 5987 | Assembler); no C++ is used, so please do not use C++ style comments (//) |
5994 | in your code. | 5988 | in your code. |
5995 | 5989 | ||
5996 | Please also stick to the following formatting rules: | 5990 | Please also stick to the following formatting rules: |
5997 | - remove any trailing white space | 5991 | - remove any trailing white space |
5998 | - use TAB characters for indentation and vertical alignment, not spaces | 5992 | - use TAB characters for indentation and vertical alignment, not spaces |
5999 | - make sure NOT to use DOS '\r\n' line feeds | 5993 | - make sure NOT to use DOS '\r\n' line feeds |
6000 | - do not add more than 2 consecutive empty lines to source files | 5994 | - do not add more than 2 consecutive empty lines to source files |
6001 | - do not add trailing empty lines to source files | 5995 | - do not add trailing empty lines to source files |
6002 | 5996 | ||
6003 | Submissions which do not conform to the standards may be returned | 5997 | Submissions which do not conform to the standards may be returned |
6004 | with a request to reformat the changes. | 5998 | with a request to reformat the changes. |
6005 | 5999 | ||
6006 | 6000 | ||
6007 | Submitting Patches: | 6001 | Submitting Patches: |
6008 | ------------------- | 6002 | ------------------- |
6009 | 6003 | ||
6010 | Since the number of patches for U-Boot is growing, we need to | 6004 | Since the number of patches for U-Boot is growing, we need to |
6011 | establish some rules. Submissions which do not conform to these rules | 6005 | establish some rules. Submissions which do not conform to these rules |
6012 | may be rejected, even when they contain important and valuable stuff. | 6006 | may be rejected, even when they contain important and valuable stuff. |
6013 | 6007 | ||
6014 | Please see http://www.denx.de/wiki/U-Boot/Patches for details. | 6008 | Please see http://www.denx.de/wiki/U-Boot/Patches for details. |
6015 | 6009 | ||
6016 | Patches shall be sent to the u-boot mailing list <u-boot@lists.denx.de>; | 6010 | Patches shall be sent to the u-boot mailing list <u-boot@lists.denx.de>; |
6017 | see http://lists.denx.de/mailman/listinfo/u-boot | 6011 | see http://lists.denx.de/mailman/listinfo/u-boot |
6018 | 6012 | ||
6019 | When you send a patch, please include the following information with | 6013 | When you send a patch, please include the following information with |
6020 | it: | 6014 | it: |
6021 | 6015 | ||
6022 | * For bug fixes: a description of the bug and how your patch fixes | 6016 | * For bug fixes: a description of the bug and how your patch fixes |
6023 | this bug. Please try to include a way of demonstrating that the | 6017 | this bug. Please try to include a way of demonstrating that the |
6024 | patch actually fixes something. | 6018 | patch actually fixes something. |
6025 | 6019 | ||
6026 | * For new features: a description of the feature and your | 6020 | * For new features: a description of the feature and your |
6027 | implementation. | 6021 | implementation. |
6028 | 6022 | ||
6029 | * A CHANGELOG entry as plaintext (separate from the patch) | 6023 | * A CHANGELOG entry as plaintext (separate from the patch) |
6030 | 6024 | ||
6031 | * For major contributions, your entry to the CREDITS file | 6025 | * For major contributions, your entry to the CREDITS file |
6032 | 6026 | ||
6033 | * When you add support for a new board, don't forget to add a | 6027 | * When you add support for a new board, don't forget to add a |
6034 | maintainer e-mail address to the boards.cfg file, too. | 6028 | maintainer e-mail address to the boards.cfg file, too. |
6035 | 6029 | ||
6036 | * If your patch adds new configuration options, don't forget to | 6030 | * If your patch adds new configuration options, don't forget to |
6037 | document these in the README file. | 6031 | document these in the README file. |
6038 | 6032 | ||
6039 | * The patch itself. If you are using git (which is *strongly* | 6033 | * The patch itself. If you are using git (which is *strongly* |
6040 | recommended) you can easily generate the patch using the | 6034 | recommended) you can easily generate the patch using the |
6041 | "git format-patch". If you then use "git send-email" to send it to | 6035 | "git format-patch". If you then use "git send-email" to send it to |
6042 | the U-Boot mailing list, you will avoid most of the common problems | 6036 | the U-Boot mailing list, you will avoid most of the common problems |
6043 | with some other mail clients. | 6037 | with some other mail clients. |
6044 | 6038 | ||
6045 | If you cannot use git, use "diff -purN OLD NEW". If your version of | 6039 | If you cannot use git, use "diff -purN OLD NEW". If your version of |
6046 | diff does not support these options, then get the latest version of | 6040 | diff does not support these options, then get the latest version of |
6047 | GNU diff. | 6041 | GNU diff. |
6048 | 6042 | ||
6049 | The current directory when running this command shall be the parent | 6043 | The current directory when running this command shall be the parent |
6050 | directory of the U-Boot source tree (i. e. please make sure that | 6044 | directory of the U-Boot source tree (i. e. please make sure that |
6051 | your patch includes sufficient directory information for the | 6045 | your patch includes sufficient directory information for the |
6052 | affected files). | 6046 | affected files). |
6053 | 6047 | ||
6054 | We prefer patches as plain text. MIME attachments are discouraged, | 6048 | We prefer patches as plain text. MIME attachments are discouraged, |
6055 | and compressed attachments must not be used. | 6049 | and compressed attachments must not be used. |
6056 | 6050 | ||
6057 | * If one logical set of modifications affects or creates several | 6051 | * If one logical set of modifications affects or creates several |
6058 | files, all these changes shall be submitted in a SINGLE patch file. | 6052 | files, all these changes shall be submitted in a SINGLE patch file. |
6059 | 6053 | ||
6060 | * Changesets that contain different, unrelated modifications shall be | 6054 | * Changesets that contain different, unrelated modifications shall be |
6061 | submitted as SEPARATE patches, one patch per changeset. | 6055 | submitted as SEPARATE patches, one patch per changeset. |
6062 | 6056 | ||
6063 | 6057 | ||
6064 | Notes: | 6058 | Notes: |
6065 | 6059 | ||
6066 | * Before sending the patch, run the MAKEALL script on your patched | 6060 | * Before sending the patch, run the MAKEALL script on your patched |
6067 | source tree and make sure that no errors or warnings are reported | 6061 | source tree and make sure that no errors or warnings are reported |
6068 | for any of the boards. | 6062 | for any of the boards. |
6069 | 6063 | ||
6070 | * Keep your modifications to the necessary minimum: A patch | 6064 | * Keep your modifications to the necessary minimum: A patch |
6071 | containing several unrelated changes or arbitrary reformats will be | 6065 | containing several unrelated changes or arbitrary reformats will be |
6072 | returned with a request to re-formatting / split it. | 6066 | returned with a request to re-formatting / split it. |
6073 | 6067 | ||
6074 | * If you modify existing code, make sure that your new code does not | 6068 | * If you modify existing code, make sure that your new code does not |
6075 | add to the memory footprint of the code ;-) Small is beautiful! | 6069 | add to the memory footprint of the code ;-) Small is beautiful! |
6076 | When adding new features, these should compile conditionally only | 6070 | When adding new features, these should compile conditionally only |
6077 | (using #ifdef), and the resulting code with the new feature | 6071 | (using #ifdef), and the resulting code with the new feature |
6078 | disabled must not need more memory than the old code without your | 6072 | disabled must not need more memory than the old code without your |
6079 | modification. | 6073 | modification. |
6080 | 6074 | ||
6081 | * Remember that there is a size limit of 100 kB per message on the | 6075 | * Remember that there is a size limit of 100 kB per message on the |
6082 | u-boot mailing list. Bigger patches will be moderated. If they are | 6076 | u-boot mailing list. Bigger patches will be moderated. If they are |
6083 | reasonable and not too big, they will be acknowledged. But patches | 6077 | reasonable and not too big, they will be acknowledged. But patches |
6084 | bigger than the size limit should be avoided. | 6078 | bigger than the size limit should be avoided. |
6085 | 6079 |
arch/arm/cpu/arm1136/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for OMP2420/ARM1136 CPU-core | 2 | * armboot - Startup Code for OMP2420/ARM1136 CPU-core |
3 | * | 3 | * |
4 | * Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com> | 4 | * Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com> |
5 | * | 5 | * |
6 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> | 6 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> |
7 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> | 7 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> |
8 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> | 8 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> |
9 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> | 9 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> |
10 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> | 10 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> |
11 | * | 11 | * |
12 | * SPDX-License-Identifier: GPL-2.0+ | 12 | * SPDX-License-Identifier: GPL-2.0+ |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <asm-offsets.h> | 15 | #include <asm-offsets.h> |
16 | #include <config.h> | 16 | #include <config.h> |
17 | #include <version.h> | 17 | #include <version.h> |
18 | .globl _start | 18 | .globl _start |
19 | _start: b reset | 19 | _start: b reset |
20 | #ifdef CONFIG_SPL_BUILD | 20 | #ifdef CONFIG_SPL_BUILD |
21 | ldr pc, _hang | 21 | ldr pc, _hang |
22 | ldr pc, _hang | 22 | ldr pc, _hang |
23 | ldr pc, _hang | 23 | ldr pc, _hang |
24 | ldr pc, _hang | 24 | ldr pc, _hang |
25 | ldr pc, _hang | 25 | ldr pc, _hang |
26 | ldr pc, _hang | 26 | ldr pc, _hang |
27 | ldr pc, _hang | 27 | ldr pc, _hang |
28 | 28 | ||
29 | _hang: | 29 | _hang: |
30 | .word do_hang | 30 | .word do_hang |
31 | .word 0x12345678 | 31 | .word 0x12345678 |
32 | .word 0x12345678 | 32 | .word 0x12345678 |
33 | .word 0x12345678 | 33 | .word 0x12345678 |
34 | .word 0x12345678 | 34 | .word 0x12345678 |
35 | .word 0x12345678 | 35 | .word 0x12345678 |
36 | .word 0x12345678 | 36 | .word 0x12345678 |
37 | .word 0x12345678 /* now 16*4=64 */ | 37 | .word 0x12345678 /* now 16*4=64 */ |
38 | #else | 38 | #else |
39 | ldr pc, _undefined_instruction | 39 | ldr pc, _undefined_instruction |
40 | ldr pc, _software_interrupt | 40 | ldr pc, _software_interrupt |
41 | ldr pc, _prefetch_abort | 41 | ldr pc, _prefetch_abort |
42 | ldr pc, _data_abort | 42 | ldr pc, _data_abort |
43 | ldr pc, _not_used | 43 | ldr pc, _not_used |
44 | ldr pc, _irq | 44 | ldr pc, _irq |
45 | ldr pc, _fiq | 45 | ldr pc, _fiq |
46 | 46 | ||
47 | _undefined_instruction: .word undefined_instruction | 47 | _undefined_instruction: .word undefined_instruction |
48 | _software_interrupt: .word software_interrupt | 48 | _software_interrupt: .word software_interrupt |
49 | _prefetch_abort: .word prefetch_abort | 49 | _prefetch_abort: .word prefetch_abort |
50 | _data_abort: .word data_abort | 50 | _data_abort: .word data_abort |
51 | _not_used: .word not_used | 51 | _not_used: .word not_used |
52 | _irq: .word irq | 52 | _irq: .word irq |
53 | _fiq: .word fiq | 53 | _fiq: .word fiq |
54 | _pad: .word 0x12345678 /* now 16*4=64 */ | 54 | _pad: .word 0x12345678 /* now 16*4=64 */ |
55 | #endif /* CONFIG_SPL_BUILD */ | 55 | #endif /* CONFIG_SPL_BUILD */ |
56 | .global _end_vect | 56 | .global _end_vect |
57 | _end_vect: | 57 | _end_vect: |
58 | 58 | ||
59 | .balignl 16,0xdeadbeef | 59 | .balignl 16,0xdeadbeef |
60 | /* | 60 | /* |
61 | ************************************************************************* | 61 | ************************************************************************* |
62 | * | 62 | * |
63 | * Startup Code (reset vector) | 63 | * Startup Code (reset vector) |
64 | * | 64 | * |
65 | * do important init only if we don't start from memory! | 65 | * do important init only if we don't start from memory! |
66 | * setup Memory and board specific bits prior to relocation. | 66 | * setup Memory and board specific bits prior to relocation. |
67 | * relocate armboot to ram | 67 | * relocate armboot to ram |
68 | * setup stack | 68 | * setup stack |
69 | * | 69 | * |
70 | ************************************************************************* | 70 | ************************************************************************* |
71 | */ | 71 | */ |
72 | 72 | ||
73 | .globl _TEXT_BASE | ||
74 | _TEXT_BASE: | ||
75 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
76 | .word CONFIG_SPL_TEXT_BASE | ||
77 | #else | ||
78 | .word CONFIG_SYS_TEXT_BASE | ||
79 | #endif | ||
80 | |||
81 | /* | ||
82 | * These are defined in the board-specific linker script. | ||
83 | * Subtracting _start from them lets the linker put their | ||
84 | * relative position in the executable instead of leaving | ||
85 | * them null. | ||
86 | */ | ||
87 | .globl _bss_start_ofs | ||
88 | _bss_start_ofs: | ||
89 | .word __bss_start - _start | ||
90 | |||
91 | .globl _bss_end_ofs | ||
92 | _bss_end_ofs: | ||
93 | .word __bss_end - _start | ||
94 | |||
95 | .globl _end_ofs | ||
96 | _end_ofs: | ||
97 | .word _end - _start | ||
98 | |||
99 | #ifdef CONFIG_USE_IRQ | 73 | #ifdef CONFIG_USE_IRQ |
100 | /* IRQ stack memory (calculated at run-time) */ | 74 | /* IRQ stack memory (calculated at run-time) */ |
101 | .globl IRQ_STACK_START | 75 | .globl IRQ_STACK_START |
102 | IRQ_STACK_START: | 76 | IRQ_STACK_START: |
103 | .word 0x0badc0de | 77 | .word 0x0badc0de |
104 | 78 | ||
105 | /* IRQ stack memory (calculated at run-time) */ | 79 | /* IRQ stack memory (calculated at run-time) */ |
106 | .globl FIQ_STACK_START | 80 | .globl FIQ_STACK_START |
107 | FIQ_STACK_START: | 81 | FIQ_STACK_START: |
108 | .word 0x0badc0de | 82 | .word 0x0badc0de |
109 | #endif | 83 | #endif |
110 | 84 | ||
111 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 85 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
112 | .globl IRQ_STACK_START_IN | 86 | .globl IRQ_STACK_START_IN |
113 | IRQ_STACK_START_IN: | 87 | IRQ_STACK_START_IN: |
114 | .word 0x0badc0de | 88 | .word 0x0badc0de |
115 | 89 | ||
116 | /* | 90 | /* |
117 | * the actual reset code | 91 | * the actual reset code |
118 | */ | 92 | */ |
119 | 93 | ||
120 | reset: | 94 | reset: |
121 | /* | 95 | /* |
122 | * set the cpu to SVC32 mode | 96 | * set the cpu to SVC32 mode |
123 | */ | 97 | */ |
124 | mrs r0,cpsr | 98 | mrs r0,cpsr |
125 | bic r0,r0,#0x1f | 99 | bic r0,r0,#0x1f |
126 | orr r0,r0,#0xd3 | 100 | orr r0,r0,#0xd3 |
127 | msr cpsr,r0 | 101 | msr cpsr,r0 |
128 | 102 | ||
129 | /* the mask ROM code should have PLL and others stable */ | 103 | /* the mask ROM code should have PLL and others stable */ |
130 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 104 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
131 | bl cpu_init_crit | 105 | bl cpu_init_crit |
132 | #endif | 106 | #endif |
133 | 107 | ||
134 | bl _main | 108 | bl _main |
135 | 109 | ||
136 | /*------------------------------------------------------------------------------*/ | 110 | /*------------------------------------------------------------------------------*/ |
137 | 111 | ||
138 | .globl c_runtime_cpu_setup | 112 | .globl c_runtime_cpu_setup |
139 | c_runtime_cpu_setup: | 113 | c_runtime_cpu_setup: |
140 | 114 | ||
141 | bx lr | 115 | bx lr |
142 | 116 | ||
143 | /* | 117 | /* |
144 | ************************************************************************* | 118 | ************************************************************************* |
145 | * | 119 | * |
146 | * CPU_init_critical registers | 120 | * CPU_init_critical registers |
147 | * | 121 | * |
148 | * setup important registers | 122 | * setup important registers |
149 | * setup memory timing | 123 | * setup memory timing |
150 | * | 124 | * |
151 | ************************************************************************* | 125 | ************************************************************************* |
152 | */ | 126 | */ |
153 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 127 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
154 | cpu_init_crit: | 128 | cpu_init_crit: |
155 | /* | 129 | /* |
156 | * flush v4 I/D caches | 130 | * flush v4 I/D caches |
157 | */ | 131 | */ |
158 | mov r0, #0 | 132 | mov r0, #0 |
159 | mcr p15, 0, r0, c7, c7, 0 /* Invalidate I+D+BTB caches */ | 133 | mcr p15, 0, r0, c7, c7, 0 /* Invalidate I+D+BTB caches */ |
160 | mcr p15, 0, r0, c8, c7, 0 /* Invalidate Unified TLB */ | 134 | mcr p15, 0, r0, c8, c7, 0 /* Invalidate Unified TLB */ |
161 | 135 | ||
162 | /* | 136 | /* |
163 | * disable MMU stuff and caches | 137 | * disable MMU stuff and caches |
164 | */ | 138 | */ |
165 | mrc p15, 0, r0, c1, c0, 0 | 139 | mrc p15, 0, r0, c1, c0, 0 |
166 | bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) | 140 | bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) |
167 | bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) | 141 | bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) |
168 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align | 142 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align |
169 | orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache | 143 | orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache |
170 | mcr p15, 0, r0, c1, c0, 0 | 144 | mcr p15, 0, r0, c1, c0, 0 |
171 | 145 | ||
172 | /* | 146 | /* |
173 | * Jump to board specific initialization... The Mask ROM will have already initialized | 147 | * Jump to board specific initialization... The Mask ROM will have already initialized |
174 | * basic memory. Go here to bump up clock rate and handle wake up conditions. | 148 | * basic memory. Go here to bump up clock rate and handle wake up conditions. |
175 | */ | 149 | */ |
176 | mov ip, lr /* persevere link reg across call */ | 150 | mov ip, lr /* persevere link reg across call */ |
177 | bl lowlevel_init /* go setup pll,mux,memory */ | 151 | bl lowlevel_init /* go setup pll,mux,memory */ |
178 | mov lr, ip /* restore link */ | 152 | mov lr, ip /* restore link */ |
179 | mov pc, lr /* back to my caller */ | 153 | mov pc, lr /* back to my caller */ |
180 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ | 154 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ |
181 | 155 | ||
182 | #ifndef CONFIG_SPL_BUILD | 156 | #ifndef CONFIG_SPL_BUILD |
183 | /* | 157 | /* |
184 | ************************************************************************* | 158 | ************************************************************************* |
185 | * | 159 | * |
186 | * Interrupt handling | 160 | * Interrupt handling |
187 | * | 161 | * |
188 | ************************************************************************* | 162 | ************************************************************************* |
189 | */ | 163 | */ |
190 | @ | 164 | @ |
191 | @ IRQ stack frame. | 165 | @ IRQ stack frame. |
192 | @ | 166 | @ |
193 | #define S_FRAME_SIZE 72 | 167 | #define S_FRAME_SIZE 72 |
194 | 168 | ||
195 | #define S_OLD_R0 68 | 169 | #define S_OLD_R0 68 |
196 | #define S_PSR 64 | 170 | #define S_PSR 64 |
197 | #define S_PC 60 | 171 | #define S_PC 60 |
198 | #define S_LR 56 | 172 | #define S_LR 56 |
199 | #define S_SP 52 | 173 | #define S_SP 52 |
200 | 174 | ||
201 | #define S_IP 48 | 175 | #define S_IP 48 |
202 | #define S_FP 44 | 176 | #define S_FP 44 |
203 | #define S_R10 40 | 177 | #define S_R10 40 |
204 | #define S_R9 36 | 178 | #define S_R9 36 |
205 | #define S_R8 32 | 179 | #define S_R8 32 |
206 | #define S_R7 28 | 180 | #define S_R7 28 |
207 | #define S_R6 24 | 181 | #define S_R6 24 |
208 | #define S_R5 20 | 182 | #define S_R5 20 |
209 | #define S_R4 16 | 183 | #define S_R4 16 |
210 | #define S_R3 12 | 184 | #define S_R3 12 |
211 | #define S_R2 8 | 185 | #define S_R2 8 |
212 | #define S_R1 4 | 186 | #define S_R1 4 |
213 | #define S_R0 0 | 187 | #define S_R0 0 |
214 | 188 | ||
215 | #define MODE_SVC 0x13 | 189 | #define MODE_SVC 0x13 |
216 | #define I_BIT 0x80 | 190 | #define I_BIT 0x80 |
217 | 191 | ||
218 | /* | 192 | /* |
219 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 193 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
220 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling | 194 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
221 | */ | 195 | */ |
222 | 196 | ||
223 | .macro bad_save_user_regs | 197 | .macro bad_save_user_regs |
224 | sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current user stack | 198 | sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current user stack |
225 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 | 199 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 |
226 | 200 | ||
227 | ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort stack | 201 | ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort stack |
228 | ldmia r2, {r2 - r3} @ get values for "aborted" pc and cpsr (into parm regs) | 202 | ldmia r2, {r2 - r3} @ get values for "aborted" pc and cpsr (into parm regs) |
229 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack | 203 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack |
230 | 204 | ||
231 | add r5, sp, #S_SP | 205 | add r5, sp, #S_SP |
232 | mov r1, lr | 206 | mov r1, lr |
233 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr | 207 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr |
234 | mov r0, sp @ save current stack into r0 (param register) | 208 | mov r0, sp @ save current stack into r0 (param register) |
235 | .endm | 209 | .endm |
236 | 210 | ||
237 | .macro irq_save_user_regs | 211 | .macro irq_save_user_regs |
238 | sub sp, sp, #S_FRAME_SIZE | 212 | sub sp, sp, #S_FRAME_SIZE |
239 | stmia sp, {r0 - r12} @ Calling r0-r12 | 213 | stmia sp, {r0 - r12} @ Calling r0-r12 |
240 | add r8, sp, #S_PC @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. | 214 | add r8, sp, #S_PC @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. |
241 | stmdb r8, {sp, lr}^ @ Calling SP, LR | 215 | stmdb r8, {sp, lr}^ @ Calling SP, LR |
242 | str lr, [r8, #0] @ Save calling PC | 216 | str lr, [r8, #0] @ Save calling PC |
243 | mrs r6, spsr | 217 | mrs r6, spsr |
244 | str r6, [r8, #4] @ Save CPSR | 218 | str r6, [r8, #4] @ Save CPSR |
245 | str r0, [r8, #8] @ Save OLD_R0 | 219 | str r0, [r8, #8] @ Save OLD_R0 |
246 | mov r0, sp | 220 | mov r0, sp |
247 | .endm | 221 | .endm |
248 | 222 | ||
249 | .macro irq_restore_user_regs | 223 | .macro irq_restore_user_regs |
250 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr | 224 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
251 | mov r0, r0 | 225 | mov r0, r0 |
252 | ldr lr, [sp, #S_PC] @ Get PC | 226 | ldr lr, [sp, #S_PC] @ Get PC |
253 | add sp, sp, #S_FRAME_SIZE | 227 | add sp, sp, #S_FRAME_SIZE |
254 | subs pc, lr, #4 @ return & move spsr_svc into cpsr | 228 | subs pc, lr, #4 @ return & move spsr_svc into cpsr |
255 | .endm | 229 | .endm |
256 | 230 | ||
257 | .macro get_bad_stack | 231 | .macro get_bad_stack |
258 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter in banked mode) | 232 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter in banked mode) |
259 | 233 | ||
260 | str lr, [r13] @ save caller lr in position 0 of saved stack | 234 | str lr, [r13] @ save caller lr in position 0 of saved stack |
261 | mrs lr, spsr @ get the spsr | 235 | mrs lr, spsr @ get the spsr |
262 | str lr, [r13, #4] @ save spsr in position 1 of saved stack | 236 | str lr, [r13, #4] @ save spsr in position 1 of saved stack |
263 | 237 | ||
264 | mov r13, #MODE_SVC @ prepare SVC-Mode | 238 | mov r13, #MODE_SVC @ prepare SVC-Mode |
265 | @ msr spsr_c, r13 | 239 | @ msr spsr_c, r13 |
266 | msr spsr, r13 @ switch modes, make sure moves will execute | 240 | msr spsr, r13 @ switch modes, make sure moves will execute |
267 | mov lr, pc @ capture return pc | 241 | mov lr, pc @ capture return pc |
268 | movs pc, lr @ jump to next instruction & switch modes. | 242 | movs pc, lr @ jump to next instruction & switch modes. |
269 | .endm | 243 | .endm |
270 | 244 | ||
271 | .macro get_bad_stack_swi | 245 | .macro get_bad_stack_swi |
272 | sub r13, r13, #4 @ space on current stack for scratch reg. | 246 | sub r13, r13, #4 @ space on current stack for scratch reg. |
273 | str r0, [r13] @ save R0's value. | 247 | str r0, [r13] @ save R0's value. |
274 | ldr r0, IRQ_STACK_START_IN @ get data regions start | 248 | ldr r0, IRQ_STACK_START_IN @ get data regions start |
275 | str lr, [r0] @ save caller lr in position 0 of saved stack | 249 | str lr, [r0] @ save caller lr in position 0 of saved stack |
276 | mrs lr, spsr @ get the spsr | 250 | mrs lr, spsr @ get the spsr |
277 | str lr, [r0, #4] @ save spsr in position 1 of saved stack | 251 | str lr, [r0, #4] @ save spsr in position 1 of saved stack |
278 | ldr lr, [r0] @ restore lr | 252 | ldr lr, [r0] @ restore lr |
279 | ldr r0, [r13] @ restore r0 | 253 | ldr r0, [r13] @ restore r0 |
280 | add r13, r13, #4 @ pop stack entry | 254 | add r13, r13, #4 @ pop stack entry |
281 | .endm | 255 | .endm |
282 | 256 | ||
283 | .macro get_irq_stack @ setup IRQ stack | 257 | .macro get_irq_stack @ setup IRQ stack |
284 | ldr sp, IRQ_STACK_START | 258 | ldr sp, IRQ_STACK_START |
285 | .endm | 259 | .endm |
286 | 260 | ||
287 | .macro get_fiq_stack @ setup FIQ stack | 261 | .macro get_fiq_stack @ setup FIQ stack |
288 | ldr sp, FIQ_STACK_START | 262 | ldr sp, FIQ_STACK_START |
289 | .endm | 263 | .endm |
290 | #endif /* CONFIG_SPL_BUILD */ | 264 | #endif /* CONFIG_SPL_BUILD */ |
291 | 265 | ||
292 | /* | 266 | /* |
293 | * exception handlers | 267 | * exception handlers |
294 | */ | 268 | */ |
295 | #ifdef CONFIG_SPL_BUILD | 269 | #ifdef CONFIG_SPL_BUILD |
296 | .align 5 | 270 | .align 5 |
297 | do_hang: | 271 | do_hang: |
298 | ldr sp, _TEXT_BASE /* use 32 words about stack */ | ||
299 | bl hang /* hang and never return */ | 272 | bl hang /* hang and never return */ |
300 | #else /* !CONFIG_SPL_BUILD */ | 273 | #else /* !CONFIG_SPL_BUILD */ |
301 | .align 5 | 274 | .align 5 |
302 | undefined_instruction: | 275 | undefined_instruction: |
303 | get_bad_stack | 276 | get_bad_stack |
304 | bad_save_user_regs | 277 | bad_save_user_regs |
305 | bl do_undefined_instruction | 278 | bl do_undefined_instruction |
306 | 279 | ||
307 | .align 5 | 280 | .align 5 |
308 | software_interrupt: | 281 | software_interrupt: |
309 | get_bad_stack_swi | 282 | get_bad_stack_swi |
310 | bad_save_user_regs | 283 | bad_save_user_regs |
311 | bl do_software_interrupt | 284 | bl do_software_interrupt |
312 | 285 | ||
313 | .align 5 | 286 | .align 5 |
314 | prefetch_abort: | 287 | prefetch_abort: |
315 | get_bad_stack | 288 | get_bad_stack |
316 | bad_save_user_regs | 289 | bad_save_user_regs |
317 | bl do_prefetch_abort | 290 | bl do_prefetch_abort |
318 | 291 | ||
319 | .align 5 | 292 | .align 5 |
320 | data_abort: | 293 | data_abort: |
321 | get_bad_stack | 294 | get_bad_stack |
322 | bad_save_user_regs | 295 | bad_save_user_regs |
323 | bl do_data_abort | 296 | bl do_data_abort |
324 | 297 | ||
325 | .align 5 | 298 | .align 5 |
326 | not_used: | 299 | not_used: |
327 | get_bad_stack | 300 | get_bad_stack |
328 | bad_save_user_regs | 301 | bad_save_user_regs |
329 | bl do_not_used | 302 | bl do_not_used |
330 | 303 | ||
331 | #ifdef CONFIG_USE_IRQ | 304 | #ifdef CONFIG_USE_IRQ |
332 | 305 | ||
333 | .align 5 | 306 | .align 5 |
334 | irq: | 307 | irq: |
335 | get_irq_stack | 308 | get_irq_stack |
336 | irq_save_user_regs | 309 | irq_save_user_regs |
337 | bl do_irq | 310 | bl do_irq |
338 | irq_restore_user_regs | 311 | irq_restore_user_regs |
339 | 312 | ||
340 | .align 5 | 313 | .align 5 |
341 | fiq: | 314 | fiq: |
342 | get_fiq_stack | 315 | get_fiq_stack |
343 | /* someone ought to write a more effiction fiq_save_user_regs */ | 316 | /* someone ought to write a more effiction fiq_save_user_regs */ |
344 | irq_save_user_regs | 317 | irq_save_user_regs |
345 | bl do_fiq | 318 | bl do_fiq |
346 | irq_restore_user_regs | 319 | irq_restore_user_regs |
347 | 320 | ||
348 | #else | 321 | #else |
349 | 322 | ||
350 | .align 5 | 323 | .align 5 |
351 | irq: | 324 | irq: |
352 | get_bad_stack | 325 | get_bad_stack |
353 | bad_save_user_regs | 326 | bad_save_user_regs |
354 | bl do_irq | 327 | bl do_irq |
355 | 328 | ||
356 | .align 5 | 329 | .align 5 |
357 | fiq: | 330 | fiq: |
358 | get_bad_stack | 331 | get_bad_stack |
359 | bad_save_user_regs | 332 | bad_save_user_regs |
360 | bl do_fiq | 333 | bl do_fiq |
361 | 334 | ||
362 | #endif | 335 | #endif |
363 | .align 5 | 336 | .align 5 |
364 | .global arm1136_cache_flush | 337 | .global arm1136_cache_flush |
365 | arm1136_cache_flush: | 338 | arm1136_cache_flush: |
366 | #if !defined(CONFIG_SYS_ICACHE_OFF) | 339 | #if !defined(CONFIG_SYS_ICACHE_OFF) |
367 | mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache | 340 | mcr p15, 0, r1, c7, c5, 0 @ invalidate I cache |
368 | #endif | 341 | #endif |
369 | #if !defined(CONFIG_SYS_DCACHE_OFF) | 342 | #if !defined(CONFIG_SYS_DCACHE_OFF) |
370 | mcr p15, 0, r1, c7, c14, 0 @ invalidate D cache | 343 | mcr p15, 0, r1, c7, c14, 0 @ invalidate D cache |
371 | #endif | 344 | #endif |
372 | mov pc, lr @ back to caller | 345 | mov pc, lr @ back to caller |
373 | #endif /* CONFIG_SPL_BUILD */ | 346 | #endif /* CONFIG_SPL_BUILD */ |
374 | 347 |
arch/arm/cpu/arm1176/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for ARM1176 CPU-core | 2 | * armboot - Startup Code for ARM1176 CPU-core |
3 | * | 3 | * |
4 | * Copyright (c) 2007 Samsung Electronics | 4 | * Copyright (c) 2007 Samsung Electronics |
5 | * | 5 | * |
6 | * Copyright (C) 2008 | 6 | * Copyright (C) 2008 |
7 | * Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de> | 7 | * Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de> |
8 | * | 8 | * |
9 | * SPDX-License-Identifier: GPL-2.0+ | 9 | * SPDX-License-Identifier: GPL-2.0+ |
10 | * | 10 | * |
11 | * 2007-09-21 - Restructured codes by jsgood (jsgood.yang@samsung.com) | 11 | * 2007-09-21 - Restructured codes by jsgood (jsgood.yang@samsung.com) |
12 | * 2007-09-21 - Added MoviNAND and OneNAND boot codes by | 12 | * 2007-09-21 - Added MoviNAND and OneNAND boot codes by |
13 | * jsgood (jsgood.yang@samsung.com) | 13 | * jsgood (jsgood.yang@samsung.com) |
14 | * Base codes by scsuh (sc.suh) | 14 | * Base codes by scsuh (sc.suh) |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <asm-offsets.h> | 17 | #include <asm-offsets.h> |
18 | #include <config.h> | 18 | #include <config.h> |
19 | #include <version.h> | 19 | #include <version.h> |
20 | 20 | ||
21 | #ifndef CONFIG_SYS_PHY_UBOOT_BASE | 21 | #ifndef CONFIG_SYS_PHY_UBOOT_BASE |
22 | #define CONFIG_SYS_PHY_UBOOT_BASE CONFIG_SYS_UBOOT_BASE | 22 | #define CONFIG_SYS_PHY_UBOOT_BASE CONFIG_SYS_UBOOT_BASE |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | /* | 25 | /* |
26 | ************************************************************************* | 26 | ************************************************************************* |
27 | * | 27 | * |
28 | * Jump vector table as in table 3.1 in [1] | 28 | * Jump vector table as in table 3.1 in [1] |
29 | * | 29 | * |
30 | ************************************************************************* | 30 | ************************************************************************* |
31 | */ | 31 | */ |
32 | 32 | ||
33 | .globl _start | 33 | .globl _start |
34 | _start: b reset | 34 | _start: b reset |
35 | #ifndef CONFIG_SPL_BUILD | 35 | #ifndef CONFIG_SPL_BUILD |
36 | ldr pc, _undefined_instruction | 36 | ldr pc, _undefined_instruction |
37 | ldr pc, _software_interrupt | 37 | ldr pc, _software_interrupt |
38 | ldr pc, _prefetch_abort | 38 | ldr pc, _prefetch_abort |
39 | ldr pc, _data_abort | 39 | ldr pc, _data_abort |
40 | ldr pc, _not_used | 40 | ldr pc, _not_used |
41 | ldr pc, _irq | 41 | ldr pc, _irq |
42 | ldr pc, _fiq | 42 | ldr pc, _fiq |
43 | 43 | ||
44 | _undefined_instruction: | 44 | _undefined_instruction: |
45 | .word undefined_instruction | 45 | .word undefined_instruction |
46 | _software_interrupt: | 46 | _software_interrupt: |
47 | .word software_interrupt | 47 | .word software_interrupt |
48 | _prefetch_abort: | 48 | _prefetch_abort: |
49 | .word prefetch_abort | 49 | .word prefetch_abort |
50 | _data_abort: | 50 | _data_abort: |
51 | .word data_abort | 51 | .word data_abort |
52 | _not_used: | 52 | _not_used: |
53 | .word not_used | 53 | .word not_used |
54 | _irq: | 54 | _irq: |
55 | .word irq | 55 | .word irq |
56 | _fiq: | 56 | _fiq: |
57 | .word fiq | 57 | .word fiq |
58 | _pad: | 58 | _pad: |
59 | .word 0x12345678 /* now 16*4=64 */ | 59 | .word 0x12345678 /* now 16*4=64 */ |
60 | #else | 60 | #else |
61 | . = _start + 64 | 61 | . = _start + 64 |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | .global _end_vect | 64 | .global _end_vect |
65 | _end_vect: | 65 | _end_vect: |
66 | .balignl 16,0xdeadbeef | 66 | .balignl 16,0xdeadbeef |
67 | /* | 67 | /* |
68 | ************************************************************************* | 68 | ************************************************************************* |
69 | * | 69 | * |
70 | * Startup Code (reset vector) | 70 | * Startup Code (reset vector) |
71 | * | 71 | * |
72 | * do important init only if we don't start from memory! | 72 | * do important init only if we don't start from memory! |
73 | * setup Memory and board specific bits prior to relocation. | 73 | * setup Memory and board specific bits prior to relocation. |
74 | * relocate armboot to ram | 74 | * relocate armboot to ram |
75 | * setup stack | 75 | * setup stack |
76 | * | 76 | * |
77 | ************************************************************************* | 77 | ************************************************************************* |
78 | */ | 78 | */ |
79 | 79 | ||
80 | .globl _TEXT_BASE | ||
81 | _TEXT_BASE: | ||
82 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
83 | .word CONFIG_SPL_TEXT_BASE | ||
84 | #else | ||
85 | .word CONFIG_SYS_TEXT_BASE | ||
86 | #endif | ||
87 | |||
88 | /* | ||
89 | * These are defined in the board-specific linker script. | ||
90 | * Subtracting _start from them lets the linker put their | ||
91 | * relative position in the executable instead of leaving | ||
92 | * them null. | ||
93 | */ | ||
94 | |||
95 | .globl _bss_start_ofs | ||
96 | _bss_start_ofs: | ||
97 | .word __bss_start - _start | ||
98 | |||
99 | .globl _bss_end_ofs | ||
100 | _bss_end_ofs: | ||
101 | .word __bss_end - _start | ||
102 | |||
103 | .globl _end_ofs | ||
104 | _end_ofs: | ||
105 | .word _end - _start | ||
106 | |||
107 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 80 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
108 | .globl IRQ_STACK_START_IN | 81 | .globl IRQ_STACK_START_IN |
109 | IRQ_STACK_START_IN: | 82 | IRQ_STACK_START_IN: |
110 | .word 0x0badc0de | 83 | .word 0x0badc0de |
111 | 84 | ||
112 | /* | 85 | /* |
113 | * the actual reset code | 86 | * the actual reset code |
114 | */ | 87 | */ |
115 | 88 | ||
116 | reset: | 89 | reset: |
117 | /* | 90 | /* |
118 | * set the cpu to SVC32 mode | 91 | * set the cpu to SVC32 mode |
119 | */ | 92 | */ |
120 | mrs r0, cpsr | 93 | mrs r0, cpsr |
121 | bic r0, r0, #0x3f | 94 | bic r0, r0, #0x3f |
122 | orr r0, r0, #0xd3 | 95 | orr r0, r0, #0xd3 |
123 | msr cpsr, r0 | 96 | msr cpsr, r0 |
124 | 97 | ||
125 | /* | 98 | /* |
126 | ************************************************************************* | 99 | ************************************************************************* |
127 | * | 100 | * |
128 | * CPU_init_critical registers | 101 | * CPU_init_critical registers |
129 | * | 102 | * |
130 | * setup important registers | 103 | * setup important registers |
131 | * setup memory timing | 104 | * setup memory timing |
132 | * | 105 | * |
133 | ************************************************************************* | 106 | ************************************************************************* |
134 | */ | 107 | */ |
135 | /* | 108 | /* |
136 | * we do sys-critical inits only at reboot, | 109 | * we do sys-critical inits only at reboot, |
137 | * not when booting from ram! | 110 | * not when booting from ram! |
138 | */ | 111 | */ |
139 | cpu_init_crit: | 112 | cpu_init_crit: |
140 | /* | 113 | /* |
141 | * When booting from NAND - it has definitely been a reset, so, no need | 114 | * When booting from NAND - it has definitely been a reset, so, no need |
142 | * to flush caches and disable the MMU | 115 | * to flush caches and disable the MMU |
143 | */ | 116 | */ |
144 | #ifndef CONFIG_SPL_BUILD | 117 | #ifndef CONFIG_SPL_BUILD |
145 | /* | 118 | /* |
146 | * flush v4 I/D caches | 119 | * flush v4 I/D caches |
147 | */ | 120 | */ |
148 | mov r0, #0 | 121 | mov r0, #0 |
149 | mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */ | 122 | mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */ |
150 | mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */ | 123 | mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */ |
151 | 124 | ||
152 | /* | 125 | /* |
153 | * disable MMU stuff and caches | 126 | * disable MMU stuff and caches |
154 | */ | 127 | */ |
155 | mrc p15, 0, r0, c1, c0, 0 | 128 | mrc p15, 0, r0, c1, c0, 0 |
156 | bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) | 129 | bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) |
157 | bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) | 130 | bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) |
158 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align | 131 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align |
159 | orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache | 132 | orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache |
160 | 133 | ||
161 | /* Prepare to disable the MMU */ | 134 | /* Prepare to disable the MMU */ |
162 | adr r2, mmu_disable_phys | 135 | adr r2, mmu_disable_phys |
163 | sub r2, r2, #(CONFIG_SYS_PHY_UBOOT_BASE - CONFIG_SYS_TEXT_BASE) | 136 | sub r2, r2, #(CONFIG_SYS_PHY_UBOOT_BASE - CONFIG_SYS_TEXT_BASE) |
164 | b mmu_disable | 137 | b mmu_disable |
165 | 138 | ||
166 | .align 5 | 139 | .align 5 |
167 | /* Run in a single cache-line */ | 140 | /* Run in a single cache-line */ |
168 | mmu_disable: | 141 | mmu_disable: |
169 | mcr p15, 0, r0, c1, c0, 0 | 142 | mcr p15, 0, r0, c1, c0, 0 |
170 | nop | 143 | nop |
171 | nop | 144 | nop |
172 | mov pc, r2 | 145 | mov pc, r2 |
173 | mmu_disable_phys: | 146 | mmu_disable_phys: |
174 | 147 | ||
175 | #ifdef CONFIG_DISABLE_TCM | 148 | #ifdef CONFIG_DISABLE_TCM |
176 | /* | 149 | /* |
177 | * Disable the TCMs | 150 | * Disable the TCMs |
178 | */ | 151 | */ |
179 | mrc p15, 0, r0, c0, c0, 2 /* Return TCM details */ | 152 | mrc p15, 0, r0, c0, c0, 2 /* Return TCM details */ |
180 | cmp r0, #0 | 153 | cmp r0, #0 |
181 | beq skip_tcmdisable | 154 | beq skip_tcmdisable |
182 | mov r1, #0 | 155 | mov r1, #0 |
183 | mov r2, #1 | 156 | mov r2, #1 |
184 | tst r0, r2 | 157 | tst r0, r2 |
185 | mcrne p15, 0, r1, c9, c1, 1 /* Disable Instruction TCM if present*/ | 158 | mcrne p15, 0, r1, c9, c1, 1 /* Disable Instruction TCM if present*/ |
186 | tst r0, r2, LSL #16 | 159 | tst r0, r2, LSL #16 |
187 | mcrne p15, 0, r1, c9, c1, 0 /* Disable Data TCM if present*/ | 160 | mcrne p15, 0, r1, c9, c1, 0 /* Disable Data TCM if present*/ |
188 | skip_tcmdisable: | 161 | skip_tcmdisable: |
189 | #endif | 162 | #endif |
190 | #endif | 163 | #endif |
191 | 164 | ||
192 | #ifdef CONFIG_PERIPORT_REMAP | 165 | #ifdef CONFIG_PERIPORT_REMAP |
193 | /* Peri port setup */ | 166 | /* Peri port setup */ |
194 | ldr r0, =CONFIG_PERIPORT_BASE | 167 | ldr r0, =CONFIG_PERIPORT_BASE |
195 | orr r0, r0, #CONFIG_PERIPORT_SIZE | 168 | orr r0, r0, #CONFIG_PERIPORT_SIZE |
196 | mcr p15,0,r0,c15,c2,4 | 169 | mcr p15,0,r0,c15,c2,4 |
197 | #endif | 170 | #endif |
198 | 171 | ||
199 | /* | 172 | /* |
200 | * Go setup Memory and board specific bits prior to relocation. | 173 | * Go setup Memory and board specific bits prior to relocation. |
201 | */ | 174 | */ |
202 | bl lowlevel_init /* go setup pll,mux,memory */ | 175 | bl lowlevel_init /* go setup pll,mux,memory */ |
203 | 176 | ||
204 | bl _main | 177 | bl _main |
205 | 178 | ||
206 | /*------------------------------------------------------------------------------*/ | 179 | /*------------------------------------------------------------------------------*/ |
207 | 180 | ||
208 | .globl c_runtime_cpu_setup | 181 | .globl c_runtime_cpu_setup |
209 | c_runtime_cpu_setup: | 182 | c_runtime_cpu_setup: |
210 | 183 | ||
211 | mov pc, lr | 184 | mov pc, lr |
212 | 185 | ||
213 | #ifndef CONFIG_SPL_BUILD | 186 | #ifndef CONFIG_SPL_BUILD |
214 | /* | 187 | /* |
215 | ************************************************************************* | 188 | ************************************************************************* |
216 | * | 189 | * |
217 | * Interrupt handling | 190 | * Interrupt handling |
218 | * | 191 | * |
219 | ************************************************************************* | 192 | ************************************************************************* |
220 | */ | 193 | */ |
221 | @ | 194 | @ |
222 | @ IRQ stack frame. | 195 | @ IRQ stack frame. |
223 | @ | 196 | @ |
224 | #define S_FRAME_SIZE 72 | 197 | #define S_FRAME_SIZE 72 |
225 | 198 | ||
226 | #define S_OLD_R0 68 | 199 | #define S_OLD_R0 68 |
227 | #define S_PSR 64 | 200 | #define S_PSR 64 |
228 | #define S_PC 60 | 201 | #define S_PC 60 |
229 | #define S_LR 56 | 202 | #define S_LR 56 |
230 | #define S_SP 52 | 203 | #define S_SP 52 |
231 | 204 | ||
232 | #define S_IP 48 | 205 | #define S_IP 48 |
233 | #define S_FP 44 | 206 | #define S_FP 44 |
234 | #define S_R10 40 | 207 | #define S_R10 40 |
235 | #define S_R9 36 | 208 | #define S_R9 36 |
236 | #define S_R8 32 | 209 | #define S_R8 32 |
237 | #define S_R7 28 | 210 | #define S_R7 28 |
238 | #define S_R6 24 | 211 | #define S_R6 24 |
239 | #define S_R5 20 | 212 | #define S_R5 20 |
240 | #define S_R4 16 | 213 | #define S_R4 16 |
241 | #define S_R3 12 | 214 | #define S_R3 12 |
242 | #define S_R2 8 | 215 | #define S_R2 8 |
243 | #define S_R1 4 | 216 | #define S_R1 4 |
244 | #define S_R0 0 | 217 | #define S_R0 0 |
245 | 218 | ||
246 | #define MODE_SVC 0x13 | 219 | #define MODE_SVC 0x13 |
247 | #define I_BIT 0x80 | 220 | #define I_BIT 0x80 |
248 | 221 | ||
249 | /* | 222 | /* |
250 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 223 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
251 | */ | 224 | */ |
252 | 225 | ||
253 | .macro bad_save_user_regs | 226 | .macro bad_save_user_regs |
254 | /* carve out a frame on current user stack */ | 227 | /* carve out a frame on current user stack */ |
255 | sub sp, sp, #S_FRAME_SIZE | 228 | sub sp, sp, #S_FRAME_SIZE |
256 | /* Save user registers (now in svc mode) r0-r12 */ | 229 | /* Save user registers (now in svc mode) r0-r12 */ |
257 | stmia sp, {r0 - r12} | 230 | stmia sp, {r0 - r12} |
258 | 231 | ||
259 | ldr r2, IRQ_STACK_START_IN | 232 | ldr r2, IRQ_STACK_START_IN |
260 | /* get values for "aborted" pc and cpsr (into parm regs) */ | 233 | /* get values for "aborted" pc and cpsr (into parm regs) */ |
261 | ldmia r2, {r2 - r3} | 234 | ldmia r2, {r2 - r3} |
262 | /* grab pointer to old stack */ | 235 | /* grab pointer to old stack */ |
263 | add r0, sp, #S_FRAME_SIZE | 236 | add r0, sp, #S_FRAME_SIZE |
264 | 237 | ||
265 | add r5, sp, #S_SP | 238 | add r5, sp, #S_SP |
266 | mov r1, lr | 239 | mov r1, lr |
267 | /* save sp_SVC, lr_SVC, pc, cpsr */ | 240 | /* save sp_SVC, lr_SVC, pc, cpsr */ |
268 | stmia r5, {r0 - r3} | 241 | stmia r5, {r0 - r3} |
269 | /* save current stack into r0 (param register) */ | 242 | /* save current stack into r0 (param register) */ |
270 | mov r0, sp | 243 | mov r0, sp |
271 | .endm | 244 | .endm |
272 | 245 | ||
273 | .macro get_bad_stack | 246 | .macro get_bad_stack |
274 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack | 247 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack |
275 | 248 | ||
276 | /* save caller lr in position 0 of saved stack */ | 249 | /* save caller lr in position 0 of saved stack */ |
277 | str lr, [r13] | 250 | str lr, [r13] |
278 | /* get the spsr */ | 251 | /* get the spsr */ |
279 | mrs lr, spsr | 252 | mrs lr, spsr |
280 | /* save spsr in position 1 of saved stack */ | 253 | /* save spsr in position 1 of saved stack */ |
281 | str lr, [r13, #4] | 254 | str lr, [r13, #4] |
282 | 255 | ||
283 | /* prepare SVC-Mode */ | 256 | /* prepare SVC-Mode */ |
284 | mov r13, #MODE_SVC | 257 | mov r13, #MODE_SVC |
285 | @ msr spsr_c, r13 | 258 | @ msr spsr_c, r13 |
286 | /* switch modes, make sure moves will execute */ | 259 | /* switch modes, make sure moves will execute */ |
287 | msr spsr, r13 | 260 | msr spsr, r13 |
288 | /* capture return pc */ | 261 | /* capture return pc */ |
289 | mov lr, pc | 262 | mov lr, pc |
290 | /* jump to next instruction & switch modes. */ | 263 | /* jump to next instruction & switch modes. */ |
291 | movs pc, lr | 264 | movs pc, lr |
292 | .endm | 265 | .endm |
293 | 266 | ||
294 | .macro get_bad_stack_swi | 267 | .macro get_bad_stack_swi |
295 | /* space on current stack for scratch reg. */ | 268 | /* space on current stack for scratch reg. */ |
296 | sub r13, r13, #4 | 269 | sub r13, r13, #4 |
297 | /* save R0's value. */ | 270 | /* save R0's value. */ |
298 | str r0, [r13] | 271 | str r0, [r13] |
299 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack | 272 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack |
300 | /* save caller lr in position 0 of saved stack */ | 273 | /* save caller lr in position 0 of saved stack */ |
301 | str lr, [r0] | 274 | str lr, [r0] |
302 | /* get the spsr */ | 275 | /* get the spsr */ |
303 | mrs lr, spsr | 276 | mrs lr, spsr |
304 | /* save spsr in position 1 of saved stack */ | 277 | /* save spsr in position 1 of saved stack */ |
305 | str lr, [r0, #4] | 278 | str lr, [r0, #4] |
306 | /* restore lr */ | 279 | /* restore lr */ |
307 | ldr lr, [r0] | 280 | ldr lr, [r0] |
308 | /* restore r0 */ | 281 | /* restore r0 */ |
309 | ldr r0, [r13] | 282 | ldr r0, [r13] |
310 | /* pop stack entry */ | 283 | /* pop stack entry */ |
311 | add r13, r13, #4 | 284 | add r13, r13, #4 |
312 | .endm | 285 | .endm |
313 | 286 | ||
314 | /* | 287 | /* |
315 | * exception handlers | 288 | * exception handlers |
316 | */ | 289 | */ |
317 | .align 5 | 290 | .align 5 |
318 | undefined_instruction: | 291 | undefined_instruction: |
319 | get_bad_stack | 292 | get_bad_stack |
320 | bad_save_user_regs | 293 | bad_save_user_regs |
321 | bl do_undefined_instruction | 294 | bl do_undefined_instruction |
322 | 295 | ||
323 | .align 5 | 296 | .align 5 |
324 | software_interrupt: | 297 | software_interrupt: |
325 | get_bad_stack_swi | 298 | get_bad_stack_swi |
326 | bad_save_user_regs | 299 | bad_save_user_regs |
327 | bl do_software_interrupt | 300 | bl do_software_interrupt |
328 | 301 | ||
329 | .align 5 | 302 | .align 5 |
330 | prefetch_abort: | 303 | prefetch_abort: |
331 | get_bad_stack | 304 | get_bad_stack |
332 | bad_save_user_regs | 305 | bad_save_user_regs |
333 | bl do_prefetch_abort | 306 | bl do_prefetch_abort |
334 | 307 | ||
335 | .align 5 | 308 | .align 5 |
336 | data_abort: | 309 | data_abort: |
337 | get_bad_stack | 310 | get_bad_stack |
338 | bad_save_user_regs | 311 | bad_save_user_regs |
339 | bl do_data_abort | 312 | bl do_data_abort |
340 | 313 | ||
341 | .align 5 | 314 | .align 5 |
342 | not_used: | 315 | not_used: |
343 | get_bad_stack | 316 | get_bad_stack |
344 | bad_save_user_regs | 317 | bad_save_user_regs |
345 | bl do_not_used | 318 | bl do_not_used |
346 | 319 | ||
347 | .align 5 | 320 | .align 5 |
348 | irq: | 321 | irq: |
349 | get_bad_stack | 322 | get_bad_stack |
350 | bad_save_user_regs | 323 | bad_save_user_regs |
351 | bl do_irq | 324 | bl do_irq |
352 | 325 | ||
353 | .align 5 | 326 | .align 5 |
354 | fiq: | 327 | fiq: |
355 | get_bad_stack | 328 | get_bad_stack |
356 | bad_save_user_regs | 329 | bad_save_user_regs |
357 | bl do_fiq | 330 | bl do_fiq |
358 | #endif /* CONFIG_SPL_BUILD */ | 331 | #endif /* CONFIG_SPL_BUILD */ |
359 | 332 |
arch/arm/cpu/arm720t/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for ARM720 CPU-core | 2 | * armboot - Startup Code for ARM720 CPU-core |
3 | * | 3 | * |
4 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> | 4 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> |
5 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> | 5 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> |
6 | * | 6 | * |
7 | * SPDX-License-Identifier: GPL-2.0+ | 7 | * SPDX-License-Identifier: GPL-2.0+ |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <asm-offsets.h> | 10 | #include <asm-offsets.h> |
11 | #include <config.h> | 11 | #include <config.h> |
12 | #include <version.h> | 12 | #include <version.h> |
13 | #include <asm/hardware.h> | 13 | #include <asm/hardware.h> |
14 | 14 | ||
15 | /* | 15 | /* |
16 | ************************************************************************* | 16 | ************************************************************************* |
17 | * | 17 | * |
18 | * Jump vector table as in table 3.1 in [1] | 18 | * Jump vector table as in table 3.1 in [1] |
19 | * | 19 | * |
20 | ************************************************************************* | 20 | ************************************************************************* |
21 | */ | 21 | */ |
22 | 22 | ||
23 | 23 | ||
24 | .globl _start | 24 | .globl _start |
25 | _start: b reset | 25 | _start: b reset |
26 | ldr pc, _undefined_instruction | 26 | ldr pc, _undefined_instruction |
27 | ldr pc, _software_interrupt | 27 | ldr pc, _software_interrupt |
28 | ldr pc, _prefetch_abort | 28 | ldr pc, _prefetch_abort |
29 | ldr pc, _data_abort | 29 | ldr pc, _data_abort |
30 | ldr pc, _not_used | 30 | ldr pc, _not_used |
31 | ldr pc, _irq | 31 | ldr pc, _irq |
32 | ldr pc, _fiq | 32 | ldr pc, _fiq |
33 | 33 | ||
34 | #ifdef CONFIG_SPL_BUILD | 34 | #ifdef CONFIG_SPL_BUILD |
35 | _undefined_instruction: .word _undefined_instruction | 35 | _undefined_instruction: .word _undefined_instruction |
36 | _software_interrupt: .word _software_interrupt | 36 | _software_interrupt: .word _software_interrupt |
37 | _prefetch_abort: .word _prefetch_abort | 37 | _prefetch_abort: .word _prefetch_abort |
38 | _data_abort: .word _data_abort | 38 | _data_abort: .word _data_abort |
39 | _not_used: .word _not_used | 39 | _not_used: .word _not_used |
40 | _irq: .word _irq | 40 | _irq: .word _irq |
41 | _fiq: .word _fiq | 41 | _fiq: .word _fiq |
42 | _pad: .word 0x12345678 /* now 16*4=64 */ | 42 | _pad: .word 0x12345678 /* now 16*4=64 */ |
43 | #else | 43 | #else |
44 | _undefined_instruction: .word undefined_instruction | 44 | _undefined_instruction: .word undefined_instruction |
45 | _software_interrupt: .word software_interrupt | 45 | _software_interrupt: .word software_interrupt |
46 | _prefetch_abort: .word prefetch_abort | 46 | _prefetch_abort: .word prefetch_abort |
47 | _data_abort: .word data_abort | 47 | _data_abort: .word data_abort |
48 | _not_used: .word not_used | 48 | _not_used: .word not_used |
49 | _irq: .word irq | 49 | _irq: .word irq |
50 | _fiq: .word fiq | 50 | _fiq: .word fiq |
51 | _pad: .word 0x12345678 /* now 16*4=64 */ | 51 | _pad: .word 0x12345678 /* now 16*4=64 */ |
52 | #endif /* CONFIG_SPL_BUILD */ | 52 | #endif /* CONFIG_SPL_BUILD */ |
53 | 53 | ||
54 | .balignl 16,0xdeadbeef | 54 | .balignl 16,0xdeadbeef |
55 | 55 | ||
56 | 56 | ||
57 | /* | 57 | /* |
58 | ************************************************************************* | 58 | ************************************************************************* |
59 | * | 59 | * |
60 | * Startup Code (reset vector) | 60 | * Startup Code (reset vector) |
61 | * | 61 | * |
62 | * do important init only if we don't start from RAM! | 62 | * do important init only if we don't start from RAM! |
63 | * relocate armboot to ram | 63 | * relocate armboot to ram |
64 | * setup stack | 64 | * setup stack |
65 | * jump to second stage | 65 | * jump to second stage |
66 | * | 66 | * |
67 | ************************************************************************* | 67 | ************************************************************************* |
68 | */ | 68 | */ |
69 | 69 | ||
70 | .globl _TEXT_BASE | ||
71 | _TEXT_BASE: | ||
72 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
73 | .word CONFIG_SPL_TEXT_BASE | ||
74 | #else | ||
75 | .word CONFIG_SYS_TEXT_BASE | ||
76 | #endif | ||
77 | |||
78 | /* | ||
79 | * These are defined in the board-specific linker script. | ||
80 | * Subtracting _start from them lets the linker put their | ||
81 | * relative position in the executable instead of leaving | ||
82 | * them null. | ||
83 | */ | ||
84 | .globl _bss_start_ofs | ||
85 | _bss_start_ofs: | ||
86 | .word __bss_start - _start | ||
87 | |||
88 | .globl _bss_end_ofs | ||
89 | _bss_end_ofs: | ||
90 | .word __bss_end - _start | ||
91 | |||
92 | .globl _end_ofs | ||
93 | _end_ofs: | ||
94 | .word _end - _start | ||
95 | |||
96 | #ifdef CONFIG_USE_IRQ | 70 | #ifdef CONFIG_USE_IRQ |
97 | /* IRQ stack memory (calculated at run-time) */ | 71 | /* IRQ stack memory (calculated at run-time) */ |
98 | .globl IRQ_STACK_START | 72 | .globl IRQ_STACK_START |
99 | IRQ_STACK_START: | 73 | IRQ_STACK_START: |
100 | .word 0x0badc0de | 74 | .word 0x0badc0de |
101 | 75 | ||
102 | /* IRQ stack memory (calculated at run-time) */ | 76 | /* IRQ stack memory (calculated at run-time) */ |
103 | .globl FIQ_STACK_START | 77 | .globl FIQ_STACK_START |
104 | FIQ_STACK_START: | 78 | FIQ_STACK_START: |
105 | .word 0x0badc0de | 79 | .word 0x0badc0de |
106 | #endif | 80 | #endif |
107 | 81 | ||
108 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 82 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
109 | .globl IRQ_STACK_START_IN | 83 | .globl IRQ_STACK_START_IN |
110 | IRQ_STACK_START_IN: | 84 | IRQ_STACK_START_IN: |
111 | .word 0x0badc0de | 85 | .word 0x0badc0de |
112 | 86 | ||
113 | /* | 87 | /* |
114 | * the actual reset code | 88 | * the actual reset code |
115 | */ | 89 | */ |
116 | 90 | ||
117 | reset: | 91 | reset: |
118 | /* | 92 | /* |
119 | * set the cpu to SVC32 mode | 93 | * set the cpu to SVC32 mode |
120 | */ | 94 | */ |
121 | mrs r0,cpsr | 95 | mrs r0,cpsr |
122 | bic r0,r0,#0x1f | 96 | bic r0,r0,#0x1f |
123 | orr r0,r0,#0xd3 | 97 | orr r0,r0,#0xd3 |
124 | msr cpsr,r0 | 98 | msr cpsr,r0 |
125 | 99 | ||
126 | /* | 100 | /* |
127 | * we do sys-critical inits only at reboot, | 101 | * we do sys-critical inits only at reboot, |
128 | * not when booting from ram! | 102 | * not when booting from ram! |
129 | */ | 103 | */ |
130 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 104 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
131 | bl cpu_init_crit | 105 | bl cpu_init_crit |
132 | #endif | 106 | #endif |
133 | 107 | ||
134 | bl _main | 108 | bl _main |
135 | 109 | ||
136 | /*------------------------------------------------------------------------------*/ | 110 | /*------------------------------------------------------------------------------*/ |
137 | 111 | ||
138 | .globl c_runtime_cpu_setup | 112 | .globl c_runtime_cpu_setup |
139 | c_runtime_cpu_setup: | 113 | c_runtime_cpu_setup: |
140 | 114 | ||
141 | mov pc, lr | 115 | mov pc, lr |
142 | 116 | ||
143 | /* | 117 | /* |
144 | ************************************************************************* | 118 | ************************************************************************* |
145 | * | 119 | * |
146 | * CPU_init_critical registers | 120 | * CPU_init_critical registers |
147 | * | 121 | * |
148 | * setup important registers | 122 | * setup important registers |
149 | * setup memory timing | 123 | * setup memory timing |
150 | * | 124 | * |
151 | ************************************************************************* | 125 | ************************************************************************* |
152 | */ | 126 | */ |
153 | 127 | ||
154 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 128 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
155 | cpu_init_crit: | 129 | cpu_init_crit: |
156 | 130 | ||
157 | mov ip, lr | 131 | mov ip, lr |
158 | /* | 132 | /* |
159 | * before relocating, we have to setup RAM timing | 133 | * before relocating, we have to setup RAM timing |
160 | * because memory timing is board-dependent, you will | 134 | * because memory timing is board-dependent, you will |
161 | * find a lowlevel_init.S in your board directory. | 135 | * find a lowlevel_init.S in your board directory. |
162 | */ | 136 | */ |
163 | bl lowlevel_init | 137 | bl lowlevel_init |
164 | mov lr, ip | 138 | mov lr, ip |
165 | 139 | ||
166 | mov pc, lr | 140 | mov pc, lr |
167 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ | 141 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ |
168 | 142 | ||
169 | 143 | ||
170 | #ifndef CONFIG_SPL_BUILD | 144 | #ifndef CONFIG_SPL_BUILD |
171 | /* | 145 | /* |
172 | ************************************************************************* | 146 | ************************************************************************* |
173 | * | 147 | * |
174 | * Interrupt handling | 148 | * Interrupt handling |
175 | * | 149 | * |
176 | ************************************************************************* | 150 | ************************************************************************* |
177 | */ | 151 | */ |
178 | 152 | ||
179 | @ | 153 | @ |
180 | @ IRQ stack frame. | 154 | @ IRQ stack frame. |
181 | @ | 155 | @ |
182 | #define S_FRAME_SIZE 72 | 156 | #define S_FRAME_SIZE 72 |
183 | 157 | ||
184 | #define S_OLD_R0 68 | 158 | #define S_OLD_R0 68 |
185 | #define S_PSR 64 | 159 | #define S_PSR 64 |
186 | #define S_PC 60 | 160 | #define S_PC 60 |
187 | #define S_LR 56 | 161 | #define S_LR 56 |
188 | #define S_SP 52 | 162 | #define S_SP 52 |
189 | 163 | ||
190 | #define S_IP 48 | 164 | #define S_IP 48 |
191 | #define S_FP 44 | 165 | #define S_FP 44 |
192 | #define S_R10 40 | 166 | #define S_R10 40 |
193 | #define S_R9 36 | 167 | #define S_R9 36 |
194 | #define S_R8 32 | 168 | #define S_R8 32 |
195 | #define S_R7 28 | 169 | #define S_R7 28 |
196 | #define S_R6 24 | 170 | #define S_R6 24 |
197 | #define S_R5 20 | 171 | #define S_R5 20 |
198 | #define S_R4 16 | 172 | #define S_R4 16 |
199 | #define S_R3 12 | 173 | #define S_R3 12 |
200 | #define S_R2 8 | 174 | #define S_R2 8 |
201 | #define S_R1 4 | 175 | #define S_R1 4 |
202 | #define S_R0 0 | 176 | #define S_R0 0 |
203 | 177 | ||
204 | #define MODE_SVC 0x13 | 178 | #define MODE_SVC 0x13 |
205 | #define I_BIT 0x80 | 179 | #define I_BIT 0x80 |
206 | 180 | ||
207 | /* | 181 | /* |
208 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 182 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
209 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling | 183 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
210 | */ | 184 | */ |
211 | 185 | ||
212 | .macro bad_save_user_regs | 186 | .macro bad_save_user_regs |
213 | sub sp, sp, #S_FRAME_SIZE | 187 | sub sp, sp, #S_FRAME_SIZE |
214 | stmia sp, {r0 - r12} @ Calling r0-r12 | 188 | stmia sp, {r0 - r12} @ Calling r0-r12 |
215 | add r8, sp, #S_PC | 189 | add r8, sp, #S_PC |
216 | 190 | ||
217 | ldr r2, IRQ_STACK_START_IN | 191 | ldr r2, IRQ_STACK_START_IN |
218 | ldmia r2, {r2 - r4} @ get pc, cpsr, old_r0 | 192 | ldmia r2, {r2 - r4} @ get pc, cpsr, old_r0 |
219 | add r0, sp, #S_FRAME_SIZE @ restore sp_SVC | 193 | add r0, sp, #S_FRAME_SIZE @ restore sp_SVC |
220 | 194 | ||
221 | add r5, sp, #S_SP | 195 | add r5, sp, #S_SP |
222 | mov r1, lr | 196 | mov r1, lr |
223 | stmia r5, {r0 - r4} @ save sp_SVC, lr_SVC, pc, cpsr, old_r | 197 | stmia r5, {r0 - r4} @ save sp_SVC, lr_SVC, pc, cpsr, old_r |
224 | mov r0, sp | 198 | mov r0, sp |
225 | .endm | 199 | .endm |
226 | 200 | ||
227 | .macro irq_save_user_regs | 201 | .macro irq_save_user_regs |
228 | sub sp, sp, #S_FRAME_SIZE | 202 | sub sp, sp, #S_FRAME_SIZE |
229 | stmia sp, {r0 - r12} @ Calling r0-r12 | 203 | stmia sp, {r0 - r12} @ Calling r0-r12 |
230 | add r8, sp, #S_PC | 204 | add r8, sp, #S_PC |
231 | stmdb r8, {sp, lr}^ @ Calling SP, LR | 205 | stmdb r8, {sp, lr}^ @ Calling SP, LR |
232 | str lr, [r8, #0] @ Save calling PC | 206 | str lr, [r8, #0] @ Save calling PC |
233 | mrs r6, spsr | 207 | mrs r6, spsr |
234 | str r6, [r8, #4] @ Save CPSR | 208 | str r6, [r8, #4] @ Save CPSR |
235 | str r0, [r8, #8] @ Save OLD_R0 | 209 | str r0, [r8, #8] @ Save OLD_R0 |
236 | mov r0, sp | 210 | mov r0, sp |
237 | .endm | 211 | .endm |
238 | 212 | ||
239 | .macro irq_restore_user_regs | 213 | .macro irq_restore_user_regs |
240 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr | 214 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
241 | mov r0, r0 | 215 | mov r0, r0 |
242 | ldr lr, [sp, #S_PC] @ Get PC | 216 | ldr lr, [sp, #S_PC] @ Get PC |
243 | add sp, sp, #S_FRAME_SIZE | 217 | add sp, sp, #S_FRAME_SIZE |
244 | subs pc, lr, #4 @ return & move spsr_svc into cpsr | 218 | subs pc, lr, #4 @ return & move spsr_svc into cpsr |
245 | .endm | 219 | .endm |
246 | 220 | ||
247 | .macro get_bad_stack | 221 | .macro get_bad_stack |
248 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack | 222 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack |
249 | 223 | ||
250 | str lr, [r13] @ save caller lr / spsr | 224 | str lr, [r13] @ save caller lr / spsr |
251 | mrs lr, spsr | 225 | mrs lr, spsr |
252 | str lr, [r13, #4] | 226 | str lr, [r13, #4] |
253 | 227 | ||
254 | mov r13, #MODE_SVC @ prepare SVC-Mode | 228 | mov r13, #MODE_SVC @ prepare SVC-Mode |
255 | msr spsr_c, r13 | 229 | msr spsr_c, r13 |
256 | mov lr, pc | 230 | mov lr, pc |
257 | movs pc, lr | 231 | movs pc, lr |
258 | .endm | 232 | .endm |
259 | 233 | ||
260 | .macro get_irq_stack @ setup IRQ stack | 234 | .macro get_irq_stack @ setup IRQ stack |
261 | ldr sp, IRQ_STACK_START | 235 | ldr sp, IRQ_STACK_START |
262 | .endm | 236 | .endm |
263 | 237 | ||
264 | .macro get_fiq_stack @ setup FIQ stack | 238 | .macro get_fiq_stack @ setup FIQ stack |
265 | ldr sp, FIQ_STACK_START | 239 | ldr sp, FIQ_STACK_START |
266 | .endm | 240 | .endm |
267 | 241 | ||
268 | /* | 242 | /* |
269 | * exception handlers | 243 | * exception handlers |
270 | */ | 244 | */ |
271 | .align 5 | 245 | .align 5 |
272 | undefined_instruction: | 246 | undefined_instruction: |
273 | get_bad_stack | 247 | get_bad_stack |
274 | bad_save_user_regs | 248 | bad_save_user_regs |
275 | bl do_undefined_instruction | 249 | bl do_undefined_instruction |
276 | 250 | ||
277 | .align 5 | 251 | .align 5 |
278 | software_interrupt: | 252 | software_interrupt: |
279 | get_bad_stack | 253 | get_bad_stack |
280 | bad_save_user_regs | 254 | bad_save_user_regs |
281 | bl do_software_interrupt | 255 | bl do_software_interrupt |
282 | 256 | ||
283 | .align 5 | 257 | .align 5 |
284 | prefetch_abort: | 258 | prefetch_abort: |
285 | get_bad_stack | 259 | get_bad_stack |
286 | bad_save_user_regs | 260 | bad_save_user_regs |
287 | bl do_prefetch_abort | 261 | bl do_prefetch_abort |
288 | 262 | ||
289 | .align 5 | 263 | .align 5 |
290 | data_abort: | 264 | data_abort: |
291 | get_bad_stack | 265 | get_bad_stack |
292 | bad_save_user_regs | 266 | bad_save_user_regs |
293 | bl do_data_abort | 267 | bl do_data_abort |
294 | 268 | ||
295 | .align 5 | 269 | .align 5 |
296 | not_used: | 270 | not_used: |
297 | get_bad_stack | 271 | get_bad_stack |
298 | bad_save_user_regs | 272 | bad_save_user_regs |
299 | bl do_not_used | 273 | bl do_not_used |
300 | 274 | ||
301 | #ifdef CONFIG_USE_IRQ | 275 | #ifdef CONFIG_USE_IRQ |
302 | 276 | ||
303 | .align 5 | 277 | .align 5 |
304 | irq: | 278 | irq: |
305 | get_irq_stack | 279 | get_irq_stack |
306 | irq_save_user_regs | 280 | irq_save_user_regs |
307 | bl do_irq | 281 | bl do_irq |
308 | irq_restore_user_regs | 282 | irq_restore_user_regs |
309 | 283 | ||
310 | .align 5 | 284 | .align 5 |
311 | fiq: | 285 | fiq: |
312 | get_fiq_stack | 286 | get_fiq_stack |
313 | /* someone ought to write a more effiction fiq_save_user_regs */ | 287 | /* someone ought to write a more effiction fiq_save_user_regs */ |
314 | irq_save_user_regs | 288 | irq_save_user_regs |
315 | bl do_fiq | 289 | bl do_fiq |
316 | irq_restore_user_regs | 290 | irq_restore_user_regs |
317 | 291 | ||
318 | #else | 292 | #else |
319 | 293 | ||
320 | .align 5 | 294 | .align 5 |
321 | irq: | 295 | irq: |
322 | get_bad_stack | 296 | get_bad_stack |
323 | bad_save_user_regs | 297 | bad_save_user_regs |
324 | bl do_irq | 298 | bl do_irq |
325 | 299 | ||
326 | .align 5 | 300 | .align 5 |
327 | fiq: | 301 | fiq: |
328 | get_bad_stack | 302 | get_bad_stack |
329 | bad_save_user_regs | 303 | bad_save_user_regs |
330 | bl do_fiq | 304 | bl do_fiq |
331 | 305 | ||
332 | #endif | 306 | #endif |
333 | #endif /* CONFIG_SPL_BUILD */ | 307 | #endif /* CONFIG_SPL_BUILD */ |
334 | 308 |
arch/arm/cpu/arm920t/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for ARM920 CPU-core | 2 | * armboot - Startup Code for ARM920 CPU-core |
3 | * | 3 | * |
4 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> | 4 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> |
5 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> | 5 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> |
6 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> | 6 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> |
7 | * | 7 | * |
8 | * SPDX-License-Identifier: GPL-2.0+ | 8 | * SPDX-License-Identifier: GPL-2.0+ |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <asm-offsets.h> | 11 | #include <asm-offsets.h> |
12 | #include <common.h> | 12 | #include <common.h> |
13 | #include <config.h> | 13 | #include <config.h> |
14 | 14 | ||
15 | /* | 15 | /* |
16 | ************************************************************************* | 16 | ************************************************************************* |
17 | * | 17 | * |
18 | * Jump vector table as in table 3.1 in [1] | 18 | * Jump vector table as in table 3.1 in [1] |
19 | * | 19 | * |
20 | ************************************************************************* | 20 | ************************************************************************* |
21 | */ | 21 | */ |
22 | 22 | ||
23 | 23 | ||
24 | .globl _start | 24 | .globl _start |
25 | _start: b start_code | 25 | _start: b start_code |
26 | ldr pc, _undefined_instruction | 26 | ldr pc, _undefined_instruction |
27 | ldr pc, _software_interrupt | 27 | ldr pc, _software_interrupt |
28 | ldr pc, _prefetch_abort | 28 | ldr pc, _prefetch_abort |
29 | ldr pc, _data_abort | 29 | ldr pc, _data_abort |
30 | ldr pc, _not_used | 30 | ldr pc, _not_used |
31 | ldr pc, _irq | 31 | ldr pc, _irq |
32 | ldr pc, _fiq | 32 | ldr pc, _fiq |
33 | 33 | ||
34 | _undefined_instruction: .word undefined_instruction | 34 | _undefined_instruction: .word undefined_instruction |
35 | _software_interrupt: .word software_interrupt | 35 | _software_interrupt: .word software_interrupt |
36 | _prefetch_abort: .word prefetch_abort | 36 | _prefetch_abort: .word prefetch_abort |
37 | _data_abort: .word data_abort | 37 | _data_abort: .word data_abort |
38 | _not_used: .word not_used | 38 | _not_used: .word not_used |
39 | _irq: .word irq | 39 | _irq: .word irq |
40 | _fiq: .word fiq | 40 | _fiq: .word fiq |
41 | 41 | ||
42 | .balignl 16,0xdeadbeef | 42 | .balignl 16,0xdeadbeef |
43 | 43 | ||
44 | 44 | ||
45 | /* | 45 | /* |
46 | ************************************************************************* | 46 | ************************************************************************* |
47 | * | 47 | * |
48 | * Startup Code (called from the ARM reset exception vector) | 48 | * Startup Code (called from the ARM reset exception vector) |
49 | * | 49 | * |
50 | * do important init only if we don't start from memory! | 50 | * do important init only if we don't start from memory! |
51 | * relocate armboot to ram | 51 | * relocate armboot to ram |
52 | * setup stack | 52 | * setup stack |
53 | * jump to second stage | 53 | * jump to second stage |
54 | * | 54 | * |
55 | ************************************************************************* | 55 | ************************************************************************* |
56 | */ | 56 | */ |
57 | 57 | ||
58 | .globl _TEXT_BASE | ||
59 | _TEXT_BASE: | ||
60 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
61 | .word CONFIG_SPL_TEXT_BASE | ||
62 | #else | ||
63 | .word CONFIG_SYS_TEXT_BASE | ||
64 | #endif | ||
65 | |||
66 | /* | ||
67 | * These are defined in the board-specific linker script. | ||
68 | * Subtracting _start from them lets the linker put their | ||
69 | * relative position in the executable instead of leaving | ||
70 | * them null. | ||
71 | */ | ||
72 | .globl _bss_start_ofs | ||
73 | _bss_start_ofs: | ||
74 | .word __bss_start - _start | ||
75 | |||
76 | .globl _bss_end_ofs | ||
77 | _bss_end_ofs: | ||
78 | .word __bss_end - _start | ||
79 | |||
80 | .globl _end_ofs | ||
81 | _end_ofs: | ||
82 | .word _end - _start | ||
83 | |||
84 | #ifdef CONFIG_USE_IRQ | 58 | #ifdef CONFIG_USE_IRQ |
85 | /* IRQ stack memory (calculated at run-time) */ | 59 | /* IRQ stack memory (calculated at run-time) */ |
86 | .globl IRQ_STACK_START | 60 | .globl IRQ_STACK_START |
87 | IRQ_STACK_START: | 61 | IRQ_STACK_START: |
88 | .word 0x0badc0de | 62 | .word 0x0badc0de |
89 | 63 | ||
90 | /* IRQ stack memory (calculated at run-time) */ | 64 | /* IRQ stack memory (calculated at run-time) */ |
91 | .globl FIQ_STACK_START | 65 | .globl FIQ_STACK_START |
92 | FIQ_STACK_START: | 66 | FIQ_STACK_START: |
93 | .word 0x0badc0de | 67 | .word 0x0badc0de |
94 | #endif | 68 | #endif |
95 | 69 | ||
96 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 70 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
97 | .globl IRQ_STACK_START_IN | 71 | .globl IRQ_STACK_START_IN |
98 | IRQ_STACK_START_IN: | 72 | IRQ_STACK_START_IN: |
99 | .word 0x0badc0de | 73 | .word 0x0badc0de |
100 | 74 | ||
101 | /* | 75 | /* |
102 | * the actual start code | 76 | * the actual start code |
103 | */ | 77 | */ |
104 | 78 | ||
105 | start_code: | 79 | start_code: |
106 | /* | 80 | /* |
107 | * set the cpu to SVC32 mode | 81 | * set the cpu to SVC32 mode |
108 | */ | 82 | */ |
109 | mrs r0, cpsr | 83 | mrs r0, cpsr |
110 | bic r0, r0, #0x1f | 84 | bic r0, r0, #0x1f |
111 | orr r0, r0, #0xd3 | 85 | orr r0, r0, #0xd3 |
112 | msr cpsr, r0 | 86 | msr cpsr, r0 |
113 | 87 | ||
114 | #if defined(CONFIG_AT91RM9200DK) || defined(CONFIG_AT91RM9200EK) | 88 | #if defined(CONFIG_AT91RM9200DK) || defined(CONFIG_AT91RM9200EK) |
115 | /* | 89 | /* |
116 | * relocate exception table | 90 | * relocate exception table |
117 | */ | 91 | */ |
118 | ldr r0, =_start | 92 | ldr r0, =_start |
119 | ldr r1, =0x0 | 93 | ldr r1, =0x0 |
120 | mov r2, #16 | 94 | mov r2, #16 |
121 | copyex: | 95 | copyex: |
122 | subs r2, r2, #1 | 96 | subs r2, r2, #1 |
123 | ldr r3, [r0], #4 | 97 | ldr r3, [r0], #4 |
124 | str r3, [r1], #4 | 98 | str r3, [r1], #4 |
125 | bne copyex | 99 | bne copyex |
126 | #endif | 100 | #endif |
127 | 101 | ||
128 | #ifdef CONFIG_S3C24X0 | 102 | #ifdef CONFIG_S3C24X0 |
129 | /* turn off the watchdog */ | 103 | /* turn off the watchdog */ |
130 | 104 | ||
131 | # if defined(CONFIG_S3C2400) | 105 | # if defined(CONFIG_S3C2400) |
132 | # define pWTCON 0x15300000 | 106 | # define pWTCON 0x15300000 |
133 | # define INTMSK 0x14400008 /* Interrupt-Controller base addresses */ | 107 | # define INTMSK 0x14400008 /* Interrupt-Controller base addresses */ |
134 | # define CLKDIVN 0x14800014 /* clock divisor register */ | 108 | # define CLKDIVN 0x14800014 /* clock divisor register */ |
135 | #else | 109 | #else |
136 | # define pWTCON 0x53000000 | 110 | # define pWTCON 0x53000000 |
137 | # define INTMSK 0x4A000008 /* Interrupt-Controller base addresses */ | 111 | # define INTMSK 0x4A000008 /* Interrupt-Controller base addresses */ |
138 | # define INTSUBMSK 0x4A00001C | 112 | # define INTSUBMSK 0x4A00001C |
139 | # define CLKDIVN 0x4C000014 /* clock divisor register */ | 113 | # define CLKDIVN 0x4C000014 /* clock divisor register */ |
140 | # endif | 114 | # endif |
141 | 115 | ||
142 | ldr r0, =pWTCON | 116 | ldr r0, =pWTCON |
143 | mov r1, #0x0 | 117 | mov r1, #0x0 |
144 | str r1, [r0] | 118 | str r1, [r0] |
145 | 119 | ||
146 | /* | 120 | /* |
147 | * mask all IRQs by setting all bits in the INTMR - default | 121 | * mask all IRQs by setting all bits in the INTMR - default |
148 | */ | 122 | */ |
149 | mov r1, #0xffffffff | 123 | mov r1, #0xffffffff |
150 | ldr r0, =INTMSK | 124 | ldr r0, =INTMSK |
151 | str r1, [r0] | 125 | str r1, [r0] |
152 | # if defined(CONFIG_S3C2410) | 126 | # if defined(CONFIG_S3C2410) |
153 | ldr r1, =0x3ff | 127 | ldr r1, =0x3ff |
154 | ldr r0, =INTSUBMSK | 128 | ldr r0, =INTSUBMSK |
155 | str r1, [r0] | 129 | str r1, [r0] |
156 | # endif | 130 | # endif |
157 | 131 | ||
158 | /* FCLK:HCLK:PCLK = 1:2:4 */ | 132 | /* FCLK:HCLK:PCLK = 1:2:4 */ |
159 | /* default FCLK is 120 MHz ! */ | 133 | /* default FCLK is 120 MHz ! */ |
160 | ldr r0, =CLKDIVN | 134 | ldr r0, =CLKDIVN |
161 | mov r1, #3 | 135 | mov r1, #3 |
162 | str r1, [r0] | 136 | str r1, [r0] |
163 | #endif /* CONFIG_S3C24X0 */ | 137 | #endif /* CONFIG_S3C24X0 */ |
164 | 138 | ||
165 | /* | 139 | /* |
166 | * we do sys-critical inits only at reboot, | 140 | * we do sys-critical inits only at reboot, |
167 | * not when booting from ram! | 141 | * not when booting from ram! |
168 | */ | 142 | */ |
169 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 143 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
170 | bl cpu_init_crit | 144 | bl cpu_init_crit |
171 | #endif | 145 | #endif |
172 | 146 | ||
173 | bl _main | 147 | bl _main |
174 | 148 | ||
175 | /*------------------------------------------------------------------------------*/ | 149 | /*------------------------------------------------------------------------------*/ |
176 | 150 | ||
177 | .globl c_runtime_cpu_setup | 151 | .globl c_runtime_cpu_setup |
178 | c_runtime_cpu_setup: | 152 | c_runtime_cpu_setup: |
179 | 153 | ||
180 | mov pc, lr | 154 | mov pc, lr |
181 | 155 | ||
182 | /* | 156 | /* |
183 | ************************************************************************* | 157 | ************************************************************************* |
184 | * | 158 | * |
185 | * CPU_init_critical registers | 159 | * CPU_init_critical registers |
186 | * | 160 | * |
187 | * setup important registers | 161 | * setup important registers |
188 | * setup memory timing | 162 | * setup memory timing |
189 | * | 163 | * |
190 | ************************************************************************* | 164 | ************************************************************************* |
191 | */ | 165 | */ |
192 | 166 | ||
193 | 167 | ||
194 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 168 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
195 | cpu_init_crit: | 169 | cpu_init_crit: |
196 | /* | 170 | /* |
197 | * flush v4 I/D caches | 171 | * flush v4 I/D caches |
198 | */ | 172 | */ |
199 | mov r0, #0 | 173 | mov r0, #0 |
200 | mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */ | 174 | mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */ |
201 | mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */ | 175 | mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */ |
202 | 176 | ||
203 | /* | 177 | /* |
204 | * disable MMU stuff and caches | 178 | * disable MMU stuff and caches |
205 | */ | 179 | */ |
206 | mrc p15, 0, r0, c1, c0, 0 | 180 | mrc p15, 0, r0, c1, c0, 0 |
207 | bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) | 181 | bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) |
208 | bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) | 182 | bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) |
209 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align | 183 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align |
210 | orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache | 184 | orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache |
211 | mcr p15, 0, r0, c1, c0, 0 | 185 | mcr p15, 0, r0, c1, c0, 0 |
212 | 186 | ||
213 | /* | 187 | /* |
214 | * before relocating, we have to setup RAM timing | 188 | * before relocating, we have to setup RAM timing |
215 | * because memory timing is board-dependend, you will | 189 | * because memory timing is board-dependend, you will |
216 | * find a lowlevel_init.S in your board directory. | 190 | * find a lowlevel_init.S in your board directory. |
217 | */ | 191 | */ |
218 | mov ip, lr | 192 | mov ip, lr |
219 | 193 | ||
220 | bl lowlevel_init | 194 | bl lowlevel_init |
221 | 195 | ||
222 | mov lr, ip | 196 | mov lr, ip |
223 | mov pc, lr | 197 | mov pc, lr |
224 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ | 198 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ |
225 | 199 | ||
226 | /* | 200 | /* |
227 | ************************************************************************* | 201 | ************************************************************************* |
228 | * | 202 | * |
229 | * Interrupt handling | 203 | * Interrupt handling |
230 | * | 204 | * |
231 | ************************************************************************* | 205 | ************************************************************************* |
232 | */ | 206 | */ |
233 | 207 | ||
234 | @ | 208 | @ |
235 | @ IRQ stack frame. | 209 | @ IRQ stack frame. |
236 | @ | 210 | @ |
237 | #define S_FRAME_SIZE 72 | 211 | #define S_FRAME_SIZE 72 |
238 | 212 | ||
239 | #define S_OLD_R0 68 | 213 | #define S_OLD_R0 68 |
240 | #define S_PSR 64 | 214 | #define S_PSR 64 |
241 | #define S_PC 60 | 215 | #define S_PC 60 |
242 | #define S_LR 56 | 216 | #define S_LR 56 |
243 | #define S_SP 52 | 217 | #define S_SP 52 |
244 | 218 | ||
245 | #define S_IP 48 | 219 | #define S_IP 48 |
246 | #define S_FP 44 | 220 | #define S_FP 44 |
247 | #define S_R10 40 | 221 | #define S_R10 40 |
248 | #define S_R9 36 | 222 | #define S_R9 36 |
249 | #define S_R8 32 | 223 | #define S_R8 32 |
250 | #define S_R7 28 | 224 | #define S_R7 28 |
251 | #define S_R6 24 | 225 | #define S_R6 24 |
252 | #define S_R5 20 | 226 | #define S_R5 20 |
253 | #define S_R4 16 | 227 | #define S_R4 16 |
254 | #define S_R3 12 | 228 | #define S_R3 12 |
255 | #define S_R2 8 | 229 | #define S_R2 8 |
256 | #define S_R1 4 | 230 | #define S_R1 4 |
257 | #define S_R0 0 | 231 | #define S_R0 0 |
258 | 232 | ||
259 | #define MODE_SVC 0x13 | 233 | #define MODE_SVC 0x13 |
260 | #define I_BIT 0x80 | 234 | #define I_BIT 0x80 |
261 | 235 | ||
262 | /* | 236 | /* |
263 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 237 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
264 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling | 238 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
265 | */ | 239 | */ |
266 | 240 | ||
267 | .macro bad_save_user_regs | 241 | .macro bad_save_user_regs |
268 | sub sp, sp, #S_FRAME_SIZE | 242 | sub sp, sp, #S_FRAME_SIZE |
269 | stmia sp, {r0 - r12} @ Calling r0-r12 | 243 | stmia sp, {r0 - r12} @ Calling r0-r12 |
270 | ldr r2, IRQ_STACK_START_IN | 244 | ldr r2, IRQ_STACK_START_IN |
271 | ldmia r2, {r2 - r3} @ get pc, cpsr | 245 | ldmia r2, {r2 - r3} @ get pc, cpsr |
272 | add r0, sp, #S_FRAME_SIZE @ restore sp_SVC | 246 | add r0, sp, #S_FRAME_SIZE @ restore sp_SVC |
273 | 247 | ||
274 | add r5, sp, #S_SP | 248 | add r5, sp, #S_SP |
275 | mov r1, lr | 249 | mov r1, lr |
276 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr | 250 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr |
277 | mov r0, sp | 251 | mov r0, sp |
278 | .endm | 252 | .endm |
279 | 253 | ||
280 | .macro irq_save_user_regs | 254 | .macro irq_save_user_regs |
281 | sub sp, sp, #S_FRAME_SIZE | 255 | sub sp, sp, #S_FRAME_SIZE |
282 | stmia sp, {r0 - r12} @ Calling r0-r12 | 256 | stmia sp, {r0 - r12} @ Calling r0-r12 |
283 | add r7, sp, #S_PC | 257 | add r7, sp, #S_PC |
284 | stmdb r7, {sp, lr}^ @ Calling SP, LR | 258 | stmdb r7, {sp, lr}^ @ Calling SP, LR |
285 | str lr, [r7, #0] @ Save calling PC | 259 | str lr, [r7, #0] @ Save calling PC |
286 | mrs r6, spsr | 260 | mrs r6, spsr |
287 | str r6, [r7, #4] @ Save CPSR | 261 | str r6, [r7, #4] @ Save CPSR |
288 | str r0, [r7, #8] @ Save OLD_R0 | 262 | str r0, [r7, #8] @ Save OLD_R0 |
289 | mov r0, sp | 263 | mov r0, sp |
290 | .endm | 264 | .endm |
291 | 265 | ||
292 | .macro irq_restore_user_regs | 266 | .macro irq_restore_user_regs |
293 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr | 267 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
294 | mov r0, r0 | 268 | mov r0, r0 |
295 | ldr lr, [sp, #S_PC] @ Get PC | 269 | ldr lr, [sp, #S_PC] @ Get PC |
296 | add sp, sp, #S_FRAME_SIZE | 270 | add sp, sp, #S_FRAME_SIZE |
297 | /* return & move spsr_svc into cpsr */ | 271 | /* return & move spsr_svc into cpsr */ |
298 | subs pc, lr, #4 | 272 | subs pc, lr, #4 |
299 | .endm | 273 | .endm |
300 | 274 | ||
301 | .macro get_bad_stack | 275 | .macro get_bad_stack |
302 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack | 276 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack |
303 | 277 | ||
304 | str lr, [r13] @ save caller lr / spsr | 278 | str lr, [r13] @ save caller lr / spsr |
305 | mrs lr, spsr | 279 | mrs lr, spsr |
306 | str lr, [r13, #4] | 280 | str lr, [r13, #4] |
307 | 281 | ||
308 | mov r13, #MODE_SVC @ prepare SVC-Mode | 282 | mov r13, #MODE_SVC @ prepare SVC-Mode |
309 | @ msr spsr_c, r13 | 283 | @ msr spsr_c, r13 |
310 | msr spsr, r13 | 284 | msr spsr, r13 |
311 | mov lr, pc | 285 | mov lr, pc |
312 | movs pc, lr | 286 | movs pc, lr |
313 | .endm | 287 | .endm |
314 | 288 | ||
315 | .macro get_irq_stack @ setup IRQ stack | 289 | .macro get_irq_stack @ setup IRQ stack |
316 | ldr sp, IRQ_STACK_START | 290 | ldr sp, IRQ_STACK_START |
317 | .endm | 291 | .endm |
318 | 292 | ||
319 | .macro get_fiq_stack @ setup FIQ stack | 293 | .macro get_fiq_stack @ setup FIQ stack |
320 | ldr sp, FIQ_STACK_START | 294 | ldr sp, FIQ_STACK_START |
321 | .endm | 295 | .endm |
322 | 296 | ||
323 | /* | 297 | /* |
324 | * exception handlers | 298 | * exception handlers |
325 | */ | 299 | */ |
326 | .align 5 | 300 | .align 5 |
327 | undefined_instruction: | 301 | undefined_instruction: |
328 | get_bad_stack | 302 | get_bad_stack |
329 | bad_save_user_regs | 303 | bad_save_user_regs |
330 | bl do_undefined_instruction | 304 | bl do_undefined_instruction |
331 | 305 | ||
332 | .align 5 | 306 | .align 5 |
333 | software_interrupt: | 307 | software_interrupt: |
334 | get_bad_stack | 308 | get_bad_stack |
335 | bad_save_user_regs | 309 | bad_save_user_regs |
336 | bl do_software_interrupt | 310 | bl do_software_interrupt |
337 | 311 | ||
338 | .align 5 | 312 | .align 5 |
339 | prefetch_abort: | 313 | prefetch_abort: |
340 | get_bad_stack | 314 | get_bad_stack |
341 | bad_save_user_regs | 315 | bad_save_user_regs |
342 | bl do_prefetch_abort | 316 | bl do_prefetch_abort |
343 | 317 | ||
344 | .align 5 | 318 | .align 5 |
345 | data_abort: | 319 | data_abort: |
346 | get_bad_stack | 320 | get_bad_stack |
347 | bad_save_user_regs | 321 | bad_save_user_regs |
348 | bl do_data_abort | 322 | bl do_data_abort |
349 | 323 | ||
350 | .align 5 | 324 | .align 5 |
351 | not_used: | 325 | not_used: |
352 | get_bad_stack | 326 | get_bad_stack |
353 | bad_save_user_regs | 327 | bad_save_user_regs |
354 | bl do_not_used | 328 | bl do_not_used |
355 | 329 | ||
356 | #ifdef CONFIG_USE_IRQ | 330 | #ifdef CONFIG_USE_IRQ |
357 | 331 | ||
358 | .align 5 | 332 | .align 5 |
359 | irq: | 333 | irq: |
360 | get_irq_stack | 334 | get_irq_stack |
361 | irq_save_user_regs | 335 | irq_save_user_regs |
362 | bl do_irq | 336 | bl do_irq |
363 | irq_restore_user_regs | 337 | irq_restore_user_regs |
364 | 338 | ||
365 | .align 5 | 339 | .align 5 |
366 | fiq: | 340 | fiq: |
367 | get_fiq_stack | 341 | get_fiq_stack |
368 | /* someone ought to write a more effiction fiq_save_user_regs */ | 342 | /* someone ought to write a more effiction fiq_save_user_regs */ |
369 | irq_save_user_regs | 343 | irq_save_user_regs |
370 | bl do_fiq | 344 | bl do_fiq |
371 | irq_restore_user_regs | 345 | irq_restore_user_regs |
372 | 346 | ||
373 | #else | 347 | #else |
374 | 348 | ||
375 | .align 5 | 349 | .align 5 |
376 | irq: | 350 | irq: |
377 | get_bad_stack | 351 | get_bad_stack |
378 | bad_save_user_regs | 352 | bad_save_user_regs |
379 | bl do_irq | 353 | bl do_irq |
380 | 354 | ||
381 | .align 5 | 355 | .align 5 |
382 | fiq: | 356 | fiq: |
383 | get_bad_stack | 357 | get_bad_stack |
384 | bad_save_user_regs | 358 | bad_save_user_regs |
385 | bl do_fiq | 359 | bl do_fiq |
386 | 360 | ||
387 | #endif | 361 | #endif |
388 | 362 |
arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
1 | /* | 1 | /* |
2 | * Memory Setup stuff - taken from blob memsetup.S | 2 | * Memory Setup stuff - taken from blob memsetup.S |
3 | * | 3 | * |
4 | * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and | 4 | * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and |
5 | * Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl) | 5 | * Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl) |
6 | * | 6 | * |
7 | * Copyright (C) 2008 Ronetix Ilko Iliev (www.ronetix.at) | 7 | * Copyright (C) 2008 Ronetix Ilko Iliev (www.ronetix.at) |
8 | * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 8 | * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> |
9 | * | 9 | * |
10 | * SPDX-License-Identifier: GPL-2.0+ | 10 | * SPDX-License-Identifier: GPL-2.0+ |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <config.h> | 13 | #include <config.h> |
14 | #include <asm/arch/hardware.h> | 14 | #include <asm/arch/hardware.h> |
15 | #include <asm/arch/at91_pmc.h> | 15 | #include <asm/arch/at91_pmc.h> |
16 | #include <asm/arch/at91_wdt.h> | 16 | #include <asm/arch/at91_wdt.h> |
17 | #include <asm/arch/at91_pio.h> | 17 | #include <asm/arch/at91_pio.h> |
18 | #include <asm/arch/at91_matrix.h> | 18 | #include <asm/arch/at91_matrix.h> |
19 | #include <asm/arch/at91sam9_sdramc.h> | 19 | #include <asm/arch/at91sam9_sdramc.h> |
20 | #include <asm/arch/at91sam9_smc.h> | 20 | #include <asm/arch/at91sam9_smc.h> |
21 | #include <asm/arch/at91_rstc.h> | 21 | #include <asm/arch/at91_rstc.h> |
22 | #ifdef CONFIG_ATMEL_LEGACY | 22 | #ifdef CONFIG_ATMEL_LEGACY |
23 | #include <asm/arch/at91sam9_matrix.h> | 23 | #include <asm/arch/at91sam9_matrix.h> |
24 | #endif | 24 | #endif |
25 | #ifndef CONFIG_SYS_MATRIX_EBICSA_VAL | 25 | #ifndef CONFIG_SYS_MATRIX_EBICSA_VAL |
26 | #define CONFIG_SYS_MATRIX_EBICSA_VAL CONFIG_SYS_MATRIX_EBI0CSA_VAL | 26 | #define CONFIG_SYS_MATRIX_EBICSA_VAL CONFIG_SYS_MATRIX_EBI0CSA_VAL |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | _TEXT_BASE: | ||
30 | .word CONFIG_SYS_TEXT_BASE | ||
31 | |||
32 | .globl lowlevel_init | 29 | .globl lowlevel_init |
33 | .type lowlevel_init,function | 30 | .type lowlevel_init,function |
34 | lowlevel_init: | 31 | lowlevel_init: |
35 | 32 | ||
36 | mov r5, pc /* r5 = POS1 + 4 current */ | ||
37 | POS1: | 33 | POS1: |
34 | adr r5, POS1 /* r5 = POS1 run time */ | ||
38 | ldr r0, =POS1 /* r0 = POS1 compile */ | 35 | ldr r0, =POS1 /* r0 = POS1 compile */ |
39 | ldr r2, _TEXT_BASE | ||
40 | sub r0, r0, r2 /* r0 = POS1-_TEXT_BASE (POS1 relative) */ | ||
41 | sub r5, r5, r0 /* r0 = CONFIG_SYS_TEXT_BASE-1 */ | 36 | sub r5, r5, r0 /* r0 = CONFIG_SYS_TEXT_BASE-1 */ |
42 | sub r5, r5, #4 /* r1 = text base - current */ | ||
43 | 37 | ||
44 | /* memory control configuration 1 */ | 38 | /* memory control configuration 1 */ |
45 | ldr r0, =SMRDATA | 39 | ldr r0, =SMRDATA |
46 | ldr r2, =SMRDATA1 | 40 | ldr r2, =SMRDATA1 |
47 | ldr r1, _TEXT_BASE | ||
48 | sub r0, r0, r1 | ||
49 | sub r2, r2, r1 | ||
50 | add r0, r0, r5 | 41 | add r0, r0, r5 |
51 | add r2, r2, r5 | 42 | add r2, r2, r5 |
52 | 0: | 43 | 0: |
53 | /* the address */ | 44 | /* the address */ |
54 | ldr r1, [r0], #4 | 45 | ldr r1, [r0], #4 |
55 | /* the value */ | 46 | /* the value */ |
56 | ldr r3, [r0], #4 | 47 | ldr r3, [r0], #4 |
57 | str r3, [r1] | 48 | str r3, [r1] |
58 | cmp r2, r0 | 49 | cmp r2, r0 |
59 | bne 0b | 50 | bne 0b |
60 | 51 | ||
61 | /* ---------------------------------------------------------------------------- | 52 | /* ---------------------------------------------------------------------------- |
62 | * PMC Init Step 1. | 53 | * PMC Init Step 1. |
63 | * ---------------------------------------------------------------------------- | 54 | * ---------------------------------------------------------------------------- |
64 | * - Check if the PLL is already initialized | 55 | * - Check if the PLL is already initialized |
65 | * ---------------------------------------------------------------------------- | 56 | * ---------------------------------------------------------------------------- |
66 | */ | 57 | */ |
67 | ldr r1, =(AT91_ASM_PMC_MCKR) | 58 | ldr r1, =(AT91_ASM_PMC_MCKR) |
68 | ldr r0, [r1] | 59 | ldr r0, [r1] |
69 | and r0, r0, #3 | 60 | and r0, r0, #3 |
70 | cmp r0, #0 | 61 | cmp r0, #0 |
71 | bne PLL_setup_end | 62 | bne PLL_setup_end |
72 | 63 | ||
73 | /* --------------------------------------------------------------------------- | 64 | /* --------------------------------------------------------------------------- |
74 | * - Enable the Main Oscillator | 65 | * - Enable the Main Oscillator |
75 | * --------------------------------------------------------------------------- | 66 | * --------------------------------------------------------------------------- |
76 | */ | 67 | */ |
77 | ldr r1, =(AT91_ASM_PMC_MOR) | 68 | ldr r1, =(AT91_ASM_PMC_MOR) |
78 | ldr r2, =(AT91_ASM_PMC_SR) | 69 | ldr r2, =(AT91_ASM_PMC_SR) |
79 | /* Main oscillator Enable register PMC_MOR: */ | 70 | /* Main oscillator Enable register PMC_MOR: */ |
80 | ldr r0, =CONFIG_SYS_MOR_VAL | 71 | ldr r0, =CONFIG_SYS_MOR_VAL |
81 | str r0, [r1] | 72 | str r0, [r1] |
82 | 73 | ||
83 | /* Reading the PMC Status to detect when the Main Oscillator is enabled */ | 74 | /* Reading the PMC Status to detect when the Main Oscillator is enabled */ |
84 | mov r4, #AT91_PMC_IXR_MOSCS | 75 | mov r4, #AT91_PMC_IXR_MOSCS |
85 | MOSCS_Loop: | 76 | MOSCS_Loop: |
86 | ldr r3, [r2] | 77 | ldr r3, [r2] |
87 | and r3, r4, r3 | 78 | and r3, r4, r3 |
88 | cmp r3, #AT91_PMC_IXR_MOSCS | 79 | cmp r3, #AT91_PMC_IXR_MOSCS |
89 | bne MOSCS_Loop | 80 | bne MOSCS_Loop |
90 | 81 | ||
91 | /* ---------------------------------------------------------------------------- | 82 | /* ---------------------------------------------------------------------------- |
92 | * PMC Init Step 2. | 83 | * PMC Init Step 2. |
93 | * ---------------------------------------------------------------------------- | 84 | * ---------------------------------------------------------------------------- |
94 | * Setup PLLA | 85 | * Setup PLLA |
95 | * ---------------------------------------------------------------------------- | 86 | * ---------------------------------------------------------------------------- |
96 | */ | 87 | */ |
97 | ldr r1, =(AT91_ASM_PMC_PLLAR) | 88 | ldr r1, =(AT91_ASM_PMC_PLLAR) |
98 | ldr r0, =CONFIG_SYS_PLLAR_VAL | 89 | ldr r0, =CONFIG_SYS_PLLAR_VAL |
99 | str r0, [r1] | 90 | str r0, [r1] |
100 | 91 | ||
101 | /* Reading the PMC Status register to detect when the PLLA is locked */ | 92 | /* Reading the PMC Status register to detect when the PLLA is locked */ |
102 | mov r4, #AT91_PMC_IXR_LOCKA | 93 | mov r4, #AT91_PMC_IXR_LOCKA |
103 | MOSCS_Loop1: | 94 | MOSCS_Loop1: |
104 | ldr r3, [r2] | 95 | ldr r3, [r2] |
105 | and r3, r4, r3 | 96 | and r3, r4, r3 |
106 | cmp r3, #AT91_PMC_IXR_LOCKA | 97 | cmp r3, #AT91_PMC_IXR_LOCKA |
107 | bne MOSCS_Loop1 | 98 | bne MOSCS_Loop1 |
108 | 99 | ||
109 | /* ---------------------------------------------------------------------------- | 100 | /* ---------------------------------------------------------------------------- |
110 | * PMC Init Step 3. | 101 | * PMC Init Step 3. |
111 | * ---------------------------------------------------------------------------- | 102 | * ---------------------------------------------------------------------------- |
112 | * - Switch on the Main Oscillator | 103 | * - Switch on the Main Oscillator |
113 | * ---------------------------------------------------------------------------- | 104 | * ---------------------------------------------------------------------------- |
114 | */ | 105 | */ |
115 | ldr r1, =(AT91_ASM_PMC_MCKR) | 106 | ldr r1, =(AT91_ASM_PMC_MCKR) |
116 | 107 | ||
117 | /* -Master Clock Controller register PMC_MCKR */ | 108 | /* -Master Clock Controller register PMC_MCKR */ |
118 | ldr r0, =CONFIG_SYS_MCKR1_VAL | 109 | ldr r0, =CONFIG_SYS_MCKR1_VAL |
119 | str r0, [r1] | 110 | str r0, [r1] |
120 | 111 | ||
121 | /* Reading the PMC Status to detect when the Master clock is ready */ | 112 | /* Reading the PMC Status to detect when the Master clock is ready */ |
122 | mov r4, #AT91_PMC_IXR_MCKRDY | 113 | mov r4, #AT91_PMC_IXR_MCKRDY |
123 | MCKRDY_Loop: | 114 | MCKRDY_Loop: |
124 | ldr r3, [r2] | 115 | ldr r3, [r2] |
125 | and r3, r4, r3 | 116 | and r3, r4, r3 |
126 | cmp r3, #AT91_PMC_IXR_MCKRDY | 117 | cmp r3, #AT91_PMC_IXR_MCKRDY |
127 | bne MCKRDY_Loop | 118 | bne MCKRDY_Loop |
128 | 119 | ||
129 | ldr r0, =CONFIG_SYS_MCKR2_VAL | 120 | ldr r0, =CONFIG_SYS_MCKR2_VAL |
130 | str r0, [r1] | 121 | str r0, [r1] |
131 | 122 | ||
132 | /* Reading the PMC Status to detect when the Master clock is ready */ | 123 | /* Reading the PMC Status to detect when the Master clock is ready */ |
133 | mov r4, #AT91_PMC_IXR_MCKRDY | 124 | mov r4, #AT91_PMC_IXR_MCKRDY |
134 | MCKRDY_Loop1: | 125 | MCKRDY_Loop1: |
135 | ldr r3, [r2] | 126 | ldr r3, [r2] |
136 | and r3, r4, r3 | 127 | and r3, r4, r3 |
137 | cmp r3, #AT91_PMC_IXR_MCKRDY | 128 | cmp r3, #AT91_PMC_IXR_MCKRDY |
138 | bne MCKRDY_Loop1 | 129 | bne MCKRDY_Loop1 |
139 | PLL_setup_end: | 130 | PLL_setup_end: |
140 | 131 | ||
141 | /* ---------------------------------------------------------------------------- | 132 | /* ---------------------------------------------------------------------------- |
142 | * - memory control configuration 2 | 133 | * - memory control configuration 2 |
143 | * ---------------------------------------------------------------------------- | 134 | * ---------------------------------------------------------------------------- |
144 | */ | 135 | */ |
145 | ldr r0, =(AT91_ASM_SDRAMC_TR) | 136 | ldr r0, =(AT91_ASM_SDRAMC_TR) |
146 | ldr r1, [r0] | 137 | ldr r1, [r0] |
147 | cmp r1, #0 | 138 | cmp r1, #0 |
148 | bne SDRAM_setup_end | 139 | bne SDRAM_setup_end |
149 | 140 | ||
150 | ldr r0, =SMRDATA1 | 141 | ldr r0, =SMRDATA1 |
151 | ldr r2, =SMRDATA2 | 142 | ldr r2, =SMRDATA2 |
152 | ldr r1, _TEXT_BASE | ||
153 | sub r0, r0, r1 | ||
154 | sub r2, r2, r1 | ||
155 | add r0, r0, r5 | 143 | add r0, r0, r5 |
156 | add r2, r2, r5 | 144 | add r2, r2, r5 |
157 | 2: | 145 | 2: |
158 | /* the address */ | 146 | /* the address */ |
159 | ldr r1, [r0], #4 | 147 | ldr r1, [r0], #4 |
160 | /* the value */ | 148 | /* the value */ |
161 | ldr r3, [r0], #4 | 149 | ldr r3, [r0], #4 |
162 | str r3, [r1] | 150 | str r3, [r1] |
163 | cmp r2, r0 | 151 | cmp r2, r0 |
164 | bne 2b | 152 | bne 2b |
165 | 153 | ||
166 | SDRAM_setup_end: | 154 | SDRAM_setup_end: |
167 | /* everything is fine now */ | 155 | /* everything is fine now */ |
168 | mov pc, lr | 156 | mov pc, lr |
169 | 157 | ||
170 | .ltorg | 158 | .ltorg |
171 | 159 | ||
172 | SMRDATA: | 160 | SMRDATA: |
173 | .word AT91_ASM_WDT_MR | 161 | .word AT91_ASM_WDT_MR |
174 | .word CONFIG_SYS_WDTC_WDMR_VAL | 162 | .word CONFIG_SYS_WDTC_WDMR_VAL |
175 | /* configure PIOx as EBI0 D[16-31] */ | 163 | /* configure PIOx as EBI0 D[16-31] */ |
176 | #if defined(CONFIG_AT91SAM9263) | 164 | #if defined(CONFIG_AT91SAM9263) |
177 | .word AT91_ASM_PIOD_PDR | 165 | .word AT91_ASM_PIOD_PDR |
178 | .word CONFIG_SYS_PIOD_PDR_VAL1 | 166 | .word CONFIG_SYS_PIOD_PDR_VAL1 |
179 | .word AT91_ASM_PIOD_PUDR | 167 | .word AT91_ASM_PIOD_PUDR |
180 | .word CONFIG_SYS_PIOD_PPUDR_VAL | 168 | .word CONFIG_SYS_PIOD_PPUDR_VAL |
181 | .word AT91_ASM_PIOD_ASR | 169 | .word AT91_ASM_PIOD_ASR |
182 | .word CONFIG_SYS_PIOD_PPUDR_VAL | 170 | .word CONFIG_SYS_PIOD_PPUDR_VAL |
183 | #elif defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9261) \ | 171 | #elif defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9261) \ |
184 | || defined(CONFIG_AT91SAM9G20) | 172 | || defined(CONFIG_AT91SAM9G20) |
185 | .word AT91_ASM_PIOC_PDR | 173 | .word AT91_ASM_PIOC_PDR |
186 | .word CONFIG_SYS_PIOC_PDR_VAL1 | 174 | .word CONFIG_SYS_PIOC_PDR_VAL1 |
187 | .word AT91_ASM_PIOC_PUDR | 175 | .word AT91_ASM_PIOC_PUDR |
188 | .word CONFIG_SYS_PIOC_PPUDR_VAL | 176 | .word CONFIG_SYS_PIOC_PPUDR_VAL |
189 | #endif | 177 | #endif |
190 | .word AT91_ASM_MATRIX_CSA0 | 178 | .word AT91_ASM_MATRIX_CSA0 |
191 | .word CONFIG_SYS_MATRIX_EBICSA_VAL | 179 | .word CONFIG_SYS_MATRIX_EBICSA_VAL |
192 | 180 | ||
193 | /* flash */ | 181 | /* flash */ |
194 | .word AT91_ASM_SMC_MODE0 | 182 | .word AT91_ASM_SMC_MODE0 |
195 | .word CONFIG_SYS_SMC0_MODE0_VAL | 183 | .word CONFIG_SYS_SMC0_MODE0_VAL |
196 | 184 | ||
197 | .word AT91_ASM_SMC_CYCLE0 | 185 | .word AT91_ASM_SMC_CYCLE0 |
198 | .word CONFIG_SYS_SMC0_CYCLE0_VAL | 186 | .word CONFIG_SYS_SMC0_CYCLE0_VAL |
199 | 187 | ||
200 | .word AT91_ASM_SMC_PULSE0 | 188 | .word AT91_ASM_SMC_PULSE0 |
201 | .word CONFIG_SYS_SMC0_PULSE0_VAL | 189 | .word CONFIG_SYS_SMC0_PULSE0_VAL |
202 | 190 | ||
203 | .word AT91_ASM_SMC_SETUP0 | 191 | .word AT91_ASM_SMC_SETUP0 |
204 | .word CONFIG_SYS_SMC0_SETUP0_VAL | 192 | .word CONFIG_SYS_SMC0_SETUP0_VAL |
205 | 193 | ||
206 | SMRDATA1: | 194 | SMRDATA1: |
207 | .word AT91_ASM_SDRAMC_MR | 195 | .word AT91_ASM_SDRAMC_MR |
208 | .word CONFIG_SYS_SDRC_MR_VAL1 | 196 | .word CONFIG_SYS_SDRC_MR_VAL1 |
209 | .word AT91_ASM_SDRAMC_TR | 197 | .word AT91_ASM_SDRAMC_TR |
210 | .word CONFIG_SYS_SDRC_TR_VAL1 | 198 | .word CONFIG_SYS_SDRC_TR_VAL1 |
211 | .word AT91_ASM_SDRAMC_CR | 199 | .word AT91_ASM_SDRAMC_CR |
212 | .word CONFIG_SYS_SDRC_CR_VAL | 200 | .word CONFIG_SYS_SDRC_CR_VAL |
213 | .word AT91_ASM_SDRAMC_MDR | 201 | .word AT91_ASM_SDRAMC_MDR |
214 | .word CONFIG_SYS_SDRC_MDR_VAL | 202 | .word CONFIG_SYS_SDRC_MDR_VAL |
215 | .word AT91_ASM_SDRAMC_MR | 203 | .word AT91_ASM_SDRAMC_MR |
216 | .word CONFIG_SYS_SDRC_MR_VAL2 | 204 | .word CONFIG_SYS_SDRC_MR_VAL2 |
217 | .word CONFIG_SYS_SDRAM_BASE | 205 | .word CONFIG_SYS_SDRAM_BASE |
218 | .word CONFIG_SYS_SDRAM_VAL1 | 206 | .word CONFIG_SYS_SDRAM_VAL1 |
219 | .word AT91_ASM_SDRAMC_MR | 207 | .word AT91_ASM_SDRAMC_MR |
220 | .word CONFIG_SYS_SDRC_MR_VAL3 | 208 | .word CONFIG_SYS_SDRC_MR_VAL3 |
221 | .word CONFIG_SYS_SDRAM_BASE | 209 | .word CONFIG_SYS_SDRAM_BASE |
222 | .word CONFIG_SYS_SDRAM_VAL2 | 210 | .word CONFIG_SYS_SDRAM_VAL2 |
223 | .word CONFIG_SYS_SDRAM_BASE | 211 | .word CONFIG_SYS_SDRAM_BASE |
224 | .word CONFIG_SYS_SDRAM_VAL3 | 212 | .word CONFIG_SYS_SDRAM_VAL3 |
225 | .word CONFIG_SYS_SDRAM_BASE | 213 | .word CONFIG_SYS_SDRAM_BASE |
226 | .word CONFIG_SYS_SDRAM_VAL4 | 214 | .word CONFIG_SYS_SDRAM_VAL4 |
227 | .word CONFIG_SYS_SDRAM_BASE | 215 | .word CONFIG_SYS_SDRAM_BASE |
228 | .word CONFIG_SYS_SDRAM_VAL5 | 216 | .word CONFIG_SYS_SDRAM_VAL5 |
229 | .word CONFIG_SYS_SDRAM_BASE | 217 | .word CONFIG_SYS_SDRAM_BASE |
230 | .word CONFIG_SYS_SDRAM_VAL6 | 218 | .word CONFIG_SYS_SDRAM_VAL6 |
231 | .word CONFIG_SYS_SDRAM_BASE | 219 | .word CONFIG_SYS_SDRAM_BASE |
232 | .word CONFIG_SYS_SDRAM_VAL7 | 220 | .word CONFIG_SYS_SDRAM_VAL7 |
233 | .word CONFIG_SYS_SDRAM_BASE | 221 | .word CONFIG_SYS_SDRAM_BASE |
234 | .word CONFIG_SYS_SDRAM_VAL8 | 222 | .word CONFIG_SYS_SDRAM_VAL8 |
235 | .word CONFIG_SYS_SDRAM_BASE | 223 | .word CONFIG_SYS_SDRAM_BASE |
236 | .word CONFIG_SYS_SDRAM_VAL9 | 224 | .word CONFIG_SYS_SDRAM_VAL9 |
237 | .word AT91_ASM_SDRAMC_MR | 225 | .word AT91_ASM_SDRAMC_MR |
238 | .word CONFIG_SYS_SDRC_MR_VAL4 | 226 | .word CONFIG_SYS_SDRC_MR_VAL4 |
239 | .word CONFIG_SYS_SDRAM_BASE | 227 | .word CONFIG_SYS_SDRAM_BASE |
240 | .word CONFIG_SYS_SDRAM_VAL10 | 228 | .word CONFIG_SYS_SDRAM_VAL10 |
241 | .word AT91_ASM_SDRAMC_MR | 229 | .word AT91_ASM_SDRAMC_MR |
242 | .word CONFIG_SYS_SDRC_MR_VAL5 | 230 | .word CONFIG_SYS_SDRC_MR_VAL5 |
243 | .word CONFIG_SYS_SDRAM_BASE | 231 | .word CONFIG_SYS_SDRAM_BASE |
244 | .word CONFIG_SYS_SDRAM_VAL11 | 232 | .word CONFIG_SYS_SDRAM_VAL11 |
245 | .word AT91_ASM_SDRAMC_TR | 233 | .word AT91_ASM_SDRAMC_TR |
246 | .word CONFIG_SYS_SDRC_TR_VAL2 | 234 | .word CONFIG_SYS_SDRC_TR_VAL2 |
247 | .word CONFIG_SYS_SDRAM_BASE | 235 | .word CONFIG_SYS_SDRAM_BASE |
248 | .word CONFIG_SYS_SDRAM_VAL12 | 236 | .word CONFIG_SYS_SDRAM_VAL12 |
249 | /* User reset enable*/ | 237 | /* User reset enable*/ |
250 | .word AT91_ASM_RSTC_MR | 238 | .word AT91_ASM_RSTC_MR |
251 | .word CONFIG_SYS_RSTC_RMR_VAL | 239 | .word CONFIG_SYS_RSTC_RMR_VAL |
252 | #ifdef CONFIG_SYS_MATRIX_MCFG_REMAP | 240 | #ifdef CONFIG_SYS_MATRIX_MCFG_REMAP |
253 | /* MATRIX_MCFG - REMAP all masters */ | 241 | /* MATRIX_MCFG - REMAP all masters */ |
254 | .word AT91_ASM_MATRIX_MCFG | 242 | .word AT91_ASM_MATRIX_MCFG |
255 | .word 0x1FF | 243 | .word 0x1FF |
256 | #endif | 244 | #endif |
257 | SMRDATA2: | 245 | SMRDATA2: |
258 | .word 0 | 246 | .word 0 |
arch/arm/cpu/arm926ejs/mxs/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for ARM926EJS CPU-core | 2 | * armboot - Startup Code for ARM926EJS CPU-core |
3 | * | 3 | * |
4 | * Copyright (c) 2003 Texas Instruments | 4 | * Copyright (c) 2003 Texas Instruments |
5 | * | 5 | * |
6 | * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------ | 6 | * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------ |
7 | * | 7 | * |
8 | * Copyright (c) 2001 Marius Groger <mag@sysgo.de> | 8 | * Copyright (c) 2001 Marius Groger <mag@sysgo.de> |
9 | * Copyright (c) 2002 Alex Zupke <azu@sysgo.de> | 9 | * Copyright (c) 2002 Alex Zupke <azu@sysgo.de> |
10 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> | 10 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> |
11 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> | 11 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> |
12 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> | 12 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> |
13 | * Copyright (c) 2010 Albert Aribaud <albert.u.boot@aribaud.net> | 13 | * Copyright (c) 2010 Albert Aribaud <albert.u.boot@aribaud.net> |
14 | * | 14 | * |
15 | * Change to support call back into iMX28 bootrom | 15 | * Change to support call back into iMX28 bootrom |
16 | * Copyright (c) 2011 Marek Vasut <marek.vasut@gmail.com> | 16 | * Copyright (c) 2011 Marek Vasut <marek.vasut@gmail.com> |
17 | * on behalf of DENX Software Engineering GmbH | 17 | * on behalf of DENX Software Engineering GmbH |
18 | * | 18 | * |
19 | * SPDX-License-Identifier: GPL-2.0+ | 19 | * SPDX-License-Identifier: GPL-2.0+ |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <asm-offsets.h> | 22 | #include <asm-offsets.h> |
23 | #include <config.h> | 23 | #include <config.h> |
24 | #include <common.h> | 24 | #include <common.h> |
25 | #include <version.h> | 25 | #include <version.h> |
26 | 26 | ||
27 | /* | 27 | /* |
28 | ************************************************************************* | 28 | ************************************************************************* |
29 | * | 29 | * |
30 | * Jump vector table as in table 3.1 in [1] | 30 | * Jump vector table as in table 3.1 in [1] |
31 | * | 31 | * |
32 | ************************************************************************* | 32 | ************************************************************************* |
33 | */ | 33 | */ |
34 | 34 | ||
35 | 35 | ||
36 | .globl _start | 36 | .globl _start |
37 | _start: | 37 | _start: |
38 | b reset | 38 | b reset |
39 | b undefined_instruction | 39 | b undefined_instruction |
40 | b software_interrupt | 40 | b software_interrupt |
41 | b prefetch_abort | 41 | b prefetch_abort |
42 | b data_abort | 42 | b data_abort |
43 | b not_used | 43 | b not_used |
44 | b irq | 44 | b irq |
45 | b fiq | 45 | b fiq |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Vector table, located at address 0x20. | 48 | * Vector table, located at address 0x20. |
49 | * This table allows the code running AFTER SPL, the U-Boot, to install it's | 49 | * This table allows the code running AFTER SPL, the U-Boot, to install it's |
50 | * interrupt handlers here. The problem is that the U-Boot is loaded into RAM, | 50 | * interrupt handlers here. The problem is that the U-Boot is loaded into RAM, |
51 | * including it's interrupt vectoring table and the table at 0x0 is still the | 51 | * including it's interrupt vectoring table and the table at 0x0 is still the |
52 | * SPLs. So if interrupt happens in U-Boot, the SPLs interrupt vectoring table | 52 | * SPLs. So if interrupt happens in U-Boot, the SPLs interrupt vectoring table |
53 | * is still used. | 53 | * is still used. |
54 | */ | 54 | */ |
55 | _vt_reset: | 55 | _vt_reset: |
56 | .word _reset | 56 | .word _reset |
57 | _vt_undefined_instruction: | 57 | _vt_undefined_instruction: |
58 | .word _hang | 58 | .word _hang |
59 | _vt_software_interrupt: | 59 | _vt_software_interrupt: |
60 | .word _hang | 60 | .word _hang |
61 | _vt_prefetch_abort: | 61 | _vt_prefetch_abort: |
62 | .word _hang | 62 | .word _hang |
63 | _vt_data_abort: | 63 | _vt_data_abort: |
64 | .word _hang | 64 | .word _hang |
65 | _vt_not_used: | 65 | _vt_not_used: |
66 | .word _reset | 66 | .word _reset |
67 | _vt_irq: | 67 | _vt_irq: |
68 | .word _hang | 68 | .word _hang |
69 | _vt_fiq: | 69 | _vt_fiq: |
70 | .word _hang | 70 | .word _hang |
71 | 71 | ||
72 | reset: | 72 | reset: |
73 | ldr pc, _vt_reset | 73 | ldr pc, _vt_reset |
74 | undefined_instruction: | 74 | undefined_instruction: |
75 | ldr pc, _vt_undefined_instruction | 75 | ldr pc, _vt_undefined_instruction |
76 | software_interrupt: | 76 | software_interrupt: |
77 | ldr pc, _vt_software_interrupt | 77 | ldr pc, _vt_software_interrupt |
78 | prefetch_abort: | 78 | prefetch_abort: |
79 | ldr pc, _vt_prefetch_abort | 79 | ldr pc, _vt_prefetch_abort |
80 | data_abort: | 80 | data_abort: |
81 | ldr pc, _vt_data_abort | 81 | ldr pc, _vt_data_abort |
82 | not_used: | 82 | not_used: |
83 | ldr pc, _vt_not_used | 83 | ldr pc, _vt_not_used |
84 | irq: | 84 | irq: |
85 | ldr pc, _vt_irq | 85 | ldr pc, _vt_irq |
86 | fiq: | 86 | fiq: |
87 | ldr pc, _vt_fiq | 87 | ldr pc, _vt_fiq |
88 | 88 | ||
89 | .balignl 16,0xdeadbeef | 89 | .balignl 16,0xdeadbeef |
90 | 90 | ||
91 | /* | 91 | /* |
92 | ************************************************************************* | 92 | ************************************************************************* |
93 | * | 93 | * |
94 | * Startup Code (reset vector) | 94 | * Startup Code (reset vector) |
95 | * | 95 | * |
96 | * do important init only if we don't start from memory! | 96 | * do important init only if we don't start from memory! |
97 | * setup Memory and board specific bits prior to relocation. | 97 | * setup Memory and board specific bits prior to relocation. |
98 | * relocate armboot to ram | 98 | * relocate armboot to ram |
99 | * setup stack | 99 | * setup stack |
100 | * | 100 | * |
101 | ************************************************************************* | 101 | ************************************************************************* |
102 | */ | 102 | */ |
103 | 103 | ||
104 | .globl _TEXT_BASE | ||
105 | _TEXT_BASE: | ||
106 | #ifdef CONFIG_SPL_TEXT_BASE | ||
107 | .word CONFIG_SPL_TEXT_BASE | ||
108 | #else | ||
109 | .word CONFIG_SYS_TEXT_BASE | ||
110 | #endif | ||
111 | |||
112 | /* | ||
113 | * These are defined in the board-specific linker script. | ||
114 | * Subtracting _start from them lets the linker put their | ||
115 | * relative position in the executable instead of leaving | ||
116 | * them null. | ||
117 | */ | ||
118 | .globl _bss_start_ofs | ||
119 | _bss_start_ofs: | ||
120 | .word __bss_start - _start | ||
121 | |||
122 | .globl _bss_end_ofs | ||
123 | _bss_end_ofs: | ||
124 | .word __bss_end - _start | ||
125 | |||
126 | .globl _end_ofs | ||
127 | _end_ofs: | ||
128 | .word _end - _start | ||
129 | |||
130 | #ifdef CONFIG_USE_IRQ | 104 | #ifdef CONFIG_USE_IRQ |
131 | /* IRQ stack memory (calculated at run-time) */ | 105 | /* IRQ stack memory (calculated at run-time) */ |
132 | .globl IRQ_STACK_START | 106 | .globl IRQ_STACK_START |
133 | IRQ_STACK_START: | 107 | IRQ_STACK_START: |
134 | .word 0x0badc0de | 108 | .word 0x0badc0de |
135 | 109 | ||
136 | /* IRQ stack memory (calculated at run-time) */ | 110 | /* IRQ stack memory (calculated at run-time) */ |
137 | .globl FIQ_STACK_START | 111 | .globl FIQ_STACK_START |
138 | FIQ_STACK_START: | 112 | FIQ_STACK_START: |
139 | .word 0x0badc0de | 113 | .word 0x0badc0de |
140 | #endif | 114 | #endif |
141 | 115 | ||
142 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 116 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
143 | .globl IRQ_STACK_START_IN | 117 | .globl IRQ_STACK_START_IN |
144 | IRQ_STACK_START_IN: | 118 | IRQ_STACK_START_IN: |
145 | .word 0x0badc0de | 119 | .word 0x0badc0de |
146 | 120 | ||
147 | /* | 121 | /* |
148 | * the actual reset code | 122 | * the actual reset code |
149 | */ | 123 | */ |
150 | 124 | ||
151 | _reset: | 125 | _reset: |
152 | /* | 126 | /* |
153 | * If the CPU is configured in "Wait JTAG connection mode", the stack | 127 | * If the CPU is configured in "Wait JTAG connection mode", the stack |
154 | * pointer is not configured and is zero. This will cause crash when | 128 | * pointer is not configured and is zero. This will cause crash when |
155 | * trying to push data onto stack right below here. Load the SP and make | 129 | * trying to push data onto stack right below here. Load the SP and make |
156 | * it point to the end of OCRAM if the SP is zero. | 130 | * it point to the end of OCRAM if the SP is zero. |
157 | */ | 131 | */ |
158 | cmp sp, #0x00000000 | 132 | cmp sp, #0x00000000 |
159 | ldreq sp, =CONFIG_SYS_INIT_SP_ADDR | 133 | ldreq sp, =CONFIG_SYS_INIT_SP_ADDR |
160 | 134 | ||
161 | /* | 135 | /* |
162 | * Store all registers on old stack pointer, this will allow us later to | 136 | * Store all registers on old stack pointer, this will allow us later to |
163 | * return to the BootROM and let the BootROM load U-Boot into RAM. | 137 | * return to the BootROM and let the BootROM load U-Boot into RAM. |
164 | * | 138 | * |
165 | * WARNING: Register r0 and r1 are used by the BootROM to pass data | 139 | * WARNING: Register r0 and r1 are used by the BootROM to pass data |
166 | * to the called code. Register r0 will contain arbitrary | 140 | * to the called code. Register r0 will contain arbitrary |
167 | * data that are set in the BootStream. In case this code | 141 | * data that are set in the BootStream. In case this code |
168 | * was started with CALL instruction, register r1 will contain | 142 | * was started with CALL instruction, register r1 will contain |
169 | * pointer to the return value this function can then set. | 143 | * pointer to the return value this function can then set. |
170 | * The code below MUST NOT CHANGE register r0 and r1 ! | 144 | * The code below MUST NOT CHANGE register r0 and r1 ! |
171 | */ | 145 | */ |
172 | push {r0-r12,r14} | 146 | push {r0-r12,r14} |
173 | 147 | ||
174 | /* Save control register c1 */ | 148 | /* Save control register c1 */ |
175 | mrc p15, 0, r2, c1, c0, 0 | 149 | mrc p15, 0, r2, c1, c0, 0 |
176 | push {r2} | 150 | push {r2} |
177 | 151 | ||
178 | /* Set the cpu to SVC32 mode and store old CPSR register content. */ | 152 | /* Set the cpu to SVC32 mode and store old CPSR register content. */ |
179 | mrs r2, cpsr | 153 | mrs r2, cpsr |
180 | push {r2} | 154 | push {r2} |
181 | bic r2, r2, #0x1f | 155 | bic r2, r2, #0x1f |
182 | orr r2, r2, #0xd3 | 156 | orr r2, r2, #0xd3 |
183 | msr cpsr, r2 | 157 | msr cpsr, r2 |
184 | 158 | ||
185 | bl board_init_ll | 159 | bl board_init_ll |
186 | 160 | ||
187 | /* Restore BootROM's CPU mode (especially FIQ). */ | 161 | /* Restore BootROM's CPU mode (especially FIQ). */ |
188 | pop {r2} | 162 | pop {r2} |
189 | msr cpsr,r2 | 163 | msr cpsr,r2 |
190 | 164 | ||
191 | /* | 165 | /* |
192 | * Restore c1 register. Especially set exception vector location | 166 | * Restore c1 register. Especially set exception vector location |
193 | * back to BootROM space which is required by bootrom for USB boot. | 167 | * back to BootROM space which is required by bootrom for USB boot. |
194 | */ | 168 | */ |
195 | pop {r2} | 169 | pop {r2} |
196 | mcr p15, 0, r2, c1, c0, 0 | 170 | mcr p15, 0, r2, c1, c0, 0 |
197 | 171 | ||
198 | pop {r0-r12,r14} | 172 | pop {r0-r12,r14} |
199 | 173 | ||
200 | /* | 174 | /* |
201 | * In case this code was started by the CALL instruction, the register | 175 | * In case this code was started by the CALL instruction, the register |
202 | * r0 is examined by the BootROM after this code returns. The value in | 176 | * r0 is examined by the BootROM after this code returns. The value in |
203 | * r0 must be set to 0 to indicate successful return. | 177 | * r0 must be set to 0 to indicate successful return. |
204 | */ | 178 | */ |
205 | mov r0, #0 | 179 | mov r0, #0 |
206 | 180 | ||
207 | bx lr | 181 | bx lr |
208 | 182 | ||
209 | _hang: | 183 | _hang: |
210 | ldr sp, _TEXT_BASE /* switch to abort stack */ | ||
211 | 1: | 184 | 1: |
212 | bl 1b /* hang and never return */ | 185 | bl 1b /* hang and never return */ |
213 | 186 |
arch/arm/cpu/arm926ejs/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for ARM926EJS CPU-core | 2 | * armboot - Startup Code for ARM926EJS CPU-core |
3 | * | 3 | * |
4 | * Copyright (c) 2003 Texas Instruments | 4 | * Copyright (c) 2003 Texas Instruments |
5 | * | 5 | * |
6 | * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------ | 6 | * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------ |
7 | * | 7 | * |
8 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> | 8 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> |
9 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> | 9 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> |
10 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> | 10 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> |
11 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> | 11 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> |
12 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> | 12 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> |
13 | * Copyright (c) 2010 Albert Aribaud <albert.u.boot@aribaud.net> | 13 | * Copyright (c) 2010 Albert Aribaud <albert.u.boot@aribaud.net> |
14 | * | 14 | * |
15 | * SPDX-License-Identifier: GPL-2.0+ | 15 | * SPDX-License-Identifier: GPL-2.0+ |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <asm-offsets.h> | 18 | #include <asm-offsets.h> |
19 | #include <config.h> | 19 | #include <config.h> |
20 | #include <common.h> | 20 | #include <common.h> |
21 | #include <version.h> | 21 | #include <version.h> |
22 | 22 | ||
23 | /* | 23 | /* |
24 | ************************************************************************* | 24 | ************************************************************************* |
25 | * | 25 | * |
26 | * Jump vector table as in table 3.1 in [1] | 26 | * Jump vector table as in table 3.1 in [1] |
27 | * | 27 | * |
28 | ************************************************************************* | 28 | ************************************************************************* |
29 | */ | 29 | */ |
30 | 30 | ||
31 | 31 | ||
32 | #ifdef CONFIG_SYS_DV_NOR_BOOT_CFG | 32 | #ifdef CONFIG_SYS_DV_NOR_BOOT_CFG |
33 | .globl _start | 33 | .globl _start |
34 | _start: | 34 | _start: |
35 | .globl _NOR_BOOT_CFG | 35 | .globl _NOR_BOOT_CFG |
36 | _NOR_BOOT_CFG: | 36 | _NOR_BOOT_CFG: |
37 | .word CONFIG_SYS_DV_NOR_BOOT_CFG | 37 | .word CONFIG_SYS_DV_NOR_BOOT_CFG |
38 | b reset | 38 | b reset |
39 | #else | 39 | #else |
40 | .globl _start | 40 | .globl _start |
41 | _start: | 41 | _start: |
42 | b reset | 42 | b reset |
43 | #endif | 43 | #endif |
44 | #ifdef CONFIG_SPL_BUILD | 44 | #ifdef CONFIG_SPL_BUILD |
45 | /* No exception handlers in preloader */ | 45 | /* No exception handlers in preloader */ |
46 | ldr pc, _hang | 46 | ldr pc, _hang |
47 | ldr pc, _hang | 47 | ldr pc, _hang |
48 | ldr pc, _hang | 48 | ldr pc, _hang |
49 | ldr pc, _hang | 49 | ldr pc, _hang |
50 | ldr pc, _hang | 50 | ldr pc, _hang |
51 | ldr pc, _hang | 51 | ldr pc, _hang |
52 | ldr pc, _hang | 52 | ldr pc, _hang |
53 | 53 | ||
54 | _hang: | 54 | _hang: |
55 | .word do_hang | 55 | .word do_hang |
56 | /* pad to 64 byte boundary */ | 56 | /* pad to 64 byte boundary */ |
57 | .word 0x12345678 | 57 | .word 0x12345678 |
58 | .word 0x12345678 | 58 | .word 0x12345678 |
59 | .word 0x12345678 | 59 | .word 0x12345678 |
60 | .word 0x12345678 | 60 | .word 0x12345678 |
61 | .word 0x12345678 | 61 | .word 0x12345678 |
62 | .word 0x12345678 | 62 | .word 0x12345678 |
63 | .word 0x12345678 | 63 | .word 0x12345678 |
64 | #else | 64 | #else |
65 | ldr pc, _undefined_instruction | 65 | ldr pc, _undefined_instruction |
66 | ldr pc, _software_interrupt | 66 | ldr pc, _software_interrupt |
67 | ldr pc, _prefetch_abort | 67 | ldr pc, _prefetch_abort |
68 | ldr pc, _data_abort | 68 | ldr pc, _data_abort |
69 | ldr pc, _not_used | 69 | ldr pc, _not_used |
70 | ldr pc, _irq | 70 | ldr pc, _irq |
71 | ldr pc, _fiq | 71 | ldr pc, _fiq |
72 | 72 | ||
73 | _undefined_instruction: | 73 | _undefined_instruction: |
74 | .word undefined_instruction | 74 | .word undefined_instruction |
75 | _software_interrupt: | 75 | _software_interrupt: |
76 | .word software_interrupt | 76 | .word software_interrupt |
77 | _prefetch_abort: | 77 | _prefetch_abort: |
78 | .word prefetch_abort | 78 | .word prefetch_abort |
79 | _data_abort: | 79 | _data_abort: |
80 | .word data_abort | 80 | .word data_abort |
81 | _not_used: | 81 | _not_used: |
82 | .word not_used | 82 | .word not_used |
83 | _irq: | 83 | _irq: |
84 | .word irq | 84 | .word irq |
85 | _fiq: | 85 | _fiq: |
86 | .word fiq | 86 | .word fiq |
87 | 87 | ||
88 | #endif /* CONFIG_SPL_BUILD */ | 88 | #endif /* CONFIG_SPL_BUILD */ |
89 | .balignl 16,0xdeadbeef | 89 | .balignl 16,0xdeadbeef |
90 | 90 | ||
91 | 91 | ||
92 | /* | 92 | /* |
93 | ************************************************************************* | 93 | ************************************************************************* |
94 | * | 94 | * |
95 | * Startup Code (reset vector) | 95 | * Startup Code (reset vector) |
96 | * | 96 | * |
97 | * do important init only if we don't start from memory! | 97 | * do important init only if we don't start from memory! |
98 | * setup Memory and board specific bits prior to relocation. | 98 | * setup Memory and board specific bits prior to relocation. |
99 | * relocate armboot to ram | 99 | * relocate armboot to ram |
100 | * setup stack | 100 | * setup stack |
101 | * | 101 | * |
102 | ************************************************************************* | 102 | ************************************************************************* |
103 | */ | 103 | */ |
104 | 104 | ||
105 | .globl _TEXT_BASE | ||
106 | _TEXT_BASE: | ||
107 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
108 | .word CONFIG_SPL_TEXT_BASE | ||
109 | #else | ||
110 | .word CONFIG_SYS_TEXT_BASE | ||
111 | #endif | ||
112 | |||
113 | /* | ||
114 | * These are defined in the board-specific linker script. | ||
115 | * Subtracting _start from them lets the linker put their | ||
116 | * relative position in the executable instead of leaving | ||
117 | * them null. | ||
118 | */ | ||
119 | .globl _bss_start_ofs | ||
120 | _bss_start_ofs: | ||
121 | .word __bss_start - _start | ||
122 | |||
123 | .globl _bss_end_ofs | ||
124 | _bss_end_ofs: | ||
125 | .word __bss_end - _start | ||
126 | |||
127 | .globl _end_ofs | ||
128 | _end_ofs: | ||
129 | .word _end - _start | ||
130 | |||
131 | #ifdef CONFIG_USE_IRQ | 105 | #ifdef CONFIG_USE_IRQ |
132 | /* IRQ stack memory (calculated at run-time) */ | 106 | /* IRQ stack memory (calculated at run-time) */ |
133 | .globl IRQ_STACK_START | 107 | .globl IRQ_STACK_START |
134 | IRQ_STACK_START: | 108 | IRQ_STACK_START: |
135 | .word 0x0badc0de | 109 | .word 0x0badc0de |
136 | 110 | ||
137 | /* IRQ stack memory (calculated at run-time) */ | 111 | /* IRQ stack memory (calculated at run-time) */ |
138 | .globl FIQ_STACK_START | 112 | .globl FIQ_STACK_START |
139 | FIQ_STACK_START: | 113 | FIQ_STACK_START: |
140 | .word 0x0badc0de | 114 | .word 0x0badc0de |
141 | #endif | 115 | #endif |
142 | 116 | ||
143 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 117 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
144 | .globl IRQ_STACK_START_IN | 118 | .globl IRQ_STACK_START_IN |
145 | IRQ_STACK_START_IN: | 119 | IRQ_STACK_START_IN: |
146 | .word 0x0badc0de | 120 | .word 0x0badc0de |
147 | 121 | ||
148 | /* | 122 | /* |
149 | * the actual reset code | 123 | * the actual reset code |
150 | */ | 124 | */ |
151 | 125 | ||
152 | reset: | 126 | reset: |
153 | /* | 127 | /* |
154 | * set the cpu to SVC32 mode | 128 | * set the cpu to SVC32 mode |
155 | */ | 129 | */ |
156 | mrs r0,cpsr | 130 | mrs r0,cpsr |
157 | bic r0,r0,#0x1f | 131 | bic r0,r0,#0x1f |
158 | orr r0,r0,#0xd3 | 132 | orr r0,r0,#0xd3 |
159 | msr cpsr,r0 | 133 | msr cpsr,r0 |
160 | 134 | ||
161 | /* | 135 | /* |
162 | * we do sys-critical inits only at reboot, | 136 | * we do sys-critical inits only at reboot, |
163 | * not when booting from ram! | 137 | * not when booting from ram! |
164 | */ | 138 | */ |
165 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 139 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
166 | bl cpu_init_crit | 140 | bl cpu_init_crit |
167 | #endif | 141 | #endif |
168 | 142 | ||
169 | bl _main | 143 | bl _main |
170 | 144 | ||
171 | /*------------------------------------------------------------------------------*/ | 145 | /*------------------------------------------------------------------------------*/ |
172 | 146 | ||
173 | .globl c_runtime_cpu_setup | 147 | .globl c_runtime_cpu_setup |
174 | c_runtime_cpu_setup: | 148 | c_runtime_cpu_setup: |
175 | 149 | ||
176 | bx lr | 150 | bx lr |
177 | 151 | ||
178 | /* | 152 | /* |
179 | ************************************************************************* | 153 | ************************************************************************* |
180 | * | 154 | * |
181 | * CPU_init_critical registers | 155 | * CPU_init_critical registers |
182 | * | 156 | * |
183 | * setup important registers | 157 | * setup important registers |
184 | * setup memory timing | 158 | * setup memory timing |
185 | * | 159 | * |
186 | ************************************************************************* | 160 | ************************************************************************* |
187 | */ | 161 | */ |
188 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 162 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
189 | cpu_init_crit: | 163 | cpu_init_crit: |
190 | /* | 164 | /* |
191 | * flush D cache before disabling it | 165 | * flush D cache before disabling it |
192 | */ | 166 | */ |
193 | mov r0, #0 | 167 | mov r0, #0 |
194 | flush_dcache: | 168 | flush_dcache: |
195 | mrc p15, 0, r15, c7, c10, 3 | 169 | mrc p15, 0, r15, c7, c10, 3 |
196 | bne flush_dcache | 170 | bne flush_dcache |
197 | 171 | ||
198 | mcr p15, 0, r0, c8, c7, 0 /* invalidate TLB */ | 172 | mcr p15, 0, r0, c8, c7, 0 /* invalidate TLB */ |
199 | mcr p15, 0, r0, c7, c5, 0 /* invalidate I Cache */ | 173 | mcr p15, 0, r0, c7, c5, 0 /* invalidate I Cache */ |
200 | 174 | ||
201 | /* | 175 | /* |
202 | * disable MMU and D cache | 176 | * disable MMU and D cache |
203 | * enable I cache if CONFIG_SYS_ICACHE_OFF is not defined | 177 | * enable I cache if CONFIG_SYS_ICACHE_OFF is not defined |
204 | */ | 178 | */ |
205 | mrc p15, 0, r0, c1, c0, 0 | 179 | mrc p15, 0, r0, c1, c0, 0 |
206 | bic r0, r0, #0x00000300 /* clear bits 9:8 (---- --RS) */ | 180 | bic r0, r0, #0x00000300 /* clear bits 9:8 (---- --RS) */ |
207 | bic r0, r0, #0x00000087 /* clear bits 7, 2:0 (B--- -CAM) */ | 181 | bic r0, r0, #0x00000087 /* clear bits 7, 2:0 (B--- -CAM) */ |
208 | #ifdef CONFIG_SYS_EXCEPTION_VECTORS_HIGH | 182 | #ifdef CONFIG_SYS_EXCEPTION_VECTORS_HIGH |
209 | orr r0, r0, #0x00002000 /* set bit 13 (--V- ----) */ | 183 | orr r0, r0, #0x00002000 /* set bit 13 (--V- ----) */ |
210 | #else | 184 | #else |
211 | bic r0, r0, #0x00002000 /* clear bit 13 (--V- ----) */ | 185 | bic r0, r0, #0x00002000 /* clear bit 13 (--V- ----) */ |
212 | #endif | 186 | #endif |
213 | orr r0, r0, #0x00000002 /* set bit 2 (A) Align */ | 187 | orr r0, r0, #0x00000002 /* set bit 2 (A) Align */ |
214 | #ifndef CONFIG_SYS_ICACHE_OFF | 188 | #ifndef CONFIG_SYS_ICACHE_OFF |
215 | orr r0, r0, #0x00001000 /* set bit 12 (I) I-Cache */ | 189 | orr r0, r0, #0x00001000 /* set bit 12 (I) I-Cache */ |
216 | #endif | 190 | #endif |
217 | mcr p15, 0, r0, c1, c0, 0 | 191 | mcr p15, 0, r0, c1, c0, 0 |
218 | 192 | ||
219 | /* | 193 | /* |
220 | * Go setup Memory and board specific bits prior to relocation. | 194 | * Go setup Memory and board specific bits prior to relocation. |
221 | */ | 195 | */ |
222 | mov ip, lr /* perserve link reg across call */ | 196 | mov ip, lr /* perserve link reg across call */ |
223 | bl lowlevel_init /* go setup pll,mux,memory */ | 197 | bl lowlevel_init /* go setup pll,mux,memory */ |
224 | mov lr, ip /* restore link */ | 198 | mov lr, ip /* restore link */ |
225 | mov pc, lr /* back to my caller */ | 199 | mov pc, lr /* back to my caller */ |
226 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ | 200 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ |
227 | 201 | ||
228 | #ifndef CONFIG_SPL_BUILD | 202 | #ifndef CONFIG_SPL_BUILD |
229 | /* | 203 | /* |
230 | ************************************************************************* | 204 | ************************************************************************* |
231 | * | 205 | * |
232 | * Interrupt handling | 206 | * Interrupt handling |
233 | * | 207 | * |
234 | ************************************************************************* | 208 | ************************************************************************* |
235 | */ | 209 | */ |
236 | 210 | ||
237 | @ | 211 | @ |
238 | @ IRQ stack frame. | 212 | @ IRQ stack frame. |
239 | @ | 213 | @ |
240 | #define S_FRAME_SIZE 72 | 214 | #define S_FRAME_SIZE 72 |
241 | 215 | ||
242 | #define S_OLD_R0 68 | 216 | #define S_OLD_R0 68 |
243 | #define S_PSR 64 | 217 | #define S_PSR 64 |
244 | #define S_PC 60 | 218 | #define S_PC 60 |
245 | #define S_LR 56 | 219 | #define S_LR 56 |
246 | #define S_SP 52 | 220 | #define S_SP 52 |
247 | 221 | ||
248 | #define S_IP 48 | 222 | #define S_IP 48 |
249 | #define S_FP 44 | 223 | #define S_FP 44 |
250 | #define S_R10 40 | 224 | #define S_R10 40 |
251 | #define S_R9 36 | 225 | #define S_R9 36 |
252 | #define S_R8 32 | 226 | #define S_R8 32 |
253 | #define S_R7 28 | 227 | #define S_R7 28 |
254 | #define S_R6 24 | 228 | #define S_R6 24 |
255 | #define S_R5 20 | 229 | #define S_R5 20 |
256 | #define S_R4 16 | 230 | #define S_R4 16 |
257 | #define S_R3 12 | 231 | #define S_R3 12 |
258 | #define S_R2 8 | 232 | #define S_R2 8 |
259 | #define S_R1 4 | 233 | #define S_R1 4 |
260 | #define S_R0 0 | 234 | #define S_R0 0 |
261 | 235 | ||
262 | #define MODE_SVC 0x13 | 236 | #define MODE_SVC 0x13 |
263 | #define I_BIT 0x80 | 237 | #define I_BIT 0x80 |
264 | 238 | ||
265 | /* | 239 | /* |
266 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 240 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
267 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling | 241 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
268 | */ | 242 | */ |
269 | 243 | ||
270 | .macro bad_save_user_regs | 244 | .macro bad_save_user_regs |
271 | @ carve out a frame on current user stack | 245 | @ carve out a frame on current user stack |
272 | sub sp, sp, #S_FRAME_SIZE | 246 | sub sp, sp, #S_FRAME_SIZE |
273 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 | 247 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 |
274 | ldr r2, IRQ_STACK_START_IN | 248 | ldr r2, IRQ_STACK_START_IN |
275 | @ get values for "aborted" pc and cpsr (into parm regs) | 249 | @ get values for "aborted" pc and cpsr (into parm regs) |
276 | ldmia r2, {r2 - r3} | 250 | ldmia r2, {r2 - r3} |
277 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack | 251 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack |
278 | add r5, sp, #S_SP | 252 | add r5, sp, #S_SP |
279 | mov r1, lr | 253 | mov r1, lr |
280 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr | 254 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr |
281 | mov r0, sp @ save current stack into r0 (param register) | 255 | mov r0, sp @ save current stack into r0 (param register) |
282 | .endm | 256 | .endm |
283 | 257 | ||
284 | .macro irq_save_user_regs | 258 | .macro irq_save_user_regs |
285 | sub sp, sp, #S_FRAME_SIZE | 259 | sub sp, sp, #S_FRAME_SIZE |
286 | stmia sp, {r0 - r12} @ Calling r0-r12 | 260 | stmia sp, {r0 - r12} @ Calling r0-r12 |
287 | @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. | 261 | @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. |
288 | add r8, sp, #S_PC | 262 | add r8, sp, #S_PC |
289 | stmdb r8, {sp, lr}^ @ Calling SP, LR | 263 | stmdb r8, {sp, lr}^ @ Calling SP, LR |
290 | str lr, [r8, #0] @ Save calling PC | 264 | str lr, [r8, #0] @ Save calling PC |
291 | mrs r6, spsr | 265 | mrs r6, spsr |
292 | str r6, [r8, #4] @ Save CPSR | 266 | str r6, [r8, #4] @ Save CPSR |
293 | str r0, [r8, #8] @ Save OLD_R0 | 267 | str r0, [r8, #8] @ Save OLD_R0 |
294 | mov r0, sp | 268 | mov r0, sp |
295 | .endm | 269 | .endm |
296 | 270 | ||
297 | .macro irq_restore_user_regs | 271 | .macro irq_restore_user_regs |
298 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr | 272 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
299 | mov r0, r0 | 273 | mov r0, r0 |
300 | ldr lr, [sp, #S_PC] @ Get PC | 274 | ldr lr, [sp, #S_PC] @ Get PC |
301 | add sp, sp, #S_FRAME_SIZE | 275 | add sp, sp, #S_FRAME_SIZE |
302 | subs pc, lr, #4 @ return & move spsr_svc into cpsr | 276 | subs pc, lr, #4 @ return & move spsr_svc into cpsr |
303 | .endm | 277 | .endm |
304 | 278 | ||
305 | .macro get_bad_stack | 279 | .macro get_bad_stack |
306 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack | 280 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack |
307 | 281 | ||
308 | str lr, [r13] @ save caller lr in position 0 of saved stack | 282 | str lr, [r13] @ save caller lr in position 0 of saved stack |
309 | mrs lr, spsr @ get the spsr | 283 | mrs lr, spsr @ get the spsr |
310 | str lr, [r13, #4] @ save spsr in position 1 of saved stack | 284 | str lr, [r13, #4] @ save spsr in position 1 of saved stack |
311 | mov r13, #MODE_SVC @ prepare SVC-Mode | 285 | mov r13, #MODE_SVC @ prepare SVC-Mode |
312 | @ msr spsr_c, r13 | 286 | @ msr spsr_c, r13 |
313 | msr spsr, r13 @ switch modes, make sure moves will execute | 287 | msr spsr, r13 @ switch modes, make sure moves will execute |
314 | mov lr, pc @ capture return pc | 288 | mov lr, pc @ capture return pc |
315 | movs pc, lr @ jump to next instruction & switch modes. | 289 | movs pc, lr @ jump to next instruction & switch modes. |
316 | .endm | 290 | .endm |
317 | 291 | ||
318 | .macro get_irq_stack @ setup IRQ stack | 292 | .macro get_irq_stack @ setup IRQ stack |
319 | ldr sp, IRQ_STACK_START | 293 | ldr sp, IRQ_STACK_START |
320 | .endm | 294 | .endm |
321 | 295 | ||
322 | .macro get_fiq_stack @ setup FIQ stack | 296 | .macro get_fiq_stack @ setup FIQ stack |
323 | ldr sp, FIQ_STACK_START | 297 | ldr sp, FIQ_STACK_START |
324 | .endm | 298 | .endm |
325 | #endif /* CONFIG_SPL_BUILD */ | 299 | #endif /* CONFIG_SPL_BUILD */ |
326 | 300 | ||
327 | /* | 301 | /* |
328 | * exception handlers | 302 | * exception handlers |
329 | */ | 303 | */ |
330 | #ifdef CONFIG_SPL_BUILD | 304 | #ifdef CONFIG_SPL_BUILD |
331 | .align 5 | 305 | .align 5 |
332 | do_hang: | 306 | do_hang: |
333 | ldr sp, _TEXT_BASE /* switch to abort stack */ | ||
334 | 1: | 307 | 1: |
335 | bl 1b /* hang and never return */ | 308 | bl 1b /* hang and never return */ |
336 | #else /* !CONFIG_SPL_BUILD */ | 309 | #else /* !CONFIG_SPL_BUILD */ |
337 | .align 5 | 310 | .align 5 |
338 | undefined_instruction: | 311 | undefined_instruction: |
339 | get_bad_stack | 312 | get_bad_stack |
340 | bad_save_user_regs | 313 | bad_save_user_regs |
341 | bl do_undefined_instruction | 314 | bl do_undefined_instruction |
342 | 315 | ||
343 | .align 5 | 316 | .align 5 |
344 | software_interrupt: | 317 | software_interrupt: |
345 | get_bad_stack | 318 | get_bad_stack |
346 | bad_save_user_regs | 319 | bad_save_user_regs |
347 | bl do_software_interrupt | 320 | bl do_software_interrupt |
348 | 321 | ||
349 | .align 5 | 322 | .align 5 |
350 | prefetch_abort: | 323 | prefetch_abort: |
351 | get_bad_stack | 324 | get_bad_stack |
352 | bad_save_user_regs | 325 | bad_save_user_regs |
353 | bl do_prefetch_abort | 326 | bl do_prefetch_abort |
354 | 327 | ||
355 | .align 5 | 328 | .align 5 |
356 | data_abort: | 329 | data_abort: |
357 | get_bad_stack | 330 | get_bad_stack |
358 | bad_save_user_regs | 331 | bad_save_user_regs |
359 | bl do_data_abort | 332 | bl do_data_abort |
360 | 333 | ||
361 | .align 5 | 334 | .align 5 |
362 | not_used: | 335 | not_used: |
363 | get_bad_stack | 336 | get_bad_stack |
364 | bad_save_user_regs | 337 | bad_save_user_regs |
365 | bl do_not_used | 338 | bl do_not_used |
366 | 339 | ||
367 | #ifdef CONFIG_USE_IRQ | 340 | #ifdef CONFIG_USE_IRQ |
368 | 341 | ||
369 | .align 5 | 342 | .align 5 |
370 | irq: | 343 | irq: |
371 | get_irq_stack | 344 | get_irq_stack |
372 | irq_save_user_regs | 345 | irq_save_user_regs |
373 | bl do_irq | 346 | bl do_irq |
374 | irq_restore_user_regs | 347 | irq_restore_user_regs |
375 | 348 | ||
376 | .align 5 | 349 | .align 5 |
377 | fiq: | 350 | fiq: |
378 | get_fiq_stack | 351 | get_fiq_stack |
379 | /* someone ought to write a more effiction fiq_save_user_regs */ | 352 | /* someone ought to write a more effiction fiq_save_user_regs */ |
380 | irq_save_user_regs | 353 | irq_save_user_regs |
381 | bl do_fiq | 354 | bl do_fiq |
382 | irq_restore_user_regs | 355 | irq_restore_user_regs |
383 | 356 | ||
384 | #else | 357 | #else |
385 | 358 | ||
386 | .align 5 | 359 | .align 5 |
387 | irq: | 360 | irq: |
388 | get_bad_stack | 361 | get_bad_stack |
389 | bad_save_user_regs | 362 | bad_save_user_regs |
390 | bl do_irq | 363 | bl do_irq |
391 | 364 | ||
392 | .align 5 | 365 | .align 5 |
393 | fiq: | 366 | fiq: |
394 | get_bad_stack | 367 | get_bad_stack |
395 | bad_save_user_regs | 368 | bad_save_user_regs |
396 | bl do_fiq | 369 | bl do_fiq |
397 | 370 | ||
398 | #endif | 371 | #endif |
399 | #endif /* CONFIG_SPL_BUILD */ | 372 | #endif /* CONFIG_SPL_BUILD */ |
400 | 373 |
arch/arm/cpu/arm946es/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for ARM926EJS CPU-core | 2 | * armboot - Startup Code for ARM926EJS CPU-core |
3 | * | 3 | * |
4 | * Copyright (c) 2003 Texas Instruments | 4 | * Copyright (c) 2003 Texas Instruments |
5 | * | 5 | * |
6 | * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------ | 6 | * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------ |
7 | * | 7 | * |
8 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> | 8 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> |
9 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> | 9 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> |
10 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> | 10 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> |
11 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> | 11 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> |
12 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> | 12 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> |
13 | * Copyright (c) 2010 Albert Aribaud <albert.u.boot@aribaud.net> | 13 | * Copyright (c) 2010 Albert Aribaud <albert.u.boot@aribaud.net> |
14 | * | 14 | * |
15 | * SPDX-License-Identifier: GPL-2.0+ | 15 | * SPDX-License-Identifier: GPL-2.0+ |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <asm-offsets.h> | 18 | #include <asm-offsets.h> |
19 | #include <config.h> | 19 | #include <config.h> |
20 | #include <version.h> | 20 | #include <version.h> |
21 | 21 | ||
22 | /* | 22 | /* |
23 | ************************************************************************* | 23 | ************************************************************************* |
24 | * | 24 | * |
25 | * Jump vector table as in table 3.1 in [1] | 25 | * Jump vector table as in table 3.1 in [1] |
26 | * | 26 | * |
27 | ************************************************************************* | 27 | ************************************************************************* |
28 | */ | 28 | */ |
29 | 29 | ||
30 | 30 | ||
31 | .globl _start | 31 | .globl _start |
32 | _start: | 32 | _start: |
33 | b reset | 33 | b reset |
34 | ldr pc, _undefined_instruction | 34 | ldr pc, _undefined_instruction |
35 | ldr pc, _software_interrupt | 35 | ldr pc, _software_interrupt |
36 | ldr pc, _prefetch_abort | 36 | ldr pc, _prefetch_abort |
37 | ldr pc, _data_abort | 37 | ldr pc, _data_abort |
38 | ldr pc, _not_used | 38 | ldr pc, _not_used |
39 | ldr pc, _irq | 39 | ldr pc, _irq |
40 | ldr pc, _fiq | 40 | ldr pc, _fiq |
41 | 41 | ||
42 | _undefined_instruction: | 42 | _undefined_instruction: |
43 | .word undefined_instruction | 43 | .word undefined_instruction |
44 | _software_interrupt: | 44 | _software_interrupt: |
45 | .word software_interrupt | 45 | .word software_interrupt |
46 | _prefetch_abort: | 46 | _prefetch_abort: |
47 | .word prefetch_abort | 47 | .word prefetch_abort |
48 | _data_abort: | 48 | _data_abort: |
49 | .word data_abort | 49 | .word data_abort |
50 | _not_used: | 50 | _not_used: |
51 | .word not_used | 51 | .word not_used |
52 | _irq: | 52 | _irq: |
53 | .word irq | 53 | .word irq |
54 | _fiq: | 54 | _fiq: |
55 | .word fiq | 55 | .word fiq |
56 | 56 | ||
57 | .balignl 16,0xdeadbeef | 57 | .balignl 16,0xdeadbeef |
58 | 58 | ||
59 | _vectors_end: | 59 | _vectors_end: |
60 | 60 | ||
61 | /* | 61 | /* |
62 | ************************************************************************* | 62 | ************************************************************************* |
63 | * | 63 | * |
64 | * Startup Code (reset vector) | 64 | * Startup Code (reset vector) |
65 | * | 65 | * |
66 | * do important init only if we don't start from memory! | 66 | * do important init only if we don't start from memory! |
67 | * setup Memory and board specific bits prior to relocation. | 67 | * setup Memory and board specific bits prior to relocation. |
68 | * relocate armboot to ram | 68 | * relocate armboot to ram |
69 | * setup stack | 69 | * setup stack |
70 | * | 70 | * |
71 | ************************************************************************* | 71 | ************************************************************************* |
72 | */ | 72 | */ |
73 | 73 | ||
74 | .globl _TEXT_BASE | ||
75 | _TEXT_BASE: | ||
76 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
77 | .word CONFIG_SPL_TEXT_BASE | ||
78 | #else | ||
79 | .word CONFIG_SYS_TEXT_BASE | ||
80 | #endif | ||
81 | |||
82 | /* | ||
83 | * These are defined in the board-specific linker script. | ||
84 | * Subtracting _start from them lets the linker put their | ||
85 | * relative position in the executable instead of leaving | ||
86 | * them null. | ||
87 | */ | ||
88 | .globl _bss_start_ofs | ||
89 | _bss_start_ofs: | ||
90 | .word __bss_start - _start | ||
91 | |||
92 | .globl _bss_end_ofs | ||
93 | _bss_end_ofs: | ||
94 | .word __bss_end - _start | ||
95 | |||
96 | .globl _end_ofs | ||
97 | _end_ofs: | ||
98 | .word _end - _start | ||
99 | |||
100 | #ifdef CONFIG_USE_IRQ | 74 | #ifdef CONFIG_USE_IRQ |
101 | /* IRQ stack memory (calculated at run-time) */ | 75 | /* IRQ stack memory (calculated at run-time) */ |
102 | .globl IRQ_STACK_START | 76 | .globl IRQ_STACK_START |
103 | IRQ_STACK_START: | 77 | IRQ_STACK_START: |
104 | .word 0x0badc0de | 78 | .word 0x0badc0de |
105 | 79 | ||
106 | /* IRQ stack memory (calculated at run-time) */ | 80 | /* IRQ stack memory (calculated at run-time) */ |
107 | .globl FIQ_STACK_START | 81 | .globl FIQ_STACK_START |
108 | FIQ_STACK_START: | 82 | FIQ_STACK_START: |
109 | .word 0x0badc0de | 83 | .word 0x0badc0de |
110 | #endif | 84 | #endif |
111 | 85 | ||
112 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 86 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
113 | .globl IRQ_STACK_START_IN | 87 | .globl IRQ_STACK_START_IN |
114 | IRQ_STACK_START_IN: | 88 | IRQ_STACK_START_IN: |
115 | .word 0x0badc0de | 89 | .word 0x0badc0de |
116 | 90 | ||
117 | /* | 91 | /* |
118 | * the actual reset code | 92 | * the actual reset code |
119 | */ | 93 | */ |
120 | 94 | ||
121 | reset: | 95 | reset: |
122 | /* | 96 | /* |
123 | * set the cpu to SVC32 mode | 97 | * set the cpu to SVC32 mode |
124 | */ | 98 | */ |
125 | mrs r0,cpsr | 99 | mrs r0,cpsr |
126 | bic r0,r0,#0x1f | 100 | bic r0,r0,#0x1f |
127 | orr r0,r0,#0xd3 | 101 | orr r0,r0,#0xd3 |
128 | msr cpsr,r0 | 102 | msr cpsr,r0 |
129 | 103 | ||
130 | /* | 104 | /* |
131 | * we do sys-critical inits only at reboot, | 105 | * we do sys-critical inits only at reboot, |
132 | * not when booting from ram! | 106 | * not when booting from ram! |
133 | */ | 107 | */ |
134 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 108 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
135 | bl cpu_init_crit | 109 | bl cpu_init_crit |
136 | #endif | 110 | #endif |
137 | 111 | ||
138 | bl _main | 112 | bl _main |
139 | 113 | ||
140 | /*------------------------------------------------------------------------------*/ | 114 | /*------------------------------------------------------------------------------*/ |
141 | 115 | ||
142 | .globl c_runtime_cpu_setup | 116 | .globl c_runtime_cpu_setup |
143 | c_runtime_cpu_setup: | 117 | c_runtime_cpu_setup: |
144 | 118 | ||
145 | mov pc, lr | 119 | mov pc, lr |
146 | 120 | ||
147 | /* | 121 | /* |
148 | ************************************************************************* | 122 | ************************************************************************* |
149 | * | 123 | * |
150 | * CPU_init_critical registers | 124 | * CPU_init_critical registers |
151 | * | 125 | * |
152 | * setup important registers | 126 | * setup important registers |
153 | * setup memory timing | 127 | * setup memory timing |
154 | * | 128 | * |
155 | ************************************************************************* | 129 | ************************************************************************* |
156 | */ | 130 | */ |
157 | 131 | ||
158 | 132 | ||
159 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 133 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
160 | cpu_init_crit: | 134 | cpu_init_crit: |
161 | /* | 135 | /* |
162 | * flush v4 I/D caches | 136 | * flush v4 I/D caches |
163 | */ | 137 | */ |
164 | mov r0, #0 | 138 | mov r0, #0 |
165 | mcr p15, 0, r0, c7, c5, 0 /* flush v4 I-cache */ | 139 | mcr p15, 0, r0, c7, c5, 0 /* flush v4 I-cache */ |
166 | mcr p15, 0, r0, c7, c6, 0 /* flush v4 D-cache */ | 140 | mcr p15, 0, r0, c7, c6, 0 /* flush v4 D-cache */ |
167 | 141 | ||
168 | /* | 142 | /* |
169 | * disable MMU stuff and caches | 143 | * disable MMU stuff and caches |
170 | */ | 144 | */ |
171 | mrc p15, 0, r0, c1, c0, 0 | 145 | mrc p15, 0, r0, c1, c0, 0 |
172 | bic r0, r0, #0x00002300 /* clear bits 13, 9:8 (--V- --RS) */ | 146 | bic r0, r0, #0x00002300 /* clear bits 13, 9:8 (--V- --RS) */ |
173 | bic r0, r0, #0x00000087 /* clear bits 7, 2:0 (B--- -CAM) */ | 147 | bic r0, r0, #0x00000087 /* clear bits 7, 2:0 (B--- -CAM) */ |
174 | orr r0, r0, #0x00000002 /* set bit 2 (A) Align */ | 148 | orr r0, r0, #0x00000002 /* set bit 2 (A) Align */ |
175 | orr r0, r0, #0x00001000 /* set bit 12 (I) I-Cache */ | 149 | orr r0, r0, #0x00001000 /* set bit 12 (I) I-Cache */ |
176 | mcr p15, 0, r0, c1, c0, 0 | 150 | mcr p15, 0, r0, c1, c0, 0 |
177 | 151 | ||
178 | /* | 152 | /* |
179 | * Go setup Memory and board specific bits prior to relocation. | 153 | * Go setup Memory and board specific bits prior to relocation. |
180 | */ | 154 | */ |
181 | mov ip, lr /* perserve link reg across call */ | 155 | mov ip, lr /* perserve link reg across call */ |
182 | bl lowlevel_init /* go setup memory */ | 156 | bl lowlevel_init /* go setup memory */ |
183 | mov lr, ip /* restore link */ | 157 | mov lr, ip /* restore link */ |
184 | mov pc, lr /* back to my caller */ | 158 | mov pc, lr /* back to my caller */ |
185 | #endif | 159 | #endif |
186 | /* | 160 | /* |
187 | ************************************************************************* | 161 | ************************************************************************* |
188 | * | 162 | * |
189 | * Interrupt handling | 163 | * Interrupt handling |
190 | * | 164 | * |
191 | ************************************************************************* | 165 | ************************************************************************* |
192 | */ | 166 | */ |
193 | 167 | ||
194 | @ | 168 | @ |
195 | @ IRQ stack frame. | 169 | @ IRQ stack frame. |
196 | @ | 170 | @ |
197 | #define S_FRAME_SIZE 72 | 171 | #define S_FRAME_SIZE 72 |
198 | 172 | ||
199 | #define S_OLD_R0 68 | 173 | #define S_OLD_R0 68 |
200 | #define S_PSR 64 | 174 | #define S_PSR 64 |
201 | #define S_PC 60 | 175 | #define S_PC 60 |
202 | #define S_LR 56 | 176 | #define S_LR 56 |
203 | #define S_SP 52 | 177 | #define S_SP 52 |
204 | 178 | ||
205 | #define S_IP 48 | 179 | #define S_IP 48 |
206 | #define S_FP 44 | 180 | #define S_FP 44 |
207 | #define S_R10 40 | 181 | #define S_R10 40 |
208 | #define S_R9 36 | 182 | #define S_R9 36 |
209 | #define S_R8 32 | 183 | #define S_R8 32 |
210 | #define S_R7 28 | 184 | #define S_R7 28 |
211 | #define S_R6 24 | 185 | #define S_R6 24 |
212 | #define S_R5 20 | 186 | #define S_R5 20 |
213 | #define S_R4 16 | 187 | #define S_R4 16 |
214 | #define S_R3 12 | 188 | #define S_R3 12 |
215 | #define S_R2 8 | 189 | #define S_R2 8 |
216 | #define S_R1 4 | 190 | #define S_R1 4 |
217 | #define S_R0 0 | 191 | #define S_R0 0 |
218 | 192 | ||
219 | #define MODE_SVC 0x13 | 193 | #define MODE_SVC 0x13 |
220 | #define I_BIT 0x80 | 194 | #define I_BIT 0x80 |
221 | 195 | ||
222 | /* | 196 | /* |
223 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 197 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
224 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling | 198 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
225 | */ | 199 | */ |
226 | 200 | ||
227 | .macro bad_save_user_regs | 201 | .macro bad_save_user_regs |
228 | @ carve out a frame on current user stack | 202 | @ carve out a frame on current user stack |
229 | sub sp, sp, #S_FRAME_SIZE | 203 | sub sp, sp, #S_FRAME_SIZE |
230 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 | 204 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 |
231 | 205 | ||
232 | ldr r2, IRQ_STACK_START_IN | 206 | ldr r2, IRQ_STACK_START_IN |
233 | @ get values for "aborted" pc and cpsr (into parm regs) | 207 | @ get values for "aborted" pc and cpsr (into parm regs) |
234 | ldmia r2, {r2 - r3} | 208 | ldmia r2, {r2 - r3} |
235 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack | 209 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack |
236 | add r5, sp, #S_SP | 210 | add r5, sp, #S_SP |
237 | mov r1, lr | 211 | mov r1, lr |
238 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr | 212 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr |
239 | mov r0, sp @ save current stack into r0 (param register) | 213 | mov r0, sp @ save current stack into r0 (param register) |
240 | .endm | 214 | .endm |
241 | 215 | ||
242 | .macro irq_save_user_regs | 216 | .macro irq_save_user_regs |
243 | sub sp, sp, #S_FRAME_SIZE | 217 | sub sp, sp, #S_FRAME_SIZE |
244 | stmia sp, {r0 - r12} @ Calling r0-r12 | 218 | stmia sp, {r0 - r12} @ Calling r0-r12 |
245 | @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. | 219 | @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. |
246 | add r8, sp, #S_PC | 220 | add r8, sp, #S_PC |
247 | stmdb r8, {sp, lr}^ @ Calling SP, LR | 221 | stmdb r8, {sp, lr}^ @ Calling SP, LR |
248 | str lr, [r8, #0] @ Save calling PC | 222 | str lr, [r8, #0] @ Save calling PC |
249 | mrs r6, spsr | 223 | mrs r6, spsr |
250 | str r6, [r8, #4] @ Save CPSR | 224 | str r6, [r8, #4] @ Save CPSR |
251 | str r0, [r8, #8] @ Save OLD_R0 | 225 | str r0, [r8, #8] @ Save OLD_R0 |
252 | mov r0, sp | 226 | mov r0, sp |
253 | .endm | 227 | .endm |
254 | 228 | ||
255 | .macro irq_restore_user_regs | 229 | .macro irq_restore_user_regs |
256 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr | 230 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
257 | mov r0, r0 | 231 | mov r0, r0 |
258 | ldr lr, [sp, #S_PC] @ Get PC | 232 | ldr lr, [sp, #S_PC] @ Get PC |
259 | add sp, sp, #S_FRAME_SIZE | 233 | add sp, sp, #S_FRAME_SIZE |
260 | subs pc, lr, #4 @ return & move spsr_svc into cpsr | 234 | subs pc, lr, #4 @ return & move spsr_svc into cpsr |
261 | .endm | 235 | .endm |
262 | 236 | ||
263 | .macro get_bad_stack | 237 | .macro get_bad_stack |
264 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack | 238 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack |
265 | 239 | ||
266 | str lr, [r13] @ save caller lr in position 0 of saved stack | 240 | str lr, [r13] @ save caller lr in position 0 of saved stack |
267 | mrs lr, spsr @ get the spsr | 241 | mrs lr, spsr @ get the spsr |
268 | str lr, [r13, #4] @ save spsr in position 1 of saved stack | 242 | str lr, [r13, #4] @ save spsr in position 1 of saved stack |
269 | mov r13, #MODE_SVC @ prepare SVC-Mode | 243 | mov r13, #MODE_SVC @ prepare SVC-Mode |
270 | @ msr spsr_c, r13 | 244 | @ msr spsr_c, r13 |
271 | msr spsr, r13 @ switch modes, make sure moves will execute | 245 | msr spsr, r13 @ switch modes, make sure moves will execute |
272 | mov lr, pc @ capture return pc | 246 | mov lr, pc @ capture return pc |
273 | movs pc, lr @ jump to next instruction & switch modes. | 247 | movs pc, lr @ jump to next instruction & switch modes. |
274 | .endm | 248 | .endm |
275 | 249 | ||
276 | .macro get_irq_stack @ setup IRQ stack | 250 | .macro get_irq_stack @ setup IRQ stack |
277 | ldr sp, IRQ_STACK_START | 251 | ldr sp, IRQ_STACK_START |
278 | .endm | 252 | .endm |
279 | 253 | ||
280 | .macro get_fiq_stack @ setup FIQ stack | 254 | .macro get_fiq_stack @ setup FIQ stack |
281 | ldr sp, FIQ_STACK_START | 255 | ldr sp, FIQ_STACK_START |
282 | .endm | 256 | .endm |
283 | 257 | ||
284 | /* | 258 | /* |
285 | * exception handlers | 259 | * exception handlers |
286 | */ | 260 | */ |
287 | .align 5 | 261 | .align 5 |
288 | undefined_instruction: | 262 | undefined_instruction: |
289 | get_bad_stack | 263 | get_bad_stack |
290 | bad_save_user_regs | 264 | bad_save_user_regs |
291 | bl do_undefined_instruction | 265 | bl do_undefined_instruction |
292 | 266 | ||
293 | .align 5 | 267 | .align 5 |
294 | software_interrupt: | 268 | software_interrupt: |
295 | get_bad_stack | 269 | get_bad_stack |
296 | bad_save_user_regs | 270 | bad_save_user_regs |
297 | bl do_software_interrupt | 271 | bl do_software_interrupt |
298 | 272 | ||
299 | .align 5 | 273 | .align 5 |
300 | prefetch_abort: | 274 | prefetch_abort: |
301 | get_bad_stack | 275 | get_bad_stack |
302 | bad_save_user_regs | 276 | bad_save_user_regs |
303 | bl do_prefetch_abort | 277 | bl do_prefetch_abort |
304 | 278 | ||
305 | .align 5 | 279 | .align 5 |
306 | data_abort: | 280 | data_abort: |
307 | get_bad_stack | 281 | get_bad_stack |
308 | bad_save_user_regs | 282 | bad_save_user_regs |
309 | bl do_data_abort | 283 | bl do_data_abort |
310 | 284 | ||
311 | .align 5 | 285 | .align 5 |
312 | not_used: | 286 | not_used: |
313 | get_bad_stack | 287 | get_bad_stack |
314 | bad_save_user_regs | 288 | bad_save_user_regs |
315 | bl do_not_used | 289 | bl do_not_used |
316 | 290 | ||
317 | #ifdef CONFIG_USE_IRQ | 291 | #ifdef CONFIG_USE_IRQ |
318 | 292 | ||
319 | .align 5 | 293 | .align 5 |
320 | irq: | 294 | irq: |
321 | get_irq_stack | 295 | get_irq_stack |
322 | irq_save_user_regs | 296 | irq_save_user_regs |
323 | bl do_irq | 297 | bl do_irq |
324 | irq_restore_user_regs | 298 | irq_restore_user_regs |
325 | 299 | ||
326 | .align 5 | 300 | .align 5 |
327 | fiq: | 301 | fiq: |
328 | get_fiq_stack | 302 | get_fiq_stack |
329 | /* someone ought to write a more effiction fiq_save_user_regs */ | 303 | /* someone ought to write a more effiction fiq_save_user_regs */ |
330 | irq_save_user_regs | 304 | irq_save_user_regs |
331 | bl do_fiq | 305 | bl do_fiq |
332 | irq_restore_user_regs | 306 | irq_restore_user_regs |
333 | 307 | ||
334 | #else | 308 | #else |
335 | 309 | ||
336 | .align 5 | 310 | .align 5 |
337 | irq: | 311 | irq: |
338 | get_bad_stack | 312 | get_bad_stack |
339 | bad_save_user_regs | 313 | bad_save_user_regs |
340 | bl do_irq | 314 | bl do_irq |
341 | 315 | ||
342 | .align 5 | 316 | .align 5 |
343 | fiq: | 317 | fiq: |
344 | get_bad_stack | 318 | get_bad_stack |
345 | bad_save_user_regs | 319 | bad_save_user_regs |
346 | bl do_fiq | 320 | bl do_fiq |
347 | 321 | ||
348 | #endif | 322 | #endif |
349 | 323 | ||
350 | # ifdef CONFIG_INTEGRATOR | 324 | # ifdef CONFIG_INTEGRATOR |
351 | 325 | ||
352 | /* Satisfied by general board level routine */ | 326 | /* Satisfied by general board level routine */ |
353 | 327 | ||
354 | #else | 328 | #else |
355 | 329 | ||
356 | .align 5 | 330 | .align 5 |
357 | .globl reset_cpu | 331 | .globl reset_cpu |
358 | reset_cpu: | 332 | reset_cpu: |
359 | 333 | ||
360 | ldr r1, rstctl1 /* get clkm1 reset ctl */ | 334 | ldr r1, rstctl1 /* get clkm1 reset ctl */ |
361 | mov r3, #0x0 | 335 | mov r3, #0x0 |
362 | strh r3, [r1] /* clear it */ | 336 | strh r3, [r1] /* clear it */ |
363 | mov r3, #0x8 | 337 | mov r3, #0x8 |
364 | strh r3, [r1] /* force dsp+arm reset */ | 338 | strh r3, [r1] /* force dsp+arm reset */ |
365 | _loop_forever: | 339 | _loop_forever: |
366 | b _loop_forever | 340 | b _loop_forever |
367 | 341 | ||
368 | rstctl1: | 342 | rstctl1: |
369 | .word 0xfffece10 | 343 | .word 0xfffece10 |
370 | 344 | ||
371 | #endif /* #ifdef CONFIG_INTEGRATOR */ | 345 | #endif /* #ifdef CONFIG_INTEGRATOR */ |
372 | 346 |
arch/arm/cpu/arm_intcm/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for ARM926EJS CPU-core | 2 | * armboot - Startup Code for ARM926EJS CPU-core |
3 | * | 3 | * |
4 | * Copyright (c) 2003 Texas Instruments | 4 | * Copyright (c) 2003 Texas Instruments |
5 | * | 5 | * |
6 | * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------ | 6 | * ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------ |
7 | * | 7 | * |
8 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> | 8 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> |
9 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> | 9 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> |
10 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> | 10 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> |
11 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> | 11 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> |
12 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> | 12 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> |
13 | * | 13 | * |
14 | * SPDX-License-Identifier: GPL-2.0+ | 14 | * SPDX-License-Identifier: GPL-2.0+ |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <asm-offsets.h> | 17 | #include <asm-offsets.h> |
18 | #include <config.h> | 18 | #include <config.h> |
19 | #include <version.h> | 19 | #include <version.h> |
20 | 20 | ||
21 | /* | 21 | /* |
22 | ************************************************************************* | 22 | ************************************************************************* |
23 | * | 23 | * |
24 | * Jump vector table | 24 | * Jump vector table |
25 | * | 25 | * |
26 | ************************************************************************* | 26 | ************************************************************************* |
27 | */ | 27 | */ |
28 | 28 | ||
29 | .globl _start | 29 | .globl _start |
30 | _start: | 30 | _start: |
31 | b reset | 31 | b reset |
32 | ldr pc, _undefined_instruction | 32 | ldr pc, _undefined_instruction |
33 | ldr pc, _software_interrupt | 33 | ldr pc, _software_interrupt |
34 | ldr pc, _prefetch_abort | 34 | ldr pc, _prefetch_abort |
35 | ldr pc, _data_abort | 35 | ldr pc, _data_abort |
36 | ldr pc, _not_used | 36 | ldr pc, _not_used |
37 | ldr pc, _irq | 37 | ldr pc, _irq |
38 | ldr pc, _fiq | 38 | ldr pc, _fiq |
39 | 39 | ||
40 | _undefined_instruction: | 40 | _undefined_instruction: |
41 | .word undefined_instruction | 41 | .word undefined_instruction |
42 | _software_interrupt: | 42 | _software_interrupt: |
43 | .word software_interrupt | 43 | .word software_interrupt |
44 | _prefetch_abort: | 44 | _prefetch_abort: |
45 | .word prefetch_abort | 45 | .word prefetch_abort |
46 | _data_abort: | 46 | _data_abort: |
47 | .word data_abort | 47 | .word data_abort |
48 | _not_used: | 48 | _not_used: |
49 | .word not_used | 49 | .word not_used |
50 | _irq: | 50 | _irq: |
51 | .word irq | 51 | .word irq |
52 | _fiq: | 52 | _fiq: |
53 | .word fiq | 53 | .word fiq |
54 | 54 | ||
55 | .balignl 16,0xdeadbeef | 55 | .balignl 16,0xdeadbeef |
56 | 56 | ||
57 | /* | 57 | /* |
58 | ************************************************************************* | 58 | ************************************************************************* |
59 | * | 59 | * |
60 | * Startup Code (reset vector) | 60 | * Startup Code (reset vector) |
61 | * | 61 | * |
62 | * do important init only if we don't start from memory! | 62 | * do important init only if we don't start from memory! |
63 | * setup memory and board specific bits prior to relocation. | 63 | * setup memory and board specific bits prior to relocation. |
64 | * relocate armboot to ram | 64 | * relocate armboot to ram |
65 | * setup stack | 65 | * setup stack |
66 | * | 66 | * |
67 | ************************************************************************* | 67 | ************************************************************************* |
68 | */ | 68 | */ |
69 | 69 | ||
70 | .globl _TEXT_BASE | ||
71 | _TEXT_BASE: | ||
72 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
73 | .word CONFIG_SPL_TEXT_BASE | ||
74 | #else | ||
75 | .word CONFIG_SYS_TEXT_BASE | ||
76 | #endif | ||
77 | |||
78 | /* | ||
79 | * These are defined in the board-specific linker script. | ||
80 | * Subtracting _start from them lets the linker put their | ||
81 | * relative position in the executable instead of leaving | ||
82 | * them null. | ||
83 | */ | ||
84 | .globl _bss_start_ofs | ||
85 | _bss_start_ofs: | ||
86 | .word __bss_start - _start | ||
87 | |||
88 | .globl _bss_end_ofs | ||
89 | _bss_end_ofs: | ||
90 | .word __bss_end - _start | ||
91 | |||
92 | .globl _end_ofs | ||
93 | _end_ofs: | ||
94 | .word _end - _start | ||
95 | |||
96 | #ifdef CONFIG_USE_IRQ | 70 | #ifdef CONFIG_USE_IRQ |
97 | /* IRQ stack memory (calculated at run-time) */ | 71 | /* IRQ stack memory (calculated at run-time) */ |
98 | .globl IRQ_STACK_START | 72 | .globl IRQ_STACK_START |
99 | IRQ_STACK_START: | 73 | IRQ_STACK_START: |
100 | .word 0x0badc0de | 74 | .word 0x0badc0de |
101 | 75 | ||
102 | /* IRQ stack memory (calculated at run-time) */ | 76 | /* IRQ stack memory (calculated at run-time) */ |
103 | .globl FIQ_STACK_START | 77 | .globl FIQ_STACK_START |
104 | FIQ_STACK_START: | 78 | FIQ_STACK_START: |
105 | .word 0x0badc0de | 79 | .word 0x0badc0de |
106 | #endif | 80 | #endif |
107 | 81 | ||
108 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 82 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
109 | .globl IRQ_STACK_START_IN | 83 | .globl IRQ_STACK_START_IN |
110 | IRQ_STACK_START_IN: | 84 | IRQ_STACK_START_IN: |
111 | .word 0x0badc0de | 85 | .word 0x0badc0de |
112 | 86 | ||
113 | /* | 87 | /* |
114 | * the actual reset code | 88 | * the actual reset code |
115 | */ | 89 | */ |
116 | 90 | ||
117 | reset: | 91 | reset: |
118 | /* | 92 | /* |
119 | * set the cpu to SVC32 mode | 93 | * set the cpu to SVC32 mode |
120 | */ | 94 | */ |
121 | mrs r0,cpsr | 95 | mrs r0,cpsr |
122 | bic r0,r0,#0x1f | 96 | bic r0,r0,#0x1f |
123 | orr r0,r0,#0xd3 | 97 | orr r0,r0,#0xd3 |
124 | msr cpsr,r0 | 98 | msr cpsr,r0 |
125 | 99 | ||
126 | /* | 100 | /* |
127 | * we do sys-critical inits only at reboot, | 101 | * we do sys-critical inits only at reboot, |
128 | * not when booting from ram! | 102 | * not when booting from ram! |
129 | */ | 103 | */ |
130 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 104 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
131 | bl cpu_init_crit | 105 | bl cpu_init_crit |
132 | #endif | 106 | #endif |
133 | 107 | ||
134 | bl _main | 108 | bl _main |
135 | 109 | ||
136 | /*------------------------------------------------------------------------------*/ | 110 | /*------------------------------------------------------------------------------*/ |
137 | 111 | ||
138 | .globl c_runtime_cpu_setup | 112 | .globl c_runtime_cpu_setup |
139 | c_runtime_cpu_setup: | 113 | c_runtime_cpu_setup: |
140 | 114 | ||
141 | mov pc, lr | 115 | mov pc, lr |
142 | 116 | ||
143 | /* | 117 | /* |
144 | ************************************************************************* | 118 | ************************************************************************* |
145 | * | 119 | * |
146 | * CPU_init_critical registers | 120 | * CPU_init_critical registers |
147 | * | 121 | * |
148 | * setup important registers | 122 | * setup important registers |
149 | * setup memory timing | 123 | * setup memory timing |
150 | * | 124 | * |
151 | ************************************************************************* | 125 | ************************************************************************* |
152 | */ | 126 | */ |
153 | 127 | ||
154 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 128 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
155 | cpu_init_crit: | 129 | cpu_init_crit: |
156 | /* arm_int_generic assumes the ARM boot monitor, or user software, | 130 | /* arm_int_generic assumes the ARM boot monitor, or user software, |
157 | * has initialized the platform | 131 | * has initialized the platform |
158 | */ | 132 | */ |
159 | mov pc, lr /* back to my caller */ | 133 | mov pc, lr /* back to my caller */ |
160 | #endif | 134 | #endif |
161 | /* | 135 | /* |
162 | ************************************************************************* | 136 | ************************************************************************* |
163 | * | 137 | * |
164 | * Interrupt handling | 138 | * Interrupt handling |
165 | * | 139 | * |
166 | ************************************************************************* | 140 | ************************************************************************* |
167 | */ | 141 | */ |
168 | 142 | ||
169 | @ | 143 | @ |
170 | @ IRQ stack frame. | 144 | @ IRQ stack frame. |
171 | @ | 145 | @ |
172 | #define S_FRAME_SIZE 72 | 146 | #define S_FRAME_SIZE 72 |
173 | 147 | ||
174 | #define S_OLD_R0 68 | 148 | #define S_OLD_R0 68 |
175 | #define S_PSR 64 | 149 | #define S_PSR 64 |
176 | #define S_PC 60 | 150 | #define S_PC 60 |
177 | #define S_LR 56 | 151 | #define S_LR 56 |
178 | #define S_SP 52 | 152 | #define S_SP 52 |
179 | 153 | ||
180 | #define S_IP 48 | 154 | #define S_IP 48 |
181 | #define S_FP 44 | 155 | #define S_FP 44 |
182 | #define S_R10 40 | 156 | #define S_R10 40 |
183 | #define S_R9 36 | 157 | #define S_R9 36 |
184 | #define S_R8 32 | 158 | #define S_R8 32 |
185 | #define S_R7 28 | 159 | #define S_R7 28 |
186 | #define S_R6 24 | 160 | #define S_R6 24 |
187 | #define S_R5 20 | 161 | #define S_R5 20 |
188 | #define S_R4 16 | 162 | #define S_R4 16 |
189 | #define S_R3 12 | 163 | #define S_R3 12 |
190 | #define S_R2 8 | 164 | #define S_R2 8 |
191 | #define S_R1 4 | 165 | #define S_R1 4 |
192 | #define S_R0 0 | 166 | #define S_R0 0 |
193 | 167 | ||
194 | #define MODE_SVC 0x13 | 168 | #define MODE_SVC 0x13 |
195 | #define I_BIT 0x80 | 169 | #define I_BIT 0x80 |
196 | 170 | ||
197 | /* | 171 | /* |
198 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 172 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
199 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling | 173 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
200 | */ | 174 | */ |
201 | 175 | ||
202 | .macro bad_save_user_regs | 176 | .macro bad_save_user_regs |
203 | @ carve out a frame on current user stack | 177 | @ carve out a frame on current user stack |
204 | sub sp, sp, #S_FRAME_SIZE | 178 | sub sp, sp, #S_FRAME_SIZE |
205 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 | 179 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 |
206 | 180 | ||
207 | ldr r2, IRQ_STACK_START_IN | 181 | ldr r2, IRQ_STACK_START_IN |
208 | @ get values for "aborted" pc and cpsr (into parm regs) | 182 | @ get values for "aborted" pc and cpsr (into parm regs) |
209 | ldmia r2, {r2 - r3} | 183 | ldmia r2, {r2 - r3} |
210 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack | 184 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack |
211 | add r5, sp, #S_SP | 185 | add r5, sp, #S_SP |
212 | mov r1, lr | 186 | mov r1, lr |
213 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr | 187 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr |
214 | mov r0, sp @ save current stack into r0 (param register) | 188 | mov r0, sp @ save current stack into r0 (param register) |
215 | .endm | 189 | .endm |
216 | 190 | ||
217 | .macro irq_save_user_regs | 191 | .macro irq_save_user_regs |
218 | sub sp, sp, #S_FRAME_SIZE | 192 | sub sp, sp, #S_FRAME_SIZE |
219 | stmia sp, {r0 - r12} @ Calling r0-r12 | 193 | stmia sp, {r0 - r12} @ Calling r0-r12 |
220 | @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. | 194 | @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. |
221 | add r8, sp, #S_PC | 195 | add r8, sp, #S_PC |
222 | stmdb r8, {sp, lr}^ @ Calling SP, LR | 196 | stmdb r8, {sp, lr}^ @ Calling SP, LR |
223 | str lr, [r8, #0] @ Save calling PC | 197 | str lr, [r8, #0] @ Save calling PC |
224 | mrs r6, spsr | 198 | mrs r6, spsr |
225 | str r6, [r8, #4] @ Save CPSR | 199 | str r6, [r8, #4] @ Save CPSR |
226 | str r0, [r8, #8] @ Save OLD_R0 | 200 | str r0, [r8, #8] @ Save OLD_R0 |
227 | mov r0, sp | 201 | mov r0, sp |
228 | .endm | 202 | .endm |
229 | 203 | ||
230 | .macro irq_restore_user_regs | 204 | .macro irq_restore_user_regs |
231 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr | 205 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
232 | mov r0, r0 | 206 | mov r0, r0 |
233 | ldr lr, [sp, #S_PC] @ Get PC | 207 | ldr lr, [sp, #S_PC] @ Get PC |
234 | add sp, sp, #S_FRAME_SIZE | 208 | add sp, sp, #S_FRAME_SIZE |
235 | subs pc, lr, #4 @ return & move spsr_svc into cpsr | 209 | subs pc, lr, #4 @ return & move spsr_svc into cpsr |
236 | .endm | 210 | .endm |
237 | 211 | ||
238 | .macro get_bad_stack | 212 | .macro get_bad_stack |
239 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack | 213 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack |
240 | 214 | ||
241 | str lr, [r13] @ save caller lr in position 0 of saved stack | 215 | str lr, [r13] @ save caller lr in position 0 of saved stack |
242 | mrs lr, spsr @ get the spsr | 216 | mrs lr, spsr @ get the spsr |
243 | str lr, [r13, #4] @ save spsr in position 1 of saved stack | 217 | str lr, [r13, #4] @ save spsr in position 1 of saved stack |
244 | mov r13, #MODE_SVC @ prepare SVC-Mode | 218 | mov r13, #MODE_SVC @ prepare SVC-Mode |
245 | @ msr spsr_c, r13 | 219 | @ msr spsr_c, r13 |
246 | msr spsr, r13 @ switch modes, make sure moves will execute | 220 | msr spsr, r13 @ switch modes, make sure moves will execute |
247 | mov lr, pc @ capture return pc | 221 | mov lr, pc @ capture return pc |
248 | movs pc, lr @ jump to next instruction & switch modes. | 222 | movs pc, lr @ jump to next instruction & switch modes. |
249 | .endm | 223 | .endm |
250 | 224 | ||
251 | .macro get_irq_stack @ setup IRQ stack | 225 | .macro get_irq_stack @ setup IRQ stack |
252 | ldr sp, IRQ_STACK_START | 226 | ldr sp, IRQ_STACK_START |
253 | .endm | 227 | .endm |
254 | 228 | ||
255 | .macro get_fiq_stack @ setup FIQ stack | 229 | .macro get_fiq_stack @ setup FIQ stack |
256 | ldr sp, FIQ_STACK_START | 230 | ldr sp, FIQ_STACK_START |
257 | .endm | 231 | .endm |
258 | 232 | ||
259 | /* | 233 | /* |
260 | * exception handlers | 234 | * exception handlers |
261 | */ | 235 | */ |
262 | .align 5 | 236 | .align 5 |
263 | .globl undefined_instruction | 237 | .globl undefined_instruction |
264 | undefined_instruction: | 238 | undefined_instruction: |
265 | get_bad_stack | 239 | get_bad_stack |
266 | bad_save_user_regs | 240 | bad_save_user_regs |
267 | bl do_undefined_instruction | 241 | bl do_undefined_instruction |
268 | 242 | ||
269 | .align 5 | 243 | .align 5 |
270 | .globl software_interrupt | 244 | .globl software_interrupt |
271 | software_interrupt: | 245 | software_interrupt: |
272 | get_bad_stack | 246 | get_bad_stack |
273 | bad_save_user_regs | 247 | bad_save_user_regs |
274 | bl do_software_interrupt | 248 | bl do_software_interrupt |
275 | 249 | ||
276 | .align 5 | 250 | .align 5 |
277 | .globl prefetch_abort | 251 | .globl prefetch_abort |
278 | prefetch_abort: | 252 | prefetch_abort: |
279 | get_bad_stack | 253 | get_bad_stack |
280 | bad_save_user_regs | 254 | bad_save_user_regs |
281 | bl do_prefetch_abort | 255 | bl do_prefetch_abort |
282 | 256 | ||
283 | .align 5 | 257 | .align 5 |
284 | .globl data_abort | 258 | .globl data_abort |
285 | data_abort: | 259 | data_abort: |
286 | get_bad_stack | 260 | get_bad_stack |
287 | bad_save_user_regs | 261 | bad_save_user_regs |
288 | bl do_data_abort | 262 | bl do_data_abort |
289 | 263 | ||
290 | .align 5 | 264 | .align 5 |
291 | .globl not_used | 265 | .globl not_used |
292 | not_used: | 266 | not_used: |
293 | get_bad_stack | 267 | get_bad_stack |
294 | bad_save_user_regs | 268 | bad_save_user_regs |
295 | bl do_not_used | 269 | bl do_not_used |
296 | 270 | ||
297 | #ifdef CONFIG_USE_IRQ | 271 | #ifdef CONFIG_USE_IRQ |
298 | .align 5 | 272 | .align 5 |
299 | .globl irq | 273 | .globl irq |
300 | irq: | 274 | irq: |
301 | get_irq_stack | 275 | get_irq_stack |
302 | irq_save_user_regs | 276 | irq_save_user_regs |
303 | bl do_irq | 277 | bl do_irq |
304 | irq_restore_user_regs | 278 | irq_restore_user_regs |
305 | 279 | ||
306 | .align 5 | 280 | .align 5 |
307 | .globl fiq | 281 | .globl fiq |
308 | fiq: | 282 | fiq: |
309 | get_fiq_stack | 283 | get_fiq_stack |
310 | /* someone ought to write a more effiction fiq_save_user_regs */ | 284 | /* someone ought to write a more effiction fiq_save_user_regs */ |
311 | irq_save_user_regs | 285 | irq_save_user_regs |
312 | bl do_fiq | 286 | bl do_fiq |
313 | irq_restore_user_regs | 287 | irq_restore_user_regs |
314 | 288 | ||
315 | #else | 289 | #else |
316 | 290 | ||
317 | .align 5 | 291 | .align 5 |
318 | .globl irq | 292 | .globl irq |
319 | irq: | 293 | irq: |
320 | get_bad_stack | 294 | get_bad_stack |
321 | bad_save_user_regs | 295 | bad_save_user_regs |
322 | bl do_irq | 296 | bl do_irq |
323 | 297 | ||
324 | .align 5 | 298 | .align 5 |
325 | .globl fiq | 299 | .globl fiq |
326 | fiq: | 300 | fiq: |
327 | get_bad_stack | 301 | get_bad_stack |
328 | bad_save_user_regs | 302 | bad_save_user_regs |
329 | bl do_fiq | 303 | bl do_fiq |
330 | 304 | ||
331 | #endif | 305 | #endif |
332 | 306 |
arch/arm/cpu/armv7/omap3/lowlevel_init.S
1 | /* | 1 | /* |
2 | * Board specific setup info | 2 | * Board specific setup info |
3 | * | 3 | * |
4 | * (C) Copyright 2008 | 4 | * (C) Copyright 2008 |
5 | * Texas Instruments, <www.ti.com> | 5 | * Texas Instruments, <www.ti.com> |
6 | * | 6 | * |
7 | * Initial Code by: | 7 | * Initial Code by: |
8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
9 | * Syed Mohammed Khasim <khasim@ti.com> | 9 | * Syed Mohammed Khasim <khasim@ti.com> |
10 | * | 10 | * |
11 | * SPDX-License-Identifier: GPL-2.0+ | 11 | * SPDX-License-Identifier: GPL-2.0+ |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <config.h> | 14 | #include <config.h> |
15 | #include <version.h> | 15 | #include <version.h> |
16 | #include <asm/arch/mem.h> | 16 | #include <asm/arch/mem.h> |
17 | #include <asm/arch/clocks_omap3.h> | 17 | #include <asm/arch/clocks_omap3.h> |
18 | #include <linux/linkage.h> | 18 | #include <linux/linkage.h> |
19 | 19 | ||
20 | _TEXT_BASE: | ||
21 | .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */ | ||
22 | |||
23 | #ifdef CONFIG_SPL_BUILD | 20 | #ifdef CONFIG_SPL_BUILD |
24 | ENTRY(save_boot_params) | 21 | ENTRY(save_boot_params) |
25 | ldr r4, =omap3_boot_device | 22 | ldr r4, =omap3_boot_device |
26 | ldr r5, [r0, #0x4] | 23 | ldr r5, [r0, #0x4] |
27 | and r5, r5, #0xff | 24 | and r5, r5, #0xff |
28 | str r5, [r4] | 25 | str r5, [r4] |
29 | bx lr | 26 | bx lr |
30 | ENDPROC(save_boot_params) | 27 | ENDPROC(save_boot_params) |
31 | #endif | 28 | #endif |
32 | 29 | ||
33 | ENTRY(omap3_gp_romcode_call) | 30 | ENTRY(omap3_gp_romcode_call) |
34 | PUSH {r4-r12, lr} @ Save all registers from ROM code! | 31 | PUSH {r4-r12, lr} @ Save all registers from ROM code! |
35 | MOV r12, r0 @ Copy the Service ID in R12 | 32 | MOV r12, r0 @ Copy the Service ID in R12 |
36 | MOV r0, r1 @ Copy parameter to R0 | 33 | MOV r0, r1 @ Copy parameter to R0 |
37 | mcr p15, 0, r0, c7, c10, 4 @ DSB | 34 | mcr p15, 0, r0, c7, c10, 4 @ DSB |
38 | mcr p15, 0, r0, c7, c10, 5 @ DMB | 35 | mcr p15, 0, r0, c7, c10, 5 @ DMB |
39 | .word 0xe1600070 @ SMC #0 to enter monitor - hand assembled | 36 | .word 0xe1600070 @ SMC #0 to enter monitor - hand assembled |
40 | @ because we use -march=armv5 | 37 | @ because we use -march=armv5 |
41 | POP {r4-r12, pc} | 38 | POP {r4-r12, pc} |
42 | ENDPROC(omap3_gp_romcode_call) | 39 | ENDPROC(omap3_gp_romcode_call) |
43 | 40 | ||
44 | /* | 41 | /* |
45 | * Funtion for making PPA HAL API calls in secure devices | 42 | * Funtion for making PPA HAL API calls in secure devices |
46 | * Input: | 43 | * Input: |
47 | * R0 - Service ID | 44 | * R0 - Service ID |
48 | * R1 - paramer list | 45 | * R1 - paramer list |
49 | */ | 46 | */ |
50 | ENTRY(do_omap3_emu_romcode_call) | 47 | ENTRY(do_omap3_emu_romcode_call) |
51 | PUSH {r4-r12, lr} @ Save all registers from ROM code! | 48 | PUSH {r4-r12, lr} @ Save all registers from ROM code! |
52 | MOV r12, r0 @ Copy the Secure Service ID in R12 | 49 | MOV r12, r0 @ Copy the Secure Service ID in R12 |
53 | MOV r3, r1 @ Copy the pointer to va_list in R3 | 50 | MOV r3, r1 @ Copy the pointer to va_list in R3 |
54 | MOV r1, #0 @ Process ID - 0 | 51 | MOV r1, #0 @ Process ID - 0 |
55 | MOV r2, #OMAP3_EMU_HAL_START_HAL_CRITICAL @ Copy the pointer | 52 | MOV r2, #OMAP3_EMU_HAL_START_HAL_CRITICAL @ Copy the pointer |
56 | @ to va_list in R3 | 53 | @ to va_list in R3 |
57 | MOV r6, #0xFF @ Indicate new Task call | 54 | MOV r6, #0xFF @ Indicate new Task call |
58 | mcr p15, 0, r0, c7, c10, 4 @ DSB | 55 | mcr p15, 0, r0, c7, c10, 4 @ DSB |
59 | mcr p15, 0, r0, c7, c10, 5 @ DMB | 56 | mcr p15, 0, r0, c7, c10, 5 @ DMB |
60 | .word 0xe1600071 @ SMC #1 to call PPA service - hand assembled | 57 | .word 0xe1600071 @ SMC #1 to call PPA service - hand assembled |
61 | @ because we use -march=armv5 | 58 | @ because we use -march=armv5 |
62 | POP {r4-r12, pc} | 59 | POP {r4-r12, pc} |
63 | ENDPROC(do_omap3_emu_romcode_call) | 60 | ENDPROC(do_omap3_emu_romcode_call) |
64 | 61 | ||
65 | #if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_NAND_BOOT) | 62 | #if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_NAND_BOOT) |
66 | /************************************************************************** | 63 | /************************************************************************** |
67 | * cpy_clk_code: relocates clock code into SRAM where its safer to execute | 64 | * cpy_clk_code: relocates clock code into SRAM where its safer to execute |
68 | * R1 = SRAM destination address. | 65 | * R1 = SRAM destination address. |
69 | *************************************************************************/ | 66 | *************************************************************************/ |
70 | ENTRY(cpy_clk_code) | 67 | ENTRY(cpy_clk_code) |
71 | /* Copy DPLL code into SRAM */ | 68 | /* Copy DPLL code into SRAM */ |
72 | adr r0, go_to_speed /* copy from start of go_to_speed... */ | 69 | adr r0, go_to_speed /* copy from start of go_to_speed... */ |
73 | adr r2, lowlevel_init /* ... up to start of low_level_init */ | 70 | adr r2, lowlevel_init /* ... up to start of low_level_init */ |
74 | next2: | 71 | next2: |
75 | ldmia r0!, {r3 - r10} /* copy from source address [r0] */ | 72 | ldmia r0!, {r3 - r10} /* copy from source address [r0] */ |
76 | stmia r1!, {r3 - r10} /* copy to target address [r1] */ | 73 | stmia r1!, {r3 - r10} /* copy to target address [r1] */ |
77 | cmp r0, r2 /* until source end address [r2] */ | 74 | cmp r0, r2 /* until source end address [r2] */ |
78 | blo next2 | 75 | blo next2 |
79 | mov pc, lr /* back to caller */ | 76 | mov pc, lr /* back to caller */ |
80 | ENDPROC(cpy_clk_code) | 77 | ENDPROC(cpy_clk_code) |
81 | 78 | ||
82 | /* *************************************************************************** | 79 | /* *************************************************************************** |
83 | * go_to_speed: -Moves to bypass, -Commits clock dividers, -puts dpll at speed | 80 | * go_to_speed: -Moves to bypass, -Commits clock dividers, -puts dpll at speed |
84 | * -executed from SRAM. | 81 | * -executed from SRAM. |
85 | * R0 = CM_CLKEN_PLL-bypass value | 82 | * R0 = CM_CLKEN_PLL-bypass value |
86 | * R1 = CM_CLKSEL1_PLL-m, n, and divider values | 83 | * R1 = CM_CLKSEL1_PLL-m, n, and divider values |
87 | * R2 = CM_CLKSEL_CORE-divider values | 84 | * R2 = CM_CLKSEL_CORE-divider values |
88 | * R3 = CM_IDLEST_CKGEN - addr dpll lock wait | 85 | * R3 = CM_IDLEST_CKGEN - addr dpll lock wait |
89 | * | 86 | * |
90 | * Note: If core unlocks/relocks and SDRAM is running fast already it gets | 87 | * Note: If core unlocks/relocks and SDRAM is running fast already it gets |
91 | * confused. A reset of the controller gets it back. Taking away its | 88 | * confused. A reset of the controller gets it back. Taking away its |
92 | * L3 when its not in self refresh seems bad for it. Normally, this | 89 | * L3 when its not in self refresh seems bad for it. Normally, this |
93 | * code runs from flash before SDR is init so that should be ok. | 90 | * code runs from flash before SDR is init so that should be ok. |
94 | ****************************************************************************/ | 91 | ****************************************************************************/ |
95 | ENTRY(go_to_speed) | 92 | ENTRY(go_to_speed) |
96 | stmfd sp!, {r4 - r6} | 93 | stmfd sp!, {r4 - r6} |
97 | 94 | ||
98 | /* move into fast relock bypass */ | 95 | /* move into fast relock bypass */ |
99 | ldr r4, pll_ctl_add | 96 | ldr r4, pll_ctl_add |
100 | str r0, [r4] | 97 | str r0, [r4] |
101 | wait1: | 98 | wait1: |
102 | ldr r5, [r3] /* get status */ | 99 | ldr r5, [r3] /* get status */ |
103 | and r5, r5, #0x1 /* isolate core status */ | 100 | and r5, r5, #0x1 /* isolate core status */ |
104 | cmp r5, #0x1 /* still locked? */ | 101 | cmp r5, #0x1 /* still locked? */ |
105 | beq wait1 /* if lock, loop */ | 102 | beq wait1 /* if lock, loop */ |
106 | 103 | ||
107 | /* set new dpll dividers _after_ in bypass */ | 104 | /* set new dpll dividers _after_ in bypass */ |
108 | ldr r5, pll_div_add1 | 105 | ldr r5, pll_div_add1 |
109 | str r1, [r5] /* set m, n, m2 */ | 106 | str r1, [r5] /* set m, n, m2 */ |
110 | ldr r5, pll_div_add2 | 107 | ldr r5, pll_div_add2 |
111 | str r2, [r5] /* set l3/l4/.. dividers*/ | 108 | str r2, [r5] /* set l3/l4/.. dividers*/ |
112 | ldr r5, pll_div_add3 /* wkup */ | 109 | ldr r5, pll_div_add3 /* wkup */ |
113 | ldr r2, pll_div_val3 /* rsm val */ | 110 | ldr r2, pll_div_val3 /* rsm val */ |
114 | str r2, [r5] | 111 | str r2, [r5] |
115 | ldr r5, pll_div_add4 /* gfx */ | 112 | ldr r5, pll_div_add4 /* gfx */ |
116 | ldr r2, pll_div_val4 | 113 | ldr r2, pll_div_val4 |
117 | str r2, [r5] | 114 | str r2, [r5] |
118 | ldr r5, pll_div_add5 /* emu */ | 115 | ldr r5, pll_div_add5 /* emu */ |
119 | ldr r2, pll_div_val5 | 116 | ldr r2, pll_div_val5 |
120 | str r2, [r5] | 117 | str r2, [r5] |
121 | 118 | ||
122 | /* now prepare GPMC (flash) for new dpll speed */ | 119 | /* now prepare GPMC (flash) for new dpll speed */ |
123 | /* flash needs to be stable when we jump back to it */ | 120 | /* flash needs to be stable when we jump back to it */ |
124 | ldr r5, flash_cfg3_addr | 121 | ldr r5, flash_cfg3_addr |
125 | ldr r2, flash_cfg3_val | 122 | ldr r2, flash_cfg3_val |
126 | str r2, [r5] | 123 | str r2, [r5] |
127 | ldr r5, flash_cfg4_addr | 124 | ldr r5, flash_cfg4_addr |
128 | ldr r2, flash_cfg4_val | 125 | ldr r2, flash_cfg4_val |
129 | str r2, [r5] | 126 | str r2, [r5] |
130 | ldr r5, flash_cfg5_addr | 127 | ldr r5, flash_cfg5_addr |
131 | ldr r2, flash_cfg5_val | 128 | ldr r2, flash_cfg5_val |
132 | str r2, [r5] | 129 | str r2, [r5] |
133 | ldr r5, flash_cfg1_addr | 130 | ldr r5, flash_cfg1_addr |
134 | ldr r2, [r5] | 131 | ldr r2, [r5] |
135 | orr r2, r2, #0x3 /* up gpmc divider */ | 132 | orr r2, r2, #0x3 /* up gpmc divider */ |
136 | str r2, [r5] | 133 | str r2, [r5] |
137 | 134 | ||
138 | /* lock DPLL3 and wait a bit */ | 135 | /* lock DPLL3 and wait a bit */ |
139 | orr r0, r0, #0x7 /* set up for lock mode */ | 136 | orr r0, r0, #0x7 /* set up for lock mode */ |
140 | str r0, [r4] /* lock */ | 137 | str r0, [r4] /* lock */ |
141 | nop /* ARM slow at this point working at sys_clk */ | 138 | nop /* ARM slow at this point working at sys_clk */ |
142 | nop | 139 | nop |
143 | nop | 140 | nop |
144 | nop | 141 | nop |
145 | wait2: | 142 | wait2: |
146 | ldr r5, [r3] /* get status */ | 143 | ldr r5, [r3] /* get status */ |
147 | and r5, r5, #0x1 /* isolate core status */ | 144 | and r5, r5, #0x1 /* isolate core status */ |
148 | cmp r5, #0x1 /* still locked? */ | 145 | cmp r5, #0x1 /* still locked? */ |
149 | bne wait2 /* if lock, loop */ | 146 | bne wait2 /* if lock, loop */ |
150 | nop | 147 | nop |
151 | nop | 148 | nop |
152 | nop | 149 | nop |
153 | nop | 150 | nop |
154 | ldmfd sp!, {r4 - r6} | 151 | ldmfd sp!, {r4 - r6} |
155 | mov pc, lr /* back to caller, locked */ | 152 | mov pc, lr /* back to caller, locked */ |
156 | ENDPROC(go_to_speed) | 153 | ENDPROC(go_to_speed) |
157 | 154 | ||
158 | _go_to_speed: .word go_to_speed | 155 | _go_to_speed: .word go_to_speed |
159 | 156 | ||
160 | /* these constants need to be close for PIC code */ | 157 | /* these constants need to be close for PIC code */ |
161 | /* The Nor has to be in the Flash Base CS0 for this condition to happen */ | 158 | /* The Nor has to be in the Flash Base CS0 for this condition to happen */ |
162 | flash_cfg1_addr: | 159 | flash_cfg1_addr: |
163 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG1) | 160 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG1) |
164 | flash_cfg3_addr: | 161 | flash_cfg3_addr: |
165 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG3) | 162 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG3) |
166 | flash_cfg3_val: | 163 | flash_cfg3_val: |
167 | .word STNOR_GPMC_CONFIG3 | 164 | .word STNOR_GPMC_CONFIG3 |
168 | flash_cfg4_addr: | 165 | flash_cfg4_addr: |
169 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG4) | 166 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG4) |
170 | flash_cfg4_val: | 167 | flash_cfg4_val: |
171 | .word STNOR_GPMC_CONFIG4 | 168 | .word STNOR_GPMC_CONFIG4 |
172 | flash_cfg5_val: | 169 | flash_cfg5_val: |
173 | .word STNOR_GPMC_CONFIG5 | 170 | .word STNOR_GPMC_CONFIG5 |
174 | flash_cfg5_addr: | 171 | flash_cfg5_addr: |
175 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG5) | 172 | .word (GPMC_CONFIG_CS0_BASE + GPMC_CONFIG5) |
176 | pll_ctl_add: | 173 | pll_ctl_add: |
177 | .word CM_CLKEN_PLL | 174 | .word CM_CLKEN_PLL |
178 | pll_div_add1: | 175 | pll_div_add1: |
179 | .word CM_CLKSEL1_PLL | 176 | .word CM_CLKSEL1_PLL |
180 | pll_div_add2: | 177 | pll_div_add2: |
181 | .word CM_CLKSEL_CORE | 178 | .word CM_CLKSEL_CORE |
182 | pll_div_add3: | 179 | pll_div_add3: |
183 | .word CM_CLKSEL_WKUP | 180 | .word CM_CLKSEL_WKUP |
184 | pll_div_val3: | 181 | pll_div_val3: |
185 | .word (WKUP_RSM << 1) | 182 | .word (WKUP_RSM << 1) |
186 | pll_div_add4: | 183 | pll_div_add4: |
187 | .word CM_CLKSEL_GFX | 184 | .word CM_CLKSEL_GFX |
188 | pll_div_val4: | 185 | pll_div_val4: |
189 | .word (GFX_DIV << 0) | 186 | .word (GFX_DIV << 0) |
190 | pll_div_add5: | 187 | pll_div_add5: |
191 | .word CM_CLKSEL1_EMU | 188 | .word CM_CLKSEL1_EMU |
192 | pll_div_val5: | 189 | pll_div_val5: |
193 | .word CLSEL1_EMU_VAL | 190 | .word CLSEL1_EMU_VAL |
194 | 191 | ||
195 | #endif | 192 | #endif |
196 | 193 | ||
197 | ENTRY(lowlevel_init) | 194 | ENTRY(lowlevel_init) |
198 | ldr sp, SRAM_STACK | 195 | ldr sp, SRAM_STACK |
199 | str ip, [sp] /* stash ip register */ | 196 | str ip, [sp] /* stash ip register */ |
200 | mov ip, lr /* save link reg across call */ | 197 | mov ip, lr /* save link reg across call */ |
201 | #if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_ONENAND_BOOT) | 198 | #if !defined(CONFIG_SYS_NAND_BOOT) && !defined(CONFIG_SYS_ONENAND_BOOT) |
202 | /* | 199 | /* |
203 | * No need to copy/exec the clock code - DPLL adjust already done | 200 | * No need to copy/exec the clock code - DPLL adjust already done |
204 | * in NAND/oneNAND Boot. | 201 | * in NAND/oneNAND Boot. |
205 | */ | 202 | */ |
206 | ldr r1, =SRAM_CLK_CODE | 203 | ldr r1, =SRAM_CLK_CODE |
207 | bl cpy_clk_code | 204 | bl cpy_clk_code |
208 | #endif /* NAND Boot */ | 205 | #endif /* NAND Boot */ |
209 | mov lr, ip /* restore link reg */ | 206 | mov lr, ip /* restore link reg */ |
210 | ldr ip, [sp] /* restore save ip */ | 207 | ldr ip, [sp] /* restore save ip */ |
211 | /* tail-call s_init to setup pll, mux, memory */ | 208 | /* tail-call s_init to setup pll, mux, memory */ |
212 | b s_init | 209 | b s_init |
213 | 210 | ||
214 | ENDPROC(lowlevel_init) | 211 | ENDPROC(lowlevel_init) |
215 | 212 | ||
216 | /* the literal pools origin */ | 213 | /* the literal pools origin */ |
217 | .ltorg | 214 | .ltorg |
218 | 215 | ||
219 | REG_CONTROL_STATUS: | 216 | REG_CONTROL_STATUS: |
220 | .word CONTROL_STATUS | 217 | .word CONTROL_STATUS |
221 | SRAM_STACK: | 218 | SRAM_STACK: |
222 | .word LOW_LEVEL_SRAM_STACK | 219 | .word LOW_LEVEL_SRAM_STACK |
223 | 220 | ||
224 | /* DPLL(1-4) PARAM TABLES */ | 221 | /* DPLL(1-4) PARAM TABLES */ |
225 | 222 | ||
226 | /* | 223 | /* |
227 | * Each of the tables has M, N, FREQSEL, M2 values defined for nominal | 224 | * Each of the tables has M, N, FREQSEL, M2 values defined for nominal |
228 | * OPP (1.2V). The fields are defined according to dpll_param struct (clock.c). | 225 | * OPP (1.2V). The fields are defined according to dpll_param struct (clock.c). |
229 | * The values are defined for all possible sysclk and for ES1 and ES2. | 226 | * The values are defined for all possible sysclk and for ES1 and ES2. |
230 | */ | 227 | */ |
231 | 228 | ||
232 | mpu_dpll_param: | 229 | mpu_dpll_param: |
233 | /* 12MHz */ | 230 | /* 12MHz */ |
234 | /* ES1 */ | 231 | /* ES1 */ |
235 | .word MPU_M_12_ES1, MPU_N_12_ES1, MPU_FSEL_12_ES1, MPU_M2_12_ES1 | 232 | .word MPU_M_12_ES1, MPU_N_12_ES1, MPU_FSEL_12_ES1, MPU_M2_12_ES1 |
236 | /* ES2 */ | 233 | /* ES2 */ |
237 | .word MPU_M_12_ES2, MPU_N_12_ES2, MPU_FSEL_12_ES2, MPU_M2_ES2 | 234 | .word MPU_M_12_ES2, MPU_N_12_ES2, MPU_FSEL_12_ES2, MPU_M2_ES2 |
238 | /* 3410 */ | 235 | /* 3410 */ |
239 | .word MPU_M_12, MPU_N_12, MPU_FSEL_12, MPU_M2_12 | 236 | .word MPU_M_12, MPU_N_12, MPU_FSEL_12, MPU_M2_12 |
240 | 237 | ||
241 | /* 13MHz */ | 238 | /* 13MHz */ |
242 | /* ES1 */ | 239 | /* ES1 */ |
243 | .word MPU_M_13_ES1, MPU_N_13_ES1, MPU_FSEL_13_ES1, MPU_M2_13_ES1 | 240 | .word MPU_M_13_ES1, MPU_N_13_ES1, MPU_FSEL_13_ES1, MPU_M2_13_ES1 |
244 | /* ES2 */ | 241 | /* ES2 */ |
245 | .word MPU_M_13_ES2, MPU_N_13_ES2, MPU_FSEL_13_ES2, MPU_M2_13_ES2 | 242 | .word MPU_M_13_ES2, MPU_N_13_ES2, MPU_FSEL_13_ES2, MPU_M2_13_ES2 |
246 | /* 3410 */ | 243 | /* 3410 */ |
247 | .word MPU_M_13, MPU_N_13, MPU_FSEL_13, MPU_M2_13 | 244 | .word MPU_M_13, MPU_N_13, MPU_FSEL_13, MPU_M2_13 |
248 | 245 | ||
249 | /* 19.2MHz */ | 246 | /* 19.2MHz */ |
250 | /* ES1 */ | 247 | /* ES1 */ |
251 | .word MPU_M_19P2_ES1, MPU_N_19P2_ES1, MPU_FSEL_19P2_ES1, MPU_M2_19P2_ES1 | 248 | .word MPU_M_19P2_ES1, MPU_N_19P2_ES1, MPU_FSEL_19P2_ES1, MPU_M2_19P2_ES1 |
252 | /* ES2 */ | 249 | /* ES2 */ |
253 | .word MPU_M_19P2_ES2, MPU_N_19P2_ES2, MPU_FSEL_19P2_ES2, MPU_M2_19P2_ES2 | 250 | .word MPU_M_19P2_ES2, MPU_N_19P2_ES2, MPU_FSEL_19P2_ES2, MPU_M2_19P2_ES2 |
254 | /* 3410 */ | 251 | /* 3410 */ |
255 | .word MPU_M_19P2, MPU_N_19P2, MPU_FSEL_19P2, MPU_M2_19P2 | 252 | .word MPU_M_19P2, MPU_N_19P2, MPU_FSEL_19P2, MPU_M2_19P2 |
256 | 253 | ||
257 | /* 26MHz */ | 254 | /* 26MHz */ |
258 | /* ES1 */ | 255 | /* ES1 */ |
259 | .word MPU_M_26_ES1, MPU_N_26_ES1, MPU_FSEL_26_ES1, MPU_M2_26_ES1 | 256 | .word MPU_M_26_ES1, MPU_N_26_ES1, MPU_FSEL_26_ES1, MPU_M2_26_ES1 |
260 | /* ES2 */ | 257 | /* ES2 */ |
261 | .word MPU_M_26_ES2, MPU_N_26_ES2, MPU_FSEL_26_ES2, MPU_M2_26_ES2 | 258 | .word MPU_M_26_ES2, MPU_N_26_ES2, MPU_FSEL_26_ES2, MPU_M2_26_ES2 |
262 | /* 3410 */ | 259 | /* 3410 */ |
263 | .word MPU_M_26, MPU_N_26, MPU_FSEL_26, MPU_M2_26 | 260 | .word MPU_M_26, MPU_N_26, MPU_FSEL_26, MPU_M2_26 |
264 | 261 | ||
265 | /* 38.4MHz */ | 262 | /* 38.4MHz */ |
266 | /* ES1 */ | 263 | /* ES1 */ |
267 | .word MPU_M_38P4_ES1, MPU_N_38P4_ES1, MPU_FSEL_38P4_ES1, MPU_M2_38P4_ES1 | 264 | .word MPU_M_38P4_ES1, MPU_N_38P4_ES1, MPU_FSEL_38P4_ES1, MPU_M2_38P4_ES1 |
268 | /* ES2 */ | 265 | /* ES2 */ |
269 | .word MPU_M_38P4_ES2, MPU_N_38P4_ES2, MPU_FSEL_38P4_ES2, MPU_M2_38P4_ES2 | 266 | .word MPU_M_38P4_ES2, MPU_N_38P4_ES2, MPU_FSEL_38P4_ES2, MPU_M2_38P4_ES2 |
270 | /* 3410 */ | 267 | /* 3410 */ |
271 | .word MPU_M_38P4, MPU_N_38P4, MPU_FSEL_38P4, MPU_M2_38P4 | 268 | .word MPU_M_38P4, MPU_N_38P4, MPU_FSEL_38P4, MPU_M2_38P4 |
272 | 269 | ||
273 | 270 | ||
274 | .globl get_mpu_dpll_param | 271 | .globl get_mpu_dpll_param |
275 | get_mpu_dpll_param: | 272 | get_mpu_dpll_param: |
276 | adr r0, mpu_dpll_param | 273 | adr r0, mpu_dpll_param |
277 | mov pc, lr | 274 | mov pc, lr |
278 | 275 | ||
279 | iva_dpll_param: | 276 | iva_dpll_param: |
280 | /* 12MHz */ | 277 | /* 12MHz */ |
281 | /* ES1 */ | 278 | /* ES1 */ |
282 | .word IVA_M_12_ES1, IVA_N_12_ES1, IVA_FSEL_12_ES1, IVA_M2_12_ES1 | 279 | .word IVA_M_12_ES1, IVA_N_12_ES1, IVA_FSEL_12_ES1, IVA_M2_12_ES1 |
283 | /* ES2 */ | 280 | /* ES2 */ |
284 | .word IVA_M_12_ES2, IVA_N_12_ES2, IVA_FSEL_12_ES2, IVA_M2_12_ES2 | 281 | .word IVA_M_12_ES2, IVA_N_12_ES2, IVA_FSEL_12_ES2, IVA_M2_12_ES2 |
285 | /* 3410 */ | 282 | /* 3410 */ |
286 | .word IVA_M_12, IVA_N_12, IVA_FSEL_12, IVA_M2_12 | 283 | .word IVA_M_12, IVA_N_12, IVA_FSEL_12, IVA_M2_12 |
287 | 284 | ||
288 | /* 13MHz */ | 285 | /* 13MHz */ |
289 | /* ES1 */ | 286 | /* ES1 */ |
290 | .word IVA_M_13_ES1, IVA_N_13_ES1, IVA_FSEL_13_ES1, IVA_M2_13_ES1 | 287 | .word IVA_M_13_ES1, IVA_N_13_ES1, IVA_FSEL_13_ES1, IVA_M2_13_ES1 |
291 | /* ES2 */ | 288 | /* ES2 */ |
292 | .word IVA_M_13_ES2, IVA_N_13_ES2, IVA_FSEL_13_ES2, IVA_M2_13_ES2 | 289 | .word IVA_M_13_ES2, IVA_N_13_ES2, IVA_FSEL_13_ES2, IVA_M2_13_ES2 |
293 | /* 3410 */ | 290 | /* 3410 */ |
294 | .word IVA_M_13, IVA_N_13, IVA_FSEL_13, IVA_M2_13 | 291 | .word IVA_M_13, IVA_N_13, IVA_FSEL_13, IVA_M2_13 |
295 | 292 | ||
296 | /* 19.2MHz */ | 293 | /* 19.2MHz */ |
297 | /* ES1 */ | 294 | /* ES1 */ |
298 | .word IVA_M_19P2_ES1, IVA_N_19P2_ES1, IVA_FSEL_19P2_ES1, IVA_M2_19P2_ES1 | 295 | .word IVA_M_19P2_ES1, IVA_N_19P2_ES1, IVA_FSEL_19P2_ES1, IVA_M2_19P2_ES1 |
299 | /* ES2 */ | 296 | /* ES2 */ |
300 | .word IVA_M_19P2_ES2, IVA_N_19P2_ES2, IVA_FSEL_19P2_ES2, IVA_M2_19P2_ES2 | 297 | .word IVA_M_19P2_ES2, IVA_N_19P2_ES2, IVA_FSEL_19P2_ES2, IVA_M2_19P2_ES2 |
301 | /* 3410 */ | 298 | /* 3410 */ |
302 | .word IVA_M_19P2, IVA_N_19P2, IVA_FSEL_19P2, IVA_M2_19P2 | 299 | .word IVA_M_19P2, IVA_N_19P2, IVA_FSEL_19P2, IVA_M2_19P2 |
303 | 300 | ||
304 | /* 26MHz */ | 301 | /* 26MHz */ |
305 | /* ES1 */ | 302 | /* ES1 */ |
306 | .word IVA_M_26_ES1, IVA_N_26_ES1, IVA_FSEL_26_ES1, IVA_M2_26_ES1 | 303 | .word IVA_M_26_ES1, IVA_N_26_ES1, IVA_FSEL_26_ES1, IVA_M2_26_ES1 |
307 | /* ES2 */ | 304 | /* ES2 */ |
308 | .word IVA_M_26_ES2, IVA_N_26_ES2, IVA_FSEL_26_ES2, IVA_M2_26_ES2 | 305 | .word IVA_M_26_ES2, IVA_N_26_ES2, IVA_FSEL_26_ES2, IVA_M2_26_ES2 |
309 | /* 3410 */ | 306 | /* 3410 */ |
310 | .word IVA_M_26, IVA_N_26, IVA_FSEL_26, IVA_M2_26 | 307 | .word IVA_M_26, IVA_N_26, IVA_FSEL_26, IVA_M2_26 |
311 | 308 | ||
312 | /* 38.4MHz */ | 309 | /* 38.4MHz */ |
313 | /* ES1 */ | 310 | /* ES1 */ |
314 | .word IVA_M_38P4_ES1, IVA_N_38P4_ES1, IVA_FSEL_38P4_ES1, IVA_M2_38P4_ES1 | 311 | .word IVA_M_38P4_ES1, IVA_N_38P4_ES1, IVA_FSEL_38P4_ES1, IVA_M2_38P4_ES1 |
315 | /* ES2 */ | 312 | /* ES2 */ |
316 | .word IVA_M_38P4_ES2, IVA_N_38P4_ES2, IVA_FSEL_38P4_ES2, IVA_M2_38P4_ES2 | 313 | .word IVA_M_38P4_ES2, IVA_N_38P4_ES2, IVA_FSEL_38P4_ES2, IVA_M2_38P4_ES2 |
317 | /* 3410 */ | 314 | /* 3410 */ |
318 | .word IVA_M_38P4, IVA_N_38P4, IVA_FSEL_38P4, IVA_M2_38P4 | 315 | .word IVA_M_38P4, IVA_N_38P4, IVA_FSEL_38P4, IVA_M2_38P4 |
319 | 316 | ||
320 | 317 | ||
321 | .globl get_iva_dpll_param | 318 | .globl get_iva_dpll_param |
322 | get_iva_dpll_param: | 319 | get_iva_dpll_param: |
323 | adr r0, iva_dpll_param | 320 | adr r0, iva_dpll_param |
324 | mov pc, lr | 321 | mov pc, lr |
325 | 322 | ||
326 | /* Core DPLL targets for L3 at 166 & L133 */ | 323 | /* Core DPLL targets for L3 at 166 & L133 */ |
327 | core_dpll_param: | 324 | core_dpll_param: |
328 | /* 12MHz */ | 325 | /* 12MHz */ |
329 | /* ES1 */ | 326 | /* ES1 */ |
330 | .word CORE_M_12_ES1, CORE_N_12_ES1, CORE_FSL_12_ES1, CORE_M2_12_ES1 | 327 | .word CORE_M_12_ES1, CORE_N_12_ES1, CORE_FSL_12_ES1, CORE_M2_12_ES1 |
331 | /* ES2 */ | 328 | /* ES2 */ |
332 | .word CORE_M_12, CORE_N_12, CORE_FSEL_12, CORE_M2_12 | 329 | .word CORE_M_12, CORE_N_12, CORE_FSEL_12, CORE_M2_12 |
333 | /* 3410 */ | 330 | /* 3410 */ |
334 | .word CORE_M_12, CORE_N_12, CORE_FSEL_12, CORE_M2_12 | 331 | .word CORE_M_12, CORE_N_12, CORE_FSEL_12, CORE_M2_12 |
335 | 332 | ||
336 | /* 13MHz */ | 333 | /* 13MHz */ |
337 | /* ES1 */ | 334 | /* ES1 */ |
338 | .word CORE_M_13_ES1, CORE_N_13_ES1, CORE_FSL_13_ES1, CORE_M2_13_ES1 | 335 | .word CORE_M_13_ES1, CORE_N_13_ES1, CORE_FSL_13_ES1, CORE_M2_13_ES1 |
339 | /* ES2 */ | 336 | /* ES2 */ |
340 | .word CORE_M_13, CORE_N_13, CORE_FSEL_13, CORE_M2_13 | 337 | .word CORE_M_13, CORE_N_13, CORE_FSEL_13, CORE_M2_13 |
341 | /* 3410 */ | 338 | /* 3410 */ |
342 | .word CORE_M_13, CORE_N_13, CORE_FSEL_13, CORE_M2_13 | 339 | .word CORE_M_13, CORE_N_13, CORE_FSEL_13, CORE_M2_13 |
343 | 340 | ||
344 | /* 19.2MHz */ | 341 | /* 19.2MHz */ |
345 | /* ES1 */ | 342 | /* ES1 */ |
346 | .word CORE_M_19P2_ES1, CORE_N_19P2_ES1, CORE_FSL_19P2_ES1, CORE_M2_19P2_ES1 | 343 | .word CORE_M_19P2_ES1, CORE_N_19P2_ES1, CORE_FSL_19P2_ES1, CORE_M2_19P2_ES1 |
347 | /* ES2 */ | 344 | /* ES2 */ |
348 | .word CORE_M_19P2, CORE_N_19P2, CORE_FSEL_19P2, CORE_M2_19P2 | 345 | .word CORE_M_19P2, CORE_N_19P2, CORE_FSEL_19P2, CORE_M2_19P2 |
349 | /* 3410 */ | 346 | /* 3410 */ |
350 | .word CORE_M_19P2, CORE_N_19P2, CORE_FSEL_19P2, CORE_M2_19P2 | 347 | .word CORE_M_19P2, CORE_N_19P2, CORE_FSEL_19P2, CORE_M2_19P2 |
351 | 348 | ||
352 | /* 26MHz */ | 349 | /* 26MHz */ |
353 | /* ES1 */ | 350 | /* ES1 */ |
354 | .word CORE_M_26_ES1, CORE_N_26_ES1, CORE_FSL_26_ES1, CORE_M2_26_ES1 | 351 | .word CORE_M_26_ES1, CORE_N_26_ES1, CORE_FSL_26_ES1, CORE_M2_26_ES1 |
355 | /* ES2 */ | 352 | /* ES2 */ |
356 | .word CORE_M_26, CORE_N_26, CORE_FSEL_26, CORE_M2_26 | 353 | .word CORE_M_26, CORE_N_26, CORE_FSEL_26, CORE_M2_26 |
357 | /* 3410 */ | 354 | /* 3410 */ |
358 | .word CORE_M_26, CORE_N_26, CORE_FSEL_26, CORE_M2_26 | 355 | .word CORE_M_26, CORE_N_26, CORE_FSEL_26, CORE_M2_26 |
359 | 356 | ||
360 | /* 38.4MHz */ | 357 | /* 38.4MHz */ |
361 | /* ES1 */ | 358 | /* ES1 */ |
362 | .word CORE_M_38P4_ES1, CORE_N_38P4_ES1, CORE_FSL_38P4_ES1, CORE_M2_38P4_ES1 | 359 | .word CORE_M_38P4_ES1, CORE_N_38P4_ES1, CORE_FSL_38P4_ES1, CORE_M2_38P4_ES1 |
363 | /* ES2 */ | 360 | /* ES2 */ |
364 | .word CORE_M_38P4, CORE_N_38P4, CORE_FSEL_38P4, CORE_M2_38P4 | 361 | .word CORE_M_38P4, CORE_N_38P4, CORE_FSEL_38P4, CORE_M2_38P4 |
365 | /* 3410 */ | 362 | /* 3410 */ |
366 | .word CORE_M_38P4, CORE_N_38P4, CORE_FSEL_38P4, CORE_M2_38P4 | 363 | .word CORE_M_38P4, CORE_N_38P4, CORE_FSEL_38P4, CORE_M2_38P4 |
367 | 364 | ||
368 | .globl get_core_dpll_param | 365 | .globl get_core_dpll_param |
369 | get_core_dpll_param: | 366 | get_core_dpll_param: |
370 | adr r0, core_dpll_param | 367 | adr r0, core_dpll_param |
371 | mov pc, lr | 368 | mov pc, lr |
372 | 369 | ||
373 | /* PER DPLL values are same for both ES1 and ES2 */ | 370 | /* PER DPLL values are same for both ES1 and ES2 */ |
374 | per_dpll_param: | 371 | per_dpll_param: |
375 | /* 12MHz */ | 372 | /* 12MHz */ |
376 | .word PER_M_12, PER_N_12, PER_FSEL_12, PER_M2_12 | 373 | .word PER_M_12, PER_N_12, PER_FSEL_12, PER_M2_12 |
377 | 374 | ||
378 | /* 13MHz */ | 375 | /* 13MHz */ |
379 | .word PER_M_13, PER_N_13, PER_FSEL_13, PER_M2_13 | 376 | .word PER_M_13, PER_N_13, PER_FSEL_13, PER_M2_13 |
380 | 377 | ||
381 | /* 19.2MHz */ | 378 | /* 19.2MHz */ |
382 | .word PER_M_19P2, PER_N_19P2, PER_FSEL_19P2, PER_M2_19P2 | 379 | .word PER_M_19P2, PER_N_19P2, PER_FSEL_19P2, PER_M2_19P2 |
383 | 380 | ||
384 | /* 26MHz */ | 381 | /* 26MHz */ |
385 | .word PER_M_26, PER_N_26, PER_FSEL_26, PER_M2_26 | 382 | .word PER_M_26, PER_N_26, PER_FSEL_26, PER_M2_26 |
386 | 383 | ||
387 | /* 38.4MHz */ | 384 | /* 38.4MHz */ |
388 | .word PER_M_38P4, PER_N_38P4, PER_FSEL_38P4, PER_M2_38P4 | 385 | .word PER_M_38P4, PER_N_38P4, PER_FSEL_38P4, PER_M2_38P4 |
389 | 386 | ||
390 | .globl get_per_dpll_param | 387 | .globl get_per_dpll_param |
391 | get_per_dpll_param: | 388 | get_per_dpll_param: |
392 | adr r0, per_dpll_param | 389 | adr r0, per_dpll_param |
393 | mov pc, lr | 390 | mov pc, lr |
394 | 391 | ||
395 | /* PER2 DPLL values */ | 392 | /* PER2 DPLL values */ |
396 | per2_dpll_param: | 393 | per2_dpll_param: |
397 | /* 12MHz */ | 394 | /* 12MHz */ |
398 | .word PER2_M_12, PER2_N_12, PER2_FSEL_12, PER2_M2_12 | 395 | .word PER2_M_12, PER2_N_12, PER2_FSEL_12, PER2_M2_12 |
399 | 396 | ||
400 | /* 13MHz */ | 397 | /* 13MHz */ |
401 | .word PER2_M_13, PER2_N_13, PER2_FSEL_13, PER2_M2_13 | 398 | .word PER2_M_13, PER2_N_13, PER2_FSEL_13, PER2_M2_13 |
402 | 399 | ||
403 | /* 19.2MHz */ | 400 | /* 19.2MHz */ |
404 | .word PER2_M_19P2, PER2_N_19P2, PER2_FSEL_19P2, PER2_M2_19P2 | 401 | .word PER2_M_19P2, PER2_N_19P2, PER2_FSEL_19P2, PER2_M2_19P2 |
405 | 402 | ||
406 | /* 26MHz */ | 403 | /* 26MHz */ |
407 | .word PER2_M_26, PER2_N_26, PER2_FSEL_26, PER2_M2_26 | 404 | .word PER2_M_26, PER2_N_26, PER2_FSEL_26, PER2_M2_26 |
408 | 405 | ||
409 | /* 38.4MHz */ | 406 | /* 38.4MHz */ |
410 | .word PER2_M_38P4, PER2_N_38P4, PER2_FSEL_38P4, PER2_M2_38P4 | 407 | .word PER2_M_38P4, PER2_N_38P4, PER2_FSEL_38P4, PER2_M2_38P4 |
411 | 408 | ||
412 | .globl get_per2_dpll_param | 409 | .globl get_per2_dpll_param |
413 | get_per2_dpll_param: | 410 | get_per2_dpll_param: |
414 | adr r0, per2_dpll_param | 411 | adr r0, per2_dpll_param |
415 | mov pc, lr | 412 | mov pc, lr |
416 | 413 | ||
417 | /* | 414 | /* |
418 | * Tables for 36XX/37XX devices | 415 | * Tables for 36XX/37XX devices |
419 | * | 416 | * |
420 | */ | 417 | */ |
421 | mpu_36x_dpll_param: | 418 | mpu_36x_dpll_param: |
422 | /* 12MHz */ | 419 | /* 12MHz */ |
423 | .word 50, 0, 0, 1 | 420 | .word 50, 0, 0, 1 |
424 | /* 13MHz */ | 421 | /* 13MHz */ |
425 | .word 600, 12, 0, 1 | 422 | .word 600, 12, 0, 1 |
426 | /* 19.2MHz */ | 423 | /* 19.2MHz */ |
427 | .word 125, 3, 0, 1 | 424 | .word 125, 3, 0, 1 |
428 | /* 26MHz */ | 425 | /* 26MHz */ |
429 | .word 300, 12, 0, 1 | 426 | .word 300, 12, 0, 1 |
430 | /* 38.4MHz */ | 427 | /* 38.4MHz */ |
431 | .word 125, 7, 0, 1 | 428 | .word 125, 7, 0, 1 |
432 | 429 | ||
433 | iva_36x_dpll_param: | 430 | iva_36x_dpll_param: |
434 | /* 12MHz */ | 431 | /* 12MHz */ |
435 | .word 130, 2, 0, 1 | 432 | .word 130, 2, 0, 1 |
436 | /* 13MHz */ | 433 | /* 13MHz */ |
437 | .word 20, 0, 0, 1 | 434 | .word 20, 0, 0, 1 |
438 | /* 19.2MHz */ | 435 | /* 19.2MHz */ |
439 | .word 325, 11, 0, 1 | 436 | .word 325, 11, 0, 1 |
440 | /* 26MHz */ | 437 | /* 26MHz */ |
441 | .word 10, 0, 0, 1 | 438 | .word 10, 0, 0, 1 |
442 | /* 38.4MHz */ | 439 | /* 38.4MHz */ |
443 | .word 325, 23, 0, 1 | 440 | .word 325, 23, 0, 1 |
444 | 441 | ||
445 | core_36x_dpll_param: | 442 | core_36x_dpll_param: |
446 | /* 12MHz */ | 443 | /* 12MHz */ |
447 | .word 100, 2, 0, 1 | 444 | .word 100, 2, 0, 1 |
448 | /* 13MHz */ | 445 | /* 13MHz */ |
449 | .word 400, 12, 0, 1 | 446 | .word 400, 12, 0, 1 |
450 | /* 19.2MHz */ | 447 | /* 19.2MHz */ |
451 | .word 375, 17, 0, 1 | 448 | .word 375, 17, 0, 1 |
452 | /* 26MHz */ | 449 | /* 26MHz */ |
453 | .word 200, 12, 0, 1 | 450 | .word 200, 12, 0, 1 |
454 | /* 38.4MHz */ | 451 | /* 38.4MHz */ |
455 | .word 375, 35, 0, 1 | 452 | .word 375, 35, 0, 1 |
456 | 453 | ||
457 | per_36x_dpll_param: | 454 | per_36x_dpll_param: |
458 | /* SYSCLK M N M2 M3 M4 M5 M6 m2DIV */ | 455 | /* SYSCLK M N M2 M3 M4 M5 M6 m2DIV */ |
459 | .word 12000, 360, 4, 9, 16, 5, 4, 3, 1 | 456 | .word 12000, 360, 4, 9, 16, 5, 4, 3, 1 |
460 | .word 13000, 864, 12, 9, 16, 9, 4, 3, 1 | 457 | .word 13000, 864, 12, 9, 16, 9, 4, 3, 1 |
461 | .word 19200, 360, 7, 9, 16, 5, 4, 3, 1 | 458 | .word 19200, 360, 7, 9, 16, 5, 4, 3, 1 |
462 | .word 26000, 432, 12, 9, 16, 9, 4, 3, 1 | 459 | .word 26000, 432, 12, 9, 16, 9, 4, 3, 1 |
463 | .word 38400, 360, 15, 9, 16, 5, 4, 3, 1 | 460 | .word 38400, 360, 15, 9, 16, 5, 4, 3, 1 |
464 | 461 | ||
465 | per2_36x_dpll_param: | 462 | per2_36x_dpll_param: |
466 | /* 12MHz */ | 463 | /* 12MHz */ |
467 | .word PER2_36XX_M_12, PER2_36XX_N_12, 0, PER2_36XX_M2_12 | 464 | .word PER2_36XX_M_12, PER2_36XX_N_12, 0, PER2_36XX_M2_12 |
468 | /* 13MHz */ | 465 | /* 13MHz */ |
469 | .word PER2_36XX_M_13, PER2_36XX_N_13, 0, PER2_36XX_M2_13 | 466 | .word PER2_36XX_M_13, PER2_36XX_N_13, 0, PER2_36XX_M2_13 |
470 | /* 19.2MHz */ | 467 | /* 19.2MHz */ |
471 | .word PER2_36XX_M_19P2, PER2_36XX_N_19P2, 0, PER2_36XX_M2_19P2 | 468 | .word PER2_36XX_M_19P2, PER2_36XX_N_19P2, 0, PER2_36XX_M2_19P2 |
472 | /* 26MHz */ | 469 | /* 26MHz */ |
473 | .word PER2_36XX_M_26, PER2_36XX_N_26, 0, PER2_36XX_M2_26 | 470 | .word PER2_36XX_M_26, PER2_36XX_N_26, 0, PER2_36XX_M2_26 |
474 | /* 38.4MHz */ | 471 | /* 38.4MHz */ |
475 | .word PER2_36XX_M_38P4, PER2_36XX_N_38P4, 0, PER2_36XX_M2_38P4 | 472 | .word PER2_36XX_M_38P4, PER2_36XX_N_38P4, 0, PER2_36XX_M2_38P4 |
476 | 473 | ||
477 | 474 | ||
478 | ENTRY(get_36x_mpu_dpll_param) | 475 | ENTRY(get_36x_mpu_dpll_param) |
479 | adr r0, mpu_36x_dpll_param | 476 | adr r0, mpu_36x_dpll_param |
480 | mov pc, lr | 477 | mov pc, lr |
481 | ENDPROC(get_36x_mpu_dpll_param) | 478 | ENDPROC(get_36x_mpu_dpll_param) |
482 | 479 | ||
483 | ENTRY(get_36x_iva_dpll_param) | 480 | ENTRY(get_36x_iva_dpll_param) |
484 | adr r0, iva_36x_dpll_param | 481 | adr r0, iva_36x_dpll_param |
485 | mov pc, lr | 482 | mov pc, lr |
486 | ENDPROC(get_36x_iva_dpll_param) | 483 | ENDPROC(get_36x_iva_dpll_param) |
487 | 484 | ||
488 | ENTRY(get_36x_core_dpll_param) | 485 | ENTRY(get_36x_core_dpll_param) |
489 | adr r0, core_36x_dpll_param | 486 | adr r0, core_36x_dpll_param |
490 | mov pc, lr | 487 | mov pc, lr |
491 | ENDPROC(get_36x_core_dpll_param) | 488 | ENDPROC(get_36x_core_dpll_param) |
492 | 489 | ||
493 | ENTRY(get_36x_per_dpll_param) | 490 | ENTRY(get_36x_per_dpll_param) |
494 | adr r0, per_36x_dpll_param | 491 | adr r0, per_36x_dpll_param |
495 | mov pc, lr | 492 | mov pc, lr |
496 | ENDPROC(get_36x_per_dpll_param) | 493 | ENDPROC(get_36x_per_dpll_param) |
497 | 494 | ||
498 | ENTRY(get_36x_per2_dpll_param) | 495 | ENTRY(get_36x_per2_dpll_param) |
499 | adr r0, per2_36x_dpll_param | 496 | adr r0, per2_36x_dpll_param |
500 | mov pc, lr | 497 | mov pc, lr |
501 | ENDPROC(get_36x_per2_dpll_param) | 498 | ENDPROC(get_36x_per2_dpll_param) |
502 | 499 |
arch/arm/cpu/armv7/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for OMAP3530/ARM Cortex CPU-core | 2 | * armboot - Startup Code for OMAP3530/ARM Cortex CPU-core |
3 | * | 3 | * |
4 | * Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com> | 4 | * Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com> |
5 | * | 5 | * |
6 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> | 6 | * Copyright (c) 2001 Marius Grรถger <mag@sysgo.de> |
7 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> | 7 | * Copyright (c) 2002 Alex Zรผpke <azu@sysgo.de> |
8 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> | 8 | * Copyright (c) 2002 Gary Jennejohn <garyj@denx.de> |
9 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> | 9 | * Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com> |
10 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> | 10 | * Copyright (c) 2003 Kshitij <kshitij@ti.com> |
11 | * Copyright (c) 2006-2008 Syed Mohammed Khasim <x0khasim@ti.com> | 11 | * Copyright (c) 2006-2008 Syed Mohammed Khasim <x0khasim@ti.com> |
12 | * | 12 | * |
13 | * SPDX-License-Identifier: GPL-2.0+ | 13 | * SPDX-License-Identifier: GPL-2.0+ |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <asm-offsets.h> | 16 | #include <asm-offsets.h> |
17 | #include <config.h> | 17 | #include <config.h> |
18 | #include <version.h> | 18 | #include <version.h> |
19 | #include <asm/system.h> | 19 | #include <asm/system.h> |
20 | #include <linux/linkage.h> | 20 | #include <linux/linkage.h> |
21 | 21 | ||
22 | .globl _start | 22 | .globl _start |
23 | _start: b reset | 23 | _start: b reset |
24 | ldr pc, _undefined_instruction | 24 | ldr pc, _undefined_instruction |
25 | ldr pc, _software_interrupt | 25 | ldr pc, _software_interrupt |
26 | ldr pc, _prefetch_abort | 26 | ldr pc, _prefetch_abort |
27 | ldr pc, _data_abort | 27 | ldr pc, _data_abort |
28 | ldr pc, _not_used | 28 | ldr pc, _not_used |
29 | ldr pc, _irq | 29 | ldr pc, _irq |
30 | ldr pc, _fiq | 30 | ldr pc, _fiq |
31 | #ifdef CONFIG_SPL_BUILD | 31 | #ifdef CONFIG_SPL_BUILD |
32 | _undefined_instruction: .word _undefined_instruction | 32 | _undefined_instruction: .word _undefined_instruction |
33 | _software_interrupt: .word _software_interrupt | 33 | _software_interrupt: .word _software_interrupt |
34 | _prefetch_abort: .word _prefetch_abort | 34 | _prefetch_abort: .word _prefetch_abort |
35 | _data_abort: .word _data_abort | 35 | _data_abort: .word _data_abort |
36 | _not_used: .word _not_used | 36 | _not_used: .word _not_used |
37 | _irq: .word _irq | 37 | _irq: .word _irq |
38 | _fiq: .word _fiq | 38 | _fiq: .word _fiq |
39 | _pad: .word 0x12345678 /* now 16*4=64 */ | 39 | _pad: .word 0x12345678 /* now 16*4=64 */ |
40 | #else | 40 | #else |
41 | .globl _undefined_instruction | 41 | .globl _undefined_instruction |
42 | _undefined_instruction: .word undefined_instruction | 42 | _undefined_instruction: .word undefined_instruction |
43 | .globl _software_interrupt | 43 | .globl _software_interrupt |
44 | _software_interrupt: .word software_interrupt | 44 | _software_interrupt: .word software_interrupt |
45 | .globl _prefetch_abort | 45 | .globl _prefetch_abort |
46 | _prefetch_abort: .word prefetch_abort | 46 | _prefetch_abort: .word prefetch_abort |
47 | .globl _data_abort | 47 | .globl _data_abort |
48 | _data_abort: .word data_abort | 48 | _data_abort: .word data_abort |
49 | .globl _not_used | 49 | .globl _not_used |
50 | _not_used: .word not_used | 50 | _not_used: .word not_used |
51 | .globl _irq | 51 | .globl _irq |
52 | _irq: .word irq | 52 | _irq: .word irq |
53 | .globl _fiq | 53 | .globl _fiq |
54 | _fiq: .word fiq | 54 | _fiq: .word fiq |
55 | _pad: .word 0x12345678 /* now 16*4=64 */ | 55 | _pad: .word 0x12345678 /* now 16*4=64 */ |
56 | #endif /* CONFIG_SPL_BUILD */ | 56 | #endif /* CONFIG_SPL_BUILD */ |
57 | 57 | ||
58 | .global _end_vect | 58 | .global _end_vect |
59 | _end_vect: | 59 | _end_vect: |
60 | 60 | ||
61 | .balignl 16,0xdeadbeef | 61 | .balignl 16,0xdeadbeef |
62 | /************************************************************************* | 62 | /************************************************************************* |
63 | * | 63 | * |
64 | * Startup Code (reset vector) | 64 | * Startup Code (reset vector) |
65 | * | 65 | * |
66 | * do important init only if we don't start from memory! | 66 | * do important init only if we don't start from memory! |
67 | * setup Memory and board specific bits prior to relocation. | 67 | * setup Memory and board specific bits prior to relocation. |
68 | * relocate armboot to ram | 68 | * relocate armboot to ram |
69 | * setup stack | 69 | * setup stack |
70 | * | 70 | * |
71 | *************************************************************************/ | 71 | *************************************************************************/ |
72 | 72 | ||
73 | .globl _TEXT_BASE | ||
74 | _TEXT_BASE: | ||
75 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
76 | .word CONFIG_SPL_TEXT_BASE | ||
77 | #else | ||
78 | .word CONFIG_SYS_TEXT_BASE | ||
79 | #endif | ||
80 | |||
81 | /* | ||
82 | * These are defined in the board-specific linker script. | ||
83 | */ | ||
84 | .globl _bss_start_ofs | ||
85 | _bss_start_ofs: | ||
86 | .word __bss_start - _start | ||
87 | |||
88 | .globl _bss_end_ofs | ||
89 | _bss_end_ofs: | ||
90 | .word __bss_end - _start | ||
91 | |||
92 | .globl _end_ofs | ||
93 | _end_ofs: | ||
94 | .word _end - _start | ||
95 | |||
96 | #ifdef CONFIG_USE_IRQ | 73 | #ifdef CONFIG_USE_IRQ |
97 | /* IRQ stack memory (calculated at run-time) */ | 74 | /* IRQ stack memory (calculated at run-time) */ |
98 | .globl IRQ_STACK_START | 75 | .globl IRQ_STACK_START |
99 | IRQ_STACK_START: | 76 | IRQ_STACK_START: |
100 | .word 0x0badc0de | 77 | .word 0x0badc0de |
101 | 78 | ||
102 | /* IRQ stack memory (calculated at run-time) */ | 79 | /* IRQ stack memory (calculated at run-time) */ |
103 | .globl FIQ_STACK_START | 80 | .globl FIQ_STACK_START |
104 | FIQ_STACK_START: | 81 | FIQ_STACK_START: |
105 | .word 0x0badc0de | 82 | .word 0x0badc0de |
106 | #endif | 83 | #endif |
107 | 84 | ||
108 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 85 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
109 | .globl IRQ_STACK_START_IN | 86 | .globl IRQ_STACK_START_IN |
110 | IRQ_STACK_START_IN: | 87 | IRQ_STACK_START_IN: |
111 | .word 0x0badc0de | 88 | .word 0x0badc0de |
112 | 89 | ||
113 | /* | 90 | /* |
114 | * the actual reset code | 91 | * the actual reset code |
115 | */ | 92 | */ |
116 | 93 | ||
117 | reset: | 94 | reset: |
118 | bl save_boot_params | 95 | bl save_boot_params |
119 | /* | 96 | /* |
120 | * disable interrupts (FIQ and IRQ), also set the cpu to SVC32 mode, | 97 | * disable interrupts (FIQ and IRQ), also set the cpu to SVC32 mode, |
121 | * except if in HYP mode already | 98 | * except if in HYP mode already |
122 | */ | 99 | */ |
123 | mrs r0, cpsr | 100 | mrs r0, cpsr |
124 | and r1, r0, #0x1f @ mask mode bits | 101 | and r1, r0, #0x1f @ mask mode bits |
125 | teq r1, #0x1a @ test for HYP mode | 102 | teq r1, #0x1a @ test for HYP mode |
126 | bicne r0, r0, #0x1f @ clear all mode bits | 103 | bicne r0, r0, #0x1f @ clear all mode bits |
127 | orrne r0, r0, #0x13 @ set SVC mode | 104 | orrne r0, r0, #0x13 @ set SVC mode |
128 | orr r0, r0, #0xc0 @ disable FIQ and IRQ | 105 | orr r0, r0, #0xc0 @ disable FIQ and IRQ |
129 | msr cpsr,r0 | 106 | msr cpsr,r0 |
130 | 107 | ||
131 | /* | 108 | /* |
132 | * Setup vector: | 109 | * Setup vector: |
133 | * (OMAP4 spl TEXT_BASE is not 32 byte aligned. | 110 | * (OMAP4 spl TEXT_BASE is not 32 byte aligned. |
134 | * Continue to use ROM code vector only in OMAP4 spl) | 111 | * Continue to use ROM code vector only in OMAP4 spl) |
135 | */ | 112 | */ |
136 | #if !(defined(CONFIG_OMAP44XX) && defined(CONFIG_SPL_BUILD)) | 113 | #if !(defined(CONFIG_OMAP44XX) && defined(CONFIG_SPL_BUILD)) |
137 | /* Set V=0 in CP15 SCTRL register - for VBAR to point to vector */ | 114 | /* Set V=0 in CP15 SCTRL register - for VBAR to point to vector */ |
138 | mrc p15, 0, r0, c1, c0, 0 @ Read CP15 SCTRL Register | 115 | mrc p15, 0, r0, c1, c0, 0 @ Read CP15 SCTRL Register |
139 | bic r0, #CR_V @ V = 0 | 116 | bic r0, #CR_V @ V = 0 |
140 | mcr p15, 0, r0, c1, c0, 0 @ Write CP15 SCTRL Register | 117 | mcr p15, 0, r0, c1, c0, 0 @ Write CP15 SCTRL Register |
141 | 118 | ||
142 | /* Set vector address in CP15 VBAR register */ | 119 | /* Set vector address in CP15 VBAR register */ |
143 | ldr r0, =_start | 120 | ldr r0, =_start |
144 | mcr p15, 0, r0, c12, c0, 0 @Set VBAR | 121 | mcr p15, 0, r0, c12, c0, 0 @Set VBAR |
145 | #endif | 122 | #endif |
146 | 123 | ||
147 | /* the mask ROM code should have PLL and others stable */ | 124 | /* the mask ROM code should have PLL and others stable */ |
148 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 125 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
149 | bl cpu_init_cp15 | 126 | bl cpu_init_cp15 |
150 | bl cpu_init_crit | 127 | bl cpu_init_crit |
151 | #endif | 128 | #endif |
152 | 129 | ||
153 | bl _main | 130 | bl _main |
154 | 131 | ||
155 | /*------------------------------------------------------------------------------*/ | 132 | /*------------------------------------------------------------------------------*/ |
156 | 133 | ||
157 | ENTRY(c_runtime_cpu_setup) | 134 | ENTRY(c_runtime_cpu_setup) |
158 | /* | 135 | /* |
159 | * If I-cache is enabled invalidate it | 136 | * If I-cache is enabled invalidate it |
160 | */ | 137 | */ |
161 | #ifndef CONFIG_SYS_ICACHE_OFF | 138 | #ifndef CONFIG_SYS_ICACHE_OFF |
162 | mcr p15, 0, r0, c7, c5, 0 @ invalidate icache | 139 | mcr p15, 0, r0, c7, c5, 0 @ invalidate icache |
163 | mcr p15, 0, r0, c7, c10, 4 @ DSB | 140 | mcr p15, 0, r0, c7, c10, 4 @ DSB |
164 | mcr p15, 0, r0, c7, c5, 4 @ ISB | 141 | mcr p15, 0, r0, c7, c5, 4 @ ISB |
165 | #endif | 142 | #endif |
166 | /* | 143 | /* |
167 | * Move vector table | 144 | * Move vector table |
168 | */ | 145 | */ |
169 | /* Set vector address in CP15 VBAR register */ | 146 | /* Set vector address in CP15 VBAR register */ |
170 | ldr r0, =_start | 147 | ldr r0, =_start |
171 | mcr p15, 0, r0, c12, c0, 0 @Set VBAR | 148 | mcr p15, 0, r0, c12, c0, 0 @Set VBAR |
172 | 149 | ||
173 | bx lr | 150 | bx lr |
174 | 151 | ||
175 | ENDPROC(c_runtime_cpu_setup) | 152 | ENDPROC(c_runtime_cpu_setup) |
176 | 153 | ||
177 | /************************************************************************* | 154 | /************************************************************************* |
178 | * | 155 | * |
179 | * void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) | 156 | * void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) |
180 | * __attribute__((weak)); | 157 | * __attribute__((weak)); |
181 | * | 158 | * |
182 | * Stack pointer is not yet initialized at this moment | 159 | * Stack pointer is not yet initialized at this moment |
183 | * Don't save anything to stack even if compiled with -O0 | 160 | * Don't save anything to stack even if compiled with -O0 |
184 | * | 161 | * |
185 | *************************************************************************/ | 162 | *************************************************************************/ |
186 | ENTRY(save_boot_params) | 163 | ENTRY(save_boot_params) |
187 | bx lr @ back to my caller | 164 | bx lr @ back to my caller |
188 | ENDPROC(save_boot_params) | 165 | ENDPROC(save_boot_params) |
189 | .weak save_boot_params | 166 | .weak save_boot_params |
190 | 167 | ||
191 | /************************************************************************* | 168 | /************************************************************************* |
192 | * | 169 | * |
193 | * cpu_init_cp15 | 170 | * cpu_init_cp15 |
194 | * | 171 | * |
195 | * Setup CP15 registers (cache, MMU, TLBs). The I-cache is turned on unless | 172 | * Setup CP15 registers (cache, MMU, TLBs). The I-cache is turned on unless |
196 | * CONFIG_SYS_ICACHE_OFF is defined. | 173 | * CONFIG_SYS_ICACHE_OFF is defined. |
197 | * | 174 | * |
198 | *************************************************************************/ | 175 | *************************************************************************/ |
199 | ENTRY(cpu_init_cp15) | 176 | ENTRY(cpu_init_cp15) |
200 | /* | 177 | /* |
201 | * Invalidate L1 I/D | 178 | * Invalidate L1 I/D |
202 | */ | 179 | */ |
203 | mov r0, #0 @ set up for MCR | 180 | mov r0, #0 @ set up for MCR |
204 | mcr p15, 0, r0, c8, c7, 0 @ invalidate TLBs | 181 | mcr p15, 0, r0, c8, c7, 0 @ invalidate TLBs |
205 | mcr p15, 0, r0, c7, c5, 0 @ invalidate icache | 182 | mcr p15, 0, r0, c7, c5, 0 @ invalidate icache |
206 | mcr p15, 0, r0, c7, c5, 6 @ invalidate BP array | 183 | mcr p15, 0, r0, c7, c5, 6 @ invalidate BP array |
207 | mcr p15, 0, r0, c7, c10, 4 @ DSB | 184 | mcr p15, 0, r0, c7, c10, 4 @ DSB |
208 | mcr p15, 0, r0, c7, c5, 4 @ ISB | 185 | mcr p15, 0, r0, c7, c5, 4 @ ISB |
209 | 186 | ||
210 | /* | 187 | /* |
211 | * disable MMU stuff and caches | 188 | * disable MMU stuff and caches |
212 | */ | 189 | */ |
213 | mrc p15, 0, r0, c1, c0, 0 | 190 | mrc p15, 0, r0, c1, c0, 0 |
214 | bic r0, r0, #0x00002000 @ clear bits 13 (--V-) | 191 | bic r0, r0, #0x00002000 @ clear bits 13 (--V-) |
215 | bic r0, r0, #0x00000007 @ clear bits 2:0 (-CAM) | 192 | bic r0, r0, #0x00000007 @ clear bits 2:0 (-CAM) |
216 | orr r0, r0, #0x00000002 @ set bit 1 (--A-) Align | 193 | orr r0, r0, #0x00000002 @ set bit 1 (--A-) Align |
217 | orr r0, r0, #0x00000800 @ set bit 11 (Z---) BTB | 194 | orr r0, r0, #0x00000800 @ set bit 11 (Z---) BTB |
218 | #ifdef CONFIG_SYS_ICACHE_OFF | 195 | #ifdef CONFIG_SYS_ICACHE_OFF |
219 | bic r0, r0, #0x00001000 @ clear bit 12 (I) I-cache | 196 | bic r0, r0, #0x00001000 @ clear bit 12 (I) I-cache |
220 | #else | 197 | #else |
221 | orr r0, r0, #0x00001000 @ set bit 12 (I) I-cache | 198 | orr r0, r0, #0x00001000 @ set bit 12 (I) I-cache |
222 | #endif | 199 | #endif |
223 | mcr p15, 0, r0, c1, c0, 0 | 200 | mcr p15, 0, r0, c1, c0, 0 |
224 | 201 | ||
225 | #ifdef CONFIG_ARM_ERRATA_716044 | 202 | #ifdef CONFIG_ARM_ERRATA_716044 |
226 | mrc p15, 0, r0, c1, c0, 0 @ read system control register | 203 | mrc p15, 0, r0, c1, c0, 0 @ read system control register |
227 | orr r0, r0, #1 << 11 @ set bit #11 | 204 | orr r0, r0, #1 << 11 @ set bit #11 |
228 | mcr p15, 0, r0, c1, c0, 0 @ write system control register | 205 | mcr p15, 0, r0, c1, c0, 0 @ write system control register |
229 | #endif | 206 | #endif |
230 | 207 | ||
231 | #ifdef CONFIG_ARM_ERRATA_742230 | 208 | #ifdef CONFIG_ARM_ERRATA_742230 |
232 | mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register | 209 | mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register |
233 | orr r0, r0, #1 << 4 @ set bit #4 | 210 | orr r0, r0, #1 << 4 @ set bit #4 |
234 | mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register | 211 | mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register |
235 | #endif | 212 | #endif |
236 | 213 | ||
237 | #ifdef CONFIG_ARM_ERRATA_743622 | 214 | #ifdef CONFIG_ARM_ERRATA_743622 |
238 | mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register | 215 | mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register |
239 | orr r0, r0, #1 << 6 @ set bit #6 | 216 | orr r0, r0, #1 << 6 @ set bit #6 |
240 | mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register | 217 | mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register |
241 | #endif | 218 | #endif |
242 | 219 | ||
243 | #ifdef CONFIG_ARM_ERRATA_751472 | 220 | #ifdef CONFIG_ARM_ERRATA_751472 |
244 | mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register | 221 | mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register |
245 | orr r0, r0, #1 << 11 @ set bit #11 | 222 | orr r0, r0, #1 << 11 @ set bit #11 |
246 | mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register | 223 | mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register |
247 | #endif | 224 | #endif |
248 | 225 | ||
249 | mov pc, lr @ back to my caller | 226 | mov pc, lr @ back to my caller |
250 | ENDPROC(cpu_init_cp15) | 227 | ENDPROC(cpu_init_cp15) |
251 | 228 | ||
252 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 229 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
253 | /************************************************************************* | 230 | /************************************************************************* |
254 | * | 231 | * |
255 | * CPU_init_critical registers | 232 | * CPU_init_critical registers |
256 | * | 233 | * |
257 | * setup important registers | 234 | * setup important registers |
258 | * setup memory timing | 235 | * setup memory timing |
259 | * | 236 | * |
260 | *************************************************************************/ | 237 | *************************************************************************/ |
261 | ENTRY(cpu_init_crit) | 238 | ENTRY(cpu_init_crit) |
262 | /* | 239 | /* |
263 | * Jump to board specific initialization... | 240 | * Jump to board specific initialization... |
264 | * The Mask ROM will have already initialized | 241 | * The Mask ROM will have already initialized |
265 | * basic memory. Go here to bump up clock rate and handle | 242 | * basic memory. Go here to bump up clock rate and handle |
266 | * wake up conditions. | 243 | * wake up conditions. |
267 | */ | 244 | */ |
268 | b lowlevel_init @ go setup pll,mux,memory | 245 | b lowlevel_init @ go setup pll,mux,memory |
269 | ENDPROC(cpu_init_crit) | 246 | ENDPROC(cpu_init_crit) |
270 | #endif | 247 | #endif |
271 | 248 | ||
272 | #ifndef CONFIG_SPL_BUILD | 249 | #ifndef CONFIG_SPL_BUILD |
273 | /* | 250 | /* |
274 | ************************************************************************* | 251 | ************************************************************************* |
275 | * | 252 | * |
276 | * Interrupt handling | 253 | * Interrupt handling |
277 | * | 254 | * |
278 | ************************************************************************* | 255 | ************************************************************************* |
279 | */ | 256 | */ |
280 | @ | 257 | @ |
281 | @ IRQ stack frame. | 258 | @ IRQ stack frame. |
282 | @ | 259 | @ |
283 | #define S_FRAME_SIZE 72 | 260 | #define S_FRAME_SIZE 72 |
284 | 261 | ||
285 | #define S_OLD_R0 68 | 262 | #define S_OLD_R0 68 |
286 | #define S_PSR 64 | 263 | #define S_PSR 64 |
287 | #define S_PC 60 | 264 | #define S_PC 60 |
288 | #define S_LR 56 | 265 | #define S_LR 56 |
289 | #define S_SP 52 | 266 | #define S_SP 52 |
290 | 267 | ||
291 | #define S_IP 48 | 268 | #define S_IP 48 |
292 | #define S_FP 44 | 269 | #define S_FP 44 |
293 | #define S_R10 40 | 270 | #define S_R10 40 |
294 | #define S_R9 36 | 271 | #define S_R9 36 |
295 | #define S_R8 32 | 272 | #define S_R8 32 |
296 | #define S_R7 28 | 273 | #define S_R7 28 |
297 | #define S_R6 24 | 274 | #define S_R6 24 |
298 | #define S_R5 20 | 275 | #define S_R5 20 |
299 | #define S_R4 16 | 276 | #define S_R4 16 |
300 | #define S_R3 12 | 277 | #define S_R3 12 |
301 | #define S_R2 8 | 278 | #define S_R2 8 |
302 | #define S_R1 4 | 279 | #define S_R1 4 |
303 | #define S_R0 0 | 280 | #define S_R0 0 |
304 | 281 | ||
305 | #define MODE_SVC 0x13 | 282 | #define MODE_SVC 0x13 |
306 | #define I_BIT 0x80 | 283 | #define I_BIT 0x80 |
307 | 284 | ||
308 | /* | 285 | /* |
309 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 286 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
310 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling | 287 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
311 | */ | 288 | */ |
312 | 289 | ||
313 | .macro bad_save_user_regs | 290 | .macro bad_save_user_regs |
314 | sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current | 291 | sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current |
315 | @ user stack | 292 | @ user stack |
316 | stmia sp, {r0 - r12} @ Save user registers (now in | 293 | stmia sp, {r0 - r12} @ Save user registers (now in |
317 | @ svc mode) r0-r12 | 294 | @ svc mode) r0-r12 |
318 | ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort | 295 | ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort |
319 | @ stack | 296 | @ stack |
320 | ldmia r2, {r2 - r3} @ get values for "aborted" pc | 297 | ldmia r2, {r2 - r3} @ get values for "aborted" pc |
321 | @ and cpsr (into parm regs) | 298 | @ and cpsr (into parm regs) |
322 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack | 299 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack |
323 | 300 | ||
324 | add r5, sp, #S_SP | 301 | add r5, sp, #S_SP |
325 | mov r1, lr | 302 | mov r1, lr |
326 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr | 303 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr |
327 | mov r0, sp @ save current stack into r0 | 304 | mov r0, sp @ save current stack into r0 |
328 | @ (param register) | 305 | @ (param register) |
329 | .endm | 306 | .endm |
330 | 307 | ||
331 | .macro irq_save_user_regs | 308 | .macro irq_save_user_regs |
332 | sub sp, sp, #S_FRAME_SIZE | 309 | sub sp, sp, #S_FRAME_SIZE |
333 | stmia sp, {r0 - r12} @ Calling r0-r12 | 310 | stmia sp, {r0 - r12} @ Calling r0-r12 |
334 | add r8, sp, #S_PC @ !! R8 NEEDS to be saved !! | 311 | add r8, sp, #S_PC @ !! R8 NEEDS to be saved !! |
335 | @ a reserved stack spot would | 312 | @ a reserved stack spot would |
336 | @ be good. | 313 | @ be good. |
337 | stmdb r8, {sp, lr}^ @ Calling SP, LR | 314 | stmdb r8, {sp, lr}^ @ Calling SP, LR |
338 | str lr, [r8, #0] @ Save calling PC | 315 | str lr, [r8, #0] @ Save calling PC |
339 | mrs r6, spsr | 316 | mrs r6, spsr |
340 | str r6, [r8, #4] @ Save CPSR | 317 | str r6, [r8, #4] @ Save CPSR |
341 | str r0, [r8, #8] @ Save OLD_R0 | 318 | str r0, [r8, #8] @ Save OLD_R0 |
342 | mov r0, sp | 319 | mov r0, sp |
343 | .endm | 320 | .endm |
344 | 321 | ||
345 | .macro irq_restore_user_regs | 322 | .macro irq_restore_user_regs |
346 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr | 323 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
347 | mov r0, r0 | 324 | mov r0, r0 |
348 | ldr lr, [sp, #S_PC] @ Get PC | 325 | ldr lr, [sp, #S_PC] @ Get PC |
349 | add sp, sp, #S_FRAME_SIZE | 326 | add sp, sp, #S_FRAME_SIZE |
350 | subs pc, lr, #4 @ return & move spsr_svc into | 327 | subs pc, lr, #4 @ return & move spsr_svc into |
351 | @ cpsr | 328 | @ cpsr |
352 | .endm | 329 | .endm |
353 | 330 | ||
354 | .macro get_bad_stack | 331 | .macro get_bad_stack |
355 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter | 332 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter |
356 | @ in banked mode) | 333 | @ in banked mode) |
357 | 334 | ||
358 | str lr, [r13] @ save caller lr in position 0 | 335 | str lr, [r13] @ save caller lr in position 0 |
359 | @ of saved stack | 336 | @ of saved stack |
360 | mrs lr, spsr @ get the spsr | 337 | mrs lr, spsr @ get the spsr |
361 | str lr, [r13, #4] @ save spsr in position 1 of | 338 | str lr, [r13, #4] @ save spsr in position 1 of |
362 | @ saved stack | 339 | @ saved stack |
363 | 340 | ||
364 | mov r13, #MODE_SVC @ prepare SVC-Mode | 341 | mov r13, #MODE_SVC @ prepare SVC-Mode |
365 | @ msr spsr_c, r13 | 342 | @ msr spsr_c, r13 |
366 | msr spsr, r13 @ switch modes, make sure | 343 | msr spsr, r13 @ switch modes, make sure |
367 | @ moves will execute | 344 | @ moves will execute |
368 | mov lr, pc @ capture return pc | 345 | mov lr, pc @ capture return pc |
369 | movs pc, lr @ jump to next instruction & | 346 | movs pc, lr @ jump to next instruction & |
370 | @ switch modes. | 347 | @ switch modes. |
371 | .endm | 348 | .endm |
372 | 349 | ||
373 | .macro get_bad_stack_swi | 350 | .macro get_bad_stack_swi |
374 | sub r13, r13, #4 @ space on current stack for | 351 | sub r13, r13, #4 @ space on current stack for |
375 | @ scratch reg. | 352 | @ scratch reg. |
376 | str r0, [r13] @ save R0's value. | 353 | str r0, [r13] @ save R0's value. |
377 | ldr r0, IRQ_STACK_START_IN @ get data regions start | 354 | ldr r0, IRQ_STACK_START_IN @ get data regions start |
378 | @ spots for abort stack | 355 | @ spots for abort stack |
379 | str lr, [r0] @ save caller lr in position 0 | 356 | str lr, [r0] @ save caller lr in position 0 |
380 | @ of saved stack | 357 | @ of saved stack |
381 | mrs lr, spsr @ get the spsr | 358 | mrs lr, spsr @ get the spsr |
382 | str lr, [r0, #4] @ save spsr in position 1 of | 359 | str lr, [r0, #4] @ save spsr in position 1 of |
383 | @ saved stack | 360 | @ saved stack |
384 | ldr lr, [r0] @ restore lr | 361 | ldr lr, [r0] @ restore lr |
385 | ldr r0, [r13] @ restore r0 | 362 | ldr r0, [r13] @ restore r0 |
386 | add r13, r13, #4 @ pop stack entry | 363 | add r13, r13, #4 @ pop stack entry |
387 | .endm | 364 | .endm |
388 | 365 | ||
389 | .macro get_irq_stack @ setup IRQ stack | 366 | .macro get_irq_stack @ setup IRQ stack |
390 | ldr sp, IRQ_STACK_START | 367 | ldr sp, IRQ_STACK_START |
391 | .endm | 368 | .endm |
392 | 369 | ||
393 | .macro get_fiq_stack @ setup FIQ stack | 370 | .macro get_fiq_stack @ setup FIQ stack |
394 | ldr sp, FIQ_STACK_START | 371 | ldr sp, FIQ_STACK_START |
395 | .endm | 372 | .endm |
396 | 373 | ||
397 | /* | 374 | /* |
398 | * exception handlers | 375 | * exception handlers |
399 | */ | 376 | */ |
400 | .align 5 | 377 | .align 5 |
401 | undefined_instruction: | 378 | undefined_instruction: |
402 | get_bad_stack | 379 | get_bad_stack |
403 | bad_save_user_regs | 380 | bad_save_user_regs |
404 | bl do_undefined_instruction | 381 | bl do_undefined_instruction |
405 | 382 | ||
406 | .align 5 | 383 | .align 5 |
407 | software_interrupt: | 384 | software_interrupt: |
408 | get_bad_stack_swi | 385 | get_bad_stack_swi |
409 | bad_save_user_regs | 386 | bad_save_user_regs |
410 | bl do_software_interrupt | 387 | bl do_software_interrupt |
411 | 388 | ||
412 | .align 5 | 389 | .align 5 |
413 | prefetch_abort: | 390 | prefetch_abort: |
414 | get_bad_stack | 391 | get_bad_stack |
415 | bad_save_user_regs | 392 | bad_save_user_regs |
416 | bl do_prefetch_abort | 393 | bl do_prefetch_abort |
417 | 394 | ||
418 | .align 5 | 395 | .align 5 |
419 | data_abort: | 396 | data_abort: |
420 | get_bad_stack | 397 | get_bad_stack |
421 | bad_save_user_regs | 398 | bad_save_user_regs |
422 | bl do_data_abort | 399 | bl do_data_abort |
423 | 400 | ||
424 | .align 5 | 401 | .align 5 |
425 | not_used: | 402 | not_used: |
426 | get_bad_stack | 403 | get_bad_stack |
427 | bad_save_user_regs | 404 | bad_save_user_regs |
428 | bl do_not_used | 405 | bl do_not_used |
429 | 406 | ||
430 | #ifdef CONFIG_USE_IRQ | 407 | #ifdef CONFIG_USE_IRQ |
431 | 408 | ||
432 | .align 5 | 409 | .align 5 |
433 | irq: | 410 | irq: |
434 | get_irq_stack | 411 | get_irq_stack |
435 | irq_save_user_regs | 412 | irq_save_user_regs |
436 | bl do_irq | 413 | bl do_irq |
437 | irq_restore_user_regs | 414 | irq_restore_user_regs |
438 | 415 | ||
439 | .align 5 | 416 | .align 5 |
440 | fiq: | 417 | fiq: |
441 | get_fiq_stack | 418 | get_fiq_stack |
442 | /* someone ought to write a more effective fiq_save_user_regs */ | 419 | /* someone ought to write a more effective fiq_save_user_regs */ |
443 | irq_save_user_regs | 420 | irq_save_user_regs |
444 | bl do_fiq | 421 | bl do_fiq |
445 | irq_restore_user_regs | 422 | irq_restore_user_regs |
446 | 423 | ||
447 | #else | 424 | #else |
448 | 425 | ||
449 | .align 5 | 426 | .align 5 |
450 | irq: | 427 | irq: |
451 | get_bad_stack | 428 | get_bad_stack |
452 | bad_save_user_regs | 429 | bad_save_user_regs |
453 | bl do_irq | 430 | bl do_irq |
454 | 431 | ||
455 | .align 5 | 432 | .align 5 |
456 | fiq: | 433 | fiq: |
457 | get_bad_stack | 434 | get_bad_stack |
458 | bad_save_user_regs | 435 | bad_save_user_regs |
459 | bl do_fiq | 436 | bl do_fiq |
460 | 437 | ||
461 | #endif /* CONFIG_USE_IRQ */ | 438 | #endif /* CONFIG_USE_IRQ */ |
462 | #endif /* CONFIG_SPL_BUILD */ | 439 | #endif /* CONFIG_SPL_BUILD */ |
463 | 440 |
arch/arm/cpu/pxa/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for XScale CPU-core | 2 | * armboot - Startup Code for XScale CPU-core |
3 | * | 3 | * |
4 | * Copyright (C) 1998 Dan Malek <dmalek@jlc.net> | 4 | * Copyright (C) 1998 Dan Malek <dmalek@jlc.net> |
5 | * Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se> | 5 | * Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se> |
6 | * Copyright (C) 2000 Wolfgang Denk <wd@denx.de> | 6 | * Copyright (C) 2000 Wolfgang Denk <wd@denx.de> |
7 | * Copyright (C) 2001 Alex Zuepke <azu@sysgo.de> | 7 | * Copyright (C) 2001 Alex Zuepke <azu@sysgo.de> |
8 | * Copyright (C) 2001 Marius Groger <mag@sysgo.de> | 8 | * Copyright (C) 2001 Marius Groger <mag@sysgo.de> |
9 | * Copyright (C) 2002 Alex Zupke <azu@sysgo.de> | 9 | * Copyright (C) 2002 Alex Zupke <azu@sysgo.de> |
10 | * Copyright (C) 2002 Gary Jennejohn <garyj@denx.de> | 10 | * Copyright (C) 2002 Gary Jennejohn <garyj@denx.de> |
11 | * Copyright (C) 2002 Kyle Harris <kharris@nexus-tech.net> | 11 | * Copyright (C) 2002 Kyle Harris <kharris@nexus-tech.net> |
12 | * Copyright (C) 2003 Kai-Uwe Bloem <kai-uwe.bloem@auerswald.de> | 12 | * Copyright (C) 2003 Kai-Uwe Bloem <kai-uwe.bloem@auerswald.de> |
13 | * Copyright (C) 2003 Kshitij <kshitij@ti.com> | 13 | * Copyright (C) 2003 Kshitij <kshitij@ti.com> |
14 | * Copyright (C) 2003 Richard Woodruff <r-woodruff2@ti.com> | 14 | * Copyright (C) 2003 Richard Woodruff <r-woodruff2@ti.com> |
15 | * Copyright (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de> | 15 | * Copyright (C) 2003 Robert Schwebel <r.schwebel@pengutronix.de> |
16 | * Copyright (C) 2004 Texas Instruments <r-woodruff2@ti.com> | 16 | * Copyright (C) 2004 Texas Instruments <r-woodruff2@ti.com> |
17 | * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com> | 17 | * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com> |
18 | * | 18 | * |
19 | * SPDX-License-Identifier: GPL-2.0+ | 19 | * SPDX-License-Identifier: GPL-2.0+ |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <asm-offsets.h> | 22 | #include <asm-offsets.h> |
23 | #include <config.h> | 23 | #include <config.h> |
24 | #include <version.h> | 24 | #include <version.h> |
25 | 25 | ||
26 | #ifdef CONFIG_CPU_PXA25X | 26 | #ifdef CONFIG_CPU_PXA25X |
27 | #if ((CONFIG_SYS_INIT_SP_ADDR) != 0xfffff800) | 27 | #if ((CONFIG_SYS_INIT_SP_ADDR) != 0xfffff800) |
28 | #error "Init SP address must be set to 0xfffff800 for PXA250" | 28 | #error "Init SP address must be set to 0xfffff800 for PXA250" |
29 | #endif | 29 | #endif |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | .globl _start | 32 | .globl _start |
33 | _start: b reset | 33 | _start: b reset |
34 | #ifdef CONFIG_SPL_BUILD | 34 | #ifdef CONFIG_SPL_BUILD |
35 | ldr pc, _hang | 35 | ldr pc, _hang |
36 | ldr pc, _hang | 36 | ldr pc, _hang |
37 | ldr pc, _hang | 37 | ldr pc, _hang |
38 | ldr pc, _hang | 38 | ldr pc, _hang |
39 | ldr pc, _hang | 39 | ldr pc, _hang |
40 | ldr pc, _hang | 40 | ldr pc, _hang |
41 | ldr pc, _hang | 41 | ldr pc, _hang |
42 | 42 | ||
43 | _hang: | 43 | _hang: |
44 | .word do_hang | 44 | .word do_hang |
45 | .word 0x12345678 | 45 | .word 0x12345678 |
46 | .word 0x12345678 | 46 | .word 0x12345678 |
47 | .word 0x12345678 | 47 | .word 0x12345678 |
48 | .word 0x12345678 | 48 | .word 0x12345678 |
49 | .word 0x12345678 | 49 | .word 0x12345678 |
50 | .word 0x12345678 | 50 | .word 0x12345678 |
51 | .word 0x12345678 /* now 16*4=64 */ | 51 | .word 0x12345678 /* now 16*4=64 */ |
52 | #else | 52 | #else |
53 | ldr pc, _undefined_instruction | 53 | ldr pc, _undefined_instruction |
54 | ldr pc, _software_interrupt | 54 | ldr pc, _software_interrupt |
55 | ldr pc, _prefetch_abort | 55 | ldr pc, _prefetch_abort |
56 | ldr pc, _data_abort | 56 | ldr pc, _data_abort |
57 | ldr pc, _not_used | 57 | ldr pc, _not_used |
58 | ldr pc, _irq | 58 | ldr pc, _irq |
59 | ldr pc, _fiq | 59 | ldr pc, _fiq |
60 | 60 | ||
61 | _undefined_instruction: .word undefined_instruction | 61 | _undefined_instruction: .word undefined_instruction |
62 | _software_interrupt: .word software_interrupt | 62 | _software_interrupt: .word software_interrupt |
63 | _prefetch_abort: .word prefetch_abort | 63 | _prefetch_abort: .word prefetch_abort |
64 | _data_abort: .word data_abort | 64 | _data_abort: .word data_abort |
65 | _not_used: .word not_used | 65 | _not_used: .word not_used |
66 | _irq: .word irq | 66 | _irq: .word irq |
67 | _fiq: .word fiq | 67 | _fiq: .word fiq |
68 | _pad: .word 0x12345678 /* now 16*4=64 */ | 68 | _pad: .word 0x12345678 /* now 16*4=64 */ |
69 | #endif /* CONFIG_SPL_BUILD */ | 69 | #endif /* CONFIG_SPL_BUILD */ |
70 | .global _end_vect | 70 | .global _end_vect |
71 | _end_vect: | 71 | _end_vect: |
72 | 72 | ||
73 | .balignl 16,0xdeadbeef | 73 | .balignl 16,0xdeadbeef |
74 | /* | 74 | /* |
75 | ************************************************************************* | 75 | ************************************************************************* |
76 | * | 76 | * |
77 | * Startup Code (reset vector) | 77 | * Startup Code (reset vector) |
78 | * | 78 | * |
79 | * do important init only if we don't start from memory! | 79 | * do important init only if we don't start from memory! |
80 | * setup Memory and board specific bits prior to relocation. | 80 | * setup Memory and board specific bits prior to relocation. |
81 | * relocate armboot to ram | 81 | * relocate armboot to ram |
82 | * setup stack | 82 | * setup stack |
83 | * | 83 | * |
84 | ************************************************************************* | 84 | ************************************************************************* |
85 | */ | 85 | */ |
86 | 86 | ||
87 | .globl _TEXT_BASE | ||
88 | _TEXT_BASE: | ||
89 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
90 | .word CONFIG_SPL_TEXT_BASE | ||
91 | #else | ||
92 | .word CONFIG_SYS_TEXT_BASE | ||
93 | #endif | ||
94 | |||
95 | /* | ||
96 | * These are defined in the board-specific linker script. | ||
97 | * Subtracting _start from them lets the linker put their | ||
98 | * relative position in the executable instead of leaving | ||
99 | * them null. | ||
100 | */ | ||
101 | .globl _bss_start_ofs | ||
102 | _bss_start_ofs: | ||
103 | .word __bss_start - _start | ||
104 | |||
105 | .globl _bss_end_ofs | ||
106 | _bss_end_ofs: | ||
107 | .word __bss_end - _start | ||
108 | |||
109 | .globl _end_ofs | ||
110 | _end_ofs: | ||
111 | .word _end - _start | ||
112 | |||
113 | #ifdef CONFIG_USE_IRQ | 87 | #ifdef CONFIG_USE_IRQ |
114 | /* IRQ stack memory (calculated at run-time) */ | 88 | /* IRQ stack memory (calculated at run-time) */ |
115 | .globl IRQ_STACK_START | 89 | .globl IRQ_STACK_START |
116 | IRQ_STACK_START: | 90 | IRQ_STACK_START: |
117 | .word 0x0badc0de | 91 | .word 0x0badc0de |
118 | 92 | ||
119 | /* IRQ stack memory (calculated at run-time) */ | 93 | /* IRQ stack memory (calculated at run-time) */ |
120 | .globl FIQ_STACK_START | 94 | .globl FIQ_STACK_START |
121 | FIQ_STACK_START: | 95 | FIQ_STACK_START: |
122 | .word 0x0badc0de | 96 | .word 0x0badc0de |
123 | #endif | 97 | #endif |
124 | 98 | ||
125 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 99 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
126 | .globl IRQ_STACK_START_IN | 100 | .globl IRQ_STACK_START_IN |
127 | IRQ_STACK_START_IN: | 101 | IRQ_STACK_START_IN: |
128 | .word 0x0badc0de | 102 | .word 0x0badc0de |
129 | 103 | ||
130 | /* | 104 | /* |
131 | * the actual reset code | 105 | * the actual reset code |
132 | */ | 106 | */ |
133 | 107 | ||
134 | reset: | 108 | reset: |
135 | /* | 109 | /* |
136 | * set the cpu to SVC32 mode | 110 | * set the cpu to SVC32 mode |
137 | */ | 111 | */ |
138 | mrs r0,cpsr | 112 | mrs r0,cpsr |
139 | bic r0,r0,#0x1f | 113 | bic r0,r0,#0x1f |
140 | orr r0,r0,#0xd3 | 114 | orr r0,r0,#0xd3 |
141 | msr cpsr,r0 | 115 | msr cpsr,r0 |
142 | 116 | ||
143 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 117 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
144 | bl cpu_init_crit | 118 | bl cpu_init_crit |
145 | #endif | 119 | #endif |
146 | 120 | ||
147 | #ifdef CONFIG_CPU_PXA25X | 121 | #ifdef CONFIG_CPU_PXA25X |
148 | bl lock_cache_for_stack | 122 | bl lock_cache_for_stack |
149 | #endif | 123 | #endif |
150 | 124 | ||
151 | bl _main | 125 | bl _main |
152 | 126 | ||
153 | /*------------------------------------------------------------------------------*/ | 127 | /*------------------------------------------------------------------------------*/ |
154 | 128 | ||
155 | .globl c_runtime_cpu_setup | 129 | .globl c_runtime_cpu_setup |
156 | c_runtime_cpu_setup: | 130 | c_runtime_cpu_setup: |
157 | 131 | ||
158 | #ifdef CONFIG_CPU_PXA25X | 132 | #ifdef CONFIG_CPU_PXA25X |
159 | /* | 133 | /* |
160 | * Unlock (actually, disable) the cache now that board_init_f | 134 | * Unlock (actually, disable) the cache now that board_init_f |
161 | * is done. We could do this earlier but we would need to add | 135 | * is done. We could do this earlier but we would need to add |
162 | * a new C runtime hook, whereas c_runtime_cpu_setup already | 136 | * a new C runtime hook, whereas c_runtime_cpu_setup already |
163 | * exists. | 137 | * exists. |
164 | * As this routine is just a call to cpu_init_crit, let us | 138 | * As this routine is just a call to cpu_init_crit, let us |
165 | * tail-optimize and do a simple branch here. | 139 | * tail-optimize and do a simple branch here. |
166 | */ | 140 | */ |
167 | b cpu_init_crit | 141 | b cpu_init_crit |
168 | #else | 142 | #else |
169 | bx lr | 143 | bx lr |
170 | #endif | 144 | #endif |
171 | 145 | ||
172 | /* | 146 | /* |
173 | ************************************************************************* | 147 | ************************************************************************* |
174 | * | 148 | * |
175 | * CPU_init_critical registers | 149 | * CPU_init_critical registers |
176 | * | 150 | * |
177 | * setup important registers | 151 | * setup important registers |
178 | * setup memory timing | 152 | * setup memory timing |
179 | * | 153 | * |
180 | ************************************************************************* | 154 | ************************************************************************* |
181 | */ | 155 | */ |
182 | #if !defined(CONFIG_SKIP_LOWLEVEL_INIT) || defined(CONFIG_CPU_PXA25X) | 156 | #if !defined(CONFIG_SKIP_LOWLEVEL_INIT) || defined(CONFIG_CPU_PXA25X) |
183 | cpu_init_crit: | 157 | cpu_init_crit: |
184 | /* | 158 | /* |
185 | * flush v4 I/D caches | 159 | * flush v4 I/D caches |
186 | */ | 160 | */ |
187 | mov r0, #0 | 161 | mov r0, #0 |
188 | mcr p15, 0, r0, c7, c7, 0 /* Invalidate I+D+BTB caches */ | 162 | mcr p15, 0, r0, c7, c7, 0 /* Invalidate I+D+BTB caches */ |
189 | mcr p15, 0, r0, c8, c7, 0 /* Invalidate Unified TLB */ | 163 | mcr p15, 0, r0, c8, c7, 0 /* Invalidate Unified TLB */ |
190 | 164 | ||
191 | /* | 165 | /* |
192 | * disable MMU stuff and caches | 166 | * disable MMU stuff and caches |
193 | */ | 167 | */ |
194 | mrc p15, 0, r0, c1, c0, 0 | 168 | mrc p15, 0, r0, c1, c0, 0 |
195 | bic r0, r0, #0x00003300 @ clear bits 13:12, 9:8 (--VI --RS) | 169 | bic r0, r0, #0x00003300 @ clear bits 13:12, 9:8 (--VI --RS) |
196 | bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) | 170 | bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) |
197 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align | 171 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align |
198 | mcr p15, 0, r0, c1, c0, 0 | 172 | mcr p15, 0, r0, c1, c0, 0 |
199 | 173 | ||
200 | mov pc, lr /* back to my caller */ | 174 | mov pc, lr /* back to my caller */ |
201 | #endif /* !CONFIG_SKIP_LOWLEVEL_INIT || CONFIG_CPU_PXA25X */ | 175 | #endif /* !CONFIG_SKIP_LOWLEVEL_INIT || CONFIG_CPU_PXA25X */ |
202 | 176 | ||
203 | #ifndef CONFIG_SPL_BUILD | 177 | #ifndef CONFIG_SPL_BUILD |
204 | /* | 178 | /* |
205 | ************************************************************************* | 179 | ************************************************************************* |
206 | * | 180 | * |
207 | * Interrupt handling | 181 | * Interrupt handling |
208 | * | 182 | * |
209 | ************************************************************************* | 183 | ************************************************************************* |
210 | */ | 184 | */ |
211 | @ | 185 | @ |
212 | @ IRQ stack frame. | 186 | @ IRQ stack frame. |
213 | @ | 187 | @ |
214 | #define S_FRAME_SIZE 72 | 188 | #define S_FRAME_SIZE 72 |
215 | 189 | ||
216 | #define S_OLD_R0 68 | 190 | #define S_OLD_R0 68 |
217 | #define S_PSR 64 | 191 | #define S_PSR 64 |
218 | #define S_PC 60 | 192 | #define S_PC 60 |
219 | #define S_LR 56 | 193 | #define S_LR 56 |
220 | #define S_SP 52 | 194 | #define S_SP 52 |
221 | 195 | ||
222 | #define S_IP 48 | 196 | #define S_IP 48 |
223 | #define S_FP 44 | 197 | #define S_FP 44 |
224 | #define S_R10 40 | 198 | #define S_R10 40 |
225 | #define S_R9 36 | 199 | #define S_R9 36 |
226 | #define S_R8 32 | 200 | #define S_R8 32 |
227 | #define S_R7 28 | 201 | #define S_R7 28 |
228 | #define S_R6 24 | 202 | #define S_R6 24 |
229 | #define S_R5 20 | 203 | #define S_R5 20 |
230 | #define S_R4 16 | 204 | #define S_R4 16 |
231 | #define S_R3 12 | 205 | #define S_R3 12 |
232 | #define S_R2 8 | 206 | #define S_R2 8 |
233 | #define S_R1 4 | 207 | #define S_R1 4 |
234 | #define S_R0 0 | 208 | #define S_R0 0 |
235 | 209 | ||
236 | #define MODE_SVC 0x13 | 210 | #define MODE_SVC 0x13 |
237 | #define I_BIT 0x80 | 211 | #define I_BIT 0x80 |
238 | 212 | ||
239 | /* | 213 | /* |
240 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 214 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
241 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling | 215 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
242 | */ | 216 | */ |
243 | 217 | ||
244 | .macro bad_save_user_regs | 218 | .macro bad_save_user_regs |
245 | sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current user stack | 219 | sub sp, sp, #S_FRAME_SIZE @ carve out a frame on current user stack |
246 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 | 220 | stmia sp, {r0 - r12} @ Save user registers (now in svc mode) r0-r12 |
247 | 221 | ||
248 | ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort stack | 222 | ldr r2, IRQ_STACK_START_IN @ set base 2 words into abort stack |
249 | ldmia r2, {r2 - r3} @ get values for "aborted" pc and cpsr (into parm regs) | 223 | ldmia r2, {r2 - r3} @ get values for "aborted" pc and cpsr (into parm regs) |
250 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack | 224 | add r0, sp, #S_FRAME_SIZE @ grab pointer to old stack |
251 | 225 | ||
252 | add r5, sp, #S_SP | 226 | add r5, sp, #S_SP |
253 | mov r1, lr | 227 | mov r1, lr |
254 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr | 228 | stmia r5, {r0 - r3} @ save sp_SVC, lr_SVC, pc, cpsr |
255 | mov r0, sp @ save current stack into r0 (param register) | 229 | mov r0, sp @ save current stack into r0 (param register) |
256 | .endm | 230 | .endm |
257 | 231 | ||
258 | .macro irq_save_user_regs | 232 | .macro irq_save_user_regs |
259 | sub sp, sp, #S_FRAME_SIZE | 233 | sub sp, sp, #S_FRAME_SIZE |
260 | stmia sp, {r0 - r12} @ Calling r0-r12 | 234 | stmia sp, {r0 - r12} @ Calling r0-r12 |
261 | add r8, sp, #S_PC @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. | 235 | add r8, sp, #S_PC @ !!!! R8 NEEDS to be saved !!!! a reserved stack spot would be good. |
262 | stmdb r8, {sp, lr}^ @ Calling SP, LR | 236 | stmdb r8, {sp, lr}^ @ Calling SP, LR |
263 | str lr, [r8, #0] @ Save calling PC | 237 | str lr, [r8, #0] @ Save calling PC |
264 | mrs r6, spsr | 238 | mrs r6, spsr |
265 | str r6, [r8, #4] @ Save CPSR | 239 | str r6, [r8, #4] @ Save CPSR |
266 | str r0, [r8, #8] @ Save OLD_R0 | 240 | str r0, [r8, #8] @ Save OLD_R0 |
267 | mov r0, sp | 241 | mov r0, sp |
268 | .endm | 242 | .endm |
269 | 243 | ||
270 | .macro irq_restore_user_regs | 244 | .macro irq_restore_user_regs |
271 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr | 245 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
272 | mov r0, r0 | 246 | mov r0, r0 |
273 | ldr lr, [sp, #S_PC] @ Get PC | 247 | ldr lr, [sp, #S_PC] @ Get PC |
274 | add sp, sp, #S_FRAME_SIZE | 248 | add sp, sp, #S_FRAME_SIZE |
275 | subs pc, lr, #4 @ return & move spsr_svc into cpsr | 249 | subs pc, lr, #4 @ return & move spsr_svc into cpsr |
276 | .endm | 250 | .endm |
277 | 251 | ||
278 | .macro get_bad_stack | 252 | .macro get_bad_stack |
279 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter in banked mode) | 253 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack (enter in banked mode) |
280 | 254 | ||
281 | str lr, [r13] @ save caller lr in position 0 of saved stack | 255 | str lr, [r13] @ save caller lr in position 0 of saved stack |
282 | mrs lr, spsr @ get the spsr | 256 | mrs lr, spsr @ get the spsr |
283 | str lr, [r13, #4] @ save spsr in position 1 of saved stack | 257 | str lr, [r13, #4] @ save spsr in position 1 of saved stack |
284 | 258 | ||
285 | mov r13, #MODE_SVC @ prepare SVC-Mode | 259 | mov r13, #MODE_SVC @ prepare SVC-Mode |
286 | @ msr spsr_c, r13 | 260 | @ msr spsr_c, r13 |
287 | msr spsr, r13 @ switch modes, make sure moves will execute | 261 | msr spsr, r13 @ switch modes, make sure moves will execute |
288 | mov lr, pc @ capture return pc | 262 | mov lr, pc @ capture return pc |
289 | movs pc, lr @ jump to next instruction & switch modes. | 263 | movs pc, lr @ jump to next instruction & switch modes. |
290 | .endm | 264 | .endm |
291 | 265 | ||
292 | .macro get_bad_stack_swi | 266 | .macro get_bad_stack_swi |
293 | sub r13, r13, #4 @ space on current stack for scratch reg. | 267 | sub r13, r13, #4 @ space on current stack for scratch reg. |
294 | str r0, [r13] @ save R0's value. | 268 | str r0, [r13] @ save R0's value. |
295 | ldr r0, IRQ_STACK_START_IN @ get data regions start | 269 | ldr r0, IRQ_STACK_START_IN @ get data regions start |
296 | str lr, [r0] @ save caller lr in position 0 of saved stack | 270 | str lr, [r0] @ save caller lr in position 0 of saved stack |
297 | mrs lr, spsr @ get the spsr | 271 | mrs lr, spsr @ get the spsr |
298 | str lr, [r0, #4] @ save spsr in position 1 of saved stack | 272 | str lr, [r0, #4] @ save spsr in position 1 of saved stack |
299 | ldr lr, [r0] @ restore lr | 273 | ldr lr, [r0] @ restore lr |
300 | ldr r0, [r13] @ restore r0 | 274 | ldr r0, [r13] @ restore r0 |
301 | add r13, r13, #4 @ pop stack entry | 275 | add r13, r13, #4 @ pop stack entry |
302 | .endm | 276 | .endm |
303 | 277 | ||
304 | .macro get_irq_stack @ setup IRQ stack | 278 | .macro get_irq_stack @ setup IRQ stack |
305 | ldr sp, IRQ_STACK_START | 279 | ldr sp, IRQ_STACK_START |
306 | .endm | 280 | .endm |
307 | 281 | ||
308 | .macro get_fiq_stack @ setup FIQ stack | 282 | .macro get_fiq_stack @ setup FIQ stack |
309 | ldr sp, FIQ_STACK_START | 283 | ldr sp, FIQ_STACK_START |
310 | .endm | 284 | .endm |
311 | #endif /* CONFIG_SPL_BUILD */ | 285 | #endif /* CONFIG_SPL_BUILD */ |
312 | 286 | ||
313 | /* | 287 | /* |
314 | * exception handlers | 288 | * exception handlers |
315 | */ | 289 | */ |
316 | #ifdef CONFIG_SPL_BUILD | 290 | #ifdef CONFIG_SPL_BUILD |
317 | .align 5 | 291 | .align 5 |
318 | do_hang: | 292 | do_hang: |
319 | ldr sp, _TEXT_BASE /* use 32 words about stack */ | ||
320 | bl hang /* hang and never return */ | 293 | bl hang /* hang and never return */ |
321 | #else /* !CONFIG_SPL_BUILD */ | 294 | #else /* !CONFIG_SPL_BUILD */ |
322 | .align 5 | 295 | .align 5 |
323 | undefined_instruction: | 296 | undefined_instruction: |
324 | get_bad_stack | 297 | get_bad_stack |
325 | bad_save_user_regs | 298 | bad_save_user_regs |
326 | bl do_undefined_instruction | 299 | bl do_undefined_instruction |
327 | 300 | ||
328 | .align 5 | 301 | .align 5 |
329 | software_interrupt: | 302 | software_interrupt: |
330 | get_bad_stack_swi | 303 | get_bad_stack_swi |
331 | bad_save_user_regs | 304 | bad_save_user_regs |
332 | bl do_software_interrupt | 305 | bl do_software_interrupt |
333 | 306 | ||
334 | .align 5 | 307 | .align 5 |
335 | prefetch_abort: | 308 | prefetch_abort: |
336 | get_bad_stack | 309 | get_bad_stack |
337 | bad_save_user_regs | 310 | bad_save_user_regs |
338 | bl do_prefetch_abort | 311 | bl do_prefetch_abort |
339 | 312 | ||
340 | .align 5 | 313 | .align 5 |
341 | data_abort: | 314 | data_abort: |
342 | get_bad_stack | 315 | get_bad_stack |
343 | bad_save_user_regs | 316 | bad_save_user_regs |
344 | bl do_data_abort | 317 | bl do_data_abort |
345 | 318 | ||
346 | .align 5 | 319 | .align 5 |
347 | not_used: | 320 | not_used: |
348 | get_bad_stack | 321 | get_bad_stack |
349 | bad_save_user_regs | 322 | bad_save_user_regs |
350 | bl do_not_used | 323 | bl do_not_used |
351 | 324 | ||
352 | #ifdef CONFIG_USE_IRQ | 325 | #ifdef CONFIG_USE_IRQ |
353 | 326 | ||
354 | .align 5 | 327 | .align 5 |
355 | irq: | 328 | irq: |
356 | get_irq_stack | 329 | get_irq_stack |
357 | irq_save_user_regs | 330 | irq_save_user_regs |
358 | bl do_irq | 331 | bl do_irq |
359 | irq_restore_user_regs | 332 | irq_restore_user_regs |
360 | 333 | ||
361 | .align 5 | 334 | .align 5 |
362 | fiq: | 335 | fiq: |
363 | get_fiq_stack | 336 | get_fiq_stack |
364 | /* someone ought to write a more effiction fiq_save_user_regs */ | 337 | /* someone ought to write a more effiction fiq_save_user_regs */ |
365 | irq_save_user_regs | 338 | irq_save_user_regs |
366 | bl do_fiq | 339 | bl do_fiq |
367 | irq_restore_user_regs | 340 | irq_restore_user_regs |
368 | 341 | ||
369 | #else | 342 | #else |
370 | 343 | ||
371 | .align 5 | 344 | .align 5 |
372 | irq: | 345 | irq: |
373 | get_bad_stack | 346 | get_bad_stack |
374 | bad_save_user_regs | 347 | bad_save_user_regs |
375 | bl do_irq | 348 | bl do_irq |
376 | 349 | ||
377 | .align 5 | 350 | .align 5 |
378 | fiq: | 351 | fiq: |
379 | get_bad_stack | 352 | get_bad_stack |
380 | bad_save_user_regs | 353 | bad_save_user_regs |
381 | bl do_fiq | 354 | bl do_fiq |
382 | 355 | ||
383 | #endif | 356 | #endif |
384 | .align 5 | 357 | .align 5 |
385 | #endif /* CONFIG_SPL_BUILD */ | 358 | #endif /* CONFIG_SPL_BUILD */ |
386 | 359 | ||
387 | 360 | ||
388 | /* | 361 | /* |
389 | * Enable MMU to use DCache as DRAM. | 362 | * Enable MMU to use DCache as DRAM. |
390 | * | 363 | * |
391 | * This is useful on PXA25x and PXA26x in early bootstages, where there is no | 364 | * This is useful on PXA25x and PXA26x in early bootstages, where there is no |
392 | * other possible memory available to hold stack. | 365 | * other possible memory available to hold stack. |
393 | */ | 366 | */ |
394 | #ifdef CONFIG_CPU_PXA25X | 367 | #ifdef CONFIG_CPU_PXA25X |
395 | .macro CPWAIT reg | 368 | .macro CPWAIT reg |
396 | mrc p15, 0, \reg, c2, c0, 0 | 369 | mrc p15, 0, \reg, c2, c0, 0 |
397 | mov \reg, \reg | 370 | mov \reg, \reg |
398 | sub pc, pc, #4 | 371 | sub pc, pc, #4 |
399 | .endm | 372 | .endm |
400 | lock_cache_for_stack: | 373 | lock_cache_for_stack: |
401 | /* Domain access -- enable for all CPs */ | 374 | /* Domain access -- enable for all CPs */ |
402 | ldr r0, =0x0000ffff | 375 | ldr r0, =0x0000ffff |
403 | mcr p15, 0, r0, c3, c0, 0 | 376 | mcr p15, 0, r0, c3, c0, 0 |
404 | 377 | ||
405 | /* Point TTBR to MMU table */ | 378 | /* Point TTBR to MMU table */ |
406 | ldr r0, =mmutable | 379 | ldr r0, =mmutable |
407 | mcr p15, 0, r0, c2, c0, 0 | 380 | mcr p15, 0, r0, c2, c0, 0 |
408 | 381 | ||
409 | /* Kick in MMU, ICache, DCache, BTB */ | 382 | /* Kick in MMU, ICache, DCache, BTB */ |
410 | mrc p15, 0, r0, c1, c0, 0 | 383 | mrc p15, 0, r0, c1, c0, 0 |
411 | bic r0, #0x1b00 | 384 | bic r0, #0x1b00 |
412 | bic r0, #0x0087 | 385 | bic r0, #0x0087 |
413 | orr r0, #0x1800 | 386 | orr r0, #0x1800 |
414 | orr r0, #0x0005 | 387 | orr r0, #0x0005 |
415 | mcr p15, 0, r0, c1, c0, 0 | 388 | mcr p15, 0, r0, c1, c0, 0 |
416 | CPWAIT r0 | 389 | CPWAIT r0 |
417 | 390 | ||
418 | /* Unlock Icache, Dcache */ | 391 | /* Unlock Icache, Dcache */ |
419 | mcr p15, 0, r0, c9, c1, 1 | 392 | mcr p15, 0, r0, c9, c1, 1 |
420 | mcr p15, 0, r0, c9, c2, 1 | 393 | mcr p15, 0, r0, c9, c2, 1 |
421 | 394 | ||
422 | /* Flush Icache, Dcache, BTB */ | 395 | /* Flush Icache, Dcache, BTB */ |
423 | mcr p15, 0, r0, c7, c7, 0 | 396 | mcr p15, 0, r0, c7, c7, 0 |
424 | 397 | ||
425 | /* Unlock I-TLB, D-TLB */ | 398 | /* Unlock I-TLB, D-TLB */ |
426 | mcr p15, 0, r0, c10, c4, 1 | 399 | mcr p15, 0, r0, c10, c4, 1 |
427 | mcr p15, 0, r0, c10, c8, 1 | 400 | mcr p15, 0, r0, c10, c8, 1 |
428 | 401 | ||
429 | /* Flush TLB */ | 402 | /* Flush TLB */ |
430 | mcr p15, 0, r0, c8, c7, 0 | 403 | mcr p15, 0, r0, c8, c7, 0 |
431 | 404 | ||
432 | /* Allocate 4096 bytes of Dcache as RAM */ | 405 | /* Allocate 4096 bytes of Dcache as RAM */ |
433 | 406 | ||
434 | /* Drain pending loads and stores */ | 407 | /* Drain pending loads and stores */ |
435 | mcr p15, 0, r0, c7, c10, 4 | 408 | mcr p15, 0, r0, c7, c10, 4 |
436 | 409 | ||
437 | mov r4, #0x00 | 410 | mov r4, #0x00 |
438 | mov r5, #0x00 | 411 | mov r5, #0x00 |
439 | mov r2, #0x01 | 412 | mov r2, #0x01 |
440 | mcr p15, 0, r0, c9, c2, 0 | 413 | mcr p15, 0, r0, c9, c2, 0 |
441 | CPWAIT r0 | 414 | CPWAIT r0 |
442 | 415 | ||
443 | /* 128 lines reserved (128 x 32bytes = 4096 bytes total) */ | 416 | /* 128 lines reserved (128 x 32bytes = 4096 bytes total) */ |
444 | mov r0, #128 | 417 | mov r0, #128 |
445 | ldr r1, =0xfffff000 | 418 | ldr r1, =0xfffff000 |
446 | 419 | ||
447 | alloc: | 420 | alloc: |
448 | mcr p15, 0, r1, c7, c2, 5 | 421 | mcr p15, 0, r1, c7, c2, 5 |
449 | /* Drain pending loads and stores */ | 422 | /* Drain pending loads and stores */ |
450 | mcr p15, 0, r0, c7, c10, 4 | 423 | mcr p15, 0, r0, c7, c10, 4 |
451 | strd r4, [r1], #8 | 424 | strd r4, [r1], #8 |
452 | strd r4, [r1], #8 | 425 | strd r4, [r1], #8 |
453 | strd r4, [r1], #8 | 426 | strd r4, [r1], #8 |
454 | strd r4, [r1], #8 | 427 | strd r4, [r1], #8 |
455 | subs r0, #0x01 | 428 | subs r0, #0x01 |
456 | bne alloc | 429 | bne alloc |
457 | /* Drain pending loads and stores */ | 430 | /* Drain pending loads and stores */ |
458 | mcr p15, 0, r0, c7, c10, 4 | 431 | mcr p15, 0, r0, c7, c10, 4 |
459 | mov r2, #0x00 | 432 | mov r2, #0x00 |
460 | mcr p15, 0, r2, c9, c2, 0 | 433 | mcr p15, 0, r2, c9, c2, 0 |
461 | CPWAIT r0 | 434 | CPWAIT r0 |
462 | 435 | ||
463 | mov pc, lr | 436 | mov pc, lr |
464 | 437 | ||
465 | .section .mmutable, "a" | 438 | .section .mmutable, "a" |
466 | mmutable: | 439 | mmutable: |
467 | .align 14 | 440 | .align 14 |
468 | /* 0x00000000 - 0xffe00000 : 1:1, uncached mapping */ | 441 | /* 0x00000000 - 0xffe00000 : 1:1, uncached mapping */ |
469 | .set __base, 0 | 442 | .set __base, 0 |
470 | .rept 0xfff | 443 | .rept 0xfff |
471 | .word (__base << 20) | 0xc12 | 444 | .word (__base << 20) | 0xc12 |
472 | .set __base, __base + 1 | 445 | .set __base, __base + 1 |
473 | .endr | 446 | .endr |
474 | 447 | ||
475 | /* 0xfff00000 : 1:1, cached mapping */ | 448 | /* 0xfff00000 : 1:1, cached mapping */ |
476 | .word (0xfff << 20) | 0x1c1e | 449 | .word (0xfff << 20) | 0x1c1e |
477 | #endif /* CONFIG_CPU_PXA25X */ | 450 | #endif /* CONFIG_CPU_PXA25X */ |
478 | 451 |
arch/arm/cpu/sa1100/start.S
1 | /* | 1 | /* |
2 | * armboot - Startup Code for SA1100 CPU | 2 | * armboot - Startup Code for SA1100 CPU |
3 | * | 3 | * |
4 | * Copyright (C) 1998 Dan Malek <dmalek@jlc.net> | 4 | * Copyright (C) 1998 Dan Malek <dmalek@jlc.net> |
5 | * Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se> | 5 | * Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se> |
6 | * Copyright (C) 2000 Wolfgang Denk <wd@denx.de> | 6 | * Copyright (C) 2000 Wolfgang Denk <wd@denx.de> |
7 | * Copyright (c) 2001 Alex Zรผpke <azu@sysgo.de> | 7 | * Copyright (c) 2001 Alex Zรผpke <azu@sysgo.de> |
8 | * | 8 | * |
9 | * SPDX-License-Identifier: GPL-2.0+ | 9 | * SPDX-License-Identifier: GPL-2.0+ |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <asm-offsets.h> | 12 | #include <asm-offsets.h> |
13 | #include <config.h> | 13 | #include <config.h> |
14 | #include <version.h> | 14 | #include <version.h> |
15 | 15 | ||
16 | /* | 16 | /* |
17 | ************************************************************************* | 17 | ************************************************************************* |
18 | * | 18 | * |
19 | * Jump vector table as in table 3.1 in [1] | 19 | * Jump vector table as in table 3.1 in [1] |
20 | * | 20 | * |
21 | ************************************************************************* | 21 | ************************************************************************* |
22 | */ | 22 | */ |
23 | 23 | ||
24 | 24 | ||
25 | .globl _start | 25 | .globl _start |
26 | _start: b reset | 26 | _start: b reset |
27 | ldr pc, _undefined_instruction | 27 | ldr pc, _undefined_instruction |
28 | ldr pc, _software_interrupt | 28 | ldr pc, _software_interrupt |
29 | ldr pc, _prefetch_abort | 29 | ldr pc, _prefetch_abort |
30 | ldr pc, _data_abort | 30 | ldr pc, _data_abort |
31 | ldr pc, _not_used | 31 | ldr pc, _not_used |
32 | ldr pc, _irq | 32 | ldr pc, _irq |
33 | ldr pc, _fiq | 33 | ldr pc, _fiq |
34 | 34 | ||
35 | _undefined_instruction: .word undefined_instruction | 35 | _undefined_instruction: .word undefined_instruction |
36 | _software_interrupt: .word software_interrupt | 36 | _software_interrupt: .word software_interrupt |
37 | _prefetch_abort: .word prefetch_abort | 37 | _prefetch_abort: .word prefetch_abort |
38 | _data_abort: .word data_abort | 38 | _data_abort: .word data_abort |
39 | _not_used: .word not_used | 39 | _not_used: .word not_used |
40 | _irq: .word irq | 40 | _irq: .word irq |
41 | _fiq: .word fiq | 41 | _fiq: .word fiq |
42 | 42 | ||
43 | .balignl 16,0xdeadbeef | 43 | .balignl 16,0xdeadbeef |
44 | 44 | ||
45 | 45 | ||
46 | /* | 46 | /* |
47 | ************************************************************************* | 47 | ************************************************************************* |
48 | * | 48 | * |
49 | * Startup Code (reset vector) | 49 | * Startup Code (reset vector) |
50 | * | 50 | * |
51 | * do important init only if we don't start from memory! | 51 | * do important init only if we don't start from memory! |
52 | * relocate armboot to ram | 52 | * relocate armboot to ram |
53 | * setup stack | 53 | * setup stack |
54 | * jump to second stage | 54 | * jump to second stage |
55 | * | 55 | * |
56 | ************************************************************************* | 56 | ************************************************************************* |
57 | */ | 57 | */ |
58 | 58 | ||
59 | .globl _TEXT_BASE | ||
60 | _TEXT_BASE: | ||
61 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE) | ||
62 | .word CONFIG_SPL_TEXT_BASE | ||
63 | #else | ||
64 | .word CONFIG_SYS_TEXT_BASE | ||
65 | #endif | ||
66 | |||
67 | /* | ||
68 | * These are defined in the board-specific linker script. | ||
69 | * Subtracting _start from them lets the linker put their | ||
70 | * relative position in the executable instead of leaving | ||
71 | * them null. | ||
72 | */ | ||
73 | .globl _bss_start_ofs | ||
74 | _bss_start_ofs: | ||
75 | .word __bss_start - _start | ||
76 | |||
77 | .globl _bss_end_ofs | ||
78 | _bss_end_ofs: | ||
79 | .word __bss_end - _start | ||
80 | |||
81 | .globl _end_ofs | ||
82 | _end_ofs: | ||
83 | .word _end - _start | ||
84 | |||
85 | #ifdef CONFIG_USE_IRQ | 59 | #ifdef CONFIG_USE_IRQ |
86 | /* IRQ stack memory (calculated at run-time) */ | 60 | /* IRQ stack memory (calculated at run-time) */ |
87 | .globl IRQ_STACK_START | 61 | .globl IRQ_STACK_START |
88 | IRQ_STACK_START: | 62 | IRQ_STACK_START: |
89 | .word 0x0badc0de | 63 | .word 0x0badc0de |
90 | 64 | ||
91 | /* IRQ stack memory (calculated at run-time) */ | 65 | /* IRQ stack memory (calculated at run-time) */ |
92 | .globl FIQ_STACK_START | 66 | .globl FIQ_STACK_START |
93 | FIQ_STACK_START: | 67 | FIQ_STACK_START: |
94 | .word 0x0badc0de | 68 | .word 0x0badc0de |
95 | #endif | 69 | #endif |
96 | 70 | ||
97 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ | 71 | /* IRQ stack memory (calculated at run-time) + 8 bytes */ |
98 | .globl IRQ_STACK_START_IN | 72 | .globl IRQ_STACK_START_IN |
99 | IRQ_STACK_START_IN: | 73 | IRQ_STACK_START_IN: |
100 | .word 0x0badc0de | 74 | .word 0x0badc0de |
101 | 75 | ||
102 | /* | 76 | /* |
103 | * the actual reset code | 77 | * the actual reset code |
104 | */ | 78 | */ |
105 | 79 | ||
106 | reset: | 80 | reset: |
107 | /* | 81 | /* |
108 | * set the cpu to SVC32 mode | 82 | * set the cpu to SVC32 mode |
109 | */ | 83 | */ |
110 | mrs r0,cpsr | 84 | mrs r0,cpsr |
111 | bic r0,r0,#0x1f | 85 | bic r0,r0,#0x1f |
112 | orr r0,r0,#0xd3 | 86 | orr r0,r0,#0xd3 |
113 | msr cpsr,r0 | 87 | msr cpsr,r0 |
114 | 88 | ||
115 | /* | 89 | /* |
116 | * we do sys-critical inits only at reboot, | 90 | * we do sys-critical inits only at reboot, |
117 | * not when booting from ram! | 91 | * not when booting from ram! |
118 | */ | 92 | */ |
119 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT | 93 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
120 | bl cpu_init_crit | 94 | bl cpu_init_crit |
121 | #endif | 95 | #endif |
122 | 96 | ||
123 | bl _main | 97 | bl _main |
124 | 98 | ||
125 | /*------------------------------------------------------------------------------*/ | 99 | /*------------------------------------------------------------------------------*/ |
126 | 100 | ||
127 | .globl c_runtime_cpu_setup | 101 | .globl c_runtime_cpu_setup |
128 | c_runtime_cpu_setup: | 102 | c_runtime_cpu_setup: |
129 | 103 | ||
130 | mov pc, lr | 104 | mov pc, lr |
131 | 105 | ||
132 | /* | 106 | /* |
133 | ************************************************************************* | 107 | ************************************************************************* |
134 | * | 108 | * |
135 | * CPU_init_critical registers | 109 | * CPU_init_critical registers |
136 | * | 110 | * |
137 | * setup important registers | 111 | * setup important registers |
138 | * setup memory timing | 112 | * setup memory timing |
139 | * | 113 | * |
140 | ************************************************************************* | 114 | ************************************************************************* |
141 | */ | 115 | */ |
142 | 116 | ||
143 | 117 | ||
144 | /* Interrupt-Controller base address */ | 118 | /* Interrupt-Controller base address */ |
145 | IC_BASE: .word 0x90050000 | 119 | IC_BASE: .word 0x90050000 |
146 | #define ICMR 0x04 | 120 | #define ICMR 0x04 |
147 | 121 | ||
148 | 122 | ||
149 | /* Reset-Controller */ | 123 | /* Reset-Controller */ |
150 | RST_BASE: .word 0x90030000 | 124 | RST_BASE: .word 0x90030000 |
151 | #define RSRR 0x00 | 125 | #define RSRR 0x00 |
152 | #define RCSR 0x04 | 126 | #define RCSR 0x04 |
153 | 127 | ||
154 | 128 | ||
155 | /* PWR */ | 129 | /* PWR */ |
156 | PWR_BASE: .word 0x90020000 | 130 | PWR_BASE: .word 0x90020000 |
157 | #define PSPR 0x08 | 131 | #define PSPR 0x08 |
158 | #define PPCR 0x14 | 132 | #define PPCR 0x14 |
159 | cpuspeed: .word CONFIG_SYS_CPUSPEED | 133 | cpuspeed: .word CONFIG_SYS_CPUSPEED |
160 | 134 | ||
161 | 135 | ||
162 | cpu_init_crit: | 136 | cpu_init_crit: |
163 | /* | 137 | /* |
164 | * mask all IRQs | 138 | * mask all IRQs |
165 | */ | 139 | */ |
166 | ldr r0, IC_BASE | 140 | ldr r0, IC_BASE |
167 | mov r1, #0x00 | 141 | mov r1, #0x00 |
168 | str r1, [r0, #ICMR] | 142 | str r1, [r0, #ICMR] |
169 | 143 | ||
170 | /* set clock speed */ | 144 | /* set clock speed */ |
171 | ldr r0, PWR_BASE | 145 | ldr r0, PWR_BASE |
172 | ldr r1, cpuspeed | 146 | ldr r1, cpuspeed |
173 | str r1, [r0, #PPCR] | 147 | str r1, [r0, #PPCR] |
174 | 148 | ||
175 | /* | 149 | /* |
176 | * before relocating, we have to setup RAM timing | 150 | * before relocating, we have to setup RAM timing |
177 | * because memory timing is board-dependend, you will | 151 | * because memory timing is board-dependend, you will |
178 | * find a lowlevel_init.S in your board directory. | 152 | * find a lowlevel_init.S in your board directory. |
179 | */ | 153 | */ |
180 | mov ip, lr | 154 | mov ip, lr |
181 | bl lowlevel_init | 155 | bl lowlevel_init |
182 | mov lr, ip | 156 | mov lr, ip |
183 | 157 | ||
184 | /* | 158 | /* |
185 | * disable MMU stuff and enable I-cache | 159 | * disable MMU stuff and enable I-cache |
186 | */ | 160 | */ |
187 | mrc p15,0,r0,c1,c0 | 161 | mrc p15,0,r0,c1,c0 |
188 | bic r0, r0, #0x00002000 @ clear bit 13 (X) | 162 | bic r0, r0, #0x00002000 @ clear bit 13 (X) |
189 | bic r0, r0, #0x0000000f @ clear bits 3-0 (WCAM) | 163 | bic r0, r0, #0x0000000f @ clear bits 3-0 (WCAM) |
190 | orr r0, r0, #0x00001000 @ set bit 12 (I) Icache | 164 | orr r0, r0, #0x00001000 @ set bit 12 (I) Icache |
191 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align | 165 | orr r0, r0, #0x00000002 @ set bit 2 (A) Align |
192 | mcr p15,0,r0,c1,c0 | 166 | mcr p15,0,r0,c1,c0 |
193 | 167 | ||
194 | /* | 168 | /* |
195 | * flush v4 I/D caches | 169 | * flush v4 I/D caches |
196 | */ | 170 | */ |
197 | mov r0, #0 | 171 | mov r0, #0 |
198 | mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */ | 172 | mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */ |
199 | mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */ | 173 | mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */ |
200 | 174 | ||
201 | mov pc, lr | 175 | mov pc, lr |
202 | 176 | ||
203 | 177 | ||
204 | /* | 178 | /* |
205 | ************************************************************************* | 179 | ************************************************************************* |
206 | * | 180 | * |
207 | * Interrupt handling | 181 | * Interrupt handling |
208 | * | 182 | * |
209 | ************************************************************************* | 183 | ************************************************************************* |
210 | */ | 184 | */ |
211 | 185 | ||
212 | @ | 186 | @ |
213 | @ IRQ stack frame. | 187 | @ IRQ stack frame. |
214 | @ | 188 | @ |
215 | #define S_FRAME_SIZE 72 | 189 | #define S_FRAME_SIZE 72 |
216 | 190 | ||
217 | #define S_OLD_R0 68 | 191 | #define S_OLD_R0 68 |
218 | #define S_PSR 64 | 192 | #define S_PSR 64 |
219 | #define S_PC 60 | 193 | #define S_PC 60 |
220 | #define S_LR 56 | 194 | #define S_LR 56 |
221 | #define S_SP 52 | 195 | #define S_SP 52 |
222 | 196 | ||
223 | #define S_IP 48 | 197 | #define S_IP 48 |
224 | #define S_FP 44 | 198 | #define S_FP 44 |
225 | #define S_R10 40 | 199 | #define S_R10 40 |
226 | #define S_R9 36 | 200 | #define S_R9 36 |
227 | #define S_R8 32 | 201 | #define S_R8 32 |
228 | #define S_R7 28 | 202 | #define S_R7 28 |
229 | #define S_R6 24 | 203 | #define S_R6 24 |
230 | #define S_R5 20 | 204 | #define S_R5 20 |
231 | #define S_R4 16 | 205 | #define S_R4 16 |
232 | #define S_R3 12 | 206 | #define S_R3 12 |
233 | #define S_R2 8 | 207 | #define S_R2 8 |
234 | #define S_R1 4 | 208 | #define S_R1 4 |
235 | #define S_R0 0 | 209 | #define S_R0 0 |
236 | 210 | ||
237 | #define MODE_SVC 0x13 | 211 | #define MODE_SVC 0x13 |
238 | #define I_BIT 0x80 | 212 | #define I_BIT 0x80 |
239 | 213 | ||
240 | /* | 214 | /* |
241 | * use bad_save_user_regs for abort/prefetch/undef/swi ... | 215 | * use bad_save_user_regs for abort/prefetch/undef/swi ... |
242 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling | 216 | * use irq_save_user_regs / irq_restore_user_regs for IRQ/FIQ handling |
243 | */ | 217 | */ |
244 | 218 | ||
245 | .macro bad_save_user_regs | 219 | .macro bad_save_user_regs |
246 | sub sp, sp, #S_FRAME_SIZE | 220 | sub sp, sp, #S_FRAME_SIZE |
247 | stmia sp, {r0 - r12} @ Calling r0-r12 | 221 | stmia sp, {r0 - r12} @ Calling r0-r12 |
248 | add r8, sp, #S_PC | 222 | add r8, sp, #S_PC |
249 | 223 | ||
250 | ldr r2, IRQ_STACK_START_IN | 224 | ldr r2, IRQ_STACK_START_IN |
251 | ldmia r2, {r2 - r4} @ get pc, cpsr, old_r0 | 225 | ldmia r2, {r2 - r4} @ get pc, cpsr, old_r0 |
252 | add r0, sp, #S_FRAME_SIZE @ restore sp_SVC | 226 | add r0, sp, #S_FRAME_SIZE @ restore sp_SVC |
253 | 227 | ||
254 | add r5, sp, #S_SP | 228 | add r5, sp, #S_SP |
255 | mov r1, lr | 229 | mov r1, lr |
256 | stmia r5, {r0 - r4} @ save sp_SVC, lr_SVC, pc, cpsr, old_r | 230 | stmia r5, {r0 - r4} @ save sp_SVC, lr_SVC, pc, cpsr, old_r |
257 | mov r0, sp | 231 | mov r0, sp |
258 | .endm | 232 | .endm |
259 | 233 | ||
260 | .macro irq_save_user_regs | 234 | .macro irq_save_user_regs |
261 | sub sp, sp, #S_FRAME_SIZE | 235 | sub sp, sp, #S_FRAME_SIZE |
262 | stmia sp, {r0 - r12} @ Calling r0-r12 | 236 | stmia sp, {r0 - r12} @ Calling r0-r12 |
263 | add r8, sp, #S_PC | 237 | add r8, sp, #S_PC |
264 | stmdb r8, {sp, lr}^ @ Calling SP, LR | 238 | stmdb r8, {sp, lr}^ @ Calling SP, LR |
265 | str lr, [r8, #0] @ Save calling PC | 239 | str lr, [r8, #0] @ Save calling PC |
266 | mrs r6, spsr | 240 | mrs r6, spsr |
267 | str r6, [r8, #4] @ Save CPSR | 241 | str r6, [r8, #4] @ Save CPSR |
268 | str r0, [r8, #8] @ Save OLD_R0 | 242 | str r0, [r8, #8] @ Save OLD_R0 |
269 | mov r0, sp | 243 | mov r0, sp |
270 | .endm | 244 | .endm |
271 | 245 | ||
272 | .macro irq_restore_user_regs | 246 | .macro irq_restore_user_regs |
273 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr | 247 | ldmia sp, {r0 - lr}^ @ Calling r0 - lr |
274 | mov r0, r0 | 248 | mov r0, r0 |
275 | ldr lr, [sp, #S_PC] @ Get PC | 249 | ldr lr, [sp, #S_PC] @ Get PC |
276 | add sp, sp, #S_FRAME_SIZE | 250 | add sp, sp, #S_FRAME_SIZE |
277 | subs pc, lr, #4 @ return & move spsr_svc into cpsr | 251 | subs pc, lr, #4 @ return & move spsr_svc into cpsr |
278 | .endm | 252 | .endm |
279 | 253 | ||
280 | .macro get_bad_stack | 254 | .macro get_bad_stack |
281 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack | 255 | ldr r13, IRQ_STACK_START_IN @ setup our mode stack |
282 | 256 | ||
283 | str lr, [r13] @ save caller lr / spsr | 257 | str lr, [r13] @ save caller lr / spsr |
284 | mrs lr, spsr | 258 | mrs lr, spsr |
285 | str lr, [r13, #4] | 259 | str lr, [r13, #4] |
286 | 260 | ||
287 | mov r13, #MODE_SVC @ prepare SVC-Mode | 261 | mov r13, #MODE_SVC @ prepare SVC-Mode |
288 | msr spsr_c, r13 | 262 | msr spsr_c, r13 |
289 | mov lr, pc | 263 | mov lr, pc |
290 | movs pc, lr | 264 | movs pc, lr |
291 | .endm | 265 | .endm |
292 | 266 | ||
293 | .macro get_irq_stack @ setup IRQ stack | 267 | .macro get_irq_stack @ setup IRQ stack |
294 | ldr sp, IRQ_STACK_START | 268 | ldr sp, IRQ_STACK_START |
295 | .endm | 269 | .endm |
296 | 270 | ||
297 | .macro get_fiq_stack @ setup FIQ stack | 271 | .macro get_fiq_stack @ setup FIQ stack |
298 | ldr sp, FIQ_STACK_START | 272 | ldr sp, FIQ_STACK_START |
299 | .endm | 273 | .endm |
300 | 274 | ||
301 | /* | 275 | /* |
302 | * exception handlers | 276 | * exception handlers |
303 | */ | 277 | */ |
304 | .align 5 | 278 | .align 5 |
305 | undefined_instruction: | 279 | undefined_instruction: |
306 | get_bad_stack | 280 | get_bad_stack |
307 | bad_save_user_regs | 281 | bad_save_user_regs |
308 | bl do_undefined_instruction | 282 | bl do_undefined_instruction |
309 | 283 | ||
310 | .align 5 | 284 | .align 5 |
311 | software_interrupt: | 285 | software_interrupt: |
312 | get_bad_stack | 286 | get_bad_stack |
313 | bad_save_user_regs | 287 | bad_save_user_regs |
314 | bl do_software_interrupt | 288 | bl do_software_interrupt |
315 | 289 | ||
316 | .align 5 | 290 | .align 5 |
317 | prefetch_abort: | 291 | prefetch_abort: |
318 | get_bad_stack | 292 | get_bad_stack |
319 | bad_save_user_regs | 293 | bad_save_user_regs |
320 | bl do_prefetch_abort | 294 | bl do_prefetch_abort |
321 | 295 | ||
322 | .align 5 | 296 | .align 5 |
323 | data_abort: | 297 | data_abort: |
324 | get_bad_stack | 298 | get_bad_stack |
325 | bad_save_user_regs | 299 | bad_save_user_regs |
326 | bl do_data_abort | 300 | bl do_data_abort |
327 | 301 | ||
328 | .align 5 | 302 | .align 5 |
329 | not_used: | 303 | not_used: |
330 | get_bad_stack | 304 | get_bad_stack |
331 | bad_save_user_regs | 305 | bad_save_user_regs |
332 | bl do_not_used | 306 | bl do_not_used |
333 | 307 | ||
334 | #ifdef CONFIG_USE_IRQ | 308 | #ifdef CONFIG_USE_IRQ |
335 | 309 | ||
336 | .align 5 | 310 | .align 5 |
337 | irq: | 311 | irq: |
338 | get_irq_stack | 312 | get_irq_stack |
339 | irq_save_user_regs | 313 | irq_save_user_regs |
340 | bl do_irq | 314 | bl do_irq |
341 | irq_restore_user_regs | 315 | irq_restore_user_regs |
342 | 316 | ||
343 | .align 5 | 317 | .align 5 |
344 | fiq: | 318 | fiq: |
345 | get_fiq_stack | 319 | get_fiq_stack |
346 | /* someone ought to write a more effiction fiq_save_user_regs */ | 320 | /* someone ought to write a more effiction fiq_save_user_regs */ |
347 | irq_save_user_regs | 321 | irq_save_user_regs |
348 | bl do_fiq | 322 | bl do_fiq |
349 | irq_restore_user_regs | 323 | irq_restore_user_regs |
350 | 324 | ||
351 | #else | 325 | #else |
352 | 326 | ||
353 | .align 5 | 327 | .align 5 |
354 | irq: | 328 | irq: |
355 | get_bad_stack | 329 | get_bad_stack |
356 | bad_save_user_regs | 330 | bad_save_user_regs |
357 | bl do_irq | 331 | bl do_irq |
358 | 332 | ||
359 | .align 5 | 333 | .align 5 |
360 | fiq: | 334 | fiq: |
361 | get_bad_stack | 335 | get_bad_stack |
362 | bad_save_user_regs | 336 | bad_save_user_regs |
363 | bl do_fiq | 337 | bl do_fiq |
364 | 338 | ||
365 | #endif | 339 | #endif |
366 | 340 | ||
367 | .align 5 | 341 | .align 5 |
368 | .globl reset_cpu | 342 | .globl reset_cpu |
369 | reset_cpu: | 343 | reset_cpu: |
370 | ldr r0, RST_BASE | 344 | ldr r0, RST_BASE |
371 | mov r1, #0x0 @ set bit 3-0 ... | 345 | mov r1, #0x0 @ set bit 3-0 ... |
372 | str r1, [r0, #RCSR] @ ... to clear in RCSR | 346 | str r1, [r0, #RCSR] @ ... to clear in RCSR |
373 | mov r1, #0x1 | 347 | mov r1, #0x1 |
374 | str r1, [r0, #RSRR] @ and perform reset | 348 | str r1, [r0, #RSRR] @ and perform reset |
375 | b reset_cpu @ silly, but repeat endlessly | 349 | b reset_cpu @ silly, but repeat endlessly |
376 | 350 |
arch/arm/lib/board.c
1 | /* | 1 | /* |
2 | * (C) Copyright 2002-2006 | 2 | * (C) Copyright 2002-2006 |
3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
4 | * | 4 | * |
5 | * (C) Copyright 2002 | 5 | * (C) Copyright 2002 |
6 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> | 6 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
7 | * Marius Groeger <mgroeger@sysgo.de> | 7 | * Marius Groeger <mgroeger@sysgo.de> |
8 | * | 8 | * |
9 | * SPDX-License-Identifier: GPL-2.0+ | 9 | * SPDX-License-Identifier: GPL-2.0+ |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * To match the U-Boot user interface on ARM platforms to the U-Boot | 13 | * To match the U-Boot user interface on ARM platforms to the U-Boot |
14 | * standard (as on PPC platforms), some messages with debug character | 14 | * standard (as on PPC platforms), some messages with debug character |
15 | * are removed from the default U-Boot build. | 15 | * are removed from the default U-Boot build. |
16 | * | 16 | * |
17 | * Define DEBUG here if you want additional info as shown below | 17 | * Define DEBUG here if you want additional info as shown below |
18 | * printed upon startup: | 18 | * printed upon startup: |
19 | * | 19 | * |
20 | * U-Boot code: 00F00000 -> 00F3C774 BSS: -> 00FC3274 | 20 | * U-Boot code: 00F00000 -> 00F3C774 BSS: -> 00FC3274 |
21 | * IRQ Stack: 00ebff7c | 21 | * IRQ Stack: 00ebff7c |
22 | * FIQ Stack: 00ebef7c | 22 | * FIQ Stack: 00ebef7c |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <common.h> | 25 | #include <common.h> |
26 | #include <command.h> | 26 | #include <command.h> |
27 | #include <environment.h> | 27 | #include <environment.h> |
28 | #include <malloc.h> | 28 | #include <malloc.h> |
29 | #include <stdio_dev.h> | 29 | #include <stdio_dev.h> |
30 | #include <version.h> | 30 | #include <version.h> |
31 | #include <net.h> | 31 | #include <net.h> |
32 | #include <serial.h> | 32 | #include <serial.h> |
33 | #include <nand.h> | 33 | #include <nand.h> |
34 | #include <onenand_uboot.h> | 34 | #include <onenand_uboot.h> |
35 | #include <mmc.h> | 35 | #include <mmc.h> |
36 | #include <libfdt.h> | 36 | #include <libfdt.h> |
37 | #include <fdtdec.h> | 37 | #include <fdtdec.h> |
38 | #include <post.h> | 38 | #include <post.h> |
39 | #include <logbuff.h> | 39 | #include <logbuff.h> |
40 | #include <asm/sections.h> | 40 | #include <asm/sections.h> |
41 | 41 | ||
42 | #ifdef CONFIG_BITBANGMII | 42 | #ifdef CONFIG_BITBANGMII |
43 | #include <miiphy.h> | 43 | #include <miiphy.h> |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | DECLARE_GLOBAL_DATA_PTR; | 46 | DECLARE_GLOBAL_DATA_PTR; |
47 | 47 | ||
48 | ulong monitor_flash_len; | 48 | ulong monitor_flash_len; |
49 | 49 | ||
50 | #ifdef CONFIG_HAS_DATAFLASH | 50 | #ifdef CONFIG_HAS_DATAFLASH |
51 | extern int AT91F_DataflashInit(void); | 51 | extern int AT91F_DataflashInit(void); |
52 | extern void dataflash_print_info(void); | 52 | extern void dataflash_print_info(void); |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #if defined(CONFIG_HARD_I2C) || \ | 55 | #if defined(CONFIG_HARD_I2C) || \ |
56 | defined(CONFIG_SYS_I2C) | 56 | defined(CONFIG_SYS_I2C) |
57 | #include <i2c.h> | 57 | #include <i2c.h> |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | /************************************************************************ | 60 | /************************************************************************ |
61 | * Coloured LED functionality | 61 | * Coloured LED functionality |
62 | ************************************************************************ | 62 | ************************************************************************ |
63 | * May be supplied by boards if desired | 63 | * May be supplied by boards if desired |
64 | */ | 64 | */ |
65 | inline void __coloured_LED_init(void) {} | 65 | inline void __coloured_LED_init(void) {} |
66 | void coloured_LED_init(void) | 66 | void coloured_LED_init(void) |
67 | __attribute__((weak, alias("__coloured_LED_init"))); | 67 | __attribute__((weak, alias("__coloured_LED_init"))); |
68 | inline void __red_led_on(void) {} | 68 | inline void __red_led_on(void) {} |
69 | void red_led_on(void) __attribute__((weak, alias("__red_led_on"))); | 69 | void red_led_on(void) __attribute__((weak, alias("__red_led_on"))); |
70 | inline void __red_led_off(void) {} | 70 | inline void __red_led_off(void) {} |
71 | void red_led_off(void) __attribute__((weak, alias("__red_led_off"))); | 71 | void red_led_off(void) __attribute__((weak, alias("__red_led_off"))); |
72 | inline void __green_led_on(void) {} | 72 | inline void __green_led_on(void) {} |
73 | void green_led_on(void) __attribute__((weak, alias("__green_led_on"))); | 73 | void green_led_on(void) __attribute__((weak, alias("__green_led_on"))); |
74 | inline void __green_led_off(void) {} | 74 | inline void __green_led_off(void) {} |
75 | void green_led_off(void) __attribute__((weak, alias("__green_led_off"))); | 75 | void green_led_off(void) __attribute__((weak, alias("__green_led_off"))); |
76 | inline void __yellow_led_on(void) {} | 76 | inline void __yellow_led_on(void) {} |
77 | void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on"))); | 77 | void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on"))); |
78 | inline void __yellow_led_off(void) {} | 78 | inline void __yellow_led_off(void) {} |
79 | void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off"))); | 79 | void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off"))); |
80 | inline void __blue_led_on(void) {} | 80 | inline void __blue_led_on(void) {} |
81 | void blue_led_on(void) __attribute__((weak, alias("__blue_led_on"))); | 81 | void blue_led_on(void) __attribute__((weak, alias("__blue_led_on"))); |
82 | inline void __blue_led_off(void) {} | 82 | inline void __blue_led_off(void) {} |
83 | void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); | 83 | void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); |
84 | 84 | ||
85 | /* | 85 | /* |
86 | ************************************************************************ | 86 | ************************************************************************ |
87 | * Init Utilities * | 87 | * Init Utilities * |
88 | ************************************************************************ | 88 | ************************************************************************ |
89 | * Some of this code should be moved into the core functions, | 89 | * Some of this code should be moved into the core functions, |
90 | * or dropped completely, | 90 | * or dropped completely, |
91 | * but let's get it working (again) first... | 91 | * but let's get it working (again) first... |
92 | */ | 92 | */ |
93 | 93 | ||
94 | #if defined(CONFIG_ARM_DCC) && !defined(CONFIG_BAUDRATE) | 94 | #if defined(CONFIG_ARM_DCC) && !defined(CONFIG_BAUDRATE) |
95 | #define CONFIG_BAUDRATE 115200 | 95 | #define CONFIG_BAUDRATE 115200 |
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | static int init_baudrate(void) | 98 | static int init_baudrate(void) |
99 | { | 99 | { |
100 | gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); | 100 | gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); |
101 | return 0; | 101 | return 0; |
102 | } | 102 | } |
103 | 103 | ||
104 | static int display_banner(void) | 104 | static int display_banner(void) |
105 | { | 105 | { |
106 | printf("\n\n%s\n\n", version_string); | 106 | printf("\n\n%s\n\n", version_string); |
107 | debug("U-Boot code: %08lX -> %08lX BSS: -> %08lX\n", | 107 | debug("U-Boot code: %08lX -> %08lX BSS: -> %08lX\n", |
108 | _TEXT_BASE, | 108 | (ulong)&_start, |
109 | _bss_start_ofs + _TEXT_BASE, _bss_end_ofs + _TEXT_BASE); | 109 | (ulong)&__bss_start, (ulong)&__bss_end); |
110 | #ifdef CONFIG_MODEM_SUPPORT | 110 | #ifdef CONFIG_MODEM_SUPPORT |
111 | debug("Modem Support enabled\n"); | 111 | debug("Modem Support enabled\n"); |
112 | #endif | 112 | #endif |
113 | #ifdef CONFIG_USE_IRQ | 113 | #ifdef CONFIG_USE_IRQ |
114 | debug("IRQ Stack: %08lx\n", IRQ_STACK_START); | 114 | debug("IRQ Stack: %08lx\n", IRQ_STACK_START); |
115 | debug("FIQ Stack: %08lx\n", FIQ_STACK_START); | 115 | debug("FIQ Stack: %08lx\n", FIQ_STACK_START); |
116 | #endif | 116 | #endif |
117 | 117 | ||
118 | return (0); | 118 | return (0); |
119 | } | 119 | } |
120 | 120 | ||
121 | /* | 121 | /* |
122 | * WARNING: this code looks "cleaner" than the PowerPC version, but | 122 | * WARNING: this code looks "cleaner" than the PowerPC version, but |
123 | * has the disadvantage that you either get nothing, or everything. | 123 | * has the disadvantage that you either get nothing, or everything. |
124 | * On PowerPC, you might see "DRAM: " before the system hangs - which | 124 | * On PowerPC, you might see "DRAM: " before the system hangs - which |
125 | * gives a simple yet clear indication which part of the | 125 | * gives a simple yet clear indication which part of the |
126 | * initialization if failing. | 126 | * initialization if failing. |
127 | */ | 127 | */ |
128 | static int display_dram_config(void) | 128 | static int display_dram_config(void) |
129 | { | 129 | { |
130 | int i; | 130 | int i; |
131 | 131 | ||
132 | #ifdef DEBUG | 132 | #ifdef DEBUG |
133 | puts("RAM Configuration:\n"); | 133 | puts("RAM Configuration:\n"); |
134 | 134 | ||
135 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { | 135 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { |
136 | printf("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start); | 136 | printf("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start); |
137 | print_size(gd->bd->bi_dram[i].size, "\n"); | 137 | print_size(gd->bd->bi_dram[i].size, "\n"); |
138 | } | 138 | } |
139 | #else | 139 | #else |
140 | ulong size = 0; | 140 | ulong size = 0; |
141 | 141 | ||
142 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) | 142 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) |
143 | size += gd->bd->bi_dram[i].size; | 143 | size += gd->bd->bi_dram[i].size; |
144 | 144 | ||
145 | puts("DRAM: "); | 145 | puts("DRAM: "); |
146 | print_size(size, "\n"); | 146 | print_size(size, "\n"); |
147 | #endif | 147 | #endif |
148 | 148 | ||
149 | return (0); | 149 | return (0); |
150 | } | 150 | } |
151 | 151 | ||
152 | #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) | 152 | #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) |
153 | static int init_func_i2c(void) | 153 | static int init_func_i2c(void) |
154 | { | 154 | { |
155 | puts("I2C: "); | 155 | puts("I2C: "); |
156 | #ifdef CONFIG_SYS_I2C | 156 | #ifdef CONFIG_SYS_I2C |
157 | i2c_init_all(); | 157 | i2c_init_all(); |
158 | #else | 158 | #else |
159 | i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); | 159 | i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); |
160 | #endif | 160 | #endif |
161 | puts("ready\n"); | 161 | puts("ready\n"); |
162 | return (0); | 162 | return (0); |
163 | } | 163 | } |
164 | #endif | 164 | #endif |
165 | 165 | ||
166 | #if defined(CONFIG_CMD_PCI) || defined (CONFIG_PCI) | 166 | #if defined(CONFIG_CMD_PCI) || defined (CONFIG_PCI) |
167 | #include <pci.h> | 167 | #include <pci.h> |
168 | static int arm_pci_init(void) | 168 | static int arm_pci_init(void) |
169 | { | 169 | { |
170 | pci_init(); | 170 | pci_init(); |
171 | return 0; | 171 | return 0; |
172 | } | 172 | } |
173 | #endif /* CONFIG_CMD_PCI || CONFIG_PCI */ | 173 | #endif /* CONFIG_CMD_PCI || CONFIG_PCI */ |
174 | 174 | ||
175 | /* | 175 | /* |
176 | * Breathe some life into the board... | 176 | * Breathe some life into the board... |
177 | * | 177 | * |
178 | * Initialize a serial port as console, and carry out some hardware | 178 | * Initialize a serial port as console, and carry out some hardware |
179 | * tests. | 179 | * tests. |
180 | * | 180 | * |
181 | * The first part of initialization is running from Flash memory; | 181 | * The first part of initialization is running from Flash memory; |
182 | * its main purpose is to initialize the RAM so that we | 182 | * its main purpose is to initialize the RAM so that we |
183 | * can relocate the monitor code to RAM. | 183 | * can relocate the monitor code to RAM. |
184 | */ | 184 | */ |
185 | 185 | ||
186 | /* | 186 | /* |
187 | * All attempts to come up with a "common" initialization sequence | 187 | * All attempts to come up with a "common" initialization sequence |
188 | * that works for all boards and architectures failed: some of the | 188 | * that works for all boards and architectures failed: some of the |
189 | * requirements are just _too_ different. To get rid of the resulting | 189 | * requirements are just _too_ different. To get rid of the resulting |
190 | * mess of board dependent #ifdef'ed code we now make the whole | 190 | * mess of board dependent #ifdef'ed code we now make the whole |
191 | * initialization sequence configurable to the user. | 191 | * initialization sequence configurable to the user. |
192 | * | 192 | * |
193 | * The requirements for any new initalization function is simple: it | 193 | * The requirements for any new initalization function is simple: it |
194 | * receives a pointer to the "global data" structure as it's only | 194 | * receives a pointer to the "global data" structure as it's only |
195 | * argument, and returns an integer return code, where 0 means | 195 | * argument, and returns an integer return code, where 0 means |
196 | * "continue" and != 0 means "fatal error, hang the system". | 196 | * "continue" and != 0 means "fatal error, hang the system". |
197 | */ | 197 | */ |
198 | typedef int (init_fnc_t) (void); | 198 | typedef int (init_fnc_t) (void); |
199 | 199 | ||
200 | void __dram_init_banksize(void) | 200 | void __dram_init_banksize(void) |
201 | { | 201 | { |
202 | gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; | 202 | gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; |
203 | gd->bd->bi_dram[0].size = gd->ram_size; | 203 | gd->bd->bi_dram[0].size = gd->ram_size; |
204 | } | 204 | } |
205 | void dram_init_banksize(void) | 205 | void dram_init_banksize(void) |
206 | __attribute__((weak, alias("__dram_init_banksize"))); | 206 | __attribute__((weak, alias("__dram_init_banksize"))); |
207 | 207 | ||
208 | int __arch_cpu_init(void) | 208 | int __arch_cpu_init(void) |
209 | { | 209 | { |
210 | return 0; | 210 | return 0; |
211 | } | 211 | } |
212 | int arch_cpu_init(void) | 212 | int arch_cpu_init(void) |
213 | __attribute__((weak, alias("__arch_cpu_init"))); | 213 | __attribute__((weak, alias("__arch_cpu_init"))); |
214 | 214 | ||
215 | int __power_init_board(void) | 215 | int __power_init_board(void) |
216 | { | 216 | { |
217 | return 0; | 217 | return 0; |
218 | } | 218 | } |
219 | int power_init_board(void) | 219 | int power_init_board(void) |
220 | __attribute__((weak, alias("__power_init_board"))); | 220 | __attribute__((weak, alias("__power_init_board"))); |
221 | 221 | ||
222 | /* Record the board_init_f() bootstage (after arch_cpu_init()) */ | 222 | /* Record the board_init_f() bootstage (after arch_cpu_init()) */ |
223 | static int mark_bootstage(void) | 223 | static int mark_bootstage(void) |
224 | { | 224 | { |
225 | bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); | 225 | bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); |
226 | 226 | ||
227 | return 0; | 227 | return 0; |
228 | } | 228 | } |
229 | 229 | ||
230 | init_fnc_t *init_sequence[] = { | 230 | init_fnc_t *init_sequence[] = { |
231 | arch_cpu_init, /* basic arch cpu dependent setup */ | 231 | arch_cpu_init, /* basic arch cpu dependent setup */ |
232 | mark_bootstage, | 232 | mark_bootstage, |
233 | #ifdef CONFIG_OF_CONTROL | 233 | #ifdef CONFIG_OF_CONTROL |
234 | fdtdec_check_fdt, | 234 | fdtdec_check_fdt, |
235 | #endif | 235 | #endif |
236 | #if defined(CONFIG_BOARD_EARLY_INIT_F) | 236 | #if defined(CONFIG_BOARD_EARLY_INIT_F) |
237 | board_early_init_f, | 237 | board_early_init_f, |
238 | #endif | 238 | #endif |
239 | timer_init, /* initialize timer */ | 239 | timer_init, /* initialize timer */ |
240 | #ifdef CONFIG_BOARD_POSTCLK_INIT | 240 | #ifdef CONFIG_BOARD_POSTCLK_INIT |
241 | board_postclk_init, | 241 | board_postclk_init, |
242 | #endif | 242 | #endif |
243 | #ifdef CONFIG_FSL_ESDHC | 243 | #ifdef CONFIG_FSL_ESDHC |
244 | get_clocks, | 244 | get_clocks, |
245 | #endif | 245 | #endif |
246 | env_init, /* initialize environment */ | 246 | env_init, /* initialize environment */ |
247 | init_baudrate, /* initialze baudrate settings */ | 247 | init_baudrate, /* initialze baudrate settings */ |
248 | serial_init, /* serial communications setup */ | 248 | serial_init, /* serial communications setup */ |
249 | console_init_f, /* stage 1 init of console */ | 249 | console_init_f, /* stage 1 init of console */ |
250 | display_banner, /* say that we are here */ | 250 | display_banner, /* say that we are here */ |
251 | print_cpuinfo, /* display cpu info (and speed) */ | 251 | print_cpuinfo, /* display cpu info (and speed) */ |
252 | #if defined(CONFIG_DISPLAY_BOARDINFO) | 252 | #if defined(CONFIG_DISPLAY_BOARDINFO) |
253 | checkboard, /* display board info */ | 253 | checkboard, /* display board info */ |
254 | #endif | 254 | #endif |
255 | #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) | 255 | #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) |
256 | init_func_i2c, | 256 | init_func_i2c, |
257 | #endif | 257 | #endif |
258 | dram_init, /* configure available RAM banks */ | 258 | dram_init, /* configure available RAM banks */ |
259 | NULL, | 259 | NULL, |
260 | }; | 260 | }; |
261 | 261 | ||
262 | void board_init_f(ulong bootflag) | 262 | void board_init_f(ulong bootflag) |
263 | { | 263 | { |
264 | bd_t *bd; | 264 | bd_t *bd; |
265 | init_fnc_t **init_fnc_ptr; | 265 | init_fnc_t **init_fnc_ptr; |
266 | gd_t *id; | 266 | gd_t *id; |
267 | ulong addr, addr_sp; | 267 | ulong addr, addr_sp; |
268 | #ifdef CONFIG_PRAM | 268 | #ifdef CONFIG_PRAM |
269 | ulong reg; | 269 | ulong reg; |
270 | #endif | 270 | #endif |
271 | void *new_fdt = NULL; | 271 | void *new_fdt = NULL; |
272 | size_t fdt_size = 0; | 272 | size_t fdt_size = 0; |
273 | 273 | ||
274 | memset((void *)gd, 0, sizeof(gd_t)); | 274 | memset((void *)gd, 0, sizeof(gd_t)); |
275 | 275 | ||
276 | gd->mon_len = _bss_end_ofs; | 276 | gd->mon_len = (ulong)&__bss_end - (ulong)_start; |
277 | #ifdef CONFIG_OF_EMBED | 277 | #ifdef CONFIG_OF_EMBED |
278 | /* Get a pointer to the FDT */ | 278 | /* Get a pointer to the FDT */ |
279 | gd->fdt_blob = __dtb_db_begin; | 279 | gd->fdt_blob = __dtb_db_begin; |
280 | #elif defined CONFIG_OF_SEPARATE | 280 | #elif defined CONFIG_OF_SEPARATE |
281 | /* FDT is at end of image */ | 281 | /* FDT is at end of image */ |
282 | gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE); | 282 | gd->fdt_blob = &_end; |
283 | #endif | 283 | #endif |
284 | /* Allow the early environment to override the fdt address */ | 284 | /* Allow the early environment to override the fdt address */ |
285 | gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, | 285 | gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, |
286 | (uintptr_t)gd->fdt_blob); | 286 | (uintptr_t)gd->fdt_blob); |
287 | 287 | ||
288 | for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { | 288 | for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { |
289 | if ((*init_fnc_ptr)() != 0) { | 289 | if ((*init_fnc_ptr)() != 0) { |
290 | hang (); | 290 | hang (); |
291 | } | 291 | } |
292 | } | 292 | } |
293 | 293 | ||
294 | #ifdef CONFIG_OF_CONTROL | 294 | #ifdef CONFIG_OF_CONTROL |
295 | /* For now, put this check after the console is ready */ | 295 | /* For now, put this check after the console is ready */ |
296 | if (fdtdec_prepare_fdt()) { | 296 | if (fdtdec_prepare_fdt()) { |
297 | panic("** CONFIG_OF_CONTROL defined but no FDT - please see " | 297 | panic("** CONFIG_OF_CONTROL defined but no FDT - please see " |
298 | "doc/README.fdt-control"); | 298 | "doc/README.fdt-control"); |
299 | } | 299 | } |
300 | #endif | 300 | #endif |
301 | 301 | ||
302 | debug("monitor len: %08lX\n", gd->mon_len); | 302 | debug("monitor len: %08lX\n", gd->mon_len); |
303 | /* | 303 | /* |
304 | * Ram is setup, size stored in gd !! | 304 | * Ram is setup, size stored in gd !! |
305 | */ | 305 | */ |
306 | debug("ramsize: %08lX\n", gd->ram_size); | 306 | debug("ramsize: %08lX\n", gd->ram_size); |
307 | #if defined(CONFIG_SYS_MEM_TOP_HIDE) | 307 | #if defined(CONFIG_SYS_MEM_TOP_HIDE) |
308 | /* | 308 | /* |
309 | * Subtract specified amount of memory to hide so that it won't | 309 | * Subtract specified amount of memory to hide so that it won't |
310 | * get "touched" at all by U-Boot. By fixing up gd->ram_size | 310 | * get "touched" at all by U-Boot. By fixing up gd->ram_size |
311 | * the Linux kernel should now get passed the now "corrected" | 311 | * the Linux kernel should now get passed the now "corrected" |
312 | * memory size and won't touch it either. This should work | 312 | * memory size and won't touch it either. This should work |
313 | * for arch/ppc and arch/powerpc. Only Linux board ports in | 313 | * for arch/ppc and arch/powerpc. Only Linux board ports in |
314 | * arch/powerpc with bootwrapper support, that recalculate the | 314 | * arch/powerpc with bootwrapper support, that recalculate the |
315 | * memory size from the SDRAM controller setup will have to | 315 | * memory size from the SDRAM controller setup will have to |
316 | * get fixed. | 316 | * get fixed. |
317 | */ | 317 | */ |
318 | gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; | 318 | gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; |
319 | #endif | 319 | #endif |
320 | 320 | ||
321 | addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size; | 321 | addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size; |
322 | 322 | ||
323 | #ifdef CONFIG_LOGBUFFER | 323 | #ifdef CONFIG_LOGBUFFER |
324 | #ifndef CONFIG_ALT_LB_ADDR | 324 | #ifndef CONFIG_ALT_LB_ADDR |
325 | /* reserve kernel log buffer */ | 325 | /* reserve kernel log buffer */ |
326 | addr -= (LOGBUFF_RESERVE); | 326 | addr -= (LOGBUFF_RESERVE); |
327 | debug("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, | 327 | debug("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, |
328 | addr); | 328 | addr); |
329 | #endif | 329 | #endif |
330 | #endif | 330 | #endif |
331 | 331 | ||
332 | #ifdef CONFIG_PRAM | 332 | #ifdef CONFIG_PRAM |
333 | /* | 333 | /* |
334 | * reserve protected RAM | 334 | * reserve protected RAM |
335 | */ | 335 | */ |
336 | reg = getenv_ulong("pram", 10, CONFIG_PRAM); | 336 | reg = getenv_ulong("pram", 10, CONFIG_PRAM); |
337 | addr -= (reg << 10); /* size is in kB */ | 337 | addr -= (reg << 10); /* size is in kB */ |
338 | debug("Reserving %ldk for protected RAM at %08lx\n", reg, addr); | 338 | debug("Reserving %ldk for protected RAM at %08lx\n", reg, addr); |
339 | #endif /* CONFIG_PRAM */ | 339 | #endif /* CONFIG_PRAM */ |
340 | 340 | ||
341 | #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) | 341 | #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) |
342 | /* reserve TLB table */ | 342 | /* reserve TLB table */ |
343 | gd->arch.tlb_size = PGTABLE_SIZE; | 343 | gd->arch.tlb_size = PGTABLE_SIZE; |
344 | addr -= gd->arch.tlb_size; | 344 | addr -= gd->arch.tlb_size; |
345 | 345 | ||
346 | /* round down to next 64 kB limit */ | 346 | /* round down to next 64 kB limit */ |
347 | addr &= ~(0x10000 - 1); | 347 | addr &= ~(0x10000 - 1); |
348 | 348 | ||
349 | gd->arch.tlb_addr = addr; | 349 | gd->arch.tlb_addr = addr; |
350 | debug("TLB table from %08lx to %08lx\n", addr, addr + gd->arch.tlb_size); | 350 | debug("TLB table from %08lx to %08lx\n", addr, addr + gd->arch.tlb_size); |
351 | #endif | 351 | #endif |
352 | 352 | ||
353 | /* round down to next 4 kB limit */ | 353 | /* round down to next 4 kB limit */ |
354 | addr &= ~(4096 - 1); | 354 | addr &= ~(4096 - 1); |
355 | debug("Top of RAM usable for U-Boot at: %08lx\n", addr); | 355 | debug("Top of RAM usable for U-Boot at: %08lx\n", addr); |
356 | 356 | ||
357 | #ifdef CONFIG_LCD | 357 | #ifdef CONFIG_LCD |
358 | #ifdef CONFIG_FB_ADDR | 358 | #ifdef CONFIG_FB_ADDR |
359 | gd->fb_base = CONFIG_FB_ADDR; | 359 | gd->fb_base = CONFIG_FB_ADDR; |
360 | #else | 360 | #else |
361 | /* reserve memory for LCD display (always full pages) */ | 361 | /* reserve memory for LCD display (always full pages) */ |
362 | addr = lcd_setmem(addr); | 362 | addr = lcd_setmem(addr); |
363 | gd->fb_base = addr; | 363 | gd->fb_base = addr; |
364 | #endif /* CONFIG_FB_ADDR */ | 364 | #endif /* CONFIG_FB_ADDR */ |
365 | #endif /* CONFIG_LCD */ | 365 | #endif /* CONFIG_LCD */ |
366 | 366 | ||
367 | /* | 367 | /* |
368 | * reserve memory for U-Boot code, data & bss | 368 | * reserve memory for U-Boot code, data & bss |
369 | * round down to next 4 kB limit | 369 | * round down to next 4 kB limit |
370 | */ | 370 | */ |
371 | addr -= gd->mon_len; | 371 | addr -= gd->mon_len; |
372 | addr &= ~(4096 - 1); | 372 | addr &= ~(4096 - 1); |
373 | 373 | ||
374 | debug("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10, addr); | 374 | debug("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10, addr); |
375 | 375 | ||
376 | #ifndef CONFIG_SPL_BUILD | 376 | #ifndef CONFIG_SPL_BUILD |
377 | /* | 377 | /* |
378 | * reserve memory for malloc() arena | 378 | * reserve memory for malloc() arena |
379 | */ | 379 | */ |
380 | addr_sp = addr - TOTAL_MALLOC_LEN; | 380 | addr_sp = addr - TOTAL_MALLOC_LEN; |
381 | debug("Reserving %dk for malloc() at: %08lx\n", | 381 | debug("Reserving %dk for malloc() at: %08lx\n", |
382 | TOTAL_MALLOC_LEN >> 10, addr_sp); | 382 | TOTAL_MALLOC_LEN >> 10, addr_sp); |
383 | /* | 383 | /* |
384 | * (permanently) allocate a Board Info struct | 384 | * (permanently) allocate a Board Info struct |
385 | * and a permanent copy of the "global" data | 385 | * and a permanent copy of the "global" data |
386 | */ | 386 | */ |
387 | addr_sp -= sizeof (bd_t); | 387 | addr_sp -= sizeof (bd_t); |
388 | bd = (bd_t *) addr_sp; | 388 | bd = (bd_t *) addr_sp; |
389 | gd->bd = bd; | 389 | gd->bd = bd; |
390 | debug("Reserving %zu Bytes for Board Info at: %08lx\n", | 390 | debug("Reserving %zu Bytes for Board Info at: %08lx\n", |
391 | sizeof (bd_t), addr_sp); | 391 | sizeof (bd_t), addr_sp); |
392 | 392 | ||
393 | #ifdef CONFIG_MACH_TYPE | 393 | #ifdef CONFIG_MACH_TYPE |
394 | gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ | 394 | gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ |
395 | #endif | 395 | #endif |
396 | 396 | ||
397 | addr_sp -= sizeof (gd_t); | 397 | addr_sp -= sizeof (gd_t); |
398 | id = (gd_t *) addr_sp; | 398 | id = (gd_t *) addr_sp; |
399 | debug("Reserving %zu Bytes for Global Data at: %08lx\n", | 399 | debug("Reserving %zu Bytes for Global Data at: %08lx\n", |
400 | sizeof (gd_t), addr_sp); | 400 | sizeof (gd_t), addr_sp); |
401 | 401 | ||
402 | #if defined(CONFIG_OF_SEPARATE) && defined(CONFIG_OF_CONTROL) | 402 | #if defined(CONFIG_OF_SEPARATE) && defined(CONFIG_OF_CONTROL) |
403 | /* | 403 | /* |
404 | * If the device tree is sitting immediate above our image then we | 404 | * If the device tree is sitting immediate above our image then we |
405 | * must relocate it. If it is embedded in the data section, then it | 405 | * must relocate it. If it is embedded in the data section, then it |
406 | * will be relocated with other data. | 406 | * will be relocated with other data. |
407 | */ | 407 | */ |
408 | if (gd->fdt_blob) { | 408 | if (gd->fdt_blob) { |
409 | fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32); | 409 | fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32); |
410 | 410 | ||
411 | addr_sp -= fdt_size; | 411 | addr_sp -= fdt_size; |
412 | new_fdt = (void *)addr_sp; | 412 | new_fdt = (void *)addr_sp; |
413 | debug("Reserving %zu Bytes for FDT at: %08lx\n", | 413 | debug("Reserving %zu Bytes for FDT at: %08lx\n", |
414 | fdt_size, addr_sp); | 414 | fdt_size, addr_sp); |
415 | } | 415 | } |
416 | #endif | 416 | #endif |
417 | 417 | ||
418 | #ifndef CONFIG_ARM64 | 418 | #ifndef CONFIG_ARM64 |
419 | /* setup stackpointer for exeptions */ | 419 | /* setup stackpointer for exeptions */ |
420 | gd->irq_sp = addr_sp; | 420 | gd->irq_sp = addr_sp; |
421 | #ifdef CONFIG_USE_IRQ | 421 | #ifdef CONFIG_USE_IRQ |
422 | addr_sp -= (CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ); | 422 | addr_sp -= (CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ); |
423 | debug("Reserving %zu Bytes for IRQ stack at: %08lx\n", | 423 | debug("Reserving %zu Bytes for IRQ stack at: %08lx\n", |
424 | CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ, addr_sp); | 424 | CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ, addr_sp); |
425 | #endif | 425 | #endif |
426 | /* leave 3 words for abort-stack */ | 426 | /* leave 3 words for abort-stack */ |
427 | addr_sp -= 12; | 427 | addr_sp -= 12; |
428 | 428 | ||
429 | /* 8-byte alignment for ABI compliance */ | 429 | /* 8-byte alignment for ABI compliance */ |
430 | addr_sp &= ~0x07; | 430 | addr_sp &= ~0x07; |
431 | #else /* CONFIG_ARM64 */ | 431 | #else /* CONFIG_ARM64 */ |
432 | /* 16-byte alignment for ABI compliance */ | 432 | /* 16-byte alignment for ABI compliance */ |
433 | addr_sp &= ~0x0f; | 433 | addr_sp &= ~0x0f; |
434 | #endif /* CONFIG_ARM64 */ | 434 | #endif /* CONFIG_ARM64 */ |
435 | #else | 435 | #else |
436 | addr_sp += 128; /* leave 32 words for abort-stack */ | 436 | addr_sp += 128; /* leave 32 words for abort-stack */ |
437 | gd->irq_sp = addr_sp; | 437 | gd->irq_sp = addr_sp; |
438 | #endif | 438 | #endif |
439 | 439 | ||
440 | debug("New Stack Pointer is: %08lx\n", addr_sp); | 440 | debug("New Stack Pointer is: %08lx\n", addr_sp); |
441 | 441 | ||
442 | #ifdef CONFIG_POST | 442 | #ifdef CONFIG_POST |
443 | post_bootmode_init(); | 443 | post_bootmode_init(); |
444 | post_run(NULL, POST_ROM | post_bootmode_get(0)); | 444 | post_run(NULL, POST_ROM | post_bootmode_get(0)); |
445 | #endif | 445 | #endif |
446 | 446 | ||
447 | gd->bd->bi_baudrate = gd->baudrate; | 447 | gd->bd->bi_baudrate = gd->baudrate; |
448 | /* Ram ist board specific, so move it to board code ... */ | 448 | /* Ram ist board specific, so move it to board code ... */ |
449 | dram_init_banksize(); | 449 | dram_init_banksize(); |
450 | display_dram_config(); /* and display it */ | 450 | display_dram_config(); /* and display it */ |
451 | 451 | ||
452 | gd->relocaddr = addr; | 452 | gd->relocaddr = addr; |
453 | gd->start_addr_sp = addr_sp; | 453 | gd->start_addr_sp = addr_sp; |
454 | gd->reloc_off = addr - _TEXT_BASE; | 454 | gd->reloc_off = addr - (ulong)&_start; |
455 | debug("relocation Offset is: %08lx\n", gd->reloc_off); | 455 | debug("relocation Offset is: %08lx\n", gd->reloc_off); |
456 | if (new_fdt) { | 456 | if (new_fdt) { |
457 | memcpy(new_fdt, gd->fdt_blob, fdt_size); | 457 | memcpy(new_fdt, gd->fdt_blob, fdt_size); |
458 | gd->fdt_blob = new_fdt; | 458 | gd->fdt_blob = new_fdt; |
459 | } | 459 | } |
460 | memcpy(id, (void *)gd, sizeof(gd_t)); | 460 | memcpy(id, (void *)gd, sizeof(gd_t)); |
461 | } | 461 | } |
462 | 462 | ||
463 | #if !defined(CONFIG_SYS_NO_FLASH) | 463 | #if !defined(CONFIG_SYS_NO_FLASH) |
464 | static char *failed = "*** failed ***\n"; | 464 | static char *failed = "*** failed ***\n"; |
465 | #endif | 465 | #endif |
466 | 466 | ||
467 | /* | 467 | /* |
468 | * Tell if it's OK to load the environment early in boot. | 468 | * Tell if it's OK to load the environment early in boot. |
469 | * | 469 | * |
470 | * If CONFIG_OF_CONFIG is defined, we'll check with the FDT to see | 470 | * If CONFIG_OF_CONFIG is defined, we'll check with the FDT to see |
471 | * if this is OK (defaulting to saying it's not OK). | 471 | * if this is OK (defaulting to saying it's not OK). |
472 | * | 472 | * |
473 | * NOTE: Loading the environment early can be a bad idea if security is | 473 | * NOTE: Loading the environment early can be a bad idea if security is |
474 | * important, since no verification is done on the environment. | 474 | * important, since no verification is done on the environment. |
475 | * | 475 | * |
476 | * @return 0 if environment should not be loaded, !=0 if it is ok to load | 476 | * @return 0 if environment should not be loaded, !=0 if it is ok to load |
477 | */ | 477 | */ |
478 | static int should_load_env(void) | 478 | static int should_load_env(void) |
479 | { | 479 | { |
480 | #ifdef CONFIG_OF_CONTROL | 480 | #ifdef CONFIG_OF_CONTROL |
481 | return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 1); | 481 | return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 1); |
482 | #elif defined CONFIG_DELAY_ENVIRONMENT | 482 | #elif defined CONFIG_DELAY_ENVIRONMENT |
483 | return 0; | 483 | return 0; |
484 | #else | 484 | #else |
485 | return 1; | 485 | return 1; |
486 | #endif | 486 | #endif |
487 | } | 487 | } |
488 | 488 | ||
489 | #if defined(CONFIG_DISPLAY_BOARDINFO_LATE) && defined(CONFIG_OF_CONTROL) | 489 | #if defined(CONFIG_DISPLAY_BOARDINFO_LATE) && defined(CONFIG_OF_CONTROL) |
490 | static void display_fdt_model(const void *blob) | 490 | static void display_fdt_model(const void *blob) |
491 | { | 491 | { |
492 | const char *model; | 492 | const char *model; |
493 | 493 | ||
494 | model = (char *)fdt_getprop(blob, 0, "model", NULL); | 494 | model = (char *)fdt_getprop(blob, 0, "model", NULL); |
495 | printf("Model: %s\n", model ? model : "<unknown>"); | 495 | printf("Model: %s\n", model ? model : "<unknown>"); |
496 | } | 496 | } |
497 | #endif | 497 | #endif |
498 | 498 | ||
499 | /************************************************************************ | 499 | /************************************************************************ |
500 | * | 500 | * |
501 | * This is the next part if the initialization sequence: we are now | 501 | * This is the next part if the initialization sequence: we are now |
502 | * running from RAM and have a "normal" C environment, i. e. global | 502 | * running from RAM and have a "normal" C environment, i. e. global |
503 | * data can be written, BSS has been cleared, the stack size in not | 503 | * data can be written, BSS has been cleared, the stack size in not |
504 | * that critical any more, etc. | 504 | * that critical any more, etc. |
505 | * | 505 | * |
506 | ************************************************************************ | 506 | ************************************************************************ |
507 | */ | 507 | */ |
508 | 508 | ||
509 | void board_init_r(gd_t *id, ulong dest_addr) | 509 | void board_init_r(gd_t *id, ulong dest_addr) |
510 | { | 510 | { |
511 | ulong malloc_start; | 511 | ulong malloc_start; |
512 | #if !defined(CONFIG_SYS_NO_FLASH) | 512 | #if !defined(CONFIG_SYS_NO_FLASH) |
513 | ulong flash_size; | 513 | ulong flash_size; |
514 | #endif | 514 | #endif |
515 | 515 | ||
516 | gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ | 516 | gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ |
517 | bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); | 517 | bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); |
518 | 518 | ||
519 | monitor_flash_len = _end_ofs; | 519 | monitor_flash_len = (ulong)&__rel_dyn_end - (ulong)_start; |
520 | 520 | ||
521 | /* Enable caches */ | 521 | /* Enable caches */ |
522 | enable_caches(); | 522 | enable_caches(); |
523 | 523 | ||
524 | debug("monitor flash len: %08lX\n", monitor_flash_len); | 524 | debug("monitor flash len: %08lX\n", monitor_flash_len); |
525 | board_init(); /* Setup chipselects */ | 525 | board_init(); /* Setup chipselects */ |
526 | /* | 526 | /* |
527 | * TODO: printing of the clock inforamtion of the board is now | 527 | * TODO: printing of the clock inforamtion of the board is now |
528 | * implemented as part of bdinfo command. Currently only support for | 528 | * implemented as part of bdinfo command. Currently only support for |
529 | * davinci SOC's is added. Remove this check once all the board | 529 | * davinci SOC's is added. Remove this check once all the board |
530 | * implement this. | 530 | * implement this. |
531 | */ | 531 | */ |
532 | #ifdef CONFIG_CLOCKS | 532 | #ifdef CONFIG_CLOCKS |
533 | set_cpu_clk_info(); /* Setup clock information */ | 533 | set_cpu_clk_info(); /* Setup clock information */ |
534 | #endif | 534 | #endif |
535 | serial_initialize(); | 535 | serial_initialize(); |
536 | 536 | ||
537 | debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr); | 537 | debug("Now running in RAM - U-Boot at: %08lx\n", dest_addr); |
538 | 538 | ||
539 | #ifdef CONFIG_LOGBUFFER | 539 | #ifdef CONFIG_LOGBUFFER |
540 | logbuff_init_ptrs(); | 540 | logbuff_init_ptrs(); |
541 | #endif | 541 | #endif |
542 | #ifdef CONFIG_POST | 542 | #ifdef CONFIG_POST |
543 | post_output_backlog(); | 543 | post_output_backlog(); |
544 | #endif | 544 | #endif |
545 | 545 | ||
546 | /* The Malloc area is immediately below the monitor copy in DRAM */ | 546 | /* The Malloc area is immediately below the monitor copy in DRAM */ |
547 | malloc_start = dest_addr - TOTAL_MALLOC_LEN; | 547 | malloc_start = dest_addr - TOTAL_MALLOC_LEN; |
548 | mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN); | 548 | mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN); |
549 | 549 | ||
550 | #ifdef CONFIG_ARCH_EARLY_INIT_R | 550 | #ifdef CONFIG_ARCH_EARLY_INIT_R |
551 | arch_early_init_r(); | 551 | arch_early_init_r(); |
552 | #endif | 552 | #endif |
553 | power_init_board(); | 553 | power_init_board(); |
554 | 554 | ||
555 | #if !defined(CONFIG_SYS_NO_FLASH) | 555 | #if !defined(CONFIG_SYS_NO_FLASH) |
556 | puts("Flash: "); | 556 | puts("Flash: "); |
557 | 557 | ||
558 | flash_size = flash_init(); | 558 | flash_size = flash_init(); |
559 | if (flash_size > 0) { | 559 | if (flash_size > 0) { |
560 | # ifdef CONFIG_SYS_FLASH_CHECKSUM | 560 | # ifdef CONFIG_SYS_FLASH_CHECKSUM |
561 | print_size(flash_size, ""); | 561 | print_size(flash_size, ""); |
562 | /* | 562 | /* |
563 | * Compute and print flash CRC if flashchecksum is set to 'y' | 563 | * Compute and print flash CRC if flashchecksum is set to 'y' |
564 | * | 564 | * |
565 | * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX | 565 | * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX |
566 | */ | 566 | */ |
567 | if (getenv_yesno("flashchecksum") == 1) { | 567 | if (getenv_yesno("flashchecksum") == 1) { |
568 | printf(" CRC: %08X", crc32(0, | 568 | printf(" CRC: %08X", crc32(0, |
569 | (const unsigned char *) CONFIG_SYS_FLASH_BASE, | 569 | (const unsigned char *) CONFIG_SYS_FLASH_BASE, |
570 | flash_size)); | 570 | flash_size)); |
571 | } | 571 | } |
572 | putc('\n'); | 572 | putc('\n'); |
573 | # else /* !CONFIG_SYS_FLASH_CHECKSUM */ | 573 | # else /* !CONFIG_SYS_FLASH_CHECKSUM */ |
574 | print_size(flash_size, "\n"); | 574 | print_size(flash_size, "\n"); |
575 | # endif /* CONFIG_SYS_FLASH_CHECKSUM */ | 575 | # endif /* CONFIG_SYS_FLASH_CHECKSUM */ |
576 | } else { | 576 | } else { |
577 | puts(failed); | 577 | puts(failed); |
578 | hang(); | 578 | hang(); |
579 | } | 579 | } |
580 | #endif | 580 | #endif |
581 | 581 | ||
582 | #if defined(CONFIG_CMD_NAND) | 582 | #if defined(CONFIG_CMD_NAND) |
583 | puts("NAND: "); | 583 | puts("NAND: "); |
584 | nand_init(); /* go init the NAND */ | 584 | nand_init(); /* go init the NAND */ |
585 | #endif | 585 | #endif |
586 | 586 | ||
587 | #if defined(CONFIG_CMD_ONENAND) | 587 | #if defined(CONFIG_CMD_ONENAND) |
588 | onenand_init(); | 588 | onenand_init(); |
589 | #endif | 589 | #endif |
590 | 590 | ||
591 | #ifdef CONFIG_GENERIC_MMC | 591 | #ifdef CONFIG_GENERIC_MMC |
592 | puts("MMC: "); | 592 | puts("MMC: "); |
593 | mmc_initialize(gd->bd); | 593 | mmc_initialize(gd->bd); |
594 | #endif | 594 | #endif |
595 | 595 | ||
596 | #ifdef CONFIG_HAS_DATAFLASH | 596 | #ifdef CONFIG_HAS_DATAFLASH |
597 | AT91F_DataflashInit(); | 597 | AT91F_DataflashInit(); |
598 | dataflash_print_info(); | 598 | dataflash_print_info(); |
599 | #endif | 599 | #endif |
600 | 600 | ||
601 | /* initialize environment */ | 601 | /* initialize environment */ |
602 | if (should_load_env()) | 602 | if (should_load_env()) |
603 | env_relocate(); | 603 | env_relocate(); |
604 | else | 604 | else |
605 | set_default_env(NULL); | 605 | set_default_env(NULL); |
606 | 606 | ||
607 | #if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI) | 607 | #if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI) |
608 | arm_pci_init(); | 608 | arm_pci_init(); |
609 | #endif | 609 | #endif |
610 | 610 | ||
611 | stdio_init(); /* get the devices list going. */ | 611 | stdio_init(); /* get the devices list going. */ |
612 | 612 | ||
613 | jumptable_init(); | 613 | jumptable_init(); |
614 | 614 | ||
615 | #if defined(CONFIG_API) | 615 | #if defined(CONFIG_API) |
616 | /* Initialize API */ | 616 | /* Initialize API */ |
617 | api_init(); | 617 | api_init(); |
618 | #endif | 618 | #endif |
619 | 619 | ||
620 | console_init_r(); /* fully init console as a device */ | 620 | console_init_r(); /* fully init console as a device */ |
621 | 621 | ||
622 | #ifdef CONFIG_DISPLAY_BOARDINFO_LATE | 622 | #ifdef CONFIG_DISPLAY_BOARDINFO_LATE |
623 | # ifdef CONFIG_OF_CONTROL | 623 | # ifdef CONFIG_OF_CONTROL |
624 | /* Put this here so it appears on the LCD, now it is ready */ | 624 | /* Put this here so it appears on the LCD, now it is ready */ |
625 | display_fdt_model(gd->fdt_blob); | 625 | display_fdt_model(gd->fdt_blob); |
626 | # else | 626 | # else |
627 | checkboard(); | 627 | checkboard(); |
628 | # endif | 628 | # endif |
629 | #endif | 629 | #endif |
630 | 630 | ||
631 | #if defined(CONFIG_ARCH_MISC_INIT) | 631 | #if defined(CONFIG_ARCH_MISC_INIT) |
632 | /* miscellaneous arch dependent initialisations */ | 632 | /* miscellaneous arch dependent initialisations */ |
633 | arch_misc_init(); | 633 | arch_misc_init(); |
634 | #endif | 634 | #endif |
635 | #if defined(CONFIG_MISC_INIT_R) | 635 | #if defined(CONFIG_MISC_INIT_R) |
636 | /* miscellaneous platform dependent initialisations */ | 636 | /* miscellaneous platform dependent initialisations */ |
637 | misc_init_r(); | 637 | misc_init_r(); |
638 | #endif | 638 | #endif |
639 | 639 | ||
640 | /* set up exceptions */ | 640 | /* set up exceptions */ |
641 | interrupt_init(); | 641 | interrupt_init(); |
642 | /* enable exceptions */ | 642 | /* enable exceptions */ |
643 | enable_interrupts(); | 643 | enable_interrupts(); |
644 | 644 | ||
645 | /* Initialize from environment */ | 645 | /* Initialize from environment */ |
646 | load_addr = getenv_ulong("loadaddr", 16, load_addr); | 646 | load_addr = getenv_ulong("loadaddr", 16, load_addr); |
647 | 647 | ||
648 | #ifdef CONFIG_BOARD_LATE_INIT | 648 | #ifdef CONFIG_BOARD_LATE_INIT |
649 | board_late_init(); | 649 | board_late_init(); |
650 | #endif | 650 | #endif |
651 | 651 | ||
652 | #ifdef CONFIG_BITBANGMII | 652 | #ifdef CONFIG_BITBANGMII |
653 | bb_miiphy_init(); | 653 | bb_miiphy_init(); |
654 | #endif | 654 | #endif |
655 | #if defined(CONFIG_CMD_NET) | 655 | #if defined(CONFIG_CMD_NET) |
656 | puts("Net: "); | 656 | puts("Net: "); |
657 | eth_initialize(gd->bd); | 657 | eth_initialize(gd->bd); |
658 | #if defined(CONFIG_RESET_PHY_R) | 658 | #if defined(CONFIG_RESET_PHY_R) |
659 | debug("Reset Ethernet PHY\n"); | 659 | debug("Reset Ethernet PHY\n"); |
660 | reset_phy(); | 660 | reset_phy(); |
661 | #endif | 661 | #endif |
662 | #endif | 662 | #endif |
663 | 663 | ||
664 | #ifdef CONFIG_POST | 664 | #ifdef CONFIG_POST |
665 | post_run(NULL, POST_RAM | post_bootmode_get(0)); | 665 | post_run(NULL, POST_RAM | post_bootmode_get(0)); |
666 | #endif | 666 | #endif |
667 | 667 | ||
668 | #if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER) | 668 | #if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER) |
669 | /* | 669 | /* |
670 | * Export available size of memory for Linux, | 670 | * Export available size of memory for Linux, |
671 | * taking into account the protected RAM at top of memory | 671 | * taking into account the protected RAM at top of memory |
672 | */ | 672 | */ |
673 | { | 673 | { |
674 | ulong pram = 0; | 674 | ulong pram = 0; |
675 | uchar memsz[32]; | 675 | uchar memsz[32]; |
676 | 676 | ||
677 | #ifdef CONFIG_PRAM | 677 | #ifdef CONFIG_PRAM |
678 | pram = getenv_ulong("pram", 10, CONFIG_PRAM); | 678 | pram = getenv_ulong("pram", 10, CONFIG_PRAM); |
679 | #endif | 679 | #endif |
680 | #ifdef CONFIG_LOGBUFFER | 680 | #ifdef CONFIG_LOGBUFFER |
681 | #ifndef CONFIG_ALT_LB_ADDR | 681 | #ifndef CONFIG_ALT_LB_ADDR |
682 | /* Also take the logbuffer into account (pram is in kB) */ | 682 | /* Also take the logbuffer into account (pram is in kB) */ |
683 | pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024; | 683 | pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024; |
684 | #endif | 684 | #endif |
685 | #endif | 685 | #endif |
686 | sprintf((char *)memsz, "%ldk", (gd->ram_size / 1024) - pram); | 686 | sprintf((char *)memsz, "%ldk", (gd->ram_size / 1024) - pram); |
687 | setenv("mem", (char *)memsz); | 687 | setenv("mem", (char *)memsz); |
688 | } | 688 | } |
689 | #endif | 689 | #endif |
690 | 690 | ||
691 | /* main_loop() can return to retry autoboot, if so just run it again. */ | 691 | /* main_loop() can return to retry autoboot, if so just run it again. */ |
692 | for (;;) { | 692 | for (;;) { |
693 | main_loop(); | 693 | main_loop(); |
694 | } | 694 | } |
695 | 695 | ||
696 | /* NOTREACHED - no way out of command loop except booting */ | 696 | /* NOTREACHED - no way out of command loop except booting */ |
697 | } | 697 | } |
698 | 698 |
board/armltd/integrator/lowlevel_init.S
1 | /* | 1 | /* |
2 | * Board specific setup info | 2 | * Board specific setup info |
3 | * | 3 | * |
4 | * (C) Copyright 2004, ARM Ltd. | 4 | * (C) Copyright 2004, ARM Ltd. |
5 | * Philippe Robin, <philippe.robin@arm.com> | 5 | * Philippe Robin, <philippe.robin@arm.com> |
6 | * | 6 | * |
7 | * SPDX-License-Identifier: GPL-2.0+ | 7 | * SPDX-License-Identifier: GPL-2.0+ |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <config.h> | 10 | #include <config.h> |
11 | #include <version.h> | 11 | #include <version.h> |
12 | 12 | ||
13 | /* Reset using CM control register */ | 13 | /* Reset using CM control register */ |
14 | .global reset_cpu | 14 | .global reset_cpu |
15 | reset_cpu: | 15 | reset_cpu: |
16 | mov r0, #CM_BASE | 16 | mov r0, #CM_BASE |
17 | ldr r1,[r0,#OS_CTRL] | 17 | ldr r1,[r0,#OS_CTRL] |
18 | orr r1,r1,#CMMASK_RESET | 18 | orr r1,r1,#CMMASK_RESET |
19 | str r1,[r0,#OS_CTRL] | 19 | str r1,[r0,#OS_CTRL] |
20 | 20 | ||
21 | reset_failed: | 21 | reset_failed: |
22 | b reset_failed | 22 | b reset_failed |
23 | 23 | ||
24 | /* Set up the platform, once the cpu has been initialized */ | 24 | /* Set up the platform, once the cpu has been initialized */ |
25 | .globl lowlevel_init | 25 | .globl lowlevel_init |
26 | lowlevel_init: | 26 | lowlevel_init: |
27 | /* If U-Boot has been run after the ARM boot monitor | 27 | /* If U-Boot has been run after the ARM boot monitor |
28 | * then all the necessary actions have been done | 28 | * then all the necessary actions have been done |
29 | * otherwise we are running from user flash mapped to 0x00000000 | 29 | * otherwise we are running from user flash mapped to 0x00000000 |
30 | * --- DO NOT REMAP BEFORE THE CODE HAS BEEN RELOCATED -- | 30 | * --- DO NOT REMAP BEFORE THE CODE HAS BEEN RELOCATED -- |
31 | * Changes to the (possibly soft) reset defaults of the processor | 31 | * Changes to the (possibly soft) reset defaults of the processor |
32 | * itself should be performed in cpu/arm<>/start.S | 32 | * itself should be performed in cpu/arm<>/start.S |
33 | * This function affects only the core module or board settings | 33 | * This function affects only the core module or board settings |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #ifdef CONFIG_CM_INIT | 36 | #ifdef CONFIG_CM_INIT |
37 | /* CM has an initialization register | 37 | /* CM has an initialization register |
38 | * - bits in it are wired into test-chip pins to force | 38 | * - bits in it are wired into test-chip pins to force |
39 | * reset defaults | 39 | * reset defaults |
40 | * - may need to change its contents for U-Boot | 40 | * - may need to change its contents for U-Boot |
41 | */ | 41 | */ |
42 | 42 | ||
43 | /* set the desired CM specific value */ | 43 | /* set the desired CM specific value */ |
44 | mov r2,#CMMASK_LOWVEC /* Vectors at 0x00000000 for all */ | 44 | mov r2,#CMMASK_LOWVEC /* Vectors at 0x00000000 for all */ |
45 | 45 | ||
46 | #if defined (CONFIG_CM10200E) || defined (CONFIG_CM10220E) | 46 | #if defined (CONFIG_CM10200E) || defined (CONFIG_CM10220E) |
47 | orr r2,r2,#CMMASK_INIT_102 | 47 | orr r2,r2,#CMMASK_INIT_102 |
48 | #else | 48 | #else |
49 | 49 | ||
50 | #if !defined (CONFIG_CM920T) && !defined (CONFIG_CM920T_ETM) && \ | 50 | #if !defined (CONFIG_CM920T) && !defined (CONFIG_CM920T_ETM) && \ |
51 | !defined (CONFIG_CM940T) | 51 | !defined (CONFIG_CM940T) |
52 | 52 | ||
53 | #ifdef CONFIG_CM_MULTIPLE_SSRAM | 53 | #ifdef CONFIG_CM_MULTIPLE_SSRAM |
54 | /* set simple mapping */ | 54 | /* set simple mapping */ |
55 | and r2,r2,#CMMASK_MAP_SIMPLE | 55 | and r2,r2,#CMMASK_MAP_SIMPLE |
56 | #endif /* #ifdef CONFIG_CM_MULTIPLE_SSRAM */ | 56 | #endif /* #ifdef CONFIG_CM_MULTIPLE_SSRAM */ |
57 | 57 | ||
58 | #ifdef CONFIG_CM_TCRAM | 58 | #ifdef CONFIG_CM_TCRAM |
59 | /* disable TCRAM */ | 59 | /* disable TCRAM */ |
60 | and r2,r2,#CMMASK_TCRAM_DISABLE | 60 | and r2,r2,#CMMASK_TCRAM_DISABLE |
61 | #endif /* #ifdef CONFIG_CM_TCRAM */ | 61 | #endif /* #ifdef CONFIG_CM_TCRAM */ |
62 | 62 | ||
63 | #if defined (CONFIG_CM926EJ_S) || defined (CONFIG_CM1026EJ_S) || \ | 63 | #if defined (CONFIG_CM926EJ_S) || defined (CONFIG_CM1026EJ_S) || \ |
64 | defined (CONFIG_CM1136JF_S) | 64 | defined (CONFIG_CM1136JF_S) |
65 | 65 | ||
66 | and r2,r2,#CMMASK_LE | 66 | and r2,r2,#CMMASK_LE |
67 | 67 | ||
68 | #endif /* cpu with little endian initialization */ | 68 | #endif /* cpu with little endian initialization */ |
69 | 69 | ||
70 | orr r2,r2,#CMMASK_CMxx6_COMMON | 70 | orr r2,r2,#CMMASK_CMxx6_COMMON |
71 | 71 | ||
72 | #endif /* CMxx6 code */ | 72 | #endif /* CMxx6 code */ |
73 | 73 | ||
74 | #endif /* ARM102xxE value */ | 74 | #endif /* ARM102xxE value */ |
75 | 75 | ||
76 | /* read CM_INIT */ | 76 | /* read CM_INIT */ |
77 | mov r0, #CM_BASE | 77 | mov r0, #CM_BASE |
78 | ldr r1, [r0, #OS_INIT] | 78 | ldr r1, [r0, #OS_INIT] |
79 | /* check against desired bit setting */ | 79 | /* check against desired bit setting */ |
80 | and r3,r1,r2 | 80 | and r3,r1,r2 |
81 | cmp r3,r2 | 81 | cmp r3,r2 |
82 | beq init_reg_OK | 82 | beq init_reg_OK |
83 | 83 | ||
84 | /* lock for change */ | 84 | /* lock for change */ |
85 | mov r3, #CMVAL_LOCK1 | 85 | mov r3, #CMVAL_LOCK1 |
86 | add r3,r3,#CMVAL_LOCK2 | 86 | add r3,r3,#CMVAL_LOCK2 |
87 | str r3, [r0, #OS_LOCK] | 87 | str r3, [r0, #OS_LOCK] |
88 | /* set desired value */ | 88 | /* set desired value */ |
89 | orr r1,r1,r2 | 89 | orr r1,r1,r2 |
90 | /* write & relock CM_INIT */ | 90 | /* write & relock CM_INIT */ |
91 | str r1, [r0, #OS_INIT] | 91 | str r1, [r0, #OS_INIT] |
92 | mov r1, #CMVAL_UNLOCK | 92 | mov r1, #CMVAL_UNLOCK |
93 | str r1, [r0, #OS_LOCK] | 93 | str r1, [r0, #OS_LOCK] |
94 | 94 | ||
95 | /* soft reset so new values used */ | 95 | /* soft reset so new values used */ |
96 | b reset_cpu | 96 | b reset_cpu |
97 | 97 | ||
98 | init_reg_OK: | 98 | init_reg_OK: |
99 | 99 | ||
100 | #endif /* CONFIG_CM_INIT */ | 100 | #endif /* CONFIG_CM_INIT */ |
101 | 101 | ||
102 | mov pc, lr | 102 | mov pc, lr |
103 | 103 | ||
104 | #ifdef CONFIG_CM_SPD_DETECT | 104 | #ifdef CONFIG_CM_SPD_DETECT |
105 | /* Fast memory is available for the DRAM data | 105 | /* Fast memory is available for the DRAM data |
106 | * - ensure it has been transferred, then summarize the data | 106 | * - ensure it has been transferred, then summarize the data |
107 | * into a CM register | 107 | * into a CM register |
108 | */ | 108 | */ |
109 | .globl dram_query | 109 | .globl dram_query |
110 | dram_query: | 110 | dram_query: |
111 | stmfd r13!,{r4-r6,lr} | 111 | stmfd r13!,{r4-r6,lr} |
112 | /* set up SDRAM info */ | 112 | /* set up SDRAM info */ |
113 | /* - based on example code from the CM User Guide */ | 113 | /* - based on example code from the CM User Guide */ |
114 | mov r0, #CM_BASE | 114 | mov r0, #CM_BASE |
115 | 115 | ||
116 | readspdbit: | 116 | readspdbit: |
117 | ldr r1, [r0, #OS_SDRAM] /* read the SDRAM register */ | 117 | ldr r1, [r0, #OS_SDRAM] /* read the SDRAM register */ |
118 | and r1, r1, #0x20 /* mask SPD bit (5) */ | 118 | and r1, r1, #0x20 /* mask SPD bit (5) */ |
119 | cmp r1, #0x20 /* test if set */ | 119 | cmp r1, #0x20 /* test if set */ |
120 | bne readspdbit | 120 | bne readspdbit |
121 | 121 | ||
122 | setupsdram: | 122 | setupsdram: |
123 | add r0, r0, #OS_SPD /* address the copy of the SDP data */ | 123 | add r0, r0, #OS_SPD /* address the copy of the SDP data */ |
124 | ldrb r1, [r0, #3] /* number of row address lines */ | 124 | ldrb r1, [r0, #3] /* number of row address lines */ |
125 | ldrb r2, [r0, #4] /* number of column address lines */ | 125 | ldrb r2, [r0, #4] /* number of column address lines */ |
126 | ldrb r3, [r0, #5] /* number of banks */ | 126 | ldrb r3, [r0, #5] /* number of banks */ |
127 | ldrb r4, [r0, #31] /* module bank density */ | 127 | ldrb r4, [r0, #31] /* module bank density */ |
128 | mul r5, r4, r3 /* size of SDRAM (MB divided by 4) */ | 128 | mul r5, r4, r3 /* size of SDRAM (MB divided by 4) */ |
129 | mov r5, r5, ASL#2 /* size in MB */ | 129 | mov r5, r5, ASL#2 /* size in MB */ |
130 | mov r0, #CM_BASE /* reload for later code */ | 130 | mov r0, #CM_BASE /* reload for later code */ |
131 | cmp r5, #0x10 /* is it 16MB? */ | 131 | cmp r5, #0x10 /* is it 16MB? */ |
132 | bne not16 | 132 | bne not16 |
133 | mov r6, #0x2 /* store size and CAS latency of 2 */ | 133 | mov r6, #0x2 /* store size and CAS latency of 2 */ |
134 | b writesize | 134 | b writesize |
135 | 135 | ||
136 | not16: | 136 | not16: |
137 | cmp r5, #0x20 /* is it 32MB? */ | 137 | cmp r5, #0x20 /* is it 32MB? */ |
138 | bne not32 | 138 | bne not32 |
139 | mov r6, #0x6 | 139 | mov r6, #0x6 |
140 | b writesize | 140 | b writesize |
141 | 141 | ||
142 | not32: | 142 | not32: |
143 | cmp r5, #0x40 /* is it 64MB? */ | 143 | cmp r5, #0x40 /* is it 64MB? */ |
144 | bne not64 | 144 | bne not64 |
145 | mov r6, #0xa | 145 | mov r6, #0xa |
146 | b writesize | 146 | b writesize |
147 | 147 | ||
148 | not64: | 148 | not64: |
149 | cmp r5, #0x80 /* is it 128MB? */ | 149 | cmp r5, #0x80 /* is it 128MB? */ |
150 | bne not128 | 150 | bne not128 |
151 | mov r6, #0xe | 151 | mov r6, #0xe |
152 | b writesize | 152 | b writesize |
153 | 153 | ||
154 | not128: | 154 | not128: |
155 | /* if it is none of these sizes then it is either 256MB, or | 155 | /* if it is none of these sizes then it is either 256MB, or |
156 | * there is no SDRAM fitted so default to 256MB | 156 | * there is no SDRAM fitted so default to 256MB |
157 | */ | 157 | */ |
158 | mov r6, #0x12 | 158 | mov r6, #0x12 |
159 | 159 | ||
160 | writesize: | 160 | writesize: |
161 | mov r1, r1, ASL#8 /* row addr lines from SDRAM reg */ | 161 | mov r1, r1, ASL#8 /* row addr lines from SDRAM reg */ |
162 | orr r2, r1, r2, ASL#12 /* OR in column address lines */ | 162 | orr r2, r1, r2, ASL#12 /* OR in column address lines */ |
163 | orr r3, r2, r3, ASL#16 /* OR in number of banks */ | 163 | orr r3, r2, r3, ASL#16 /* OR in number of banks */ |
164 | orr r6, r6, r3 /* OR in size and CAS latency */ | 164 | orr r6, r6, r3 /* OR in size and CAS latency */ |
165 | str r6, [r0, #OS_SDRAM] /* store SDRAM parameters */ | 165 | str r6, [r0, #OS_SDRAM] /* store SDRAM parameters */ |
166 | 166 | ||
167 | #endif /* #ifdef CONFIG_CM_SPD_DETECT */ | 167 | #endif /* #ifdef CONFIG_CM_SPD_DETECT */ |
168 | 168 | ||
169 | ldmfd r13!,{r4-r6,pc} /* back to caller */ | 169 | ldmfd r13!,{r4-r6,pc} /* back to caller */ |
170 | 170 | ||
171 | #ifdef CONFIG_CM_REMAP | 171 | #ifdef CONFIG_CM_REMAP |
172 | /* CM remap bit is operational | 172 | /* CM remap bit is operational |
173 | * - use it to map writeable memory at 0x00000000, in place of flash | 173 | * - use it to map writeable memory at 0x00000000, in place of flash |
174 | */ | 174 | */ |
175 | .globl cm_remap | 175 | .globl cm_remap |
176 | cm_remap: | 176 | cm_remap: |
177 | stmfd r13!,{r4-r10,lr} | 177 | stmfd r13!,{r4-r10,lr} |
178 | 178 | ||
179 | mov r0, #CM_BASE | 179 | mov r0, #CM_BASE |
180 | ldr r1, [r0, #OS_CTRL] | 180 | ldr r1, [r0, #OS_CTRL] |
181 | orr r1, r1, #CMMASK_REMAP /* set remap and led bits */ | 181 | orr r1, r1, #CMMASK_REMAP /* set remap and led bits */ |
182 | str r1, [r0, #OS_CTRL] | 182 | str r1, [r0, #OS_CTRL] |
183 | 183 | ||
184 | /* Now 0x00000000 is writeable, replace the vectors */ | 184 | /* Now 0x00000000 is writeable, replace the vectors */ |
185 | ldr r0, =_start /* r0 <- start of vectors */ | 185 | ldr r0, =_start /* r0 <- start of vectors */ |
186 | ldr r2, =_TEXT_BASE /* r2 <- past vectors */ | 186 | add r2, r0, #64 /* r2 <- past vectors */ |
187 | sub r1,r1,r1 /* destination 0x00000000 */ | 187 | sub r1,r1,r1 /* destination 0x00000000 */ |
188 | 188 | ||
189 | copy_vec: | 189 | copy_vec: |
190 | ldmia r0!, {r3-r10} /* copy from source address [r0] */ | 190 | ldmia r0!, {r3-r10} /* copy from source address [r0] */ |
191 | stmia r1!, {r3-r10} /* copy to target address [r1] */ | 191 | stmia r1!, {r3-r10} /* copy to target address [r1] */ |
192 | cmp r0, r2 /* until source end address [r2] */ | 192 | cmp r0, r2 /* until source end address [r2] */ |
193 | ble copy_vec | 193 | ble copy_vec |
194 | 194 | ||
195 | ldmfd r13!,{r4-r10,pc} /* back to caller */ | 195 | ldmfd r13!,{r4-r10,pc} /* back to caller */ |
196 | 196 | ||
197 | #endif /* #ifdef CONFIG_CM_REMAP */ | 197 | #endif /* #ifdef CONFIG_CM_REMAP */ |
198 | 198 |
board/cm4008/flash.c
1 | /* | 1 | /* |
2 | * (C) Copyright 2005 | 2 | * (C) Copyright 2005 |
3 | * Greg Ungerer, OpenGear Inc, greg.ungerer@opengear.com | 3 | * Greg Ungerer, OpenGear Inc, greg.ungerer@opengear.com |
4 | * | 4 | * |
5 | * (C) Copyright 2001 | 5 | * (C) Copyright 2001 |
6 | * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net | 6 | * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net |
7 | * | 7 | * |
8 | * (C) Copyright 2001 | 8 | * (C) Copyright 2001 |
9 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | 9 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
10 | * | 10 | * |
11 | * SPDX-License-Identifier: GPL-2.0+ | 11 | * SPDX-License-Identifier: GPL-2.0+ |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <common.h> | 14 | #include <common.h> |
15 | #include <linux/byteorder/swab.h> | 15 | #include <linux/byteorder/swab.h> |
16 | #include <asm/sections.h> | 16 | #include <asm/sections.h> |
17 | 17 | ||
18 | 18 | ||
19 | flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ | 19 | flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ |
20 | 20 | ||
21 | #define mb() __asm__ __volatile__ ("" : : : "memory") | 21 | #define mb() __asm__ __volatile__ ("" : : : "memory") |
22 | 22 | ||
23 | /*----------------------------------------------------------------------- | 23 | /*----------------------------------------------------------------------- |
24 | * Functions | 24 | * Functions |
25 | */ | 25 | */ |
26 | static ulong flash_get_size (unsigned char * addr, flash_info_t * info); | 26 | static ulong flash_get_size (unsigned char * addr, flash_info_t * info); |
27 | static int write_data (flash_info_t * info, ulong dest, unsigned char data); | 27 | static int write_data (flash_info_t * info, ulong dest, unsigned char data); |
28 | static void flash_get_offsets (ulong base, flash_info_t * info); | 28 | static void flash_get_offsets (ulong base, flash_info_t * info); |
29 | void inline spin_wheel (void); | 29 | void inline spin_wheel (void); |
30 | 30 | ||
31 | /*----------------------------------------------------------------------- | 31 | /*----------------------------------------------------------------------- |
32 | */ | 32 | */ |
33 | 33 | ||
34 | unsigned long flash_init (void) | 34 | unsigned long flash_init (void) |
35 | { | 35 | { |
36 | int i; | 36 | int i; |
37 | ulong size = 0; | 37 | ulong size = 0; |
38 | 38 | ||
39 | for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) { | 39 | for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) { |
40 | switch (i) { | 40 | switch (i) { |
41 | case 0: | 41 | case 0: |
42 | flash_get_size ((unsigned char *) PHYS_FLASH_1, &flash_info[i]); | 42 | flash_get_size ((unsigned char *) PHYS_FLASH_1, &flash_info[i]); |
43 | flash_get_offsets (PHYS_FLASH_1, &flash_info[i]); | 43 | flash_get_offsets (PHYS_FLASH_1, &flash_info[i]); |
44 | break; | 44 | break; |
45 | case 1: | 45 | case 1: |
46 | /* ignore for now */ | 46 | /* ignore for now */ |
47 | flash_info[i].flash_id = FLASH_UNKNOWN; | 47 | flash_info[i].flash_id = FLASH_UNKNOWN; |
48 | break; | 48 | break; |
49 | default: | 49 | default: |
50 | panic ("configured too many flash banks!\n"); | 50 | panic ("configured too many flash banks!\n"); |
51 | break; | 51 | break; |
52 | } | 52 | } |
53 | size += flash_info[i].size; | 53 | size += flash_info[i].size; |
54 | } | 54 | } |
55 | 55 | ||
56 | /* Protect monitor and environment sectors | 56 | /* Protect monitor and environment sectors |
57 | */ | 57 | */ |
58 | flash_protect (FLAG_PROTECT_SET, | 58 | flash_protect (FLAG_PROTECT_SET, |
59 | CONFIG_SYS_FLASH_BASE, | 59 | CONFIG_SYS_FLASH_BASE, |
60 | CONFIG_SYS_FLASH_BASE + _bss_start_ofs, | 60 | CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start), |
61 | &flash_info[0]); | 61 | &flash_info[0]); |
62 | 62 | ||
63 | return size; | 63 | return size; |
64 | } | 64 | } |
65 | 65 | ||
66 | /*----------------------------------------------------------------------- | 66 | /*----------------------------------------------------------------------- |
67 | */ | 67 | */ |
68 | static void flash_get_offsets (ulong base, flash_info_t * info) | 68 | static void flash_get_offsets (ulong base, flash_info_t * info) |
69 | { | 69 | { |
70 | int i; | 70 | int i; |
71 | 71 | ||
72 | if (info->flash_id == FLASH_UNKNOWN) | 72 | if (info->flash_id == FLASH_UNKNOWN) |
73 | return; | 73 | return; |
74 | 74 | ||
75 | if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) { | 75 | if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) { |
76 | for (i = 0; i < info->sector_count; i++) { | 76 | for (i = 0; i < info->sector_count; i++) { |
77 | info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE); | 77 | info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE); |
78 | info->protect[i] = 0; | 78 | info->protect[i] = 0; |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | /*----------------------------------------------------------------------- | 83 | /*----------------------------------------------------------------------- |
84 | */ | 84 | */ |
85 | void flash_print_info (flash_info_t * info) | 85 | void flash_print_info (flash_info_t * info) |
86 | { | 86 | { |
87 | int i; | 87 | int i; |
88 | 88 | ||
89 | if (info->flash_id == FLASH_UNKNOWN) { | 89 | if (info->flash_id == FLASH_UNKNOWN) { |
90 | printf ("missing or unknown FLASH type\n"); | 90 | printf ("missing or unknown FLASH type\n"); |
91 | return; | 91 | return; |
92 | } | 92 | } |
93 | 93 | ||
94 | switch (info->flash_id & FLASH_VENDMASK) { | 94 | switch (info->flash_id & FLASH_VENDMASK) { |
95 | case FLASH_MAN_INTEL: | 95 | case FLASH_MAN_INTEL: |
96 | printf ("INTEL "); | 96 | printf ("INTEL "); |
97 | break; | 97 | break; |
98 | default: | 98 | default: |
99 | printf ("Unknown Vendor "); | 99 | printf ("Unknown Vendor "); |
100 | break; | 100 | break; |
101 | } | 101 | } |
102 | 102 | ||
103 | switch (info->flash_id & FLASH_TYPEMASK) { | 103 | switch (info->flash_id & FLASH_TYPEMASK) { |
104 | case FLASH_28F128J3A: | 104 | case FLASH_28F128J3A: |
105 | printf ("28F128J3A\n"); | 105 | printf ("28F128J3A\n"); |
106 | break; | 106 | break; |
107 | default: | 107 | default: |
108 | printf ("Unknown Chip Type\n"); | 108 | printf ("Unknown Chip Type\n"); |
109 | break; | 109 | break; |
110 | } | 110 | } |
111 | 111 | ||
112 | printf (" Size: %ld MB in %d Sectors\n", | 112 | printf (" Size: %ld MB in %d Sectors\n", |
113 | info->size >> 20, info->sector_count); | 113 | info->size >> 20, info->sector_count); |
114 | 114 | ||
115 | printf (" Sector Start Addresses:"); | 115 | printf (" Sector Start Addresses:"); |
116 | for (i = 0; i < info->sector_count; ++i) { | 116 | for (i = 0; i < info->sector_count; ++i) { |
117 | if ((i % 5) == 0) | 117 | if ((i % 5) == 0) |
118 | printf ("\n "); | 118 | printf ("\n "); |
119 | printf (" %08lX%s", | 119 | printf (" %08lX%s", |
120 | info->start[i], info->protect[i] ? " (RO)" : " "); | 120 | info->start[i], info->protect[i] ? " (RO)" : " "); |
121 | } | 121 | } |
122 | printf ("\n"); | 122 | printf ("\n"); |
123 | return; | 123 | return; |
124 | } | 124 | } |
125 | 125 | ||
126 | /* | 126 | /* |
127 | * The following code cannot be run from FLASH! | 127 | * The following code cannot be run from FLASH! |
128 | */ | 128 | */ |
129 | static ulong flash_get_size (unsigned char * addr, flash_info_t * info) | 129 | static ulong flash_get_size (unsigned char * addr, flash_info_t * info) |
130 | { | 130 | { |
131 | volatile unsigned char value; | 131 | volatile unsigned char value; |
132 | 132 | ||
133 | /* Write auto select command: read Manufacturer ID */ | 133 | /* Write auto select command: read Manufacturer ID */ |
134 | addr[0x5555] = 0xAA; | 134 | addr[0x5555] = 0xAA; |
135 | addr[0x2AAA] = 0x55; | 135 | addr[0x2AAA] = 0x55; |
136 | addr[0x5555] = 0x90; | 136 | addr[0x5555] = 0x90; |
137 | 137 | ||
138 | mb (); | 138 | mb (); |
139 | value = addr[0]; | 139 | value = addr[0]; |
140 | 140 | ||
141 | switch (value) { | 141 | switch (value) { |
142 | 142 | ||
143 | case (unsigned char)INTEL_MANUFACT: | 143 | case (unsigned char)INTEL_MANUFACT: |
144 | info->flash_id = FLASH_MAN_INTEL; | 144 | info->flash_id = FLASH_MAN_INTEL; |
145 | break; | 145 | break; |
146 | 146 | ||
147 | default: | 147 | default: |
148 | info->flash_id = FLASH_UNKNOWN; | 148 | info->flash_id = FLASH_UNKNOWN; |
149 | info->sector_count = 0; | 149 | info->sector_count = 0; |
150 | info->size = 0; | 150 | info->size = 0; |
151 | addr[0] = 0xFF; /* restore read mode */ | 151 | addr[0] = 0xFF; /* restore read mode */ |
152 | return (0); /* no or unknown flash */ | 152 | return (0); /* no or unknown flash */ |
153 | } | 153 | } |
154 | 154 | ||
155 | mb (); | 155 | mb (); |
156 | value = addr[2]; /* device ID */ | 156 | value = addr[2]; /* device ID */ |
157 | 157 | ||
158 | switch (value) { | 158 | switch (value) { |
159 | 159 | ||
160 | case (unsigned char)INTEL_ID_28F640J3A: | 160 | case (unsigned char)INTEL_ID_28F640J3A: |
161 | info->flash_id += FLASH_28F640J3A; | 161 | info->flash_id += FLASH_28F640J3A; |
162 | info->sector_count = 64; | 162 | info->sector_count = 64; |
163 | info->size = 0x00800000; | 163 | info->size = 0x00800000; |
164 | break; /* => 8 MB */ | 164 | break; /* => 8 MB */ |
165 | 165 | ||
166 | case (unsigned char)INTEL_ID_28F128J3A: | 166 | case (unsigned char)INTEL_ID_28F128J3A: |
167 | info->flash_id += FLASH_28F128J3A; | 167 | info->flash_id += FLASH_28F128J3A; |
168 | info->sector_count = 128; | 168 | info->sector_count = 128; |
169 | info->size = 0x01000000; | 169 | info->size = 0x01000000; |
170 | break; /* => 16 MB */ | 170 | break; /* => 16 MB */ |
171 | 171 | ||
172 | default: | 172 | default: |
173 | info->flash_id = FLASH_UNKNOWN; | 173 | info->flash_id = FLASH_UNKNOWN; |
174 | break; | 174 | break; |
175 | } | 175 | } |
176 | 176 | ||
177 | if (info->sector_count > CONFIG_SYS_MAX_FLASH_SECT) { | 177 | if (info->sector_count > CONFIG_SYS_MAX_FLASH_SECT) { |
178 | printf ("** ERROR: sector count %d > max (%d) **\n", | 178 | printf ("** ERROR: sector count %d > max (%d) **\n", |
179 | info->sector_count, CONFIG_SYS_MAX_FLASH_SECT); | 179 | info->sector_count, CONFIG_SYS_MAX_FLASH_SECT); |
180 | info->sector_count = CONFIG_SYS_MAX_FLASH_SECT; | 180 | info->sector_count = CONFIG_SYS_MAX_FLASH_SECT; |
181 | } | 181 | } |
182 | 182 | ||
183 | addr[0] = 0xFF; /* restore read mode */ | 183 | addr[0] = 0xFF; /* restore read mode */ |
184 | 184 | ||
185 | return (info->size); | 185 | return (info->size); |
186 | } | 186 | } |
187 | 187 | ||
188 | 188 | ||
189 | /*----------------------------------------------------------------------- | 189 | /*----------------------------------------------------------------------- |
190 | */ | 190 | */ |
191 | 191 | ||
192 | int flash_erase (flash_info_t * info, int s_first, int s_last) | 192 | int flash_erase (flash_info_t * info, int s_first, int s_last) |
193 | { | 193 | { |
194 | int prot, sect; | 194 | int prot, sect; |
195 | ulong type; | 195 | ulong type; |
196 | int rcode = 0; | 196 | int rcode = 0; |
197 | ulong start; | 197 | ulong start; |
198 | 198 | ||
199 | if ((s_first < 0) || (s_first > s_last)) { | 199 | if ((s_first < 0) || (s_first > s_last)) { |
200 | if (info->flash_id == FLASH_UNKNOWN) { | 200 | if (info->flash_id == FLASH_UNKNOWN) { |
201 | printf ("- missing\n"); | 201 | printf ("- missing\n"); |
202 | } else { | 202 | } else { |
203 | printf ("- no sectors to erase\n"); | 203 | printf ("- no sectors to erase\n"); |
204 | } | 204 | } |
205 | return 1; | 205 | return 1; |
206 | } | 206 | } |
207 | 207 | ||
208 | type = (info->flash_id & FLASH_VENDMASK); | 208 | type = (info->flash_id & FLASH_VENDMASK); |
209 | if ((type != FLASH_MAN_INTEL)) { | 209 | if ((type != FLASH_MAN_INTEL)) { |
210 | printf ("Can't erase unknown flash type %08lx - aborted\n", | 210 | printf ("Can't erase unknown flash type %08lx - aborted\n", |
211 | info->flash_id); | 211 | info->flash_id); |
212 | return 1; | 212 | return 1; |
213 | } | 213 | } |
214 | 214 | ||
215 | prot = 0; | 215 | prot = 0; |
216 | for (sect = s_first; sect <= s_last; ++sect) { | 216 | for (sect = s_first; sect <= s_last; ++sect) { |
217 | if (info->protect[sect]) { | 217 | if (info->protect[sect]) { |
218 | prot++; | 218 | prot++; |
219 | } | 219 | } |
220 | } | 220 | } |
221 | 221 | ||
222 | if (prot) | 222 | if (prot) |
223 | printf ("- Warning: %d protected sectors will not be erased!\n", prot); | 223 | printf ("- Warning: %d protected sectors will not be erased!\n", prot); |
224 | else | 224 | else |
225 | printf ("\n"); | 225 | printf ("\n"); |
226 | 226 | ||
227 | /* Disable interrupts which might cause a timeout here */ | 227 | /* Disable interrupts which might cause a timeout here */ |
228 | disable_interrupts(); | 228 | disable_interrupts(); |
229 | 229 | ||
230 | /* Start erase on unprotected sectors */ | 230 | /* Start erase on unprotected sectors */ |
231 | for (sect = s_first; sect <= s_last; sect++) { | 231 | for (sect = s_first; sect <= s_last; sect++) { |
232 | if (info->protect[sect] == 0) { /* not protected */ | 232 | if (info->protect[sect] == 0) { /* not protected */ |
233 | volatile unsigned char *addr; | 233 | volatile unsigned char *addr; |
234 | unsigned char status; | 234 | unsigned char status; |
235 | 235 | ||
236 | printf ("Erasing sector %2d ... ", sect); | 236 | printf ("Erasing sector %2d ... ", sect); |
237 | 237 | ||
238 | /* arm simple, non interrupt dependent timer */ | 238 | /* arm simple, non interrupt dependent timer */ |
239 | start = get_timer(0); | 239 | start = get_timer(0); |
240 | 240 | ||
241 | addr = (volatile unsigned char *) (info->start[sect]); | 241 | addr = (volatile unsigned char *) (info->start[sect]); |
242 | *addr = 0x50; /* clear status register */ | 242 | *addr = 0x50; /* clear status register */ |
243 | *addr = 0x20; /* erase setup */ | 243 | *addr = 0x20; /* erase setup */ |
244 | *addr = 0xD0; /* erase confirm */ | 244 | *addr = 0xD0; /* erase confirm */ |
245 | 245 | ||
246 | while (((status = *addr) & 0x80) != 0x80) { | 246 | while (((status = *addr) & 0x80) != 0x80) { |
247 | if (get_timer(start) > | 247 | if (get_timer(start) > |
248 | CONFIG_SYS_FLASH_ERASE_TOUT) { | 248 | CONFIG_SYS_FLASH_ERASE_TOUT) { |
249 | printf ("Timeout\n"); | 249 | printf ("Timeout\n"); |
250 | *addr = 0xB0; /* suspend erase */ | 250 | *addr = 0xB0; /* suspend erase */ |
251 | *addr = 0xFF; /* reset to read mode */ | 251 | *addr = 0xFF; /* reset to read mode */ |
252 | rcode = 1; | 252 | rcode = 1; |
253 | break; | 253 | break; |
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
257 | *addr = 0x50; /* clear status register cmd */ | 257 | *addr = 0x50; /* clear status register cmd */ |
258 | *addr = 0xFF; /* resest to read mode */ | 258 | *addr = 0xFF; /* resest to read mode */ |
259 | 259 | ||
260 | printf (" done\n"); | 260 | printf (" done\n"); |
261 | } | 261 | } |
262 | } | 262 | } |
263 | return rcode; | 263 | return rcode; |
264 | } | 264 | } |
265 | 265 | ||
266 | /*----------------------------------------------------------------------- | 266 | /*----------------------------------------------------------------------- |
267 | * Copy memory to flash, returns: | 267 | * Copy memory to flash, returns: |
268 | * 0 - OK | 268 | * 0 - OK |
269 | * 1 - write timeout | 269 | * 1 - write timeout |
270 | * 2 - Flash not erased | 270 | * 2 - Flash not erased |
271 | * 4 - Flash not identified | 271 | * 4 - Flash not identified |
272 | */ | 272 | */ |
273 | 273 | ||
274 | int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) | 274 | int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) |
275 | { | 275 | { |
276 | ulong cp, wp; | 276 | ulong cp, wp; |
277 | unsigned char data; | 277 | unsigned char data; |
278 | int count, i, l, rc, port_width; | 278 | int count, i, l, rc, port_width; |
279 | 279 | ||
280 | if (info->flash_id == FLASH_UNKNOWN) | 280 | if (info->flash_id == FLASH_UNKNOWN) |
281 | return 4; | 281 | return 4; |
282 | 282 | ||
283 | wp = addr; | 283 | wp = addr; |
284 | port_width = 1; | 284 | port_width = 1; |
285 | 285 | ||
286 | /* | 286 | /* |
287 | * handle unaligned start bytes | 287 | * handle unaligned start bytes |
288 | */ | 288 | */ |
289 | if ((l = addr - wp) != 0) { | 289 | if ((l = addr - wp) != 0) { |
290 | data = 0; | 290 | data = 0; |
291 | for (i = 0, cp = wp; i < l; ++i, ++cp) { | 291 | for (i = 0, cp = wp; i < l; ++i, ++cp) { |
292 | data = (data << 8) | (*(uchar *) cp); | 292 | data = (data << 8) | (*(uchar *) cp); |
293 | } | 293 | } |
294 | for (; i < port_width && cnt > 0; ++i) { | 294 | for (; i < port_width && cnt > 0; ++i) { |
295 | data = (data << 8) | *src++; | 295 | data = (data << 8) | *src++; |
296 | --cnt; | 296 | --cnt; |
297 | ++cp; | 297 | ++cp; |
298 | } | 298 | } |
299 | for (; cnt == 0 && i < port_width; ++i, ++cp) { | 299 | for (; cnt == 0 && i < port_width; ++i, ++cp) { |
300 | data = (data << 8) | (*(uchar *) cp); | 300 | data = (data << 8) | (*(uchar *) cp); |
301 | } | 301 | } |
302 | 302 | ||
303 | if ((rc = write_data (info, wp, data)) != 0) { | 303 | if ((rc = write_data (info, wp, data)) != 0) { |
304 | return (rc); | 304 | return (rc); |
305 | } | 305 | } |
306 | wp += port_width; | 306 | wp += port_width; |
307 | } | 307 | } |
308 | 308 | ||
309 | /* | 309 | /* |
310 | * handle word aligned part | 310 | * handle word aligned part |
311 | */ | 311 | */ |
312 | count = 0; | 312 | count = 0; |
313 | while (cnt >= port_width) { | 313 | while (cnt >= port_width) { |
314 | data = 0; | 314 | data = 0; |
315 | for (i = 0; i < port_width; ++i) { | 315 | for (i = 0; i < port_width; ++i) { |
316 | data = (data << 8) | *src++; | 316 | data = (data << 8) | *src++; |
317 | } | 317 | } |
318 | if ((rc = write_data (info, wp, data)) != 0) { | 318 | if ((rc = write_data (info, wp, data)) != 0) { |
319 | return (rc); | 319 | return (rc); |
320 | } | 320 | } |
321 | wp += port_width; | 321 | wp += port_width; |
322 | cnt -= port_width; | 322 | cnt -= port_width; |
323 | if (count++ > 0x800) { | 323 | if (count++ > 0x800) { |
324 | spin_wheel (); | 324 | spin_wheel (); |
325 | count = 0; | 325 | count = 0; |
326 | } | 326 | } |
327 | } | 327 | } |
328 | 328 | ||
329 | if (cnt == 0) { | 329 | if (cnt == 0) { |
330 | return (0); | 330 | return (0); |
331 | } | 331 | } |
332 | 332 | ||
333 | /* | 333 | /* |
334 | * handle unaligned tail bytes | 334 | * handle unaligned tail bytes |
335 | */ | 335 | */ |
336 | data = 0; | 336 | data = 0; |
337 | for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) { | 337 | for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) { |
338 | data = (data << 8) | *src++; | 338 | data = (data << 8) | *src++; |
339 | --cnt; | 339 | --cnt; |
340 | } | 340 | } |
341 | for (; i < port_width; ++i, ++cp) { | 341 | for (; i < port_width; ++i, ++cp) { |
342 | data = (data << 8) | (*(uchar *) cp); | 342 | data = (data << 8) | (*(uchar *) cp); |
343 | } | 343 | } |
344 | 344 | ||
345 | return (write_data (info, wp, data)); | 345 | return (write_data (info, wp, data)); |
346 | } | 346 | } |
347 | 347 | ||
348 | /*----------------------------------------------------------------------- | 348 | /*----------------------------------------------------------------------- |
349 | * Write a word or halfword to Flash, returns: | 349 | * Write a word or halfword to Flash, returns: |
350 | * 0 - OK | 350 | * 0 - OK |
351 | * 1 - write timeout | 351 | * 1 - write timeout |
352 | * 2 - Flash not erased | 352 | * 2 - Flash not erased |
353 | */ | 353 | */ |
354 | static int write_data (flash_info_t * info, ulong dest, unsigned char data) | 354 | static int write_data (flash_info_t * info, ulong dest, unsigned char data) |
355 | { | 355 | { |
356 | volatile unsigned char *addr = (volatile unsigned char *) dest; | 356 | volatile unsigned char *addr = (volatile unsigned char *) dest; |
357 | ulong status; | 357 | ulong status; |
358 | ulong start; | 358 | ulong start; |
359 | 359 | ||
360 | /* Check if Flash is (sufficiently) erased */ | 360 | /* Check if Flash is (sufficiently) erased */ |
361 | if ((*addr & data) != data) { | 361 | if ((*addr & data) != data) { |
362 | printf ("not erased at %08lx (%lx)\n", (ulong) addr, | 362 | printf ("not erased at %08lx (%lx)\n", (ulong) addr, |
363 | (ulong) * addr); | 363 | (ulong) * addr); |
364 | return (2); | 364 | return (2); |
365 | } | 365 | } |
366 | /* Disable interrupts which might cause a timeout here */ | 366 | /* Disable interrupts which might cause a timeout here */ |
367 | disable_interrupts(); | 367 | disable_interrupts(); |
368 | 368 | ||
369 | *addr = 0x40; /* write setup */ | 369 | *addr = 0x40; /* write setup */ |
370 | *addr = data; | 370 | *addr = data; |
371 | 371 | ||
372 | /* arm simple, non interrupt dependent timer */ | 372 | /* arm simple, non interrupt dependent timer */ |
373 | start = get_timer(0); | 373 | start = get_timer(0); |
374 | 374 | ||
375 | /* wait while polling the status register */ | 375 | /* wait while polling the status register */ |
376 | while (((status = *addr) & 0x80) != 0x80) { | 376 | while (((status = *addr) & 0x80) != 0x80) { |
377 | if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { | 377 | if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { |
378 | *addr = 0xFF; /* restore read mode */ | 378 | *addr = 0xFF; /* restore read mode */ |
379 | return (1); | 379 | return (1); |
380 | } | 380 | } |
381 | } | 381 | } |
382 | 382 | ||
383 | *addr = 0xFF; /* restore read mode */ | 383 | *addr = 0xFF; /* restore read mode */ |
384 | 384 | ||
385 | return (0); | 385 | return (0); |
386 | } | 386 | } |
387 | 387 | ||
388 | void inline spin_wheel (void) | 388 | void inline spin_wheel (void) |
389 | { | 389 | { |
390 | static int p = 0; | 390 | static int p = 0; |
391 | static char w[] = "\\/-"; | 391 | static char w[] = "\\/-"; |
392 | 392 | ||
393 | printf ("\010%c", w[p]); | 393 | printf ("\010%c", w[p]); |
394 | (++p == 3) ? (p = 0) : 0; | 394 | (++p == 3) ? (p = 0) : 0; |
395 | } | 395 | } |
396 | 396 |
board/cm41xx/flash.c
1 | /* | 1 | /* |
2 | * (C) Copyright 2005 | 2 | * (C) Copyright 2005 |
3 | * Greg Ungerer, OpenGear Inc, greg.ungerer@opengear.com | 3 | * Greg Ungerer, OpenGear Inc, greg.ungerer@opengear.com |
4 | * | 4 | * |
5 | * (C) Copyright 2001 | 5 | * (C) Copyright 2001 |
6 | * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net | 6 | * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net |
7 | * | 7 | * |
8 | * (C) Copyright 2001 | 8 | * (C) Copyright 2001 |
9 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | 9 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
10 | * | 10 | * |
11 | * SPDX-License-Identifier: GPL-2.0+ | 11 | * SPDX-License-Identifier: GPL-2.0+ |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <common.h> | 14 | #include <common.h> |
15 | #include <linux/byteorder/swab.h> | 15 | #include <linux/byteorder/swab.h> |
16 | #include <asm/sections.h> | 16 | #include <asm/sections.h> |
17 | 17 | ||
18 | 18 | ||
19 | flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ | 19 | flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ |
20 | 20 | ||
21 | #define mb() __asm__ __volatile__ ("" : : : "memory") | 21 | #define mb() __asm__ __volatile__ ("" : : : "memory") |
22 | 22 | ||
23 | /*----------------------------------------------------------------------- | 23 | /*----------------------------------------------------------------------- |
24 | * Functions | 24 | * Functions |
25 | */ | 25 | */ |
26 | static ulong flash_get_size (unsigned char * addr, flash_info_t * info); | 26 | static ulong flash_get_size (unsigned char * addr, flash_info_t * info); |
27 | static int write_data (flash_info_t * info, ulong dest, unsigned char data); | 27 | static int write_data (flash_info_t * info, ulong dest, unsigned char data); |
28 | static void flash_get_offsets (ulong base, flash_info_t * info); | 28 | static void flash_get_offsets (ulong base, flash_info_t * info); |
29 | void inline spin_wheel (void); | 29 | void inline spin_wheel (void); |
30 | 30 | ||
31 | /*----------------------------------------------------------------------- | 31 | /*----------------------------------------------------------------------- |
32 | */ | 32 | */ |
33 | 33 | ||
34 | unsigned long flash_init (void) | 34 | unsigned long flash_init (void) |
35 | { | 35 | { |
36 | int i; | 36 | int i; |
37 | ulong size = 0; | 37 | ulong size = 0; |
38 | 38 | ||
39 | for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) { | 39 | for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) { |
40 | switch (i) { | 40 | switch (i) { |
41 | case 0: | 41 | case 0: |
42 | flash_get_size ((unsigned char *) PHYS_FLASH_1, &flash_info[i]); | 42 | flash_get_size ((unsigned char *) PHYS_FLASH_1, &flash_info[i]); |
43 | flash_get_offsets (PHYS_FLASH_1, &flash_info[i]); | 43 | flash_get_offsets (PHYS_FLASH_1, &flash_info[i]); |
44 | break; | 44 | break; |
45 | case 1: | 45 | case 1: |
46 | /* ignore for now */ | 46 | /* ignore for now */ |
47 | flash_info[i].flash_id = FLASH_UNKNOWN; | 47 | flash_info[i].flash_id = FLASH_UNKNOWN; |
48 | break; | 48 | break; |
49 | default: | 49 | default: |
50 | panic ("configured too many flash banks!\n"); | 50 | panic ("configured too many flash banks!\n"); |
51 | break; | 51 | break; |
52 | } | 52 | } |
53 | size += flash_info[i].size; | 53 | size += flash_info[i].size; |
54 | } | 54 | } |
55 | 55 | ||
56 | /* Protect monitor and environment sectors | 56 | /* Protect monitor and environment sectors |
57 | */ | 57 | */ |
58 | flash_protect (FLAG_PROTECT_SET, | 58 | flash_protect (FLAG_PROTECT_SET, |
59 | CONFIG_SYS_FLASH_BASE, | 59 | CONFIG_SYS_FLASH_BASE, |
60 | CONFIG_SYS_FLASH_BASE + _bss_start_ofs, | 60 | CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start), |
61 | &flash_info[0]); | 61 | &flash_info[0]); |
62 | 62 | ||
63 | return size; | 63 | return size; |
64 | } | 64 | } |
65 | 65 | ||
66 | /*----------------------------------------------------------------------- | 66 | /*----------------------------------------------------------------------- |
67 | */ | 67 | */ |
68 | static void flash_get_offsets (ulong base, flash_info_t * info) | 68 | static void flash_get_offsets (ulong base, flash_info_t * info) |
69 | { | 69 | { |
70 | int i; | 70 | int i; |
71 | 71 | ||
72 | if (info->flash_id == FLASH_UNKNOWN) | 72 | if (info->flash_id == FLASH_UNKNOWN) |
73 | return; | 73 | return; |
74 | 74 | ||
75 | if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) { | 75 | if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) { |
76 | for (i = 0; i < info->sector_count; i++) { | 76 | for (i = 0; i < info->sector_count; i++) { |
77 | info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE); | 77 | info->start[i] = base + (i * PHYS_FLASH_SECT_SIZE); |
78 | info->protect[i] = 0; | 78 | info->protect[i] = 0; |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | /*----------------------------------------------------------------------- | 83 | /*----------------------------------------------------------------------- |
84 | */ | 84 | */ |
85 | void flash_print_info (flash_info_t * info) | 85 | void flash_print_info (flash_info_t * info) |
86 | { | 86 | { |
87 | int i; | 87 | int i; |
88 | 88 | ||
89 | if (info->flash_id == FLASH_UNKNOWN) { | 89 | if (info->flash_id == FLASH_UNKNOWN) { |
90 | printf ("missing or unknown FLASH type\n"); | 90 | printf ("missing or unknown FLASH type\n"); |
91 | return; | 91 | return; |
92 | } | 92 | } |
93 | 93 | ||
94 | switch (info->flash_id & FLASH_VENDMASK) { | 94 | switch (info->flash_id & FLASH_VENDMASK) { |
95 | case FLASH_MAN_INTEL: | 95 | case FLASH_MAN_INTEL: |
96 | printf ("INTEL "); | 96 | printf ("INTEL "); |
97 | break; | 97 | break; |
98 | default: | 98 | default: |
99 | printf ("Unknown Vendor "); | 99 | printf ("Unknown Vendor "); |
100 | break; | 100 | break; |
101 | } | 101 | } |
102 | 102 | ||
103 | switch (info->flash_id & FLASH_TYPEMASK) { | 103 | switch (info->flash_id & FLASH_TYPEMASK) { |
104 | case FLASH_28F128J3A: | 104 | case FLASH_28F128J3A: |
105 | printf ("28F128J3A\n"); | 105 | printf ("28F128J3A\n"); |
106 | break; | 106 | break; |
107 | default: | 107 | default: |
108 | printf ("Unknown Chip Type\n"); | 108 | printf ("Unknown Chip Type\n"); |
109 | break; | 109 | break; |
110 | } | 110 | } |
111 | 111 | ||
112 | printf (" Size: %ld MB in %d Sectors\n", | 112 | printf (" Size: %ld MB in %d Sectors\n", |
113 | info->size >> 20, info->sector_count); | 113 | info->size >> 20, info->sector_count); |
114 | 114 | ||
115 | printf (" Sector Start Addresses:"); | 115 | printf (" Sector Start Addresses:"); |
116 | for (i = 0; i < info->sector_count; ++i) { | 116 | for (i = 0; i < info->sector_count; ++i) { |
117 | if ((i % 5) == 0) | 117 | if ((i % 5) == 0) |
118 | printf ("\n "); | 118 | printf ("\n "); |
119 | printf (" %08lX%s", | 119 | printf (" %08lX%s", |
120 | info->start[i], info->protect[i] ? " (RO)" : " "); | 120 | info->start[i], info->protect[i] ? " (RO)" : " "); |
121 | } | 121 | } |
122 | printf ("\n"); | 122 | printf ("\n"); |
123 | return; | 123 | return; |
124 | } | 124 | } |
125 | 125 | ||
126 | /* | 126 | /* |
127 | * The following code cannot be run from FLASH! | 127 | * The following code cannot be run from FLASH! |
128 | */ | 128 | */ |
129 | static ulong flash_get_size (unsigned char * addr, flash_info_t * info) | 129 | static ulong flash_get_size (unsigned char * addr, flash_info_t * info) |
130 | { | 130 | { |
131 | volatile unsigned char value; | 131 | volatile unsigned char value; |
132 | 132 | ||
133 | /* Write auto select command: read Manufacturer ID */ | 133 | /* Write auto select command: read Manufacturer ID */ |
134 | addr[0x5555] = 0xAA; | 134 | addr[0x5555] = 0xAA; |
135 | addr[0x2AAA] = 0x55; | 135 | addr[0x2AAA] = 0x55; |
136 | addr[0x5555] = 0x90; | 136 | addr[0x5555] = 0x90; |
137 | 137 | ||
138 | mb (); | 138 | mb (); |
139 | value = addr[0]; | 139 | value = addr[0]; |
140 | 140 | ||
141 | switch (value) { | 141 | switch (value) { |
142 | 142 | ||
143 | case (unsigned char)INTEL_MANUFACT: | 143 | case (unsigned char)INTEL_MANUFACT: |
144 | info->flash_id = FLASH_MAN_INTEL; | 144 | info->flash_id = FLASH_MAN_INTEL; |
145 | break; | 145 | break; |
146 | 146 | ||
147 | default: | 147 | default: |
148 | info->flash_id = FLASH_UNKNOWN; | 148 | info->flash_id = FLASH_UNKNOWN; |
149 | info->sector_count = 0; | 149 | info->sector_count = 0; |
150 | info->size = 0; | 150 | info->size = 0; |
151 | addr[0] = 0xFF; /* restore read mode */ | 151 | addr[0] = 0xFF; /* restore read mode */ |
152 | return (0); /* no or unknown flash */ | 152 | return (0); /* no or unknown flash */ |
153 | } | 153 | } |
154 | 154 | ||
155 | mb (); | 155 | mb (); |
156 | value = addr[2]; /* device ID */ | 156 | value = addr[2]; /* device ID */ |
157 | 157 | ||
158 | switch (value) { | 158 | switch (value) { |
159 | 159 | ||
160 | case (unsigned char)INTEL_ID_28F640J3A: | 160 | case (unsigned char)INTEL_ID_28F640J3A: |
161 | info->flash_id += FLASH_28F640J3A; | 161 | info->flash_id += FLASH_28F640J3A; |
162 | info->sector_count = 64; | 162 | info->sector_count = 64; |
163 | info->size = 0x00800000; | 163 | info->size = 0x00800000; |
164 | break; /* => 8 MB */ | 164 | break; /* => 8 MB */ |
165 | 165 | ||
166 | case (unsigned char)INTEL_ID_28F128J3A: | 166 | case (unsigned char)INTEL_ID_28F128J3A: |
167 | info->flash_id += FLASH_28F128J3A; | 167 | info->flash_id += FLASH_28F128J3A; |
168 | info->sector_count = 128; | 168 | info->sector_count = 128; |
169 | info->size = 0x01000000; | 169 | info->size = 0x01000000; |
170 | break; /* => 16 MB */ | 170 | break; /* => 16 MB */ |
171 | 171 | ||
172 | default: | 172 | default: |
173 | info->flash_id = FLASH_UNKNOWN; | 173 | info->flash_id = FLASH_UNKNOWN; |
174 | break; | 174 | break; |
175 | } | 175 | } |
176 | 176 | ||
177 | if (info->sector_count > CONFIG_SYS_MAX_FLASH_SECT) { | 177 | if (info->sector_count > CONFIG_SYS_MAX_FLASH_SECT) { |
178 | printf ("** ERROR: sector count %d > max (%d) **\n", | 178 | printf ("** ERROR: sector count %d > max (%d) **\n", |
179 | info->sector_count, CONFIG_SYS_MAX_FLASH_SECT); | 179 | info->sector_count, CONFIG_SYS_MAX_FLASH_SECT); |
180 | info->sector_count = CONFIG_SYS_MAX_FLASH_SECT; | 180 | info->sector_count = CONFIG_SYS_MAX_FLASH_SECT; |
181 | } | 181 | } |
182 | 182 | ||
183 | addr[0] = 0xFF; /* restore read mode */ | 183 | addr[0] = 0xFF; /* restore read mode */ |
184 | 184 | ||
185 | return (info->size); | 185 | return (info->size); |
186 | } | 186 | } |
187 | 187 | ||
188 | 188 | ||
189 | /*----------------------------------------------------------------------- | 189 | /*----------------------------------------------------------------------- |
190 | */ | 190 | */ |
191 | 191 | ||
192 | int flash_erase (flash_info_t * info, int s_first, int s_last) | 192 | int flash_erase (flash_info_t * info, int s_first, int s_last) |
193 | { | 193 | { |
194 | int prot, sect; | 194 | int prot, sect; |
195 | ulong type; | 195 | ulong type; |
196 | int rcode = 0; | 196 | int rcode = 0; |
197 | ulong start; | 197 | ulong start; |
198 | 198 | ||
199 | if ((s_first < 0) || (s_first > s_last)) { | 199 | if ((s_first < 0) || (s_first > s_last)) { |
200 | if (info->flash_id == FLASH_UNKNOWN) { | 200 | if (info->flash_id == FLASH_UNKNOWN) { |
201 | printf ("- missing\n"); | 201 | printf ("- missing\n"); |
202 | } else { | 202 | } else { |
203 | printf ("- no sectors to erase\n"); | 203 | printf ("- no sectors to erase\n"); |
204 | } | 204 | } |
205 | return 1; | 205 | return 1; |
206 | } | 206 | } |
207 | 207 | ||
208 | type = (info->flash_id & FLASH_VENDMASK); | 208 | type = (info->flash_id & FLASH_VENDMASK); |
209 | if ((type != FLASH_MAN_INTEL)) { | 209 | if ((type != FLASH_MAN_INTEL)) { |
210 | printf ("Can't erase unknown flash type %08lx - aborted\n", | 210 | printf ("Can't erase unknown flash type %08lx - aborted\n", |
211 | info->flash_id); | 211 | info->flash_id); |
212 | return 1; | 212 | return 1; |
213 | } | 213 | } |
214 | 214 | ||
215 | prot = 0; | 215 | prot = 0; |
216 | for (sect = s_first; sect <= s_last; ++sect) { | 216 | for (sect = s_first; sect <= s_last; ++sect) { |
217 | if (info->protect[sect]) { | 217 | if (info->protect[sect]) { |
218 | prot++; | 218 | prot++; |
219 | } | 219 | } |
220 | } | 220 | } |
221 | 221 | ||
222 | if (prot) | 222 | if (prot) |
223 | printf ("- Warning: %d protected sectors will not be erased!\n", prot); | 223 | printf ("- Warning: %d protected sectors will not be erased!\n", prot); |
224 | else | 224 | else |
225 | printf ("\n"); | 225 | printf ("\n"); |
226 | 226 | ||
227 | /* Disable interrupts which might cause a timeout here */ | 227 | /* Disable interrupts which might cause a timeout here */ |
228 | disable_interrupts(); | 228 | disable_interrupts(); |
229 | 229 | ||
230 | /* Start erase on unprotected sectors */ | 230 | /* Start erase on unprotected sectors */ |
231 | for (sect = s_first; sect <= s_last; sect++) { | 231 | for (sect = s_first; sect <= s_last; sect++) { |
232 | if (info->protect[sect] == 0) { /* not protected */ | 232 | if (info->protect[sect] == 0) { /* not protected */ |
233 | volatile unsigned char *addr; | 233 | volatile unsigned char *addr; |
234 | unsigned char status; | 234 | unsigned char status; |
235 | 235 | ||
236 | printf ("Erasing sector %2d ... ", sect); | 236 | printf ("Erasing sector %2d ... ", sect); |
237 | 237 | ||
238 | /* arm simple, non interrupt dependent timer */ | 238 | /* arm simple, non interrupt dependent timer */ |
239 | start = get_timer(0); | 239 | start = get_timer(0); |
240 | 240 | ||
241 | addr = (volatile unsigned char *) (info->start[sect]); | 241 | addr = (volatile unsigned char *) (info->start[sect]); |
242 | *addr = 0x50; /* clear status register */ | 242 | *addr = 0x50; /* clear status register */ |
243 | *addr = 0x20; /* erase setup */ | 243 | *addr = 0x20; /* erase setup */ |
244 | *addr = 0xD0; /* erase confirm */ | 244 | *addr = 0xD0; /* erase confirm */ |
245 | 245 | ||
246 | while (((status = *addr) & 0x80) != 0x80) { | 246 | while (((status = *addr) & 0x80) != 0x80) { |
247 | if (get_timer(start) > | 247 | if (get_timer(start) > |
248 | CONFIG_SYS_FLASH_ERASE_TOUT) { | 248 | CONFIG_SYS_FLASH_ERASE_TOUT) { |
249 | printf ("Timeout\n"); | 249 | printf ("Timeout\n"); |
250 | *addr = 0xB0; /* suspend erase */ | 250 | *addr = 0xB0; /* suspend erase */ |
251 | *addr = 0xFF; /* reset to read mode */ | 251 | *addr = 0xFF; /* reset to read mode */ |
252 | rcode = 1; | 252 | rcode = 1; |
253 | break; | 253 | break; |
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
257 | *addr = 0x50; /* clear status register cmd */ | 257 | *addr = 0x50; /* clear status register cmd */ |
258 | *addr = 0xFF; /* resest to read mode */ | 258 | *addr = 0xFF; /* resest to read mode */ |
259 | 259 | ||
260 | printf (" done\n"); | 260 | printf (" done\n"); |
261 | } | 261 | } |
262 | } | 262 | } |
263 | return rcode; | 263 | return rcode; |
264 | } | 264 | } |
265 | 265 | ||
266 | /*----------------------------------------------------------------------- | 266 | /*----------------------------------------------------------------------- |
267 | * Copy memory to flash, returns: | 267 | * Copy memory to flash, returns: |
268 | * 0 - OK | 268 | * 0 - OK |
269 | * 1 - write timeout | 269 | * 1 - write timeout |
270 | * 2 - Flash not erased | 270 | * 2 - Flash not erased |
271 | * 4 - Flash not identified | 271 | * 4 - Flash not identified |
272 | */ | 272 | */ |
273 | 273 | ||
274 | int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) | 274 | int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) |
275 | { | 275 | { |
276 | ulong cp, wp; | 276 | ulong cp, wp; |
277 | unsigned char data; | 277 | unsigned char data; |
278 | int count, i, l, rc, port_width; | 278 | int count, i, l, rc, port_width; |
279 | 279 | ||
280 | if (info->flash_id == FLASH_UNKNOWN) | 280 | if (info->flash_id == FLASH_UNKNOWN) |
281 | return 4; | 281 | return 4; |
282 | 282 | ||
283 | wp = addr; | 283 | wp = addr; |
284 | port_width = 1; | 284 | port_width = 1; |
285 | 285 | ||
286 | /* | 286 | /* |
287 | * handle unaligned start bytes | 287 | * handle unaligned start bytes |
288 | */ | 288 | */ |
289 | if ((l = addr - wp) != 0) { | 289 | if ((l = addr - wp) != 0) { |
290 | data = 0; | 290 | data = 0; |
291 | for (i = 0, cp = wp; i < l; ++i, ++cp) { | 291 | for (i = 0, cp = wp; i < l; ++i, ++cp) { |
292 | data = (data << 8) | (*(uchar *) cp); | 292 | data = (data << 8) | (*(uchar *) cp); |
293 | } | 293 | } |
294 | for (; i < port_width && cnt > 0; ++i) { | 294 | for (; i < port_width && cnt > 0; ++i) { |
295 | data = (data << 8) | *src++; | 295 | data = (data << 8) | *src++; |
296 | --cnt; | 296 | --cnt; |
297 | ++cp; | 297 | ++cp; |
298 | } | 298 | } |
299 | for (; cnt == 0 && i < port_width; ++i, ++cp) { | 299 | for (; cnt == 0 && i < port_width; ++i, ++cp) { |
300 | data = (data << 8) | (*(uchar *) cp); | 300 | data = (data << 8) | (*(uchar *) cp); |
301 | } | 301 | } |
302 | 302 | ||
303 | if ((rc = write_data (info, wp, data)) != 0) { | 303 | if ((rc = write_data (info, wp, data)) != 0) { |
304 | return (rc); | 304 | return (rc); |
305 | } | 305 | } |
306 | wp += port_width; | 306 | wp += port_width; |
307 | } | 307 | } |
308 | 308 | ||
309 | /* | 309 | /* |
310 | * handle word aligned part | 310 | * handle word aligned part |
311 | */ | 311 | */ |
312 | count = 0; | 312 | count = 0; |
313 | while (cnt >= port_width) { | 313 | while (cnt >= port_width) { |
314 | data = 0; | 314 | data = 0; |
315 | for (i = 0; i < port_width; ++i) { | 315 | for (i = 0; i < port_width; ++i) { |
316 | data = (data << 8) | *src++; | 316 | data = (data << 8) | *src++; |
317 | } | 317 | } |
318 | if ((rc = write_data (info, wp, data)) != 0) { | 318 | if ((rc = write_data (info, wp, data)) != 0) { |
319 | return (rc); | 319 | return (rc); |
320 | } | 320 | } |
321 | wp += port_width; | 321 | wp += port_width; |
322 | cnt -= port_width; | 322 | cnt -= port_width; |
323 | if (count++ > 0x800) { | 323 | if (count++ > 0x800) { |
324 | spin_wheel (); | 324 | spin_wheel (); |
325 | count = 0; | 325 | count = 0; |
326 | } | 326 | } |
327 | } | 327 | } |
328 | 328 | ||
329 | if (cnt == 0) { | 329 | if (cnt == 0) { |
330 | return (0); | 330 | return (0); |
331 | } | 331 | } |
332 | 332 | ||
333 | /* | 333 | /* |
334 | * handle unaligned tail bytes | 334 | * handle unaligned tail bytes |
335 | */ | 335 | */ |
336 | data = 0; | 336 | data = 0; |
337 | for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) { | 337 | for (i = 0, cp = wp; i < port_width && cnt > 0; ++i, ++cp) { |
338 | data = (data << 8) | *src++; | 338 | data = (data << 8) | *src++; |
339 | --cnt; | 339 | --cnt; |
340 | } | 340 | } |
341 | for (; i < port_width; ++i, ++cp) { | 341 | for (; i < port_width; ++i, ++cp) { |
342 | data = (data << 8) | (*(uchar *) cp); | 342 | data = (data << 8) | (*(uchar *) cp); |
343 | } | 343 | } |
344 | 344 | ||
345 | return (write_data (info, wp, data)); | 345 | return (write_data (info, wp, data)); |
346 | } | 346 | } |
347 | 347 | ||
348 | /*----------------------------------------------------------------------- | 348 | /*----------------------------------------------------------------------- |
349 | * Write a word or halfword to Flash, returns: | 349 | * Write a word or halfword to Flash, returns: |
350 | * 0 - OK | 350 | * 0 - OK |
351 | * 1 - write timeout | 351 | * 1 - write timeout |
352 | * 2 - Flash not erased | 352 | * 2 - Flash not erased |
353 | */ | 353 | */ |
354 | static int write_data (flash_info_t * info, ulong dest, unsigned char data) | 354 | static int write_data (flash_info_t * info, ulong dest, unsigned char data) |
355 | { | 355 | { |
356 | volatile unsigned char *addr = (volatile unsigned char *) dest; | 356 | volatile unsigned char *addr = (volatile unsigned char *) dest; |
357 | ulong status; | 357 | ulong status; |
358 | ulong start; | 358 | ulong start; |
359 | 359 | ||
360 | /* Check if Flash is (sufficiently) erased */ | 360 | /* Check if Flash is (sufficiently) erased */ |
361 | if ((*addr & data) != data) { | 361 | if ((*addr & data) != data) { |
362 | printf ("not erased at %08lx (%lx)\n", (ulong) addr, | 362 | printf ("not erased at %08lx (%lx)\n", (ulong) addr, |
363 | (ulong) * addr); | 363 | (ulong) * addr); |
364 | return (2); | 364 | return (2); |
365 | } | 365 | } |
366 | /* Disable interrupts which might cause a timeout here */ | 366 | /* Disable interrupts which might cause a timeout here */ |
367 | disable_interrupts(); | 367 | disable_interrupts(); |
368 | 368 | ||
369 | *addr = 0x40; /* write setup */ | 369 | *addr = 0x40; /* write setup */ |
370 | *addr = data; | 370 | *addr = data; |
371 | 371 | ||
372 | /* arm simple, non interrupt dependent timer */ | 372 | /* arm simple, non interrupt dependent timer */ |
373 | start = get_timer(0); | 373 | start = get_timer(0); |
374 | 374 | ||
375 | /* wait while polling the status register */ | 375 | /* wait while polling the status register */ |
376 | while (((status = *addr) & 0x80) != 0x80) { | 376 | while (((status = *addr) & 0x80) != 0x80) { |
377 | if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { | 377 | if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { |
378 | *addr = 0xFF; /* restore read mode */ | 378 | *addr = 0xFF; /* restore read mode */ |
379 | return (1); | 379 | return (1); |
380 | } | 380 | } |
381 | } | 381 | } |
382 | 382 | ||
383 | *addr = 0xFF; /* restore read mode */ | 383 | *addr = 0xFF; /* restore read mode */ |
384 | 384 | ||
385 | return (0); | 385 | return (0); |
386 | } | 386 | } |
387 | 387 | ||
388 | void inline spin_wheel (void) | 388 | void inline spin_wheel (void) |
389 | { | 389 | { |
390 | static int p = 0; | 390 | static int p = 0; |
391 | static char w[] = "\\/-"; | 391 | static char w[] = "\\/-"; |
392 | 392 | ||
393 | printf ("\010%c", w[p]); | 393 | printf ("\010%c", w[p]); |
394 | (++p == 3) ? (p = 0) : 0; | 394 | (++p == 3) ? (p = 0) : 0; |
395 | } | 395 | } |
396 | 396 |
board/mpl/vcma9/lowlevel_init.S
1 | /* | 1 | /* |
2 | * Memory Setup stuff - taken from blob memsetup.S | 2 | * Memory Setup stuff - taken from blob memsetup.S |
3 | * | 3 | * |
4 | * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and | 4 | * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and |
5 | * Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl) | 5 | * Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl) |
6 | * | 6 | * |
7 | * Modified for MPL VCMA9 by | 7 | * Modified for MPL VCMA9 by |
8 | * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch> | 8 | * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch> |
9 | * (C) Copyright 2002, 2003, 2004, 2005 | 9 | * (C) Copyright 2002, 2003, 2004, 2005 |
10 | * | 10 | * |
11 | * SPDX-License-Identifier: GPL-2.0+ | 11 | * SPDX-License-Identifier: GPL-2.0+ |
12 | */ | 12 | */ |
13 | 13 | ||
14 | 14 | ||
15 | #include <config.h> | 15 | #include <config.h> |
16 | #include <version.h> | 16 | #include <version.h> |
17 | 17 | ||
18 | 18 | ||
19 | /* register definitions */ | 19 | /* register definitions */ |
20 | 20 | ||
21 | #define PLD_BASE 0x28000000 | 21 | #define PLD_BASE 0x28000000 |
22 | #define MISC_REG 0x103 | 22 | #define MISC_REG 0x103 |
23 | #define SDRAM_REG 0x106 | 23 | #define SDRAM_REG 0x106 |
24 | #define BWSCON 0x48000000 | 24 | #define BWSCON 0x48000000 |
25 | #define CLKBASE 0x4C000000 | 25 | #define CLKBASE 0x4C000000 |
26 | #define LOCKTIME 0x0 | 26 | #define LOCKTIME 0x0 |
27 | #define MPLLCON 0x4 | 27 | #define MPLLCON 0x4 |
28 | #define UPLLCON 0x8 | 28 | #define UPLLCON 0x8 |
29 | #define GPIOBASE 0x56000000 | 29 | #define GPIOBASE 0x56000000 |
30 | #define GSTATUS1 0xB0 | 30 | #define GSTATUS1 0xB0 |
31 | #define FASTCPU 0x02 | 31 | #define FASTCPU 0x02 |
32 | 32 | ||
33 | /* some parameters for the board */ | 33 | /* some parameters for the board */ |
34 | /* BWSCON */ | 34 | /* BWSCON */ |
35 | #define DW8 (0x0) | 35 | #define DW8 (0x0) |
36 | #define DW16 (0x1) | 36 | #define DW16 (0x1) |
37 | #define DW32 (0x2) | 37 | #define DW32 (0x2) |
38 | #define WAIT (0x1<<2) | 38 | #define WAIT (0x1<<2) |
39 | #define UBLB (0x1<<3) | 39 | #define UBLB (0x1<<3) |
40 | 40 | ||
41 | /* BANKSIZE */ | 41 | /* BANKSIZE */ |
42 | #define BURST_EN (0x1<<7) | 42 | #define BURST_EN (0x1<<7) |
43 | 43 | ||
44 | /* BANK0CON 200 */ | 44 | /* BANK0CON 200 */ |
45 | #define B0_Tacs_200 0x0 /* 0clk (or 0x1 1clk) */ | 45 | #define B0_Tacs_200 0x0 /* 0clk (or 0x1 1clk) */ |
46 | #define B0_Tcos_200 0x1 /* 1clk (or 0x2 2clk) */ | 46 | #define B0_Tcos_200 0x1 /* 1clk (or 0x2 2clk) */ |
47 | #define B0_Tacc_200 0x5 /* 8clk (or 0x6 10clk) */ | 47 | #define B0_Tacc_200 0x5 /* 8clk (or 0x6 10clk) */ |
48 | #define B0_Tcoh_200 0x0 /* 0clk */ | 48 | #define B0_Tcoh_200 0x0 /* 0clk */ |
49 | #define B0_Tcah_200 0x3 /* 4clk (or0x01 1clk) */ | 49 | #define B0_Tcah_200 0x3 /* 4clk (or0x01 1clk) */ |
50 | #define B0_Tacp_200 0x0 /* page mode is not used */ | 50 | #define B0_Tacp_200 0x0 /* page mode is not used */ |
51 | #define B0_PMC_200 0x0 /* page mode disabled */ | 51 | #define B0_PMC_200 0x0 /* page mode disabled */ |
52 | 52 | ||
53 | /* BANK0CON 250 */ | 53 | /* BANK0CON 250 */ |
54 | #define B0_Tacs_250 0x0 /* 0clk (or 0x1 1clk) */ | 54 | #define B0_Tacs_250 0x0 /* 0clk (or 0x1 1clk) */ |
55 | #define B0_Tcos_250 0x1 /* 1clk (or 0x2 2clk) */ | 55 | #define B0_Tcos_250 0x1 /* 1clk (or 0x2 2clk) */ |
56 | #define B0_Tacc_250 0x5 /* 8clk (or 0x7 14clk) */ | 56 | #define B0_Tacc_250 0x5 /* 8clk (or 0x7 14clk) */ |
57 | #define B0_Tcoh_250 0x0 /* 0clk */ | 57 | #define B0_Tcoh_250 0x0 /* 0clk */ |
58 | #define B0_Tcah_250 0x3 /* 4clk (or 0x1 1clk) */ | 58 | #define B0_Tcah_250 0x3 /* 4clk (or 0x1 1clk) */ |
59 | #define B0_Tacp_250 0x0 /* page mode is not used */ | 59 | #define B0_Tacp_250 0x0 /* page mode is not used */ |
60 | #define B0_PMC_250 0x0 /* page mode disabled */ | 60 | #define B0_PMC_250 0x0 /* page mode disabled */ |
61 | 61 | ||
62 | /* BANK0CON 266 */ | 62 | /* BANK0CON 266 */ |
63 | #define B0_Tacs_266 0x0 /* 0clk (or 0x1 1clk) */ | 63 | #define B0_Tacs_266 0x0 /* 0clk (or 0x1 1clk) */ |
64 | #define B0_Tcos_266 0x1 /* 1clk (or 0x2 2clk) */ | 64 | #define B0_Tcos_266 0x1 /* 1clk (or 0x2 2clk) */ |
65 | #define B0_Tacc_266 0x6 /* 10clk (or 0x7 14clk) */ | 65 | #define B0_Tacc_266 0x6 /* 10clk (or 0x7 14clk) */ |
66 | #define B0_Tcoh_266 0x0 /* 0clk */ | 66 | #define B0_Tcoh_266 0x0 /* 0clk */ |
67 | #define B0_Tcah_266 0x3 /* 4clk (or 0x1 1clk) */ | 67 | #define B0_Tcah_266 0x3 /* 4clk (or 0x1 1clk) */ |
68 | #define B0_Tacp_266 0x0 /* page mode is not used */ | 68 | #define B0_Tacp_266 0x0 /* page mode is not used */ |
69 | #define B0_PMC_266 0x0 /* page mode disabled */ | 69 | #define B0_PMC_266 0x0 /* page mode disabled */ |
70 | 70 | ||
71 | /* BANK1CON 200 */ | 71 | /* BANK1CON 200 */ |
72 | #define B1_Tacs_200 0x0 /* 0clk (or 0x1 1clk) */ | 72 | #define B1_Tacs_200 0x0 /* 0clk (or 0x1 1clk) */ |
73 | #define B1_Tcos_200 0x1 /* 1clk (or 0x2 2clk) */ | 73 | #define B1_Tcos_200 0x1 /* 1clk (or 0x2 2clk) */ |
74 | #define B1_Tacc_200 0x5 /* 8clk (or 0x6 10clk) */ | 74 | #define B1_Tacc_200 0x5 /* 8clk (or 0x6 10clk) */ |
75 | #define B1_Tcoh_200 0x0 /* 0clk */ | 75 | #define B1_Tcoh_200 0x0 /* 0clk */ |
76 | #define B1_Tcah_200 0x3 /* 4clk (or 0x1 1clk) */ | 76 | #define B1_Tcah_200 0x3 /* 4clk (or 0x1 1clk) */ |
77 | #define B1_Tacp_200 0x0 /* page mode is not used */ | 77 | #define B1_Tacp_200 0x0 /* page mode is not used */ |
78 | #define B1_PMC_200 0x0 /* page mode disabled */ | 78 | #define B1_PMC_200 0x0 /* page mode disabled */ |
79 | 79 | ||
80 | /* BANK1CON 250 */ | 80 | /* BANK1CON 250 */ |
81 | #define B1_Tacs_250 0x0 /* 0clk (or 0x1 1clk) */ | 81 | #define B1_Tacs_250 0x0 /* 0clk (or 0x1 1clk) */ |
82 | #define B1_Tcos_250 0x1 /* 1clk (or 0x2 2clk) */ | 82 | #define B1_Tcos_250 0x1 /* 1clk (or 0x2 2clk) */ |
83 | #define B1_Tacc_250 0x5 /* 8clk (or 0x7 14clk) */ | 83 | #define B1_Tacc_250 0x5 /* 8clk (or 0x7 14clk) */ |
84 | #define B1_Tcoh_250 0x0 /* 0clk */ | 84 | #define B1_Tcoh_250 0x0 /* 0clk */ |
85 | #define B1_Tcah_250 0x3 /* 4clk (or 0x1 1clk) */ | 85 | #define B1_Tcah_250 0x3 /* 4clk (or 0x1 1clk) */ |
86 | #define B1_Tacp_250 0x0 /* page mode is not used */ | 86 | #define B1_Tacp_250 0x0 /* page mode is not used */ |
87 | #define B1_PMC_250 0x0 /* page mode disabled */ | 87 | #define B1_PMC_250 0x0 /* page mode disabled */ |
88 | 88 | ||
89 | /* BANK1CON 266 */ | 89 | /* BANK1CON 266 */ |
90 | #define B1_Tacs_266 0x0 /* 0clk (or 0x1 1clk) */ | 90 | #define B1_Tacs_266 0x0 /* 0clk (or 0x1 1clk) */ |
91 | #define B1_Tcos_266 0x1 /* 1clk (or 0x2 2clk) */ | 91 | #define B1_Tcos_266 0x1 /* 1clk (or 0x2 2clk) */ |
92 | #define B1_Tacc_266 0x6 /* 10clk (or 0x7 14clk) */ | 92 | #define B1_Tacc_266 0x6 /* 10clk (or 0x7 14clk) */ |
93 | #define B1_Tcoh_266 0x0 /* 0clk */ | 93 | #define B1_Tcoh_266 0x0 /* 0clk */ |
94 | #define B1_Tcah_266 0x3 /* 4clk (or 0x1 1clk) */ | 94 | #define B1_Tcah_266 0x3 /* 4clk (or 0x1 1clk) */ |
95 | #define B1_Tacp_266 0x0 /* page mode is not used */ | 95 | #define B1_Tacp_266 0x0 /* page mode is not used */ |
96 | #define B1_PMC_266 0x0 /* page mode disabled */ | 96 | #define B1_PMC_266 0x0 /* page mode disabled */ |
97 | 97 | ||
98 | /* BANK2CON 200 + 250 + 266 */ | 98 | /* BANK2CON 200 + 250 + 266 */ |
99 | #define B2_Tacs 0x3 /* 4clk */ | 99 | #define B2_Tacs 0x3 /* 4clk */ |
100 | #define B2_Tcos 0x3 /* 4clk */ | 100 | #define B2_Tcos 0x3 /* 4clk */ |
101 | #define B2_Tacc 0x7 /* 14clk */ | 101 | #define B2_Tacc 0x7 /* 14clk */ |
102 | #define B2_Tcoh 0x3 /* 4clk */ | 102 | #define B2_Tcoh 0x3 /* 4clk */ |
103 | #define B2_Tcah 0x3 /* 4clk */ | 103 | #define B2_Tcah 0x3 /* 4clk */ |
104 | #define B2_Tacp 0x0 /* page mode is not used */ | 104 | #define B2_Tacp 0x0 /* page mode is not used */ |
105 | #define B2_PMC 0x0 /* page mode disabled */ | 105 | #define B2_PMC 0x0 /* page mode disabled */ |
106 | 106 | ||
107 | /* BANK3CON 200 + 250 + 266 */ | 107 | /* BANK3CON 200 + 250 + 266 */ |
108 | #define B3_Tacs 0x3 /* 4clk */ | 108 | #define B3_Tacs 0x3 /* 4clk */ |
109 | #define B3_Tcos 0x3 /* 4clk */ | 109 | #define B3_Tcos 0x3 /* 4clk */ |
110 | #define B3_Tacc 0x7 /* 14clk */ | 110 | #define B3_Tacc 0x7 /* 14clk */ |
111 | #define B3_Tcoh 0x3 /* 4clk */ | 111 | #define B3_Tcoh 0x3 /* 4clk */ |
112 | #define B3_Tcah 0x3 /* 4clk */ | 112 | #define B3_Tcah 0x3 /* 4clk */ |
113 | #define B3_Tacp 0x0 /* page mode is not used */ | 113 | #define B3_Tacp 0x0 /* page mode is not used */ |
114 | #define B3_PMC 0x0 /* page mode disabled */ | 114 | #define B3_PMC 0x0 /* page mode disabled */ |
115 | 115 | ||
116 | /* BANK4CON 200 */ | 116 | /* BANK4CON 200 */ |
117 | #define B4_Tacs_200 0x1 /* 1clk */ | 117 | #define B4_Tacs_200 0x1 /* 1clk */ |
118 | #define B4_Tcos_200 0x3 /* 4clk */ | 118 | #define B4_Tcos_200 0x3 /* 4clk */ |
119 | #define B4_Tacc_200 0x7 /* 14clk */ | 119 | #define B4_Tacc_200 0x7 /* 14clk */ |
120 | #define B4_Tcoh_200 0x3 /* 4clk */ | 120 | #define B4_Tcoh_200 0x3 /* 4clk */ |
121 | #define B4_Tcah_200 0x2 /* 2clk */ | 121 | #define B4_Tcah_200 0x2 /* 2clk */ |
122 | #define B4_Tacp_200 0x0 /* page mode is not used */ | 122 | #define B4_Tacp_200 0x0 /* page mode is not used */ |
123 | #define B4_PMC_200 0x0 /* page mode disabled */ | 123 | #define B4_PMC_200 0x0 /* page mode disabled */ |
124 | 124 | ||
125 | /* BANK4CON 250 */ | 125 | /* BANK4CON 250 */ |
126 | #define B4_Tacs_250 0x1 /* 1clk */ | 126 | #define B4_Tacs_250 0x1 /* 1clk */ |
127 | #define B4_Tcos_250 0x3 /* 4clk */ | 127 | #define B4_Tcos_250 0x3 /* 4clk */ |
128 | #define B4_Tacc_250 0x7 /* 14clk */ | 128 | #define B4_Tacc_250 0x7 /* 14clk */ |
129 | #define B4_Tcoh_250 0x3 /* 4clk */ | 129 | #define B4_Tcoh_250 0x3 /* 4clk */ |
130 | #define B4_Tcah_250 0x2 /* 2clk */ | 130 | #define B4_Tcah_250 0x2 /* 2clk */ |
131 | #define B4_Tacp_250 0x0 /* page mode is not used */ | 131 | #define B4_Tacp_250 0x0 /* page mode is not used */ |
132 | #define B4_PMC_250 0x0 /* page mode disabled */ | 132 | #define B4_PMC_250 0x0 /* page mode disabled */ |
133 | 133 | ||
134 | /* BANK4CON 266 */ | 134 | /* BANK4CON 266 */ |
135 | #define B4_Tacs_266 0x1 /* 1clk */ | 135 | #define B4_Tacs_266 0x1 /* 1clk */ |
136 | #define B4_Tcos_266 0x3 /* 4clk */ | 136 | #define B4_Tcos_266 0x3 /* 4clk */ |
137 | #define B4_Tacc_266 0x7 /* 14clk */ | 137 | #define B4_Tacc_266 0x7 /* 14clk */ |
138 | #define B4_Tcoh_266 0x3 /* 4clk */ | 138 | #define B4_Tcoh_266 0x3 /* 4clk */ |
139 | #define B4_Tcah_266 0x2 /* 2clk */ | 139 | #define B4_Tcah_266 0x2 /* 2clk */ |
140 | #define B4_Tacp_266 0x0 /* page mode is not used */ | 140 | #define B4_Tacp_266 0x0 /* page mode is not used */ |
141 | #define B4_PMC_266 0x0 /* page mode disabled */ | 141 | #define B4_PMC_266 0x0 /* page mode disabled */ |
142 | 142 | ||
143 | /* BANK5CON 200 */ | 143 | /* BANK5CON 200 */ |
144 | #define B5_Tacs_200 0x0 /* 0clk */ | 144 | #define B5_Tacs_200 0x0 /* 0clk */ |
145 | #define B5_Tcos_200 0x3 /* 4clk */ | 145 | #define B5_Tcos_200 0x3 /* 4clk */ |
146 | #define B5_Tacc_200 0x4 /* 6clk */ | 146 | #define B5_Tacc_200 0x4 /* 6clk */ |
147 | #define B5_Tcoh_200 0x3 /* 4clk */ | 147 | #define B5_Tcoh_200 0x3 /* 4clk */ |
148 | #define B5_Tcah_200 0x1 /* 1clk */ | 148 | #define B5_Tcah_200 0x1 /* 1clk */ |
149 | #define B5_Tacp_200 0x0 /* page mode is not used */ | 149 | #define B5_Tacp_200 0x0 /* page mode is not used */ |
150 | #define B5_PMC_200 0x0 /* page mode disabled */ | 150 | #define B5_PMC_200 0x0 /* page mode disabled */ |
151 | 151 | ||
152 | /* BANK5CON 250 */ | 152 | /* BANK5CON 250 */ |
153 | #define B5_Tacs_250 0x0 /* 0clk */ | 153 | #define B5_Tacs_250 0x0 /* 0clk */ |
154 | #define B5_Tcos_250 0x3 /* 4clk */ | 154 | #define B5_Tcos_250 0x3 /* 4clk */ |
155 | #define B5_Tacc_250 0x5 /* 8clk */ | 155 | #define B5_Tacc_250 0x5 /* 8clk */ |
156 | #define B5_Tcoh_250 0x3 /* 4clk */ | 156 | #define B5_Tcoh_250 0x3 /* 4clk */ |
157 | #define B5_Tcah_250 0x1 /* 1clk */ | 157 | #define B5_Tcah_250 0x1 /* 1clk */ |
158 | #define B5_Tacp_250 0x0 /* page mode is not used */ | 158 | #define B5_Tacp_250 0x0 /* page mode is not used */ |
159 | #define B5_PMC_250 0x0 /* page mode disabled */ | 159 | #define B5_PMC_250 0x0 /* page mode disabled */ |
160 | 160 | ||
161 | /* BANK5CON 266 */ | 161 | /* BANK5CON 266 */ |
162 | #define B5_Tacs_266 0x0 /* 0clk */ | 162 | #define B5_Tacs_266 0x0 /* 0clk */ |
163 | #define B5_Tcos_266 0x3 /* 4clk */ | 163 | #define B5_Tcos_266 0x3 /* 4clk */ |
164 | #define B5_Tacc_266 0x5 /* 8clk */ | 164 | #define B5_Tacc_266 0x5 /* 8clk */ |
165 | #define B5_Tcoh_266 0x3 /* 4clk */ | 165 | #define B5_Tcoh_266 0x3 /* 4clk */ |
166 | #define B5_Tcah_266 0x1 /* 1clk */ | 166 | #define B5_Tcah_266 0x1 /* 1clk */ |
167 | #define B5_Tacp_266 0x0 /* page mode is not used */ | 167 | #define B5_Tacp_266 0x0 /* page mode is not used */ |
168 | #define B5_PMC_266 0x0 /* page mode disabled */ | 168 | #define B5_PMC_266 0x0 /* page mode disabled */ |
169 | 169 | ||
170 | #define B6_MT 0x3 /* SDRAM */ | 170 | #define B6_MT 0x3 /* SDRAM */ |
171 | #define B6_Trcd_200 0x0 /* 2clk */ | 171 | #define B6_Trcd_200 0x0 /* 2clk */ |
172 | #define B6_Trcd_250 0x1 /* 3clk */ | 172 | #define B6_Trcd_250 0x1 /* 3clk */ |
173 | #define B6_Trcd_266 0x1 /* 3clk */ | 173 | #define B6_Trcd_266 0x1 /* 3clk */ |
174 | #define B6_SCAN 0x2 /* 10bit */ | 174 | #define B6_SCAN 0x2 /* 10bit */ |
175 | 175 | ||
176 | #define B7_MT 0x3 /* SDRAM */ | 176 | #define B7_MT 0x3 /* SDRAM */ |
177 | #define B7_Trcd_200 0x0 /* 2clk */ | 177 | #define B7_Trcd_200 0x0 /* 2clk */ |
178 | #define B7_Trcd_250 0x1 /* 3clk */ | 178 | #define B7_Trcd_250 0x1 /* 3clk */ |
179 | #define B7_Trcd_266 0x1 /* 3clk */ | 179 | #define B7_Trcd_266 0x1 /* 3clk */ |
180 | #define B7_SCAN 0x2 /* 10bit */ | 180 | #define B7_SCAN 0x2 /* 10bit */ |
181 | 181 | ||
182 | /* REFRESH parameter */ | 182 | /* REFRESH parameter */ |
183 | #define REFEN 0x1 /* Refresh enable */ | 183 | #define REFEN 0x1 /* Refresh enable */ |
184 | #define TREFMD 0x0 /* CBR(CAS before RAS)/Auto refresh */ | 184 | #define TREFMD 0x0 /* CBR(CAS before RAS)/Auto refresh */ |
185 | #define Trp_200 0x0 /* 2clk */ | 185 | #define Trp_200 0x0 /* 2clk */ |
186 | #define Trp_250 0x1 /* 3clk */ | 186 | #define Trp_250 0x1 /* 3clk */ |
187 | #define Trp_266 0x1 /* 3clk */ | 187 | #define Trp_266 0x1 /* 3clk */ |
188 | #define Tsrc_200 0x1 /* 5clk */ | 188 | #define Tsrc_200 0x1 /* 5clk */ |
189 | #define Tsrc_250 0x2 /* 6clk */ | 189 | #define Tsrc_250 0x2 /* 6clk */ |
190 | #define Tsrc_266 0x3 /* 7clk */ | 190 | #define Tsrc_266 0x3 /* 7clk */ |
191 | 191 | ||
192 | /* period=15.6us, HCLK=100Mhz, (2048+1-15.6*100) */ | 192 | /* period=15.6us, HCLK=100Mhz, (2048+1-15.6*100) */ |
193 | #define REFCNT_200 489 | 193 | #define REFCNT_200 489 |
194 | /* period=15.6us, HCLK=125Mhz, (2048+1-15.6*125) */ | 194 | /* period=15.6us, HCLK=125Mhz, (2048+1-15.6*125) */ |
195 | #define REFCNT_250 99 | 195 | #define REFCNT_250 99 |
196 | /* period=15.6us, HCLK=133Mhz, (2048+1-15.6*133) */ | 196 | /* period=15.6us, HCLK=133Mhz, (2048+1-15.6*133) */ |
197 | #define REFCNT_266 0 | 197 | #define REFCNT_266 0 |
198 | /**************************************/ | 198 | /**************************************/ |
199 | 199 | ||
200 | _TEXT_BASE: | ||
201 | .word CONFIG_SYS_TEXT_BASE | ||
202 | |||
203 | .globl lowlevel_init | 200 | .globl lowlevel_init |
204 | lowlevel_init: | 201 | lowlevel_init: |
205 | /* use r0 to relocate DATA read/write to flash rather than memory ! */ | 202 | /* use r0 to relocate DATA read/write to flash rather than memory ! */ |
206 | ldr r0, _TEXT_BASE | 203 | ldr r0, =CONFIG_SYS_TEXT_BASE |
207 | ldr r13, =BWSCON | 204 | ldr r13, =BWSCON |
208 | 205 | ||
209 | /* enable minimal access to PLD */ | 206 | /* enable minimal access to PLD */ |
210 | ldr r1, [r13] /* load default BWSCON */ | 207 | ldr r1, [r13] /* load default BWSCON */ |
211 | orr r1, r1, #(DW8 + UBLB) << 20 /* set necessary CS attrs */ | 208 | orr r1, r1, #(DW8 + UBLB) << 20 /* set necessary CS attrs */ |
212 | str r1, [r13] /* set BWSCON */ | 209 | str r1, [r13] /* set BWSCON */ |
213 | ldr r1, =0x7FF0 /* select slowest timing */ | 210 | ldr r1, =0x7FF0 /* select slowest timing */ |
214 | str r1, [r13, #0x18] /* set BANKCON5 */ | 211 | str r1, [r13, #0x18] /* set BANKCON5 */ |
215 | 212 | ||
216 | ldr r1, =PLD_BASE | 213 | ldr r1, =PLD_BASE |
217 | ldr r2, =SETUPDATA | 214 | ldr r2, =SETUPDATA |
218 | ldrb r1, [r1, #MISC_REG] | 215 | ldrb r1, [r1, #MISC_REG] |
219 | sub r2, r2, r0 | 216 | sub r2, r2, r0 |
220 | tst r1, #FASTCPU /* FASTCPU available ? */ | 217 | tst r1, #FASTCPU /* FASTCPU available ? */ |
221 | addeq r2, r2, #SETUPENTRY_SIZE | 218 | addeq r2, r2, #SETUPENTRY_SIZE |
222 | 219 | ||
223 | /* memory control configuration */ | 220 | /* memory control configuration */ |
224 | /* r2 = pointer into timing table */ | 221 | /* r2 = pointer into timing table */ |
225 | /* r13 = pointer to MEM controller regs (starting with BWSCON) */ | 222 | /* r13 = pointer to MEM controller regs (starting with BWSCON) */ |
226 | add r3, r2, #CSDATA_OFFSET | 223 | add r3, r2, #CSDATA_OFFSET |
227 | add r4, r3, #CSDATAENTRY_SIZE | 224 | add r4, r3, #CSDATAENTRY_SIZE |
228 | 0: | 225 | 0: |
229 | ldr r1, [r3], #4 | 226 | ldr r1, [r3], #4 |
230 | str r1, [r13], #4 | 227 | str r1, [r13], #4 |
231 | cmp r3, r4 | 228 | cmp r3, r4 |
232 | bne 0b | 229 | bne 0b |
233 | 230 | ||
234 | /* PLD access is now possible */ | 231 | /* PLD access is now possible */ |
235 | /* r3 = SDRAMDATA | 232 | /* r3 = SDRAMDATA |
236 | /* r13 = pointer to MEM controller regs */ | 233 | /* r13 = pointer to MEM controller regs */ |
237 | ldr r1, =PLD_BASE | 234 | ldr r1, =PLD_BASE |
238 | mov r4, #SDRAMENTRY_SIZE | 235 | mov r4, #SDRAMENTRY_SIZE |
239 | ldrb r1, [r1, #SDRAM_REG] | 236 | ldrb r1, [r1, #SDRAM_REG] |
240 | /* calculate start and end point */ | 237 | /* calculate start and end point */ |
241 | mla r3, r4, r1, r3 | 238 | mla r3, r4, r1, r3 |
242 | add r4, r3, r4 | 239 | add r4, r3, r4 |
243 | 0: | 240 | 0: |
244 | ldr r1, [r3], #4 | 241 | ldr r1, [r3], #4 |
245 | str r1, [r13], #4 | 242 | str r1, [r13], #4 |
246 | cmp r3, r4 | 243 | cmp r3, r4 |
247 | bne 0b | 244 | bne 0b |
248 | 245 | ||
249 | /* setup MPLL registers */ | 246 | /* setup MPLL registers */ |
250 | ldr r1, =CLKBASE | 247 | ldr r1, =CLKBASE |
251 | ldr r4, =0xFFFFFF | 248 | ldr r4, =0xFFFFFF |
252 | add r3, r2, #4 /* r3 points to PLL values */ | 249 | add r3, r2, #4 /* r3 points to PLL values */ |
253 | str r4, [r1, #LOCKTIME] | 250 | str r4, [r1, #LOCKTIME] |
254 | ldmia r3, {r4,r5} | 251 | ldmia r3, {r4,r5} |
255 | str r5, [r1, #UPLLCON] /* writing PLL register */ | 252 | str r5, [r1, #UPLLCON] /* writing PLL register */ |
256 | /* !! order seems to be important !! */ | 253 | /* !! order seems to be important !! */ |
257 | /* a little delay */ | 254 | /* a little delay */ |
258 | ldr r3, =0x4000 | 255 | ldr r3, =0x4000 |
259 | 0: | 256 | 0: |
260 | subs r3, r3, #1 | 257 | subs r3, r3, #1 |
261 | bne 0b | 258 | bne 0b |
262 | 259 | ||
263 | str r4, [r1, #MPLLCON] /* writing PLL register */ | 260 | str r4, [r1, #MPLLCON] /* writing PLL register */ |
264 | /* !! order seems to be important !! */ | 261 | /* !! order seems to be important !! */ |
265 | /* a little delay */ | 262 | /* a little delay */ |
266 | ldr r3, =0x4000 | 263 | ldr r3, =0x4000 |
267 | 0: | 264 | 0: |
268 | subs r3, r3, #1 | 265 | subs r3, r3, #1 |
269 | bne 0b | 266 | bne 0b |
270 | 267 | ||
271 | /* everything is fine now */ | 268 | /* everything is fine now */ |
272 | mov pc, lr | 269 | mov pc, lr |
273 | 270 | ||
274 | .ltorg | 271 | .ltorg |
275 | /* the literal pools origin */ | 272 | /* the literal pools origin */ |
276 | 273 | ||
277 | #define MK_BWSCON(bws1, bws2, bws3, bws4, bws5, bws6, bws7) \ | 274 | #define MK_BWSCON(bws1, bws2, bws3, bws4, bws5, bws6, bws7) \ |
278 | ((bws1) << 4) + \ | 275 | ((bws1) << 4) + \ |
279 | ((bws2) << 8) + \ | 276 | ((bws2) << 8) + \ |
280 | ((bws3) << 12) + \ | 277 | ((bws3) << 12) + \ |
281 | ((bws4) << 16) + \ | 278 | ((bws4) << 16) + \ |
282 | ((bws5) << 20) + \ | 279 | ((bws5) << 20) + \ |
283 | ((bws6) << 24) + \ | 280 | ((bws6) << 24) + \ |
284 | ((bws7) << 28) | 281 | ((bws7) << 28) |
285 | 282 | ||
286 | #define MK_BANKCON(tacs, tcos, tacc, tcoh, tcah, tacp, pmc) \ | 283 | #define MK_BANKCON(tacs, tcos, tacc, tcoh, tcah, tacp, pmc) \ |
287 | ((tacs) << 13) + \ | 284 | ((tacs) << 13) + \ |
288 | ((tcos) << 11) + \ | 285 | ((tcos) << 11) + \ |
289 | ((tacc) << 8) + \ | 286 | ((tacc) << 8) + \ |
290 | ((tcoh) << 6) + \ | 287 | ((tcoh) << 6) + \ |
291 | ((tcah) << 4) + \ | 288 | ((tcah) << 4) + \ |
292 | ((tacp) << 2) + \ | 289 | ((tacp) << 2) + \ |
293 | (pmc) | 290 | (pmc) |
294 | 291 | ||
295 | #define MK_BANKCON_SDRAM(trcd, scan) \ | 292 | #define MK_BANKCON_SDRAM(trcd, scan) \ |
296 | ((0x03) << 15) + \ | 293 | ((0x03) << 15) + \ |
297 | ((trcd) << 2) + \ | 294 | ((trcd) << 2) + \ |
298 | (scan) | 295 | (scan) |
299 | 296 | ||
300 | #define MK_SDRAM_REFRESH(enable, trefmd, trp, tsrc, cnt) \ | 297 | #define MK_SDRAM_REFRESH(enable, trefmd, trp, tsrc, cnt) \ |
301 | ((enable) << 23) + \ | 298 | ((enable) << 23) + \ |
302 | ((trefmd) << 22) + \ | 299 | ((trefmd) << 22) + \ |
303 | ((trp) << 20) + \ | 300 | ((trp) << 20) + \ |
304 | ((tsrc) << 18) + \ | 301 | ((tsrc) << 18) + \ |
305 | (cnt) | 302 | (cnt) |
306 | 303 | ||
307 | SETUPDATA: | 304 | SETUPDATA: |
308 | .word 0x32410002 | 305 | .word 0x32410002 |
309 | /* PLL values (MDIV, PDIV, SDIV) for 250 MHz */ | 306 | /* PLL values (MDIV, PDIV, SDIV) for 250 MHz */ |
310 | .word (0x75 << 12) + (0x01 << 4) + (0x01 << 0) | 307 | .word (0x75 << 12) + (0x01 << 4) + (0x01 << 0) |
311 | /* PLL values for USB clock */ | 308 | /* PLL values for USB clock */ |
312 | .word (0x48 << 12) + (0x03 << 4) + (0x02 << 0) | 309 | .word (0x48 << 12) + (0x03 << 4) + (0x02 << 0) |
313 | 310 | ||
314 | /* timing for 250 MHz*/ | 311 | /* timing for 250 MHz*/ |
315 | 0: | 312 | 0: |
316 | .equiv CSDATA_OFFSET, (. - SETUPDATA) | 313 | .equiv CSDATA_OFFSET, (. - SETUPDATA) |
317 | .word MK_BWSCON(DW16, \ | 314 | .word MK_BWSCON(DW16, \ |
318 | DW32, \ | 315 | DW32, \ |
319 | DW32, \ | 316 | DW32, \ |
320 | DW16 + WAIT + UBLB, \ | 317 | DW16 + WAIT + UBLB, \ |
321 | DW8 + UBLB, \ | 318 | DW8 + UBLB, \ |
322 | DW32, \ | 319 | DW32, \ |
323 | DW32) | 320 | DW32) |
324 | 321 | ||
325 | .word MK_BANKCON(B0_Tacs_250, \ | 322 | .word MK_BANKCON(B0_Tacs_250, \ |
326 | B0_Tcos_250, \ | 323 | B0_Tcos_250, \ |
327 | B0_Tacc_250, \ | 324 | B0_Tacc_250, \ |
328 | B0_Tcoh_250, \ | 325 | B0_Tcoh_250, \ |
329 | B0_Tcah_250, \ | 326 | B0_Tcah_250, \ |
330 | B0_Tacp_250, \ | 327 | B0_Tacp_250, \ |
331 | B0_PMC_250) | 328 | B0_PMC_250) |
332 | 329 | ||
333 | .word MK_BANKCON(B1_Tacs_250, \ | 330 | .word MK_BANKCON(B1_Tacs_250, \ |
334 | B1_Tcos_250, \ | 331 | B1_Tcos_250, \ |
335 | B1_Tacc_250, \ | 332 | B1_Tacc_250, \ |
336 | B1_Tcoh_250, \ | 333 | B1_Tcoh_250, \ |
337 | B1_Tcah_250, \ | 334 | B1_Tcah_250, \ |
338 | B1_Tacp_250, \ | 335 | B1_Tacp_250, \ |
339 | B1_PMC_250) | 336 | B1_PMC_250) |
340 | 337 | ||
341 | .word MK_BANKCON(B2_Tacs, \ | 338 | .word MK_BANKCON(B2_Tacs, \ |
342 | B2_Tcos, \ | 339 | B2_Tcos, \ |
343 | B2_Tacc, \ | 340 | B2_Tacc, \ |
344 | B2_Tcoh, \ | 341 | B2_Tcoh, \ |
345 | B2_Tcah, \ | 342 | B2_Tcah, \ |
346 | B2_Tacp, \ | 343 | B2_Tacp, \ |
347 | B2_PMC) | 344 | B2_PMC) |
348 | 345 | ||
349 | .word MK_BANKCON(B3_Tacs, \ | 346 | .word MK_BANKCON(B3_Tacs, \ |
350 | B3_Tcos, \ | 347 | B3_Tcos, \ |
351 | B3_Tacc, \ | 348 | B3_Tacc, \ |
352 | B3_Tcoh, \ | 349 | B3_Tcoh, \ |
353 | B3_Tcah, \ | 350 | B3_Tcah, \ |
354 | B3_Tacp, \ | 351 | B3_Tacp, \ |
355 | B3_PMC) | 352 | B3_PMC) |
356 | 353 | ||
357 | .word MK_BANKCON(B4_Tacs_250, \ | 354 | .word MK_BANKCON(B4_Tacs_250, \ |
358 | B4_Tcos_250, \ | 355 | B4_Tcos_250, \ |
359 | B4_Tacc_250, \ | 356 | B4_Tacc_250, \ |
360 | B4_Tcoh_250, \ | 357 | B4_Tcoh_250, \ |
361 | B4_Tcah_250, \ | 358 | B4_Tcah_250, \ |
362 | B4_Tacp_250, \ | 359 | B4_Tacp_250, \ |
363 | B4_PMC_250) | 360 | B4_PMC_250) |
364 | 361 | ||
365 | .word MK_BANKCON(B5_Tacs_250, \ | 362 | .word MK_BANKCON(B5_Tacs_250, \ |
366 | B5_Tcos_250, \ | 363 | B5_Tcos_250, \ |
367 | B5_Tacc_250, \ | 364 | B5_Tacc_250, \ |
368 | B5_Tcoh_250, \ | 365 | B5_Tcoh_250, \ |
369 | B5_Tcah_250, \ | 366 | B5_Tcah_250, \ |
370 | B5_Tacp_250, \ | 367 | B5_Tacp_250, \ |
371 | B5_PMC_250) | 368 | B5_PMC_250) |
372 | 369 | ||
373 | .equiv CSDATAENTRY_SIZE, (. - 0b) | 370 | .equiv CSDATAENTRY_SIZE, (. - 0b) |
374 | /* 4Mx8x4 */ | 371 | /* 4Mx8x4 */ |
375 | 0: | 372 | 0: |
376 | .word MK_BANKCON_SDRAM(B6_Trcd_250, B6_SCAN) | 373 | .word MK_BANKCON_SDRAM(B6_Trcd_250, B6_SCAN) |
377 | .word MK_BANKCON_SDRAM(B7_Trcd_250, B7_SCAN) | 374 | .word MK_BANKCON_SDRAM(B7_Trcd_250, B7_SCAN) |
378 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_250, Tsrc_250, REFCNT_250) | 375 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_250, Tsrc_250, REFCNT_250) |
379 | .word 0x32 + BURST_EN | 376 | .word 0x32 + BURST_EN |
380 | .word 0x30 | 377 | .word 0x30 |
381 | .word 0x30 | 378 | .word 0x30 |
382 | .equiv SDRAMENTRY_SIZE, (. - 0b) | 379 | .equiv SDRAMENTRY_SIZE, (. - 0b) |
383 | 380 | ||
384 | /* 8Mx8x4 */ | 381 | /* 8Mx8x4 */ |
385 | .word MK_BANKCON_SDRAM(B6_Trcd_250, B6_SCAN) | 382 | .word MK_BANKCON_SDRAM(B6_Trcd_250, B6_SCAN) |
386 | .word MK_BANKCON_SDRAM(B7_Trcd_250, B7_SCAN) | 383 | .word MK_BANKCON_SDRAM(B7_Trcd_250, B7_SCAN) |
387 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_250, Tsrc_250, REFCNT_250) | 384 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_250, Tsrc_250, REFCNT_250) |
388 | .word 0x32 + BURST_EN | 385 | .word 0x32 + BURST_EN |
389 | .word 0x30 | 386 | .word 0x30 |
390 | .word 0x30 | 387 | .word 0x30 |
391 | 388 | ||
392 | /* 2Mx8x4 */ | 389 | /* 2Mx8x4 */ |
393 | .word MK_BANKCON_SDRAM(B6_Trcd_250, B6_SCAN) | 390 | .word MK_BANKCON_SDRAM(B6_Trcd_250, B6_SCAN) |
394 | .word MK_BANKCON_SDRAM(B7_Trcd_250, B7_SCAN) | 391 | .word MK_BANKCON_SDRAM(B7_Trcd_250, B7_SCAN) |
395 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_250, Tsrc_250, REFCNT_250) | 392 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_250, Tsrc_250, REFCNT_250) |
396 | .word 0x32 + BURST_EN | 393 | .word 0x32 + BURST_EN |
397 | .word 0x30 | 394 | .word 0x30 |
398 | .word 0x30 | 395 | .word 0x30 |
399 | 396 | ||
400 | /* 4Mx8x2 */ | 397 | /* 4Mx8x2 */ |
401 | .word MK_BANKCON_SDRAM(B6_Trcd_250, B6_SCAN) | 398 | .word MK_BANKCON_SDRAM(B6_Trcd_250, B6_SCAN) |
402 | .word MK_BANKCON_SDRAM(B7_Trcd_250, B7_SCAN) | 399 | .word MK_BANKCON_SDRAM(B7_Trcd_250, B7_SCAN) |
403 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_250, Tsrc_250, REFCNT_250) | 400 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_250, Tsrc_250, REFCNT_250) |
404 | .word 0x32 + BURST_EN | 401 | .word 0x32 + BURST_EN |
405 | .word 0x30 | 402 | .word 0x30 |
406 | .word 0x30 | 403 | .word 0x30 |
407 | 404 | ||
408 | .equiv SETUPENTRY_SIZE, (. - SETUPDATA) | 405 | .equiv SETUPENTRY_SIZE, (. - SETUPDATA) |
409 | 406 | ||
410 | .word 0x32410000 | 407 | .word 0x32410000 |
411 | /* PLL values (MDIV, PDIV, SDIV) for 200 MHz (Fout = 202.8MHz) */ | 408 | /* PLL values (MDIV, PDIV, SDIV) for 200 MHz (Fout = 202.8MHz) */ |
412 | .word (0xA1 << 12) + (0x03 << 4) + (0x01 << 0) | 409 | .word (0xA1 << 12) + (0x03 << 4) + (0x01 << 0) |
413 | /* PLL values for USB clock */ | 410 | /* PLL values for USB clock */ |
414 | .word (0x48 << 12) + (0x03 << 4) + (0x02 << 0) | 411 | .word (0x48 << 12) + (0x03 << 4) + (0x02 << 0) |
415 | 412 | ||
416 | /* timing for 200 MHz and default*/ | 413 | /* timing for 200 MHz and default*/ |
417 | .word MK_BWSCON(DW16, \ | 414 | .word MK_BWSCON(DW16, \ |
418 | DW32, \ | 415 | DW32, \ |
419 | DW32, \ | 416 | DW32, \ |
420 | DW16 + WAIT + UBLB, \ | 417 | DW16 + WAIT + UBLB, \ |
421 | DW8 + UBLB, \ | 418 | DW8 + UBLB, \ |
422 | DW32, \ | 419 | DW32, \ |
423 | DW32) | 420 | DW32) |
424 | 421 | ||
425 | .word MK_BANKCON(B0_Tacs_200, \ | 422 | .word MK_BANKCON(B0_Tacs_200, \ |
426 | B0_Tcos_200, \ | 423 | B0_Tcos_200, \ |
427 | B0_Tacc_200, \ | 424 | B0_Tacc_200, \ |
428 | B0_Tcoh_200, \ | 425 | B0_Tcoh_200, \ |
429 | B0_Tcah_200, \ | 426 | B0_Tcah_200, \ |
430 | B0_Tacp_200, \ | 427 | B0_Tacp_200, \ |
431 | B0_PMC_200) | 428 | B0_PMC_200) |
432 | 429 | ||
433 | .word MK_BANKCON(B1_Tacs_200, \ | 430 | .word MK_BANKCON(B1_Tacs_200, \ |
434 | B1_Tcos_200, \ | 431 | B1_Tcos_200, \ |
435 | B1_Tacc_200, \ | 432 | B1_Tacc_200, \ |
436 | B1_Tcoh_200, \ | 433 | B1_Tcoh_200, \ |
437 | B1_Tcah_200, \ | 434 | B1_Tcah_200, \ |
438 | B1_Tacp_200, \ | 435 | B1_Tacp_200, \ |
439 | B1_PMC_200) | 436 | B1_PMC_200) |
440 | 437 | ||
441 | .word MK_BANKCON(B2_Tacs, \ | 438 | .word MK_BANKCON(B2_Tacs, \ |
442 | B2_Tcos, \ | 439 | B2_Tcos, \ |
443 | B2_Tacc, \ | 440 | B2_Tacc, \ |
444 | B2_Tcoh, \ | 441 | B2_Tcoh, \ |
445 | B2_Tcah, \ | 442 | B2_Tcah, \ |
446 | B2_Tacp, \ | 443 | B2_Tacp, \ |
447 | B2_PMC) | 444 | B2_PMC) |
448 | 445 | ||
449 | .word MK_BANKCON(B3_Tacs, \ | 446 | .word MK_BANKCON(B3_Tacs, \ |
450 | B3_Tcos, \ | 447 | B3_Tcos, \ |
451 | B3_Tacc, \ | 448 | B3_Tacc, \ |
452 | B3_Tcoh, \ | 449 | B3_Tcoh, \ |
453 | B3_Tcah, \ | 450 | B3_Tcah, \ |
454 | B3_Tacp, \ | 451 | B3_Tacp, \ |
455 | B3_PMC) | 452 | B3_PMC) |
456 | 453 | ||
457 | .word MK_BANKCON(B4_Tacs_200, \ | 454 | .word MK_BANKCON(B4_Tacs_200, \ |
458 | B4_Tcos_200, \ | 455 | B4_Tcos_200, \ |
459 | B4_Tacc_200, \ | 456 | B4_Tacc_200, \ |
460 | B4_Tcoh_200, \ | 457 | B4_Tcoh_200, \ |
461 | B4_Tcah_200, \ | 458 | B4_Tcah_200, \ |
462 | B4_Tacp_200, \ | 459 | B4_Tacp_200, \ |
463 | B4_PMC_200) | 460 | B4_PMC_200) |
464 | 461 | ||
465 | .word MK_BANKCON(B5_Tacs_200, \ | 462 | .word MK_BANKCON(B5_Tacs_200, \ |
466 | B5_Tcos_200, \ | 463 | B5_Tcos_200, \ |
467 | B5_Tacc_200, \ | 464 | B5_Tacc_200, \ |
468 | B5_Tcoh_200, \ | 465 | B5_Tcoh_200, \ |
469 | B5_Tcah_200, \ | 466 | B5_Tcah_200, \ |
470 | B5_Tacp_200, \ | 467 | B5_Tacp_200, \ |
471 | B5_PMC_200) | 468 | B5_PMC_200) |
472 | 469 | ||
473 | /* 4Mx8x4 */ | 470 | /* 4Mx8x4 */ |
474 | .word MK_BANKCON_SDRAM(B6_Trcd_200, B6_SCAN) | 471 | .word MK_BANKCON_SDRAM(B6_Trcd_200, B6_SCAN) |
475 | .word MK_BANKCON_SDRAM(B7_Trcd_200, B7_SCAN) | 472 | .word MK_BANKCON_SDRAM(B7_Trcd_200, B7_SCAN) |
476 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_200, Tsrc_200, REFCNT_200) | 473 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_200, Tsrc_200, REFCNT_200) |
477 | .word 0x32 + BURST_EN | 474 | .word 0x32 + BURST_EN |
478 | .word 0x30 | 475 | .word 0x30 |
479 | .word 0x30 | 476 | .word 0x30 |
480 | 477 | ||
481 | /* 8Mx8x4 */ | 478 | /* 8Mx8x4 */ |
482 | .word MK_BANKCON_SDRAM(B6_Trcd_200, B6_SCAN) | 479 | .word MK_BANKCON_SDRAM(B6_Trcd_200, B6_SCAN) |
483 | .word MK_BANKCON_SDRAM(B7_Trcd_200, B7_SCAN) | 480 | .word MK_BANKCON_SDRAM(B7_Trcd_200, B7_SCAN) |
484 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_200, Tsrc_200, REFCNT_200) | 481 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_200, Tsrc_200, REFCNT_200) |
485 | .word 0x32 + BURST_EN | 482 | .word 0x32 + BURST_EN |
486 | .word 0x30 | 483 | .word 0x30 |
487 | .word 0x30 | 484 | .word 0x30 |
488 | 485 | ||
489 | /* 2Mx8x4 */ | 486 | /* 2Mx8x4 */ |
490 | .word MK_BANKCON_SDRAM(B6_Trcd_200, B6_SCAN) | 487 | .word MK_BANKCON_SDRAM(B6_Trcd_200, B6_SCAN) |
491 | .word MK_BANKCON_SDRAM(B7_Trcd_200, B7_SCAN) | 488 | .word MK_BANKCON_SDRAM(B7_Trcd_200, B7_SCAN) |
492 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_200, Tsrc_200, REFCNT_200) | 489 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_200, Tsrc_200, REFCNT_200) |
493 | .word 0x32 + BURST_EN | 490 | .word 0x32 + BURST_EN |
494 | .word 0x30 | 491 | .word 0x30 |
495 | .word 0x30 | 492 | .word 0x30 |
496 | 493 | ||
497 | /* 4Mx8x2 */ | 494 | /* 4Mx8x2 */ |
498 | .word MK_BANKCON_SDRAM(B6_Trcd_200, B6_SCAN) | 495 | .word MK_BANKCON_SDRAM(B6_Trcd_200, B6_SCAN) |
499 | .word MK_BANKCON_SDRAM(B7_Trcd_200, B7_SCAN) | 496 | .word MK_BANKCON_SDRAM(B7_Trcd_200, B7_SCAN) |
500 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_200, Tsrc_200, REFCNT_200) | 497 | .word MK_SDRAM_REFRESH(REFEN, TREFMD, Trp_200, Tsrc_200, REFCNT_200) |
501 | .word 0x32 + BURST_EN | 498 | .word 0x32 + BURST_EN |
502 | .word 0x30 | 499 | .word 0x30 |
503 | .word 0x30 | 500 | .word 0x30 |
504 | 501 | ||
505 | .equiv SETUPDATA_SIZE, (. - SETUPDATA) | 502 | .equiv SETUPDATA_SIZE, (. - SETUPDATA) |
506 | 503 |
board/samsung/goni/lowlevel_init.S
1 | /* | 1 | /* |
2 | * Memory Setup stuff - taken from blob memsetup.S | 2 | * Memory Setup stuff - taken from blob memsetup.S |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Samsung Electronics | 4 | * Copyright (C) 2009 Samsung Electronics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
6 | * | 6 | * |
7 | * SPDX-License-Identifier: GPL-2.0+ | 7 | * SPDX-License-Identifier: GPL-2.0+ |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <config.h> | 10 | #include <config.h> |
11 | #include <version.h> | 11 | #include <version.h> |
12 | #include <asm/arch/cpu.h> | 12 | #include <asm/arch/cpu.h> |
13 | #include <asm/arch/clock.h> | 13 | #include <asm/arch/clock.h> |
14 | #include <asm/arch/power.h> | 14 | #include <asm/arch/power.h> |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Register usages: | 17 | * Register usages: |
18 | * | 18 | * |
19 | * r5 has zero always | 19 | * r5 has zero always |
20 | * r7 has S5PC100 GPIO base, 0xE0300000 | 20 | * r7 has S5PC100 GPIO base, 0xE0300000 |
21 | * r8 has real GPIO base, 0xE0300000, 0xE0200000 at S5PC100, S5PC110 repectively | 21 | * r8 has real GPIO base, 0xE0300000, 0xE0200000 at S5PC100, S5PC110 repectively |
22 | * r9 has Mobile DDR size, 1 means 1GiB, 2 means 2GiB and so on | 22 | * r9 has Mobile DDR size, 1 means 1GiB, 2 means 2GiB and so on |
23 | */ | 23 | */ |
24 | 24 | ||
25 | _TEXT_BASE: | ||
26 | .word CONFIG_SYS_TEXT_BASE | ||
27 | |||
28 | .globl lowlevel_init | 25 | .globl lowlevel_init |
29 | lowlevel_init: | 26 | lowlevel_init: |
30 | mov r11, lr | 27 | mov r11, lr |
31 | 28 | ||
32 | /* r5 has always zero */ | 29 | /* r5 has always zero */ |
33 | mov r5, #0 | 30 | mov r5, #0 |
34 | 31 | ||
35 | ldr r7, =S5PC100_GPIO_BASE | 32 | ldr r7, =S5PC100_GPIO_BASE |
36 | ldr r8, =S5PC100_GPIO_BASE | 33 | ldr r8, =S5PC100_GPIO_BASE |
37 | /* Read CPU ID */ | 34 | /* Read CPU ID */ |
38 | ldr r2, =S5PC110_PRO_ID | 35 | ldr r2, =S5PC110_PRO_ID |
39 | ldr r0, [r2] | 36 | ldr r0, [r2] |
40 | mov r1, #0x00010000 | 37 | mov r1, #0x00010000 |
41 | and r0, r0, r1 | 38 | and r0, r0, r1 |
42 | cmp r0, r5 | 39 | cmp r0, r5 |
43 | beq 100f | 40 | beq 100f |
44 | ldr r8, =S5PC110_GPIO_BASE | 41 | ldr r8, =S5PC110_GPIO_BASE |
45 | 100: | 42 | 100: |
46 | /* Turn on KEY_LED_ON [GPJ4(1)] XMSMWEN */ | 43 | /* Turn on KEY_LED_ON [GPJ4(1)] XMSMWEN */ |
47 | cmp r7, r8 | 44 | cmp r7, r8 |
48 | beq skip_check_didle @ Support C110 only | 45 | beq skip_check_didle @ Support C110 only |
49 | 46 | ||
50 | ldr r0, =S5PC110_RST_STAT | 47 | ldr r0, =S5PC110_RST_STAT |
51 | ldr r1, [r0] | 48 | ldr r1, [r0] |
52 | and r1, r1, #0x000D0000 | 49 | and r1, r1, #0x000D0000 |
53 | cmp r1, #(0x1 << 19) @ DEEPIDLE_WAKEUP | 50 | cmp r1, #(0x1 << 19) @ DEEPIDLE_WAKEUP |
54 | beq didle_wakeup | 51 | beq didle_wakeup |
55 | cmp r7, r8 | 52 | cmp r7, r8 |
56 | 53 | ||
57 | skip_check_didle: | 54 | skip_check_didle: |
58 | addeq r0, r8, #0x280 @ S5PC100_GPIO_J4 | 55 | addeq r0, r8, #0x280 @ S5PC100_GPIO_J4 |
59 | addne r0, r8, #0x2C0 @ S5PC110_GPIO_J4 | 56 | addne r0, r8, #0x2C0 @ S5PC110_GPIO_J4 |
60 | ldr r1, [r0, #0x0] @ GPIO_CON_OFFSET | 57 | ldr r1, [r0, #0x0] @ GPIO_CON_OFFSET |
61 | bic r1, r1, #(0xf << 4) @ 1 * 4-bit | 58 | bic r1, r1, #(0xf << 4) @ 1 * 4-bit |
62 | orr r1, r1, #(0x1 << 4) | 59 | orr r1, r1, #(0x1 << 4) |
63 | str r1, [r0, #0x0] @ GPIO_CON_OFFSET | 60 | str r1, [r0, #0x0] @ GPIO_CON_OFFSET |
64 | 61 | ||
65 | ldr r1, [r0, #0x4] @ GPIO_DAT_OFFSET | 62 | ldr r1, [r0, #0x4] @ GPIO_DAT_OFFSET |
66 | bic r1, r1, #(1 << 1) | 63 | bic r1, r1, #(1 << 1) |
67 | str r1, [r0, #0x4] @ GPIO_DAT_OFFSET | 64 | str r1, [r0, #0x4] @ GPIO_DAT_OFFSET |
68 | 65 | ||
69 | /* Don't setup at s5pc100 */ | 66 | /* Don't setup at s5pc100 */ |
70 | beq 100f | 67 | beq 100f |
71 | 68 | ||
72 | /* | 69 | /* |
73 | * Initialize Async Register Setting for EVT1 | 70 | * Initialize Async Register Setting for EVT1 |
74 | * Because we are setting EVT1 as the default value of EVT0, | 71 | * Because we are setting EVT1 as the default value of EVT0, |
75 | * setting EVT0 as well does not make things worse. | 72 | * setting EVT0 as well does not make things worse. |
76 | * Thus, for the simplicity, we set for EVT0, too | 73 | * Thus, for the simplicity, we set for EVT0, too |
77 | * | 74 | * |
78 | * The "Async Registers" are: | 75 | * The "Async Registers" are: |
79 | * 0xE0F0_0000 | 76 | * 0xE0F0_0000 |
80 | * 0xE1F0_0000 | 77 | * 0xE1F0_0000 |
81 | * 0xF180_0000 | 78 | * 0xF180_0000 |
82 | * 0xF190_0000 | 79 | * 0xF190_0000 |
83 | * 0xF1A0_0000 | 80 | * 0xF1A0_0000 |
84 | * 0xF1B0_0000 | 81 | * 0xF1B0_0000 |
85 | * 0xF1C0_0000 | 82 | * 0xF1C0_0000 |
86 | * 0xF1D0_0000 | 83 | * 0xF1D0_0000 |
87 | * 0xF1E0_0000 | 84 | * 0xF1E0_0000 |
88 | * 0xF1F0_0000 | 85 | * 0xF1F0_0000 |
89 | * 0xFAF0_0000 | 86 | * 0xFAF0_0000 |
90 | */ | 87 | */ |
91 | ldr r0, =0xe0f00000 | 88 | ldr r0, =0xe0f00000 |
92 | ldr r1, [r0] | 89 | ldr r1, [r0] |
93 | bic r1, r1, #0x1 | 90 | bic r1, r1, #0x1 |
94 | str r1, [r0] | 91 | str r1, [r0] |
95 | 92 | ||
96 | ldr r0, =0xe1f00000 | 93 | ldr r0, =0xe1f00000 |
97 | ldr r1, [r0] | 94 | ldr r1, [r0] |
98 | bic r1, r1, #0x1 | 95 | bic r1, r1, #0x1 |
99 | str r1, [r0] | 96 | str r1, [r0] |
100 | 97 | ||
101 | ldr r0, =0xf1800000 | 98 | ldr r0, =0xf1800000 |
102 | ldr r1, [r0] | 99 | ldr r1, [r0] |
103 | bic r1, r1, #0x1 | 100 | bic r1, r1, #0x1 |
104 | str r1, [r0] | 101 | str r1, [r0] |
105 | 102 | ||
106 | ldr r0, =0xf1900000 | 103 | ldr r0, =0xf1900000 |
107 | ldr r1, [r0] | 104 | ldr r1, [r0] |
108 | bic r1, r1, #0x1 | 105 | bic r1, r1, #0x1 |
109 | str r1, [r0] | 106 | str r1, [r0] |
110 | 107 | ||
111 | ldr r0, =0xf1a00000 | 108 | ldr r0, =0xf1a00000 |
112 | ldr r1, [r0] | 109 | ldr r1, [r0] |
113 | bic r1, r1, #0x1 | 110 | bic r1, r1, #0x1 |
114 | str r1, [r0] | 111 | str r1, [r0] |
115 | 112 | ||
116 | ldr r0, =0xf1b00000 | 113 | ldr r0, =0xf1b00000 |
117 | ldr r1, [r0] | 114 | ldr r1, [r0] |
118 | bic r1, r1, #0x1 | 115 | bic r1, r1, #0x1 |
119 | str r1, [r0] | 116 | str r1, [r0] |
120 | 117 | ||
121 | ldr r0, =0xf1c00000 | 118 | ldr r0, =0xf1c00000 |
122 | ldr r1, [r0] | 119 | ldr r1, [r0] |
123 | bic r1, r1, #0x1 | 120 | bic r1, r1, #0x1 |
124 | str r1, [r0] | 121 | str r1, [r0] |
125 | 122 | ||
126 | ldr r0, =0xf1d00000 | 123 | ldr r0, =0xf1d00000 |
127 | ldr r1, [r0] | 124 | ldr r1, [r0] |
128 | bic r1, r1, #0x1 | 125 | bic r1, r1, #0x1 |
129 | str r1, [r0] | 126 | str r1, [r0] |
130 | 127 | ||
131 | ldr r0, =0xf1e00000 | 128 | ldr r0, =0xf1e00000 |
132 | ldr r1, [r0] | 129 | ldr r1, [r0] |
133 | bic r1, r1, #0x1 | 130 | bic r1, r1, #0x1 |
134 | str r1, [r0] | 131 | str r1, [r0] |
135 | 132 | ||
136 | ldr r0, =0xf1f00000 | 133 | ldr r0, =0xf1f00000 |
137 | ldr r1, [r0] | 134 | ldr r1, [r0] |
138 | bic r1, r1, #0x1 | 135 | bic r1, r1, #0x1 |
139 | str r1, [r0] | 136 | str r1, [r0] |
140 | 137 | ||
141 | ldr r0, =0xfaf00000 | 138 | ldr r0, =0xfaf00000 |
142 | ldr r1, [r0] | 139 | ldr r1, [r0] |
143 | bic r1, r1, #0x1 | 140 | bic r1, r1, #0x1 |
144 | str r1, [r0] | 141 | str r1, [r0] |
145 | 142 | ||
146 | /* | 143 | /* |
147 | * Diable ABB block to reduce sleep current at low temperature | 144 | * Diable ABB block to reduce sleep current at low temperature |
148 | * Note that it's hidden register setup don't modify it | 145 | * Note that it's hidden register setup don't modify it |
149 | */ | 146 | */ |
150 | ldr r0, =0xE010C300 | 147 | ldr r0, =0xE010C300 |
151 | ldr r1, =0x00800000 | 148 | ldr r1, =0x00800000 |
152 | str r1, [r0] | 149 | str r1, [r0] |
153 | 150 | ||
154 | 100: | 151 | 100: |
155 | /* IO retension release */ | 152 | /* IO retension release */ |
156 | ldreq r0, =S5PC100_OTHERS @ 0xE0108200 | 153 | ldreq r0, =S5PC100_OTHERS @ 0xE0108200 |
157 | ldrne r0, =S5PC110_OTHERS @ 0xE010E000 | 154 | ldrne r0, =S5PC110_OTHERS @ 0xE010E000 |
158 | ldr r1, [r0] | 155 | ldr r1, [r0] |
159 | ldreq r2, =(1 << 31) @ IO_RET_REL | 156 | ldreq r2, =(1 << 31) @ IO_RET_REL |
160 | ldrne r2, =((1 << 31) | (1 << 30) | (1 << 29) | (1 << 28)) | 157 | ldrne r2, =((1 << 31) | (1 << 30) | (1 << 29) | (1 << 28)) |
161 | orr r1, r1, r2 | 158 | orr r1, r1, r2 |
162 | /* Do not release retention here for S5PC110 */ | 159 | /* Do not release retention here for S5PC110 */ |
163 | streq r1, [r0] | 160 | streq r1, [r0] |
164 | 161 | ||
165 | /* Disable Watchdog */ | 162 | /* Disable Watchdog */ |
166 | ldreq r0, =S5PC100_WATCHDOG_BASE @ 0xEA200000 | 163 | ldreq r0, =S5PC100_WATCHDOG_BASE @ 0xEA200000 |
167 | ldrne r0, =S5PC110_WATCHDOG_BASE @ 0xE2700000 | 164 | ldrne r0, =S5PC110_WATCHDOG_BASE @ 0xE2700000 |
168 | str r5, [r0] | 165 | str r5, [r0] |
169 | 166 | ||
170 | /* setting SRAM */ | 167 | /* setting SRAM */ |
171 | ldreq r0, =S5PC100_SROMC_BASE | 168 | ldreq r0, =S5PC100_SROMC_BASE |
172 | ldrne r0, =S5PC110_SROMC_BASE | 169 | ldrne r0, =S5PC110_SROMC_BASE |
173 | ldr r1, =0x9 | 170 | ldr r1, =0x9 |
174 | str r1, [r0] | 171 | str r1, [r0] |
175 | 172 | ||
176 | /* S5PC100 has 3 groups of interrupt sources */ | 173 | /* S5PC100 has 3 groups of interrupt sources */ |
177 | ldreq r0, =S5PC100_VIC0_BASE @ 0xE4000000 | 174 | ldreq r0, =S5PC100_VIC0_BASE @ 0xE4000000 |
178 | ldrne r0, =S5PC110_VIC0_BASE @ 0xF2000000 | 175 | ldrne r0, =S5PC110_VIC0_BASE @ 0xF2000000 |
179 | add r1, r0, #0x00100000 | 176 | add r1, r0, #0x00100000 |
180 | add r2, r0, #0x00200000 | 177 | add r2, r0, #0x00200000 |
181 | 178 | ||
182 | /* Disable all interrupts (VIC0, VIC1 and VIC2) */ | 179 | /* Disable all interrupts (VIC0, VIC1 and VIC2) */ |
183 | mvn r3, #0x0 | 180 | mvn r3, #0x0 |
184 | str r3, [r0, #0x14] @ INTENCLEAR | 181 | str r3, [r0, #0x14] @ INTENCLEAR |
185 | str r3, [r1, #0x14] @ INTENCLEAR | 182 | str r3, [r1, #0x14] @ INTENCLEAR |
186 | str r3, [r2, #0x14] @ INTENCLEAR | 183 | str r3, [r2, #0x14] @ INTENCLEAR |
187 | 184 | ||
188 | /* Set all interrupts as IRQ */ | 185 | /* Set all interrupts as IRQ */ |
189 | str r5, [r0, #0xc] @ INTSELECT | 186 | str r5, [r0, #0xc] @ INTSELECT |
190 | str r5, [r1, #0xc] @ INTSELECT | 187 | str r5, [r1, #0xc] @ INTSELECT |
191 | str r5, [r2, #0xc] @ INTSELECT | 188 | str r5, [r2, #0xc] @ INTSELECT |
192 | 189 | ||
193 | /* Pending Interrupt Clear */ | 190 | /* Pending Interrupt Clear */ |
194 | str r5, [r0, #0xf00] @ INTADDRESS | 191 | str r5, [r0, #0xf00] @ INTADDRESS |
195 | str r5, [r1, #0xf00] @ INTADDRESS | 192 | str r5, [r1, #0xf00] @ INTADDRESS |
196 | str r5, [r2, #0xf00] @ INTADDRESS | 193 | str r5, [r2, #0xf00] @ INTADDRESS |
197 | 194 | ||
198 | /* for UART */ | 195 | /* for UART */ |
199 | bl uart_asm_init | 196 | bl uart_asm_init |
200 | 197 | ||
201 | bl internal_ram_init | 198 | bl internal_ram_init |
202 | 199 | ||
203 | cmp r7, r8 | 200 | cmp r7, r8 |
204 | /* Clear wakeup status register */ | 201 | /* Clear wakeup status register */ |
205 | ldreq r0, =S5PC100_WAKEUP_STAT | 202 | ldreq r0, =S5PC100_WAKEUP_STAT |
206 | ldrne r0, =S5PC110_WAKEUP_STAT | 203 | ldrne r0, =S5PC110_WAKEUP_STAT |
207 | ldr r1, [r0] | 204 | ldr r1, [r0] |
208 | str r1, [r0] | 205 | str r1, [r0] |
209 | 206 | ||
210 | /* IO retension release */ | 207 | /* IO retension release */ |
211 | ldreq r0, =S5PC100_OTHERS @ 0xE0108200 | 208 | ldreq r0, =S5PC100_OTHERS @ 0xE0108200 |
212 | ldrne r0, =S5PC110_OTHERS @ 0xE010E000 | 209 | ldrne r0, =S5PC110_OTHERS @ 0xE010E000 |
213 | ldr r1, [r0] | 210 | ldr r1, [r0] |
214 | ldreq r2, =(1 << 31) @ IO_RET_REL | 211 | ldreq r2, =(1 << 31) @ IO_RET_REL |
215 | ldrne r2, =((1 << 31) | (1 << 30) | (1 << 29) | (1 << 28)) | 212 | ldrne r2, =((1 << 31) | (1 << 30) | (1 << 29) | (1 << 28)) |
216 | orr r1, r1, r2 | 213 | orr r1, r1, r2 |
217 | str r1, [r0] | 214 | str r1, [r0] |
218 | 215 | ||
219 | b 1f | 216 | b 1f |
220 | 217 | ||
221 | didle_wakeup: | 218 | didle_wakeup: |
222 | /* Wait when APLL is locked */ | 219 | /* Wait when APLL is locked */ |
223 | ldr r0, =0xE0100100 @ S5PC110_APLL_CON | 220 | ldr r0, =0xE0100100 @ S5PC110_APLL_CON |
224 | lockloop: | 221 | lockloop: |
225 | ldr r1, [r0] | 222 | ldr r1, [r0] |
226 | and r1, r1, #(1 << 29) | 223 | and r1, r1, #(1 << 29) |
227 | cmp r1, #(1 << 29) | 224 | cmp r1, #(1 << 29) |
228 | bne lockloop | 225 | bne lockloop |
229 | 226 | ||
230 | ldr r0, =S5PC110_INFORM0 | 227 | ldr r0, =S5PC110_INFORM0 |
231 | ldr r1, [r0] | 228 | ldr r1, [r0] |
232 | mov pc, r1 | 229 | mov pc, r1 |
233 | nop | 230 | nop |
234 | nop | 231 | nop |
235 | nop | 232 | nop |
236 | nop | 233 | nop |
237 | nop | 234 | nop |
238 | 235 | ||
239 | 1: | 236 | 1: |
240 | mov lr, r11 | 237 | mov lr, r11 |
241 | mov pc, lr | 238 | mov pc, lr |
242 | 239 | ||
243 | /* | 240 | /* |
244 | * system_clock_init: Initialize core clock and bus clock. | 241 | * system_clock_init: Initialize core clock and bus clock. |
245 | * void system_clock_init(void) | 242 | * void system_clock_init(void) |
246 | */ | 243 | */ |
247 | system_clock_init: | 244 | system_clock_init: |
248 | ldr r0, =S5PC110_CLOCK_BASE @ 0xE0100000 | 245 | ldr r0, =S5PC110_CLOCK_BASE @ 0xE0100000 |
249 | 246 | ||
250 | /* Check S5PC100 */ | 247 | /* Check S5PC100 */ |
251 | cmp r7, r8 | 248 | cmp r7, r8 |
252 | bne 110f | 249 | bne 110f |
253 | 100: | 250 | 100: |
254 | /* Set Lock Time */ | 251 | /* Set Lock Time */ |
255 | ldr r1, =0xe10 @ Locktime : 0xe10 = 3600 | 252 | ldr r1, =0xe10 @ Locktime : 0xe10 = 3600 |
256 | str r1, [r0, #0x000] @ S5PC100_APLL_LOCK | 253 | str r1, [r0, #0x000] @ S5PC100_APLL_LOCK |
257 | str r1, [r0, #0x004] @ S5PC100_MPLL_LOCK | 254 | str r1, [r0, #0x004] @ S5PC100_MPLL_LOCK |
258 | str r1, [r0, #0x008] @ S5PC100_EPLL_LOCK | 255 | str r1, [r0, #0x008] @ S5PC100_EPLL_LOCK |
259 | str r1, [r0, #0x00C] @ S5PC100_HPLL_LOCK | 256 | str r1, [r0, #0x00C] @ S5PC100_HPLL_LOCK |
260 | 257 | ||
261 | /* S5P_APLL_CON */ | 258 | /* S5P_APLL_CON */ |
262 | ldr r1, =0x81bc0400 @ SDIV 0, PDIV 4, MDIV 444 (1333MHz) | 259 | ldr r1, =0x81bc0400 @ SDIV 0, PDIV 4, MDIV 444 (1333MHz) |
263 | str r1, [r0, #0x100] | 260 | str r1, [r0, #0x100] |
264 | /* S5P_MPLL_CON */ | 261 | /* S5P_MPLL_CON */ |
265 | ldr r1, =0x80590201 @ SDIV 1, PDIV 2, MDIV 89 (267MHz) | 262 | ldr r1, =0x80590201 @ SDIV 1, PDIV 2, MDIV 89 (267MHz) |
266 | str r1, [r0, #0x104] | 263 | str r1, [r0, #0x104] |
267 | /* S5P_EPLL_CON */ | 264 | /* S5P_EPLL_CON */ |
268 | ldr r1, =0x80870303 @ SDIV 3, PDIV 3, MDIV 135 (67.5MHz) | 265 | ldr r1, =0x80870303 @ SDIV 3, PDIV 3, MDIV 135 (67.5MHz) |
269 | str r1, [r0, #0x108] | 266 | str r1, [r0, #0x108] |
270 | /* S5P_HPLL_CON */ | 267 | /* S5P_HPLL_CON */ |
271 | ldr r1, =0x80600603 @ SDIV 3, PDIV 6, MDIV 96 | 268 | ldr r1, =0x80600603 @ SDIV 3, PDIV 6, MDIV 96 |
272 | str r1, [r0, #0x10C] | 269 | str r1, [r0, #0x10C] |
273 | 270 | ||
274 | ldr r1, [r0, #0x300] | 271 | ldr r1, [r0, #0x300] |
275 | ldr r2, =0x00003fff | 272 | ldr r2, =0x00003fff |
276 | bic r1, r1, r2 | 273 | bic r1, r1, r2 |
277 | ldr r2, =0x00011301 | 274 | ldr r2, =0x00011301 |
278 | 275 | ||
279 | orr r1, r1, r2 | 276 | orr r1, r1, r2 |
280 | str r1, [r0, #0x300] | 277 | str r1, [r0, #0x300] |
281 | ldr r1, [r0, #0x304] | 278 | ldr r1, [r0, #0x304] |
282 | ldr r2, =0x00011110 | 279 | ldr r2, =0x00011110 |
283 | orr r1, r1, r2 | 280 | orr r1, r1, r2 |
284 | str r1, [r0, #0x304] | 281 | str r1, [r0, #0x304] |
285 | ldr r1, =0x00000001 | 282 | ldr r1, =0x00000001 |
286 | str r1, [r0, #0x308] | 283 | str r1, [r0, #0x308] |
287 | 284 | ||
288 | /* Set Source Clock */ | 285 | /* Set Source Clock */ |
289 | ldr r1, =0x00001111 @ A, M, E, HPLL Muxing | 286 | ldr r1, =0x00001111 @ A, M, E, HPLL Muxing |
290 | str r1, [r0, #0x200] @ S5PC1XX_CLK_SRC0 | 287 | str r1, [r0, #0x200] @ S5PC1XX_CLK_SRC0 |
291 | 288 | ||
292 | b 200f | 289 | b 200f |
293 | 110: | 290 | 110: |
294 | ldr r0, =0xE010C000 @ S5PC110_PWR_CFG | 291 | ldr r0, =0xE010C000 @ S5PC110_PWR_CFG |
295 | 292 | ||
296 | /* Set OSC_FREQ value */ | 293 | /* Set OSC_FREQ value */ |
297 | ldr r1, =0xf | 294 | ldr r1, =0xf |
298 | str r1, [r0, #0x100] @ S5PC110_OSC_FREQ | 295 | str r1, [r0, #0x100] @ S5PC110_OSC_FREQ |
299 | 296 | ||
300 | /* Set MTC_STABLE value */ | 297 | /* Set MTC_STABLE value */ |
301 | ldr r1, =0xffffffff | 298 | ldr r1, =0xffffffff |
302 | str r1, [r0, #0x110] @ S5PC110_MTC_STABLE | 299 | str r1, [r0, #0x110] @ S5PC110_MTC_STABLE |
303 | 300 | ||
304 | /* Set CLAMP_STABLE value */ | 301 | /* Set CLAMP_STABLE value */ |
305 | ldr r1, =0x3ff03ff | 302 | ldr r1, =0x3ff03ff |
306 | str r1, [r0, #0x114] @ S5PC110_CLAMP_STABLE | 303 | str r1, [r0, #0x114] @ S5PC110_CLAMP_STABLE |
307 | 304 | ||
308 | ldr r0, =S5PC110_CLOCK_BASE @ 0xE0100000 | 305 | ldr r0, =S5PC110_CLOCK_BASE @ 0xE0100000 |
309 | 306 | ||
310 | /* Set Clock divider */ | 307 | /* Set Clock divider */ |
311 | ldr r1, =0x14131330 @ 1:1:4:4, 1:4:5 | 308 | ldr r1, =0x14131330 @ 1:1:4:4, 1:4:5 |
312 | str r1, [r0, #0x300] | 309 | str r1, [r0, #0x300] |
313 | ldr r1, =0x11110111 @ UART[3210]: MMC[3210] | 310 | ldr r1, =0x11110111 @ UART[3210]: MMC[3210] |
314 | str r1, [r0, #0x310] | 311 | str r1, [r0, #0x310] |
315 | 312 | ||
316 | /* Set Lock Time */ | 313 | /* Set Lock Time */ |
317 | ldr r1, =0x2cf @ Locktime : 30us | 314 | ldr r1, =0x2cf @ Locktime : 30us |
318 | str r1, [r0, #0x000] @ S5PC110_APLL_LOCK | 315 | str r1, [r0, #0x000] @ S5PC110_APLL_LOCK |
319 | ldr r1, =0xe10 @ Locktime : 0xe10 = 3600 | 316 | ldr r1, =0xe10 @ Locktime : 0xe10 = 3600 |
320 | str r1, [r0, #0x008] @ S5PC110_MPLL_LOCK | 317 | str r1, [r0, #0x008] @ S5PC110_MPLL_LOCK |
321 | str r1, [r0, #0x010] @ S5PC110_EPLL_LOCK | 318 | str r1, [r0, #0x010] @ S5PC110_EPLL_LOCK |
322 | str r1, [r0, #0x020] @ S5PC110_VPLL_LOCK | 319 | str r1, [r0, #0x020] @ S5PC110_VPLL_LOCK |
323 | 320 | ||
324 | /* S5PC110_APLL_CON */ | 321 | /* S5PC110_APLL_CON */ |
325 | ldr r1, =0x80C80601 @ 800MHz | 322 | ldr r1, =0x80C80601 @ 800MHz |
326 | str r1, [r0, #0x100] | 323 | str r1, [r0, #0x100] |
327 | /* S5PC110_MPLL_CON */ | 324 | /* S5PC110_MPLL_CON */ |
328 | ldr r1, =0x829B0C01 @ 667MHz | 325 | ldr r1, =0x829B0C01 @ 667MHz |
329 | str r1, [r0, #0x108] | 326 | str r1, [r0, #0x108] |
330 | /* S5PC110_EPLL_CON */ | 327 | /* S5PC110_EPLL_CON */ |
331 | ldr r1, =0x80600602 @ 96MHz VSEL 0 P 6 M 96 S 2 | 328 | ldr r1, =0x80600602 @ 96MHz VSEL 0 P 6 M 96 S 2 |
332 | str r1, [r0, #0x110] | 329 | str r1, [r0, #0x110] |
333 | /* S5PC110_VPLL_CON */ | 330 | /* S5PC110_VPLL_CON */ |
334 | ldr r1, =0x806C0603 @ 54MHz | 331 | ldr r1, =0x806C0603 @ 54MHz |
335 | str r1, [r0, #0x120] | 332 | str r1, [r0, #0x120] |
336 | 333 | ||
337 | /* Set Source Clock */ | 334 | /* Set Source Clock */ |
338 | ldr r1, =0x10001111 @ A, M, E, VPLL Muxing | 335 | ldr r1, =0x10001111 @ A, M, E, VPLL Muxing |
339 | str r1, [r0, #0x200] @ S5PC1XX_CLK_SRC0 | 336 | str r1, [r0, #0x200] @ S5PC1XX_CLK_SRC0 |
340 | 337 | ||
341 | /* OneDRAM(DMC0) clock setting */ | 338 | /* OneDRAM(DMC0) clock setting */ |
342 | ldr r1, =0x01000000 @ ONEDRAM_SEL[25:24] 1 SCLKMPLL | 339 | ldr r1, =0x01000000 @ ONEDRAM_SEL[25:24] 1 SCLKMPLL |
343 | str r1, [r0, #0x218] @ S5PC110_CLK_SRC6 | 340 | str r1, [r0, #0x218] @ S5PC110_CLK_SRC6 |
344 | ldr r1, =0x30000000 @ ONEDRAM_RATIO[31:28] 3 + 1 | 341 | ldr r1, =0x30000000 @ ONEDRAM_RATIO[31:28] 3 + 1 |
345 | str r1, [r0, #0x318] @ S5PC110_CLK_DIV6 | 342 | str r1, [r0, #0x318] @ S5PC110_CLK_DIV6 |
346 | 343 | ||
347 | /* XCLKOUT = XUSBXTI 24MHz */ | 344 | /* XCLKOUT = XUSBXTI 24MHz */ |
348 | add r2, r0, #0xE000 @ S5PC110_OTHERS | 345 | add r2, r0, #0xE000 @ S5PC110_OTHERS |
349 | ldr r1, [r2] | 346 | ldr r1, [r2] |
350 | orr r1, r1, #(0x3 << 8) @ CLKOUT[9:8] 3 XUSBXTI | 347 | orr r1, r1, #(0x3 << 8) @ CLKOUT[9:8] 3 XUSBXTI |
351 | str r1, [r2] | 348 | str r1, [r2] |
352 | 349 | ||
353 | /* CLK_IP0 */ | 350 | /* CLK_IP0 */ |
354 | ldr r1, =0x8fefeeb @ DMC[1:0] PDMA0[3] IMEM[5] | 351 | ldr r1, =0x8fefeeb @ DMC[1:0] PDMA0[3] IMEM[5] |
355 | str r1, [r0, #0x460] @ S5PC110_CLK_IP0 | 352 | str r1, [r0, #0x460] @ S5PC110_CLK_IP0 |
356 | 353 | ||
357 | /* CLK_IP1 */ | 354 | /* CLK_IP1 */ |
358 | ldr r1, =0xe9fdf0f9 @ FIMD[0] USBOTG[16] | 355 | ldr r1, =0xe9fdf0f9 @ FIMD[0] USBOTG[16] |
359 | @ NANDXL[24] | 356 | @ NANDXL[24] |
360 | str r1, [r0, #0x464] @ S5PC110_CLK_IP1 | 357 | str r1, [r0, #0x464] @ S5PC110_CLK_IP1 |
361 | 358 | ||
362 | /* CLK_IP2 */ | 359 | /* CLK_IP2 */ |
363 | ldr r1, =0xf75f7fc @ CORESIGHT[8] MODEM[9] | 360 | ldr r1, =0xf75f7fc @ CORESIGHT[8] MODEM[9] |
364 | @ HOSTIF[10] HSMMC0[16] | 361 | @ HOSTIF[10] HSMMC0[16] |
365 | @ HSMMC2[18] VIC[27:24] | 362 | @ HSMMC2[18] VIC[27:24] |
366 | str r1, [r0, #0x468] @ S5PC110_CLK_IP2 | 363 | str r1, [r0, #0x468] @ S5PC110_CLK_IP2 |
367 | 364 | ||
368 | /* CLK_IP3 */ | 365 | /* CLK_IP3 */ |
369 | ldr r1, =0x8eff038c @ I2C[8:6] | 366 | ldr r1, =0x8eff038c @ I2C[8:6] |
370 | @ SYSTIMER[16] UART0[17] | 367 | @ SYSTIMER[16] UART0[17] |
371 | @ UART1[18] UART2[19] | 368 | @ UART1[18] UART2[19] |
372 | @ UART3[20] WDT[22] | 369 | @ UART3[20] WDT[22] |
373 | @ PWM[23] GPIO[26] SYSCON[27] | 370 | @ PWM[23] GPIO[26] SYSCON[27] |
374 | str r1, [r0, #0x46c] @ S5PC110_CLK_IP3 | 371 | str r1, [r0, #0x46c] @ S5PC110_CLK_IP3 |
375 | 372 | ||
376 | /* CLK_IP4 */ | 373 | /* CLK_IP4 */ |
377 | ldr r1, =0xfffffff1 @ CHIP_ID[0] TZPC[8:5] | 374 | ldr r1, =0xfffffff1 @ CHIP_ID[0] TZPC[8:5] |
378 | str r1, [r0, #0x470] @ S5PC110_CLK_IP3 | 375 | str r1, [r0, #0x470] @ S5PC110_CLK_IP3 |
379 | 376 | ||
380 | 200: | 377 | 200: |
381 | /* wait at least 200us to stablize all clock */ | 378 | /* wait at least 200us to stablize all clock */ |
382 | mov r2, #0x10000 | 379 | mov r2, #0x10000 |
383 | 1: subs r2, r2, #1 | 380 | 1: subs r2, r2, #1 |
384 | bne 1b | 381 | bne 1b |
385 | 382 | ||
386 | mov pc, lr | 383 | mov pc, lr |
387 | 384 | ||
388 | internal_ram_init: | 385 | internal_ram_init: |
389 | ldreq r0, =0xE3800000 | 386 | ldreq r0, =0xE3800000 |
390 | ldrne r0, =0xF1500000 | 387 | ldrne r0, =0xF1500000 |
391 | ldr r1, =0x0 | 388 | ldr r1, =0x0 |
392 | str r1, [r0] | 389 | str r1, [r0] |
393 | 390 | ||
394 | mov pc, lr | 391 | mov pc, lr |
395 | 392 | ||
396 | /* | 393 | /* |
397 | * uart_asm_init: Initialize UART's pins | 394 | * uart_asm_init: Initialize UART's pins |
398 | */ | 395 | */ |
399 | uart_asm_init: | 396 | uart_asm_init: |
400 | /* set GPIO to enable UART0-UART4 */ | 397 | /* set GPIO to enable UART0-UART4 */ |
401 | mov r0, r8 | 398 | mov r0, r8 |
402 | ldr r1, =0x22222222 | 399 | ldr r1, =0x22222222 |
403 | str r1, [r0, #0x0] @ S5PC100_GPIO_A0_OFFSET | 400 | str r1, [r0, #0x0] @ S5PC100_GPIO_A0_OFFSET |
404 | ldr r1, =0x00002222 | 401 | ldr r1, =0x00002222 |
405 | str r1, [r0, #0x20] @ S5PC100_GPIO_A1_OFFSET | 402 | str r1, [r0, #0x20] @ S5PC100_GPIO_A1_OFFSET |
406 | 403 | ||
407 | /* Check S5PC100 */ | 404 | /* Check S5PC100 */ |
408 | cmp r7, r8 | 405 | cmp r7, r8 |
409 | bne 110f | 406 | bne 110f |
410 | 407 | ||
411 | /* UART_SEL GPK0[5] at S5PC100 */ | 408 | /* UART_SEL GPK0[5] at S5PC100 */ |
412 | add r0, r8, #0x2A0 @ S5PC100_GPIO_K0_OFFSET | 409 | add r0, r8, #0x2A0 @ S5PC100_GPIO_K0_OFFSET |
413 | ldr r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET | 410 | ldr r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET |
414 | bic r1, r1, #(0xf << 20) @ 20 = 5 * 4-bit | 411 | bic r1, r1, #(0xf << 20) @ 20 = 5 * 4-bit |
415 | orr r1, r1, #(0x1 << 20) @ Output | 412 | orr r1, r1, #(0x1 << 20) @ Output |
416 | str r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET | 413 | str r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET |
417 | 414 | ||
418 | ldr r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET | 415 | ldr r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET |
419 | bic r1, r1, #(0x3 << 10) @ 10 = 5 * 2-bit | 416 | bic r1, r1, #(0x3 << 10) @ 10 = 5 * 2-bit |
420 | orr r1, r1, #(0x2 << 10) @ Pull-up enabled | 417 | orr r1, r1, #(0x2 << 10) @ Pull-up enabled |
421 | str r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET | 418 | str r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET |
422 | 419 | ||
423 | ldr r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET | 420 | ldr r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET |
424 | orr r1, r1, #(1 << 5) @ 5 = 5 * 1-bit | 421 | orr r1, r1, #(1 << 5) @ 5 = 5 * 1-bit |
425 | str r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET | 422 | str r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET |
426 | 423 | ||
427 | b 200f | 424 | b 200f |
428 | 110: | 425 | 110: |
429 | /* | 426 | /* |
430 | * Note that the following address | 427 | * Note that the following address |
431 | * 0xE020'0360 is reserved address at S5PC100 | 428 | * 0xE020'0360 is reserved address at S5PC100 |
432 | */ | 429 | */ |
433 | /* UART_SEL MP0_5[7] at S5PC110 */ | 430 | /* UART_SEL MP0_5[7] at S5PC110 */ |
434 | add r0, r8, #0x360 @ S5PC110_GPIO_MP0_5_OFFSET | 431 | add r0, r8, #0x360 @ S5PC110_GPIO_MP0_5_OFFSET |
435 | ldr r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET | 432 | ldr r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET |
436 | bic r1, r1, #(0xf << 28) @ 28 = 7 * 4-bit | 433 | bic r1, r1, #(0xf << 28) @ 28 = 7 * 4-bit |
437 | orr r1, r1, #(0x1 << 28) @ Output | 434 | orr r1, r1, #(0x1 << 28) @ Output |
438 | str r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET | 435 | str r1, [r0, #0x0] @ S5PC1XX_GPIO_CON_OFFSET |
439 | 436 | ||
440 | ldr r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET | 437 | ldr r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET |
441 | bic r1, r1, #(0x3 << 14) @ 14 = 7 * 2-bit | 438 | bic r1, r1, #(0x3 << 14) @ 14 = 7 * 2-bit |
442 | orr r1, r1, #(0x2 << 14) @ Pull-up enabled | 439 | orr r1, r1, #(0x2 << 14) @ Pull-up enabled |
443 | str r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET | 440 | str r1, [r0, #0x8] @ S5PC1XX_GPIO_PULL_OFFSET |
444 | 441 | ||
445 | ldr r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET | 442 | ldr r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET |
446 | orr r1, r1, #(1 << 7) @ 7 = 7 * 1-bit | 443 | orr r1, r1, #(1 << 7) @ 7 = 7 * 1-bit |
447 | str r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET | 444 | str r1, [r0, #0x4] @ S5PC1XX_GPIO_DAT_OFFSET |
448 | 200: | 445 | 200: |
449 | mov pc, lr | 446 | mov pc, lr |
450 | 447 |
board/samsung/smdk2410/lowlevel_init.S
1 | /* | 1 | /* |
2 | * Memory Setup stuff - taken from blob memsetup.S | 2 | * Memory Setup stuff - taken from blob memsetup.S |
3 | * | 3 | * |
4 | * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and | 4 | * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and |
5 | * Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl) | 5 | * Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl) |
6 | * | 6 | * |
7 | * Modified for the Samsung SMDK2410 by | 7 | * Modified for the Samsung SMDK2410 by |
8 | * (C) Copyright 2002 | 8 | * (C) Copyright 2002 |
9 | * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch> | 9 | * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch> |
10 | * | 10 | * |
11 | * SPDX-License-Identifier: GPL-2.0+ | 11 | * SPDX-License-Identifier: GPL-2.0+ |
12 | */ | 12 | */ |
13 | 13 | ||
14 | 14 | ||
15 | #include <config.h> | 15 | #include <config.h> |
16 | #include <version.h> | 16 | #include <version.h> |
17 | 17 | ||
18 | 18 | ||
19 | /* some parameters for the board */ | 19 | /* some parameters for the board */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * | 22 | * |
23 | * Taken from linux/arch/arm/boot/compressed/head-s3c2410.S | 23 | * Taken from linux/arch/arm/boot/compressed/head-s3c2410.S |
24 | * | 24 | * |
25 | * Copyright (C) 2002 Samsung Electronics SW.LEE <hitchcar@sec.samsung.com> | 25 | * Copyright (C) 2002 Samsung Electronics SW.LEE <hitchcar@sec.samsung.com> |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define BWSCON 0x48000000 | 29 | #define BWSCON 0x48000000 |
30 | 30 | ||
31 | /* BWSCON */ | 31 | /* BWSCON */ |
32 | #define DW8 (0x0) | 32 | #define DW8 (0x0) |
33 | #define DW16 (0x1) | 33 | #define DW16 (0x1) |
34 | #define DW32 (0x2) | 34 | #define DW32 (0x2) |
35 | #define WAIT (0x1<<2) | 35 | #define WAIT (0x1<<2) |
36 | #define UBLB (0x1<<3) | 36 | #define UBLB (0x1<<3) |
37 | 37 | ||
38 | #define B1_BWSCON (DW32) | 38 | #define B1_BWSCON (DW32) |
39 | #define B2_BWSCON (DW16) | 39 | #define B2_BWSCON (DW16) |
40 | #define B3_BWSCON (DW16 + WAIT + UBLB) | 40 | #define B3_BWSCON (DW16 + WAIT + UBLB) |
41 | #define B4_BWSCON (DW16) | 41 | #define B4_BWSCON (DW16) |
42 | #define B5_BWSCON (DW16) | 42 | #define B5_BWSCON (DW16) |
43 | #define B6_BWSCON (DW32) | 43 | #define B6_BWSCON (DW32) |
44 | #define B7_BWSCON (DW32) | 44 | #define B7_BWSCON (DW32) |
45 | 45 | ||
46 | /* BANK0CON */ | 46 | /* BANK0CON */ |
47 | #define B0_Tacs 0x0 /* 0clk */ | 47 | #define B0_Tacs 0x0 /* 0clk */ |
48 | #define B0_Tcos 0x0 /* 0clk */ | 48 | #define B0_Tcos 0x0 /* 0clk */ |
49 | #define B0_Tacc 0x7 /* 14clk */ | 49 | #define B0_Tacc 0x7 /* 14clk */ |
50 | #define B0_Tcoh 0x0 /* 0clk */ | 50 | #define B0_Tcoh 0x0 /* 0clk */ |
51 | #define B0_Tah 0x0 /* 0clk */ | 51 | #define B0_Tah 0x0 /* 0clk */ |
52 | #define B0_Tacp 0x0 | 52 | #define B0_Tacp 0x0 |
53 | #define B0_PMC 0x0 /* normal */ | 53 | #define B0_PMC 0x0 /* normal */ |
54 | 54 | ||
55 | /* BANK1CON */ | 55 | /* BANK1CON */ |
56 | #define B1_Tacs 0x0 /* 0clk */ | 56 | #define B1_Tacs 0x0 /* 0clk */ |
57 | #define B1_Tcos 0x0 /* 0clk */ | 57 | #define B1_Tcos 0x0 /* 0clk */ |
58 | #define B1_Tacc 0x7 /* 14clk */ | 58 | #define B1_Tacc 0x7 /* 14clk */ |
59 | #define B1_Tcoh 0x0 /* 0clk */ | 59 | #define B1_Tcoh 0x0 /* 0clk */ |
60 | #define B1_Tah 0x0 /* 0clk */ | 60 | #define B1_Tah 0x0 /* 0clk */ |
61 | #define B1_Tacp 0x0 | 61 | #define B1_Tacp 0x0 |
62 | #define B1_PMC 0x0 | 62 | #define B1_PMC 0x0 |
63 | 63 | ||
64 | #define B2_Tacs 0x0 | 64 | #define B2_Tacs 0x0 |
65 | #define B2_Tcos 0x0 | 65 | #define B2_Tcos 0x0 |
66 | #define B2_Tacc 0x7 | 66 | #define B2_Tacc 0x7 |
67 | #define B2_Tcoh 0x0 | 67 | #define B2_Tcoh 0x0 |
68 | #define B2_Tah 0x0 | 68 | #define B2_Tah 0x0 |
69 | #define B2_Tacp 0x0 | 69 | #define B2_Tacp 0x0 |
70 | #define B2_PMC 0x0 | 70 | #define B2_PMC 0x0 |
71 | 71 | ||
72 | #define B3_Tacs 0x0 /* 0clk */ | 72 | #define B3_Tacs 0x0 /* 0clk */ |
73 | #define B3_Tcos 0x3 /* 4clk */ | 73 | #define B3_Tcos 0x3 /* 4clk */ |
74 | #define B3_Tacc 0x7 /* 14clk */ | 74 | #define B3_Tacc 0x7 /* 14clk */ |
75 | #define B3_Tcoh 0x1 /* 1clk */ | 75 | #define B3_Tcoh 0x1 /* 1clk */ |
76 | #define B3_Tah 0x0 /* 0clk */ | 76 | #define B3_Tah 0x0 /* 0clk */ |
77 | #define B3_Tacp 0x3 /* 6clk */ | 77 | #define B3_Tacp 0x3 /* 6clk */ |
78 | #define B3_PMC 0x0 /* normal */ | 78 | #define B3_PMC 0x0 /* normal */ |
79 | 79 | ||
80 | #define B4_Tacs 0x0 /* 0clk */ | 80 | #define B4_Tacs 0x0 /* 0clk */ |
81 | #define B4_Tcos 0x0 /* 0clk */ | 81 | #define B4_Tcos 0x0 /* 0clk */ |
82 | #define B4_Tacc 0x7 /* 14clk */ | 82 | #define B4_Tacc 0x7 /* 14clk */ |
83 | #define B4_Tcoh 0x0 /* 0clk */ | 83 | #define B4_Tcoh 0x0 /* 0clk */ |
84 | #define B4_Tah 0x0 /* 0clk */ | 84 | #define B4_Tah 0x0 /* 0clk */ |
85 | #define B4_Tacp 0x0 | 85 | #define B4_Tacp 0x0 |
86 | #define B4_PMC 0x0 /* normal */ | 86 | #define B4_PMC 0x0 /* normal */ |
87 | 87 | ||
88 | #define B5_Tacs 0x0 /* 0clk */ | 88 | #define B5_Tacs 0x0 /* 0clk */ |
89 | #define B5_Tcos 0x0 /* 0clk */ | 89 | #define B5_Tcos 0x0 /* 0clk */ |
90 | #define B5_Tacc 0x7 /* 14clk */ | 90 | #define B5_Tacc 0x7 /* 14clk */ |
91 | #define B5_Tcoh 0x0 /* 0clk */ | 91 | #define B5_Tcoh 0x0 /* 0clk */ |
92 | #define B5_Tah 0x0 /* 0clk */ | 92 | #define B5_Tah 0x0 /* 0clk */ |
93 | #define B5_Tacp 0x0 | 93 | #define B5_Tacp 0x0 |
94 | #define B5_PMC 0x0 /* normal */ | 94 | #define B5_PMC 0x0 /* normal */ |
95 | 95 | ||
96 | #define B6_MT 0x3 /* SDRAM */ | 96 | #define B6_MT 0x3 /* SDRAM */ |
97 | #define B6_Trcd 0x1 | 97 | #define B6_Trcd 0x1 |
98 | #define B6_SCAN 0x1 /* 9bit */ | 98 | #define B6_SCAN 0x1 /* 9bit */ |
99 | 99 | ||
100 | #define B7_MT 0x3 /* SDRAM */ | 100 | #define B7_MT 0x3 /* SDRAM */ |
101 | #define B7_Trcd 0x1 /* 3clk */ | 101 | #define B7_Trcd 0x1 /* 3clk */ |
102 | #define B7_SCAN 0x1 /* 9bit */ | 102 | #define B7_SCAN 0x1 /* 9bit */ |
103 | 103 | ||
104 | /* REFRESH parameter */ | 104 | /* REFRESH parameter */ |
105 | #define REFEN 0x1 /* Refresh enable */ | 105 | #define REFEN 0x1 /* Refresh enable */ |
106 | #define TREFMD 0x0 /* CBR(CAS before RAS)/Auto refresh */ | 106 | #define TREFMD 0x0 /* CBR(CAS before RAS)/Auto refresh */ |
107 | #define Trp 0x0 /* 2clk */ | 107 | #define Trp 0x0 /* 2clk */ |
108 | #define Trc 0x3 /* 7clk */ | 108 | #define Trc 0x3 /* 7clk */ |
109 | #define Tchr 0x2 /* 3clk */ | 109 | #define Tchr 0x2 /* 3clk */ |
110 | #define REFCNT 1113 /* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */ | 110 | #define REFCNT 1113 /* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */ |
111 | /**************************************/ | 111 | /**************************************/ |
112 | 112 | ||
113 | _TEXT_BASE: | ||
114 | .word CONFIG_SYS_TEXT_BASE | ||
115 | |||
116 | .globl lowlevel_init | 113 | .globl lowlevel_init |
117 | lowlevel_init: | 114 | lowlevel_init: |
118 | /* memory control configuration */ | 115 | /* memory control configuration */ |
119 | /* make r0 relative the current location so that it */ | 116 | /* make r0 relative the current location so that it */ |
120 | /* reads SMRDATA out of FLASH rather than memory ! */ | 117 | /* reads SMRDATA out of FLASH rather than memory ! */ |
121 | ldr r0, =SMRDATA | 118 | ldr r0, =SMRDATA |
122 | ldr r1, _TEXT_BASE | 119 | ldr r1, =CONFIG_SYS_TEXT_BASE |
123 | sub r0, r0, r1 | 120 | sub r0, r0, r1 |
124 | ldr r1, =BWSCON /* Bus Width Status Controller */ | 121 | ldr r1, =BWSCON /* Bus Width Status Controller */ |
125 | add r2, r0, #13*4 | 122 | add r2, r0, #13*4 |
126 | 0: | 123 | 0: |
127 | ldr r3, [r0], #4 | 124 | ldr r3, [r0], #4 |
128 | str r3, [r1], #4 | 125 | str r3, [r1], #4 |
129 | cmp r2, r0 | 126 | cmp r2, r0 |
130 | bne 0b | 127 | bne 0b |
131 | 128 | ||
132 | /* everything is fine now */ | 129 | /* everything is fine now */ |
133 | mov pc, lr | 130 | mov pc, lr |
134 | 131 | ||
135 | .ltorg | 132 | .ltorg |
136 | /* the literal pools origin */ | 133 | /* the literal pools origin */ |
137 | 134 | ||
138 | SMRDATA: | 135 | SMRDATA: |
139 | .word (0+(B1_BWSCON<<4)+(B2_BWSCON<<8)+(B3_BWSCON<<12)+(B4_BWSCON<<16)+(B5_BWSCON<<20)+(B6_BWSCON<<24)+(B7_BWSCON<<28)) | 136 | .word (0+(B1_BWSCON<<4)+(B2_BWSCON<<8)+(B3_BWSCON<<12)+(B4_BWSCON<<16)+(B5_BWSCON<<20)+(B6_BWSCON<<24)+(B7_BWSCON<<28)) |
140 | .word ((B0_Tacs<<13)+(B0_Tcos<<11)+(B0_Tacc<<8)+(B0_Tcoh<<6)+(B0_Tah<<4)+(B0_Tacp<<2)+(B0_PMC)) | 137 | .word ((B0_Tacs<<13)+(B0_Tcos<<11)+(B0_Tacc<<8)+(B0_Tcoh<<6)+(B0_Tah<<4)+(B0_Tacp<<2)+(B0_PMC)) |
141 | .word ((B1_Tacs<<13)+(B1_Tcos<<11)+(B1_Tacc<<8)+(B1_Tcoh<<6)+(B1_Tah<<4)+(B1_Tacp<<2)+(B1_PMC)) | 138 | .word ((B1_Tacs<<13)+(B1_Tcos<<11)+(B1_Tacc<<8)+(B1_Tcoh<<6)+(B1_Tah<<4)+(B1_Tacp<<2)+(B1_PMC)) |
142 | .word ((B2_Tacs<<13)+(B2_Tcos<<11)+(B2_Tacc<<8)+(B2_Tcoh<<6)+(B2_Tah<<4)+(B2_Tacp<<2)+(B2_PMC)) | 139 | .word ((B2_Tacs<<13)+(B2_Tcos<<11)+(B2_Tacc<<8)+(B2_Tcoh<<6)+(B2_Tah<<4)+(B2_Tacp<<2)+(B2_PMC)) |
143 | .word ((B3_Tacs<<13)+(B3_Tcos<<11)+(B3_Tacc<<8)+(B3_Tcoh<<6)+(B3_Tah<<4)+(B3_Tacp<<2)+(B3_PMC)) | 140 | .word ((B3_Tacs<<13)+(B3_Tcos<<11)+(B3_Tacc<<8)+(B3_Tcoh<<6)+(B3_Tah<<4)+(B3_Tacp<<2)+(B3_PMC)) |
144 | .word ((B4_Tacs<<13)+(B4_Tcos<<11)+(B4_Tacc<<8)+(B4_Tcoh<<6)+(B4_Tah<<4)+(B4_Tacp<<2)+(B4_PMC)) | 141 | .word ((B4_Tacs<<13)+(B4_Tcos<<11)+(B4_Tacc<<8)+(B4_Tcoh<<6)+(B4_Tah<<4)+(B4_Tacp<<2)+(B4_PMC)) |
145 | .word ((B5_Tacs<<13)+(B5_Tcos<<11)+(B5_Tacc<<8)+(B5_Tcoh<<6)+(B5_Tah<<4)+(B5_Tacp<<2)+(B5_PMC)) | 142 | .word ((B5_Tacs<<13)+(B5_Tcos<<11)+(B5_Tacc<<8)+(B5_Tcoh<<6)+(B5_Tah<<4)+(B5_Tacp<<2)+(B5_PMC)) |
146 | .word ((B6_MT<<15)+(B6_Trcd<<2)+(B6_SCAN)) | 143 | .word ((B6_MT<<15)+(B6_Trcd<<2)+(B6_SCAN)) |
147 | .word ((B7_MT<<15)+(B7_Trcd<<2)+(B7_SCAN)) | 144 | .word ((B7_MT<<15)+(B7_Trcd<<2)+(B7_SCAN)) |
148 | .word ((REFEN<<23)+(TREFMD<<22)+(Trp<<20)+(Trc<<18)+(Tchr<<16)+REFCNT) | 145 | .word ((REFEN<<23)+(TREFMD<<22)+(Trp<<20)+(Trc<<18)+(Tchr<<16)+REFCNT) |
149 | .word 0x32 | 146 | .word 0x32 |
150 | .word 0x30 | 147 | .word 0x30 |
151 | .word 0x30 | 148 | .word 0x30 |
152 | 149 |
board/samsung/smdkc100/lowlevel_init.S
1 | /* | 1 | /* |
2 | * Copyright (C) 2009 Samsung Electronics | 2 | * Copyright (C) 2009 Samsung Electronics |
3 | * Kyungmin Park <kyungmin.park@samsung.com> | 3 | * Kyungmin Park <kyungmin.park@samsung.com> |
4 | * Minkyu Kang <mk7.kang@samsung.com> | 4 | * Minkyu Kang <mk7.kang@samsung.com> |
5 | * | 5 | * |
6 | * SPDX-License-Identifier: GPL-2.0+ | 6 | * SPDX-License-Identifier: GPL-2.0+ |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <config.h> | 9 | #include <config.h> |
10 | #include <version.h> | 10 | #include <version.h> |
11 | #include <asm/arch/cpu.h> | 11 | #include <asm/arch/cpu.h> |
12 | #include <asm/arch/power.h> | 12 | #include <asm/arch/power.h> |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * Register usages: | 15 | * Register usages: |
16 | * | 16 | * |
17 | * r5 has zero always | 17 | * r5 has zero always |
18 | */ | 18 | */ |
19 | 19 | ||
20 | _TEXT_BASE: | ||
21 | .word CONFIG_SYS_TEXT_BASE | ||
22 | |||
23 | .globl lowlevel_init | 20 | .globl lowlevel_init |
24 | lowlevel_init: | 21 | lowlevel_init: |
25 | mov r9, lr | 22 | mov r9, lr |
26 | 23 | ||
27 | /* r5 has always zero */ | 24 | /* r5 has always zero */ |
28 | mov r5, #0 | 25 | mov r5, #0 |
29 | 26 | ||
30 | ldr r8, =S5PC100_GPIO_BASE | 27 | ldr r8, =S5PC100_GPIO_BASE |
31 | 28 | ||
32 | /* Disable Watchdog */ | 29 | /* Disable Watchdog */ |
33 | ldr r0, =S5PC100_WATCHDOG_BASE @0xEA200000 | 30 | ldr r0, =S5PC100_WATCHDOG_BASE @0xEA200000 |
34 | orr r0, r0, #0x0 | 31 | orr r0, r0, #0x0 |
35 | str r5, [r0] | 32 | str r5, [r0] |
36 | 33 | ||
37 | /* setting SRAM */ | 34 | /* setting SRAM */ |
38 | ldr r0, =S5PC100_SROMC_BASE | 35 | ldr r0, =S5PC100_SROMC_BASE |
39 | ldr r1, =0x9 | 36 | ldr r1, =0x9 |
40 | str r1, [r0] | 37 | str r1, [r0] |
41 | 38 | ||
42 | /* S5PC100 has 3 groups of interrupt sources */ | 39 | /* S5PC100 has 3 groups of interrupt sources */ |
43 | ldr r0, =S5PC100_VIC0_BASE @0xE4000000 | 40 | ldr r0, =S5PC100_VIC0_BASE @0xE4000000 |
44 | ldr r1, =S5PC100_VIC1_BASE @0xE4000000 | 41 | ldr r1, =S5PC100_VIC1_BASE @0xE4000000 |
45 | ldr r2, =S5PC100_VIC2_BASE @0xE4000000 | 42 | ldr r2, =S5PC100_VIC2_BASE @0xE4000000 |
46 | 43 | ||
47 | /* Disable all interrupts (VIC0, VIC1 and VIC2) */ | 44 | /* Disable all interrupts (VIC0, VIC1 and VIC2) */ |
48 | mvn r3, #0x0 | 45 | mvn r3, #0x0 |
49 | str r3, [r0, #0x14] @INTENCLEAR | 46 | str r3, [r0, #0x14] @INTENCLEAR |
50 | str r3, [r1, #0x14] @INTENCLEAR | 47 | str r3, [r1, #0x14] @INTENCLEAR |
51 | str r3, [r2, #0x14] @INTENCLEAR | 48 | str r3, [r2, #0x14] @INTENCLEAR |
52 | 49 | ||
53 | /* Set all interrupts as IRQ */ | 50 | /* Set all interrupts as IRQ */ |
54 | str r5, [r0, #0xc] @INTSELECT | 51 | str r5, [r0, #0xc] @INTSELECT |
55 | str r5, [r1, #0xc] @INTSELECT | 52 | str r5, [r1, #0xc] @INTSELECT |
56 | str r5, [r2, #0xc] @INTSELECT | 53 | str r5, [r2, #0xc] @INTSELECT |
57 | 54 | ||
58 | /* Pending Interrupt Clear */ | 55 | /* Pending Interrupt Clear */ |
59 | str r5, [r0, #0xf00] @INTADDRESS | 56 | str r5, [r0, #0xf00] @INTADDRESS |
60 | str r5, [r1, #0xf00] @INTADDRESS | 57 | str r5, [r1, #0xf00] @INTADDRESS |
61 | str r5, [r2, #0xf00] @INTADDRESS | 58 | str r5, [r2, #0xf00] @INTADDRESS |
62 | 59 | ||
63 | /* for UART */ | 60 | /* for UART */ |
64 | bl uart_asm_init | 61 | bl uart_asm_init |
65 | 62 | ||
66 | /* for TZPC */ | 63 | /* for TZPC */ |
67 | bl tzpc_asm_init | 64 | bl tzpc_asm_init |
68 | 65 | ||
69 | 1: | 66 | 1: |
70 | mov lr, r9 | 67 | mov lr, r9 |
71 | mov pc, lr | 68 | mov pc, lr |
72 | 69 | ||
73 | /* | 70 | /* |
74 | * system_clock_init: Initialize core clock and bus clock. | 71 | * system_clock_init: Initialize core clock and bus clock. |
75 | * void system_clock_init(void) | 72 | * void system_clock_init(void) |
76 | */ | 73 | */ |
77 | system_clock_init: | 74 | system_clock_init: |
78 | ldr r8, =S5PC100_CLOCK_BASE @ 0xE0100000 | 75 | ldr r8, =S5PC100_CLOCK_BASE @ 0xE0100000 |
79 | 76 | ||
80 | /* Set Clock divider */ | 77 | /* Set Clock divider */ |
81 | ldr r1, =0x00011110 | 78 | ldr r1, =0x00011110 |
82 | str r1, [r8, #0x304] | 79 | str r1, [r8, #0x304] |
83 | ldr r1, =0x1 | 80 | ldr r1, =0x1 |
84 | str r1, [r8, #0x308] | 81 | str r1, [r8, #0x308] |
85 | ldr r1, =0x00011301 | 82 | ldr r1, =0x00011301 |
86 | str r1, [r8, #0x300] | 83 | str r1, [r8, #0x300] |
87 | 84 | ||
88 | /* Set Lock Time */ | 85 | /* Set Lock Time */ |
89 | ldr r1, =0xe10 @ Locktime : 0xe10 = 3600 | 86 | ldr r1, =0xe10 @ Locktime : 0xe10 = 3600 |
90 | str r1, [r8, #0x000] @ APLL_LOCK | 87 | str r1, [r8, #0x000] @ APLL_LOCK |
91 | str r1, [r8, #0x004] @ MPLL_LOCK | 88 | str r1, [r8, #0x004] @ MPLL_LOCK |
92 | str r1, [r8, #0x008] @ EPLL_LOCK | 89 | str r1, [r8, #0x008] @ EPLL_LOCK |
93 | str r1, [r8, #0x00C] @ HPLL_LOCK | 90 | str r1, [r8, #0x00C] @ HPLL_LOCK |
94 | 91 | ||
95 | /* APLL_CON */ | 92 | /* APLL_CON */ |
96 | ldr r1, =0x81bc0400 @ SDIV 0, PDIV 4, MDIV 444 (1332MHz) | 93 | ldr r1, =0x81bc0400 @ SDIV 0, PDIV 4, MDIV 444 (1332MHz) |
97 | str r1, [r8, #0x100] | 94 | str r1, [r8, #0x100] |
98 | /* MPLL_CON */ | 95 | /* MPLL_CON */ |
99 | ldr r1, =0x80590201 @ SDIV 1, PDIV 2, MDIV 89 (267MHz) | 96 | ldr r1, =0x80590201 @ SDIV 1, PDIV 2, MDIV 89 (267MHz) |
100 | str r1, [r8, #0x104] | 97 | str r1, [r8, #0x104] |
101 | /* EPLL_CON */ | 98 | /* EPLL_CON */ |
102 | ldr r1, =0x80870303 @ SDIV 3, PDIV 3, MDIV 135 (67.5MHz) | 99 | ldr r1, =0x80870303 @ SDIV 3, PDIV 3, MDIV 135 (67.5MHz) |
103 | str r1, [r8, #0x108] | 100 | str r1, [r8, #0x108] |
104 | /* HPLL_CON */ | 101 | /* HPLL_CON */ |
105 | ldr r1, =0x80600603 | 102 | ldr r1, =0x80600603 |
106 | str r1, [r8, #0x10C] | 103 | str r1, [r8, #0x10C] |
107 | 104 | ||
108 | /* Set Source Clock */ | 105 | /* Set Source Clock */ |
109 | ldr r1, =0x1111 @ A, M, E, HPLL Muxing | 106 | ldr r1, =0x1111 @ A, M, E, HPLL Muxing |
110 | str r1, [r8, #0x200] @ CLK_SRC0 | 107 | str r1, [r8, #0x200] @ CLK_SRC0 |
111 | 108 | ||
112 | ldr r1, =0x1000001 @ Uart Clock & CLK48M Muxing | 109 | ldr r1, =0x1000001 @ Uart Clock & CLK48M Muxing |
113 | str r1, [r8, #0x204] @ CLK_SRC1 | 110 | str r1, [r8, #0x204] @ CLK_SRC1 |
114 | 111 | ||
115 | ldr r1, =0x9000 @ ARMCLK/4 | 112 | ldr r1, =0x9000 @ ARMCLK/4 |
116 | str r1, [r8, #0x400] @ CLK_OUT | 113 | str r1, [r8, #0x400] @ CLK_OUT |
117 | 114 | ||
118 | /* wait at least 200us to stablize all clock */ | 115 | /* wait at least 200us to stablize all clock */ |
119 | mov r2, #0x10000 | 116 | mov r2, #0x10000 |
120 | 1: subs r2, r2, #1 | 117 | 1: subs r2, r2, #1 |
121 | bne 1b | 118 | bne 1b |
122 | 119 | ||
123 | mov pc, lr | 120 | mov pc, lr |
124 | 121 | ||
125 | /* | 122 | /* |
126 | * uart_asm_init: Initialize UART's pins | 123 | * uart_asm_init: Initialize UART's pins |
127 | */ | 124 | */ |
128 | uart_asm_init: | 125 | uart_asm_init: |
129 | mov r0, r8 | 126 | mov r0, r8 |
130 | ldr r1, =0x22222222 | 127 | ldr r1, =0x22222222 |
131 | str r1, [r0, #0x0] @ GPA0_CON | 128 | str r1, [r0, #0x0] @ GPA0_CON |
132 | ldr r1, =0x00022222 | 129 | ldr r1, =0x00022222 |
133 | str r1, [r0, #0x20] @ GPA1_CON | 130 | str r1, [r0, #0x20] @ GPA1_CON |
134 | 131 | ||
135 | mov pc, lr | 132 | mov pc, lr |
136 | 133 | ||
137 | /* | 134 | /* |
138 | * tzpc_asm_init: Initialize TZPC | 135 | * tzpc_asm_init: Initialize TZPC |
139 | */ | 136 | */ |
140 | tzpc_asm_init: | 137 | tzpc_asm_init: |
141 | ldr r0, =0xE3800000 | 138 | ldr r0, =0xE3800000 |
142 | mov r1, #0x0 | 139 | mov r1, #0x0 |
143 | str r1, [r0] | 140 | str r1, [r0] |
144 | mov r1, #0xff | 141 | mov r1, #0xff |
145 | str r1, [r0, #0x804] | 142 | str r1, [r0, #0x804] |
146 | str r1, [r0, #0x810] | 143 | str r1, [r0, #0x810] |
147 | 144 | ||
148 | ldr r0, =0xE2800000 | 145 | ldr r0, =0xE2800000 |
149 | str r1, [r0, #0x804] | 146 | str r1, [r0, #0x804] |
150 | str r1, [r0, #0x810] | 147 | str r1, [r0, #0x810] |
151 | str r1, [r0, #0x81C] | 148 | str r1, [r0, #0x81C] |
152 | 149 | ||
153 | ldr r0, =0xE2900000 | 150 | ldr r0, =0xE2900000 |
154 | str r1, [r0, #0x804] | 151 | str r1, [r0, #0x804] |
155 | str r1, [r0, #0x810] | 152 | str r1, [r0, #0x810] |
156 | 153 | ||
157 | mov pc, lr | 154 | mov pc, lr |
158 | 155 |
board/ti/omap5912osk/lowlevel_init.S
1 | /* | 1 | /* |
2 | * Board specific setup info | 2 | * Board specific setup info |
3 | * | 3 | * |
4 | * (C) Copyright 2003 | 4 | * (C) Copyright 2003 |
5 | * Texas Instruments, <www.ti.com> | 5 | * Texas Instruments, <www.ti.com> |
6 | * Kshitij Gupta <Kshitij@ti.com> | 6 | * Kshitij Gupta <Kshitij@ti.com> |
7 | * | 7 | * |
8 | * Modified for OMAP 1610 H2 board by Nishant Kamat, Jan 2004 | 8 | * Modified for OMAP 1610 H2 board by Nishant Kamat, Jan 2004 |
9 | * | 9 | * |
10 | * Modified for OMAP 5912 OSK board by Rishi Bhattacharya, Apr 2004 | 10 | * Modified for OMAP 5912 OSK board by Rishi Bhattacharya, Apr 2004 |
11 | * SPDX-License-Identifier: GPL-2.0+ | 11 | * SPDX-License-Identifier: GPL-2.0+ |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <config.h> | 14 | #include <config.h> |
15 | #include <version.h> | 15 | #include <version.h> |
16 | 16 | ||
17 | #if defined(CONFIG_OMAP1610) | 17 | #if defined(CONFIG_OMAP1610) |
18 | #include <./configs/omap1510.h> | 18 | #include <./configs/omap1510.h> |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | |||
22 | _TEXT_BASE: | ||
23 | .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */ | ||
24 | |||
25 | .globl lowlevel_init | 21 | .globl lowlevel_init |
26 | lowlevel_init: | 22 | lowlevel_init: |
27 | 23 | ||
28 | /*------------------------------------------------------* | 24 | /*------------------------------------------------------* |
29 | * Ensure i-cache is enabled * | 25 | * Ensure i-cache is enabled * |
30 | * To configure TC regs without fetching instruction * | 26 | * To configure TC regs without fetching instruction * |
31 | *------------------------------------------------------*/ | 27 | *------------------------------------------------------*/ |
32 | mrc p15, 0, r0, c1, c0 | 28 | mrc p15, 0, r0, c1, c0 |
33 | orr r0, r0, #0x1000 | 29 | orr r0, r0, #0x1000 |
34 | mcr p15, 0, r0, c1, c0 | 30 | mcr p15, 0, r0, c1, c0 |
35 | 31 | ||
36 | /*------------------------------------------------------* | 32 | /*------------------------------------------------------* |
37 | *mask all IRQs by setting all bits in the INTMR default* | 33 | *mask all IRQs by setting all bits in the INTMR default* |
38 | *------------------------------------------------------*/ | 34 | *------------------------------------------------------*/ |
39 | mov r1, #0xffffffff | 35 | mov r1, #0xffffffff |
40 | ldr r0, =REG_IHL1_MIR | 36 | ldr r0, =REG_IHL1_MIR |
41 | str r1, [r0] | 37 | str r1, [r0] |
42 | ldr r0, =REG_IHL2_MIR | 38 | ldr r0, =REG_IHL2_MIR |
43 | str r1, [r0] | 39 | str r1, [r0] |
44 | 40 | ||
45 | /*------------------------------------------------------* | 41 | /*------------------------------------------------------* |
46 | * Set up ARM CLM registers (IDLECT1) * | 42 | * Set up ARM CLM registers (IDLECT1) * |
47 | *------------------------------------------------------*/ | 43 | *------------------------------------------------------*/ |
48 | ldr r0, REG_ARM_IDLECT1 | 44 | ldr r0, REG_ARM_IDLECT1 |
49 | ldr r1, VAL_ARM_IDLECT1 | 45 | ldr r1, VAL_ARM_IDLECT1 |
50 | str r1, [r0] | 46 | str r1, [r0] |
51 | 47 | ||
52 | /*------------------------------------------------------* | 48 | /*------------------------------------------------------* |
53 | * Set up ARM CLM registers (IDLECT2) * | 49 | * Set up ARM CLM registers (IDLECT2) * |
54 | *------------------------------------------------------*/ | 50 | *------------------------------------------------------*/ |
55 | ldr r0, REG_ARM_IDLECT2 | 51 | ldr r0, REG_ARM_IDLECT2 |
56 | ldr r1, VAL_ARM_IDLECT2 | 52 | ldr r1, VAL_ARM_IDLECT2 |
57 | str r1, [r0] | 53 | str r1, [r0] |
58 | 54 | ||
59 | /*------------------------------------------------------* | 55 | /*------------------------------------------------------* |
60 | * Set up ARM CLM registers (IDLECT3) * | 56 | * Set up ARM CLM registers (IDLECT3) * |
61 | *------------------------------------------------------*/ | 57 | *------------------------------------------------------*/ |
62 | ldr r0, REG_ARM_IDLECT3 | 58 | ldr r0, REG_ARM_IDLECT3 |
63 | ldr r1, VAL_ARM_IDLECT3 | 59 | ldr r1, VAL_ARM_IDLECT3 |
64 | str r1, [r0] | 60 | str r1, [r0] |
65 | 61 | ||
66 | mov r1, #0x01 /* PER_EN bit */ | 62 | mov r1, #0x01 /* PER_EN bit */ |
67 | ldr r0, REG_ARM_RSTCT2 | 63 | ldr r0, REG_ARM_RSTCT2 |
68 | strh r1, [r0] /* CLKM; Peripheral reset. */ | 64 | strh r1, [r0] /* CLKM; Peripheral reset. */ |
69 | 65 | ||
70 | /* Set CLKM to Sync-Scalable */ | 66 | /* Set CLKM to Sync-Scalable */ |
71 | mov r1, #0x1000 | 67 | mov r1, #0x1000 |
72 | ldr r0, REG_ARM_SYSST | 68 | ldr r0, REG_ARM_SYSST |
73 | 69 | ||
74 | mov r2, #0 | 70 | mov r2, #0 |
75 | 1: cmp r2, #1 | 71 | 1: cmp r2, #1 |
76 | streqh r1, [r0] | 72 | streqh r1, [r0] |
77 | add r2, r2, #1 | 73 | add r2, r2, #1 |
78 | cmp r2, #0x100 /* wait for any bubbles to finish */ | 74 | cmp r2, #0x100 /* wait for any bubbles to finish */ |
79 | bne 1b | 75 | bne 1b |
80 | 76 | ||
81 | ldr r1, VAL_ARM_CKCTL | 77 | ldr r1, VAL_ARM_CKCTL |
82 | ldr r0, REG_ARM_CKCTL | 78 | ldr r0, REG_ARM_CKCTL |
83 | strh r1, [r0] | 79 | strh r1, [r0] |
84 | 80 | ||
85 | /* a few nops to let settle */ | 81 | /* a few nops to let settle */ |
86 | nop | 82 | nop |
87 | nop | 83 | nop |
88 | nop | 84 | nop |
89 | nop | 85 | nop |
90 | nop | 86 | nop |
91 | nop | 87 | nop |
92 | nop | 88 | nop |
93 | nop | 89 | nop |
94 | nop | 90 | nop |
95 | nop | 91 | nop |
96 | 92 | ||
97 | /* setup DPLL 1 */ | 93 | /* setup DPLL 1 */ |
98 | /* Ramp up the clock to 96Mhz */ | 94 | /* Ramp up the clock to 96Mhz */ |
99 | ldr r1, VAL_DPLL1_CTL | 95 | ldr r1, VAL_DPLL1_CTL |
100 | ldr r0, REG_DPLL1_CTL | 96 | ldr r0, REG_DPLL1_CTL |
101 | strh r1, [r0] | 97 | strh r1, [r0] |
102 | ands r1, r1, #0x10 /* Check if PLL is enabled. */ | 98 | ands r1, r1, #0x10 /* Check if PLL is enabled. */ |
103 | beq lock_end /* Do not look for lock if BYPASS selected */ | 99 | beq lock_end /* Do not look for lock if BYPASS selected */ |
104 | 2: | 100 | 2: |
105 | ldrh r1, [r0] | 101 | ldrh r1, [r0] |
106 | ands r1, r1, #0x01 /* Check the LOCK bit.*/ | 102 | ands r1, r1, #0x01 /* Check the LOCK bit.*/ |
107 | beq 2b /* loop until bit goes hi. */ | 103 | beq 2b /* loop until bit goes hi. */ |
108 | lock_end: | 104 | lock_end: |
109 | 105 | ||
110 | /*------------------------------------------------------* | 106 | /*------------------------------------------------------* |
111 | * Turn off the watchdog during init... * | 107 | * Turn off the watchdog during init... * |
112 | *------------------------------------------------------*/ | 108 | *------------------------------------------------------*/ |
113 | ldr r0, REG_WATCHDOG | 109 | ldr r0, REG_WATCHDOG |
114 | ldr r1, WATCHDOG_VAL1 | 110 | ldr r1, WATCHDOG_VAL1 |
115 | str r1, [r0] | 111 | str r1, [r0] |
116 | ldr r1, WATCHDOG_VAL2 | 112 | ldr r1, WATCHDOG_VAL2 |
117 | str r1, [r0] | 113 | str r1, [r0] |
118 | ldr r0, REG_WSPRDOG | 114 | ldr r0, REG_WSPRDOG |
119 | ldr r1, WSPRDOG_VAL1 | 115 | ldr r1, WSPRDOG_VAL1 |
120 | str r1, [r0] | 116 | str r1, [r0] |
121 | ldr r0, REG_WWPSDOG | 117 | ldr r0, REG_WWPSDOG |
122 | 118 | ||
123 | watch1Wait: | 119 | watch1Wait: |
124 | ldr r1, [r0] | 120 | ldr r1, [r0] |
125 | tst r1, #0x10 | 121 | tst r1, #0x10 |
126 | bne watch1Wait | 122 | bne watch1Wait |
127 | 123 | ||
128 | ldr r0, REG_WSPRDOG | 124 | ldr r0, REG_WSPRDOG |
129 | ldr r1, WSPRDOG_VAL2 | 125 | ldr r1, WSPRDOG_VAL2 |
130 | str r1, [r0] | 126 | str r1, [r0] |
131 | ldr r0, REG_WWPSDOG | 127 | ldr r0, REG_WWPSDOG |
132 | watch2Wait: | 128 | watch2Wait: |
133 | ldr r1, [r0] | 129 | ldr r1, [r0] |
134 | tst r1, #0x10 | 130 | tst r1, #0x10 |
135 | bne watch2Wait | 131 | bne watch2Wait |
136 | 132 | ||
137 | /* Set memory timings corresponding to the new clock speed */ | 133 | /* Set memory timings corresponding to the new clock speed */ |
138 | ldr r3, VAL_SDRAM_CONFIG_SDF0 | 134 | ldr r3, VAL_SDRAM_CONFIG_SDF0 |
139 | 135 | ||
140 | /* Check execution location to determine current execution location | 136 | /* Check execution location to determine current execution location |
141 | * and branch to appropriate initialization code. | 137 | * and branch to appropriate initialization code. |
142 | */ | 138 | */ |
143 | mov r0, #0x10000000 /* Load physical SDRAM base. */ | 139 | mov r0, #0x10000000 /* Load physical SDRAM base. */ |
144 | mov r1, pc /* Get current execution location. */ | 140 | mov r1, pc /* Get current execution location. */ |
145 | cmp r1, r0 /* Compare. */ | 141 | cmp r1, r0 /* Compare. */ |
146 | bge skip_sdram /* Skip over EMIF-fast initialization if running from SDRAM. */ | 142 | bge skip_sdram /* Skip over EMIF-fast initialization if running from SDRAM. */ |
147 | 143 | ||
148 | /* identify the device revision, -- TMX or TMP(TMS) */ | 144 | /* identify the device revision, -- TMX or TMP(TMS) */ |
149 | ldr r0, REG_DEVICE_ID | 145 | ldr r0, REG_DEVICE_ID |
150 | ldr r1, [r0] | 146 | ldr r1, [r0] |
151 | 147 | ||
152 | ldr r0, VAL_DEVICE_ID_TMP | 148 | ldr r0, VAL_DEVICE_ID_TMP |
153 | mov r1, r1, lsl #15 | 149 | mov r1, r1, lsl #15 |
154 | mov r1, r1, lsr #16 | 150 | mov r1, r1, lsr #16 |
155 | cmp r0, r1 | 151 | cmp r0, r1 |
156 | bne skip_TMP_Patch | 152 | bne skip_TMP_Patch |
157 | 153 | ||
158 | /* Enable TMP/TMS device new features */ | 154 | /* Enable TMP/TMS device new features */ |
159 | mov r0, #1 | 155 | mov r0, #1 |
160 | ldr r1, REG_TC_EMIFF_DOUBLER | 156 | ldr r1, REG_TC_EMIFF_DOUBLER |
161 | str r0, [r1] | 157 | str r0, [r1] |
162 | 158 | ||
163 | /* Enable new ac parameters */ | 159 | /* Enable new ac parameters */ |
164 | mov r0, #0x0b | 160 | mov r0, #0x0b |
165 | ldr r1, REG_SDRAM_CONFIG2 | 161 | ldr r1, REG_SDRAM_CONFIG2 |
166 | str r0, [r1] | 162 | str r0, [r1] |
167 | 163 | ||
168 | ldr r3, VAL_SDRAM_CONFIG_SDF1 | 164 | ldr r3, VAL_SDRAM_CONFIG_SDF1 |
169 | 165 | ||
170 | skip_TMP_Patch: | 166 | skip_TMP_Patch: |
171 | 167 | ||
172 | /* | 168 | /* |
173 | * Delay for SDRAM initialization. | 169 | * Delay for SDRAM initialization. |
174 | */ | 170 | */ |
175 | mov r0, #0x1800 /* value should be checked */ | 171 | mov r0, #0x1800 /* value should be checked */ |
176 | 3: | 172 | 3: |
177 | subs r0, r0, #0x1 /* Decrement count */ | 173 | subs r0, r0, #0x1 /* Decrement count */ |
178 | bne 3b | 174 | bne 3b |
179 | 175 | ||
180 | /* | 176 | /* |
181 | * Set SDRAM control values. Disable refresh before MRS command. | 177 | * Set SDRAM control values. Disable refresh before MRS command. |
182 | */ | 178 | */ |
183 | 179 | ||
184 | /* mobile ddr operation */ | 180 | /* mobile ddr operation */ |
185 | ldr r0, REG_SDRAM_OPERATION | 181 | ldr r0, REG_SDRAM_OPERATION |
186 | mov r2, #07 | 182 | mov r2, #07 |
187 | str r2, [r0] | 183 | str r2, [r0] |
188 | 184 | ||
189 | /* config register */ | 185 | /* config register */ |
190 | ldr r0, REG_SDRAM_CONFIG | 186 | ldr r0, REG_SDRAM_CONFIG |
191 | str r3, [r0] | 187 | str r3, [r0] |
192 | 188 | ||
193 | /* manual command register */ | 189 | /* manual command register */ |
194 | ldr r0, REG_SDRAM_MANUAL_CMD | 190 | ldr r0, REG_SDRAM_MANUAL_CMD |
195 | 191 | ||
196 | /* issue set cke high */ | 192 | /* issue set cke high */ |
197 | mov r1, #CMD_SDRAM_CKE_SET_HIGH | 193 | mov r1, #CMD_SDRAM_CKE_SET_HIGH |
198 | str r1, [r0] | 194 | str r1, [r0] |
199 | 195 | ||
200 | /* issue nop */ | 196 | /* issue nop */ |
201 | mov r1, #CMD_SDRAM_NOP | 197 | mov r1, #CMD_SDRAM_NOP |
202 | str r1, [r0] | 198 | str r1, [r0] |
203 | 199 | ||
204 | mov r2, #0x0100 | 200 | mov r2, #0x0100 |
205 | waitMDDR1: | 201 | waitMDDR1: |
206 | subs r2, r2, #1 | 202 | subs r2, r2, #1 |
207 | bne waitMDDR1 /* delay loop */ | 203 | bne waitMDDR1 /* delay loop */ |
208 | 204 | ||
209 | /* issue precharge */ | 205 | /* issue precharge */ |
210 | mov r1, #CMD_SDRAM_PRECHARGE | 206 | mov r1, #CMD_SDRAM_PRECHARGE |
211 | str r1, [r0] | 207 | str r1, [r0] |
212 | 208 | ||
213 | /* issue autorefresh x 2 */ | 209 | /* issue autorefresh x 2 */ |
214 | mov r1, #CMD_SDRAM_AUTOREFRESH | 210 | mov r1, #CMD_SDRAM_AUTOREFRESH |
215 | str r1, [r0] | 211 | str r1, [r0] |
216 | str r1, [r0] | 212 | str r1, [r0] |
217 | 213 | ||
218 | /* mrs register ddr mobile */ | 214 | /* mrs register ddr mobile */ |
219 | ldr r0, REG_SDRAM_MRS | 215 | ldr r0, REG_SDRAM_MRS |
220 | mov r1, #0x33 | 216 | mov r1, #0x33 |
221 | str r1, [r0] | 217 | str r1, [r0] |
222 | 218 | ||
223 | /* emrs1 low-power register */ | 219 | /* emrs1 low-power register */ |
224 | ldr r0, REG_SDRAM_EMRS1 | 220 | ldr r0, REG_SDRAM_EMRS1 |
225 | /* self refresh on all banks */ | 221 | /* self refresh on all banks */ |
226 | mov r1, #0 | 222 | mov r1, #0 |
227 | str r1, [r0] | 223 | str r1, [r0] |
228 | 224 | ||
229 | ldr r0, REG_DLL_URD_CONTROL | 225 | ldr r0, REG_DLL_URD_CONTROL |
230 | ldr r1, DLL_URD_CONTROL_VAL | 226 | ldr r1, DLL_URD_CONTROL_VAL |
231 | str r1, [r0] | 227 | str r1, [r0] |
232 | 228 | ||
233 | ldr r0, REG_DLL_LRD_CONTROL | 229 | ldr r0, REG_DLL_LRD_CONTROL |
234 | ldr r1, DLL_LRD_CONTROL_VAL | 230 | ldr r1, DLL_LRD_CONTROL_VAL |
235 | str r1, [r0] | 231 | str r1, [r0] |
236 | 232 | ||
237 | ldr r0, REG_DLL_WRT_CONTROL | 233 | ldr r0, REG_DLL_WRT_CONTROL |
238 | ldr r1, DLL_WRT_CONTROL_VAL | 234 | ldr r1, DLL_WRT_CONTROL_VAL |
239 | str r1, [r0] | 235 | str r1, [r0] |
240 | 236 | ||
241 | /* delay loop */ | 237 | /* delay loop */ |
242 | mov r0, #0x0100 | 238 | mov r0, #0x0100 |
243 | waitMDDR2: | 239 | waitMDDR2: |
244 | subs r0, r0, #1 | 240 | subs r0, r0, #1 |
245 | bne waitMDDR2 | 241 | bne waitMDDR2 |
246 | 242 | ||
247 | /* | 243 | /* |
248 | * Delay for SDRAM initialization. | 244 | * Delay for SDRAM initialization. |
249 | */ | 245 | */ |
250 | mov r0, #0x1800 | 246 | mov r0, #0x1800 |
251 | 4: | 247 | 4: |
252 | subs r0, r0, #1 /* Decrement count. */ | 248 | subs r0, r0, #1 /* Decrement count. */ |
253 | bne 4b | 249 | bne 4b |
254 | b common_tc | 250 | b common_tc |
255 | 251 | ||
256 | skip_sdram: | 252 | skip_sdram: |
257 | ldr r0, REG_SDRAM_CONFIG | 253 | ldr r0, REG_SDRAM_CONFIG |
258 | str r3, [r0] | 254 | str r3, [r0] |
259 | 255 | ||
260 | common_tc: | 256 | common_tc: |
261 | /* slow interface */ | 257 | /* slow interface */ |
262 | ldr r1, VAL_TC_EMIFS_CS0_CONFIG | 258 | ldr r1, VAL_TC_EMIFS_CS0_CONFIG |
263 | ldr r0, REG_TC_EMIFS_CS0_CONFIG | 259 | ldr r0, REG_TC_EMIFS_CS0_CONFIG |
264 | str r1, [r0] /* Chip Select 0 */ | 260 | str r1, [r0] /* Chip Select 0 */ |
265 | 261 | ||
266 | ldr r1, VAL_TC_EMIFS_CS1_CONFIG | 262 | ldr r1, VAL_TC_EMIFS_CS1_CONFIG |
267 | ldr r0, REG_TC_EMIFS_CS1_CONFIG | 263 | ldr r0, REG_TC_EMIFS_CS1_CONFIG |
268 | str r1, [r0] /* Chip Select 1 */ | 264 | str r1, [r0] /* Chip Select 1 */ |
269 | 265 | ||
270 | ldr r1, VAL_TC_EMIFS_CS3_CONFIG | 266 | ldr r1, VAL_TC_EMIFS_CS3_CONFIG |
271 | ldr r0, REG_TC_EMIFS_CS3_CONFIG | 267 | ldr r0, REG_TC_EMIFS_CS3_CONFIG |
272 | str r1, [r0] /* Chip Select 3 */ | 268 | str r1, [r0] /* Chip Select 3 */ |
273 | 269 | ||
274 | ldr r1, VAL_TC_EMIFS_DWS | 270 | ldr r1, VAL_TC_EMIFS_DWS |
275 | ldr r0, REG_TC_EMIFS_DWS | 271 | ldr r0, REG_TC_EMIFS_DWS |
276 | str r1, [r0] /* Enable EMIFS.RDY for CS1 (ether) */ | 272 | str r1, [r0] /* Enable EMIFS.RDY for CS1 (ether) */ |
277 | 273 | ||
278 | #ifdef CONFIG_H2_OMAP1610 | 274 | #ifdef CONFIG_H2_OMAP1610 |
279 | /* inserting additional 2 clock cycle hold time for LAN */ | 275 | /* inserting additional 2 clock cycle hold time for LAN */ |
280 | ldr r0, REG_TC_EMIFS_CS1_ADVANCED | 276 | ldr r0, REG_TC_EMIFS_CS1_ADVANCED |
281 | ldr r1, VAL_TC_EMIFS_CS1_ADVANCED | 277 | ldr r1, VAL_TC_EMIFS_CS1_ADVANCED |
282 | str r1, [r0] | 278 | str r1, [r0] |
283 | #endif | 279 | #endif |
284 | /* Start MPU Timer 1 */ | 280 | /* Start MPU Timer 1 */ |
285 | ldr r0, REG_MPU_LOAD_TIMER | 281 | ldr r0, REG_MPU_LOAD_TIMER |
286 | ldr r1, VAL_MPU_LOAD_TIMER | 282 | ldr r1, VAL_MPU_LOAD_TIMER |
287 | str r1, [r0] | 283 | str r1, [r0] |
288 | 284 | ||
289 | ldr r0, REG_MPU_CNTL_TIMER | 285 | ldr r0, REG_MPU_CNTL_TIMER |
290 | ldr r1, VAL_MPU_CNTL_TIMER | 286 | ldr r1, VAL_MPU_CNTL_TIMER |
291 | str r1, [r0] | 287 | str r1, [r0] |
292 | 288 | ||
293 | /* | 289 | /* |
294 | * Setup a temporary stack | 290 | * Setup a temporary stack |
295 | */ | 291 | */ |
296 | ldr sp, SRAM_STACK | 292 | ldr sp, SRAM_STACK |
297 | bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ | 293 | bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ |
298 | 294 | ||
299 | /* | 295 | /* |
300 | * Save the old lr(passed in ip) and the current lr to stack | 296 | * Save the old lr(passed in ip) and the current lr to stack |
301 | */ | 297 | */ |
302 | push {ip, lr} | 298 | push {ip, lr} |
303 | 299 | ||
304 | /* | 300 | /* |
305 | * go setup pll, mux, memory | 301 | * go setup pll, mux, memory |
306 | */ | 302 | */ |
307 | bl s_init | 303 | bl s_init |
308 | pop {ip, pc} | 304 | pop {ip, pc} |
309 | 305 | ||
310 | /* back to arch calling code */ | 306 | /* back to arch calling code */ |
311 | mov pc, lr | 307 | mov pc, lr |
312 | 308 | ||
313 | /* the literal pools origin */ | 309 | /* the literal pools origin */ |
314 | .ltorg | 310 | .ltorg |
315 | 311 | ||
316 | REG_DEVICE_ID: /* 32 bits */ | 312 | REG_DEVICE_ID: /* 32 bits */ |
317 | .word 0xfffe2004 | 313 | .word 0xfffe2004 |
318 | REG_TC_EMIFS_CONFIG: | 314 | REG_TC_EMIFS_CONFIG: |
319 | .word 0xfffecc0c | 315 | .word 0xfffecc0c |
320 | REG_TC_EMIFS_CS0_CONFIG: /* 32 bits */ | 316 | REG_TC_EMIFS_CS0_CONFIG: /* 32 bits */ |
321 | .word 0xfffecc10 | 317 | .word 0xfffecc10 |
322 | REG_TC_EMIFS_CS1_CONFIG: /* 32 bits */ | 318 | REG_TC_EMIFS_CS1_CONFIG: /* 32 bits */ |
323 | .word 0xfffecc14 | 319 | .word 0xfffecc14 |
324 | REG_TC_EMIFS_CS2_CONFIG: /* 32 bits */ | 320 | REG_TC_EMIFS_CS2_CONFIG: /* 32 bits */ |
325 | .word 0xfffecc18 | 321 | .word 0xfffecc18 |
326 | REG_TC_EMIFS_CS3_CONFIG: /* 32 bits */ | 322 | REG_TC_EMIFS_CS3_CONFIG: /* 32 bits */ |
327 | .word 0xfffecc1c | 323 | .word 0xfffecc1c |
328 | REG_TC_EMIFS_DWS: /* 32 bits */ | 324 | REG_TC_EMIFS_DWS: /* 32 bits */ |
329 | .word 0xfffecc40 | 325 | .word 0xfffecc40 |
330 | #ifdef CONFIG_H2_OMAP1610 | 326 | #ifdef CONFIG_H2_OMAP1610 |
331 | REG_TC_EMIFS_CS1_ADVANCED: /* 32 bits */ | 327 | REG_TC_EMIFS_CS1_ADVANCED: /* 32 bits */ |
332 | .word 0xfffecc54 | 328 | .word 0xfffecc54 |
333 | #endif | 329 | #endif |
334 | 330 | ||
335 | /* MPU clock/reset/power mode control registers */ | 331 | /* MPU clock/reset/power mode control registers */ |
336 | REG_ARM_CKCTL: /* 16 bits */ | 332 | REG_ARM_CKCTL: /* 16 bits */ |
337 | .word 0xfffece00 | 333 | .word 0xfffece00 |
338 | REG_ARM_IDLECT3: /* 16 bits */ | 334 | REG_ARM_IDLECT3: /* 16 bits */ |
339 | .word 0xfffece24 | 335 | .word 0xfffece24 |
340 | REG_ARM_IDLECT2: /* 16 bits */ | 336 | REG_ARM_IDLECT2: /* 16 bits */ |
341 | .word 0xfffece08 | 337 | .word 0xfffece08 |
342 | REG_ARM_IDLECT1: /* 16 bits */ | 338 | REG_ARM_IDLECT1: /* 16 bits */ |
343 | .word 0xfffece04 | 339 | .word 0xfffece04 |
344 | REG_ARM_RSTCT2: /* 16 bits */ | 340 | REG_ARM_RSTCT2: /* 16 bits */ |
345 | .word 0xfffece14 | 341 | .word 0xfffece14 |
346 | REG_ARM_SYSST: /* 16 bits */ | 342 | REG_ARM_SYSST: /* 16 bits */ |
347 | .word 0xfffece18 | 343 | .word 0xfffece18 |
348 | 344 | ||
349 | /* DPLL control registers */ | 345 | /* DPLL control registers */ |
350 | REG_DPLL1_CTL: /* 16 bits */ | 346 | REG_DPLL1_CTL: /* 16 bits */ |
351 | .word 0xfffecf00 | 347 | .word 0xfffecf00 |
352 | 348 | ||
353 | /* Watch Dog register */ | 349 | /* Watch Dog register */ |
354 | /* secure watchdog stop */ | 350 | /* secure watchdog stop */ |
355 | REG_WSPRDOG: | 351 | REG_WSPRDOG: |
356 | .word 0xfffeb048 | 352 | .word 0xfffeb048 |
357 | /* watchdog write pending */ | 353 | /* watchdog write pending */ |
358 | REG_WWPSDOG: | 354 | REG_WWPSDOG: |
359 | .word 0xfffeb034 | 355 | .word 0xfffeb034 |
360 | 356 | ||
361 | WSPRDOG_VAL1: | 357 | WSPRDOG_VAL1: |
362 | .word 0x0000aaaa | 358 | .word 0x0000aaaa |
363 | WSPRDOG_VAL2: | 359 | WSPRDOG_VAL2: |
364 | .word 0x00005555 | 360 | .word 0x00005555 |
365 | 361 | ||
366 | /* SDRAM config is: auto refresh enabled, 16 bit 4 bank, | 362 | /* SDRAM config is: auto refresh enabled, 16 bit 4 bank, |
367 | counter @8192 rows, 10 ns, 8 burst */ | 363 | counter @8192 rows, 10 ns, 8 burst */ |
368 | REG_SDRAM_CONFIG: | 364 | REG_SDRAM_CONFIG: |
369 | .word 0xfffecc20 | 365 | .word 0xfffecc20 |
370 | REG_SDRAM_CONFIG2: | 366 | REG_SDRAM_CONFIG2: |
371 | .word 0xfffecc3c | 367 | .word 0xfffecc3c |
372 | REG_TC_EMIFF_DOUBLER: /* 32 bits */ | 368 | REG_TC_EMIFF_DOUBLER: /* 32 bits */ |
373 | .word 0xfffecc60 | 369 | .word 0xfffecc60 |
374 | 370 | ||
375 | /* Operation register */ | 371 | /* Operation register */ |
376 | REG_SDRAM_OPERATION: | 372 | REG_SDRAM_OPERATION: |
377 | .word 0xfffecc80 | 373 | .word 0xfffecc80 |
378 | 374 | ||
379 | /* Manual command register */ | 375 | /* Manual command register */ |
380 | REG_SDRAM_MANUAL_CMD: | 376 | REG_SDRAM_MANUAL_CMD: |
381 | .word 0xfffecc84 | 377 | .word 0xfffecc84 |
382 | 378 | ||
383 | /* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */ | 379 | /* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */ |
384 | REG_SDRAM_MRS: | 380 | REG_SDRAM_MRS: |
385 | .word 0xfffecc70 | 381 | .word 0xfffecc70 |
386 | 382 | ||
387 | /* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */ | 383 | /* SDRAM MRS (New) config is: CAS latency is 2, burst length 8 */ |
388 | REG_SDRAM_EMRS1: | 384 | REG_SDRAM_EMRS1: |
389 | .word 0xfffecc78 | 385 | .word 0xfffecc78 |
390 | 386 | ||
391 | /* WRT DLL register */ | 387 | /* WRT DLL register */ |
392 | REG_DLL_WRT_CONTROL: | 388 | REG_DLL_WRT_CONTROL: |
393 | .word 0xfffecc68 | 389 | .word 0xfffecc68 |
394 | DLL_WRT_CONTROL_VAL: | 390 | DLL_WRT_CONTROL_VAL: |
395 | .word 0x03f00002 /* Phase of 72deg, write offset +31 */ | 391 | .word 0x03f00002 /* Phase of 72deg, write offset +31 */ |
396 | 392 | ||
397 | /* URD DLL register */ | 393 | /* URD DLL register */ |
398 | REG_DLL_URD_CONTROL: | 394 | REG_DLL_URD_CONTROL: |
399 | .word 0xfffeccc0 | 395 | .word 0xfffeccc0 |
400 | DLL_URD_CONTROL_VAL: | 396 | DLL_URD_CONTROL_VAL: |
401 | .word 0x00800002 /* Phase of 72deg, read offset +31 */ | 397 | .word 0x00800002 /* Phase of 72deg, read offset +31 */ |
402 | 398 | ||
403 | /* LRD DLL register */ | 399 | /* LRD DLL register */ |
404 | REG_DLL_LRD_CONTROL: | 400 | REG_DLL_LRD_CONTROL: |
405 | .word 0xfffecccc | 401 | .word 0xfffecccc |
406 | DLL_LRD_CONTROL_VAL: | 402 | DLL_LRD_CONTROL_VAL: |
407 | .word 0x00800002 /* read offset +31 */ | 403 | .word 0x00800002 /* read offset +31 */ |
408 | 404 | ||
409 | REG_WATCHDOG: | 405 | REG_WATCHDOG: |
410 | .word 0xfffec808 | 406 | .word 0xfffec808 |
411 | WATCHDOG_VAL1: | 407 | WATCHDOG_VAL1: |
412 | .word 0x000000f5 | 408 | .word 0x000000f5 |
413 | WATCHDOG_VAL2: | 409 | WATCHDOG_VAL2: |
414 | .word 0x000000a0 | 410 | .word 0x000000a0 |
415 | 411 | ||
416 | REG_MPU_LOAD_TIMER: | 412 | REG_MPU_LOAD_TIMER: |
417 | .word 0xfffec504 | 413 | .word 0xfffec504 |
418 | REG_MPU_CNTL_TIMER: | 414 | REG_MPU_CNTL_TIMER: |
419 | .word 0xfffec500 | 415 | .word 0xfffec500 |
420 | VAL_MPU_LOAD_TIMER: | 416 | VAL_MPU_LOAD_TIMER: |
421 | .word 0xffffffff | 417 | .word 0xffffffff |
422 | VAL_MPU_CNTL_TIMER: | 418 | VAL_MPU_CNTL_TIMER: |
423 | .word 0xffffffa1 | 419 | .word 0xffffffa1 |
424 | 420 | ||
425 | /* 96 MHz Samsung Mobile DDR */ | 421 | /* 96 MHz Samsung Mobile DDR */ |
426 | /* Original setting for TMX device */ | 422 | /* Original setting for TMX device */ |
427 | VAL_SDRAM_CONFIG_SDF0: | 423 | VAL_SDRAM_CONFIG_SDF0: |
428 | .word 0x0014e6fe | 424 | .word 0x0014e6fe |
429 | 425 | ||
430 | /* NEW_SYS_FREQ mode (valid only TMP/TMS devices) */ | 426 | /* NEW_SYS_FREQ mode (valid only TMP/TMS devices) */ |
431 | VAL_SDRAM_CONFIG_SDF1: | 427 | VAL_SDRAM_CONFIG_SDF1: |
432 | .word 0x0114e6fe | 428 | .word 0x0114e6fe |
433 | 429 | ||
434 | VAL_ARM_CKCTL: | 430 | VAL_ARM_CKCTL: |
435 | .word 0x2000 /* was: 0x3000, now use CLK_REF for timer input */ | 431 | .word 0x2000 /* was: 0x3000, now use CLK_REF for timer input */ |
436 | VAL_DPLL1_CTL: | 432 | VAL_DPLL1_CTL: |
437 | .word 0x2830 | 433 | .word 0x2830 |
438 | 434 | ||
439 | #ifdef CONFIG_OSK_OMAP5912 | 435 | #ifdef CONFIG_OSK_OMAP5912 |
440 | VAL_TC_EMIFS_CS0_CONFIG: | 436 | VAL_TC_EMIFS_CS0_CONFIG: |
441 | .word 0x002130b0 | 437 | .word 0x002130b0 |
442 | VAL_TC_EMIFS_CS1_CONFIG: | 438 | VAL_TC_EMIFS_CS1_CONFIG: |
443 | .word 0x00001133 | 439 | .word 0x00001133 |
444 | VAL_TC_EMIFS_CS2_CONFIG: | 440 | VAL_TC_EMIFS_CS2_CONFIG: |
445 | .word 0x000055f0 | 441 | .word 0x000055f0 |
446 | VAL_TC_EMIFS_CS3_CONFIG: | 442 | VAL_TC_EMIFS_CS3_CONFIG: |
447 | .word 0x88013141 | 443 | .word 0x88013141 |
448 | VAL_TC_EMIFS_DWS: /* Enable EMIFS.RDY for CS1 access (ether) */ | 444 | VAL_TC_EMIFS_DWS: /* Enable EMIFS.RDY for CS1 access (ether) */ |
449 | .word 0x000000c0 | 445 | .word 0x000000c0 |
450 | VAL_DEVICE_ID_TMP: /* TMP/TMS=0xb65f, TMX=0xb58c */ | 446 | VAL_DEVICE_ID_TMP: /* TMP/TMS=0xb65f, TMX=0xb58c */ |
451 | .word 0xb65f | 447 | .word 0xb65f |
452 | #endif | 448 | #endif |
453 | 449 | ||
454 | #ifdef CONFIG_H2_OMAP1610 | 450 | #ifdef CONFIG_H2_OMAP1610 |
455 | VAL_TC_EMIFS_CS0_CONFIG: | 451 | VAL_TC_EMIFS_CS0_CONFIG: |
456 | .word 0x00203331 | 452 | .word 0x00203331 |
457 | VAL_TC_EMIFS_CS1_CONFIG: | 453 | VAL_TC_EMIFS_CS1_CONFIG: |
458 | .word 0x8180fff3 | 454 | .word 0x8180fff3 |
459 | VAL_TC_EMIFS_CS2_CONFIG: | 455 | VAL_TC_EMIFS_CS2_CONFIG: |
460 | .word 0xf800f22a | 456 | .word 0xf800f22a |
461 | VAL_TC_EMIFS_CS3_CONFIG: | 457 | VAL_TC_EMIFS_CS3_CONFIG: |
462 | .word 0x88013141 | 458 | .word 0x88013141 |
463 | VAL_TC_EMIFS_CS1_ADVANCED: | 459 | VAL_TC_EMIFS_CS1_ADVANCED: |
464 | .word 0x00000022 | 460 | .word 0x00000022 |
465 | #endif | 461 | #endif |
466 | 462 | ||
467 | VAL_ARM_IDLECT1: | 463 | VAL_ARM_IDLECT1: |
468 | .word 0x00000400 | 464 | .word 0x00000400 |
469 | VAL_ARM_IDLECT2: | 465 | VAL_ARM_IDLECT2: |
470 | .word 0x00000886 | 466 | .word 0x00000886 |
471 | VAL_ARM_IDLECT3: | 467 | VAL_ARM_IDLECT3: |
472 | .word 0x00000015 | 468 | .word 0x00000015 |
473 | 469 | ||
474 | SRAM_STACK: | 470 | SRAM_STACK: |
475 | .word CONFIG_SYS_INIT_SP_ADDR | 471 | .word CONFIG_SYS_INIT_SP_ADDR |
476 | 472 | ||
477 | /* command values */ | 473 | /* command values */ |
478 | .equ CMD_SDRAM_NOP, 0x00000000 | 474 | .equ CMD_SDRAM_NOP, 0x00000000 |
479 | .equ CMD_SDRAM_PRECHARGE, 0x00000001 | 475 | .equ CMD_SDRAM_PRECHARGE, 0x00000001 |
480 | .equ CMD_SDRAM_AUTOREFRESH, 0x00000002 | 476 | .equ CMD_SDRAM_AUTOREFRESH, 0x00000002 |
481 | .equ CMD_SDRAM_CKE_SET_HIGH, 0x00000007 | 477 | .equ CMD_SDRAM_CKE_SET_HIGH, 0x00000007 |
482 | 478 |
common/board_f.c
1 | /* | 1 | /* |
2 | * Copyright (c) 2011 The Chromium OS Authors. | 2 | * Copyright (c) 2011 The Chromium OS Authors. |
3 | * (C) Copyright 2002-2006 | 3 | * (C) Copyright 2002-2006 |
4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | 4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
5 | * | 5 | * |
6 | * (C) Copyright 2002 | 6 | * (C) Copyright 2002 |
7 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> | 7 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
8 | * Marius Groeger <mgroeger@sysgo.de> | 8 | * Marius Groeger <mgroeger@sysgo.de> |
9 | * | 9 | * |
10 | * SPDX-License-Identifier: GPL-2.0+ | 10 | * SPDX-License-Identifier: GPL-2.0+ |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <common.h> | 13 | #include <common.h> |
14 | #include <linux/compiler.h> | 14 | #include <linux/compiler.h> |
15 | #include <version.h> | 15 | #include <version.h> |
16 | #include <environment.h> | 16 | #include <environment.h> |
17 | #include <fdtdec.h> | 17 | #include <fdtdec.h> |
18 | #include <fs.h> | 18 | #include <fs.h> |
19 | #if defined(CONFIG_CMD_IDE) | 19 | #if defined(CONFIG_CMD_IDE) |
20 | #include <ide.h> | 20 | #include <ide.h> |
21 | #endif | 21 | #endif |
22 | #include <i2c.h> | 22 | #include <i2c.h> |
23 | #include <initcall.h> | 23 | #include <initcall.h> |
24 | #include <logbuff.h> | 24 | #include <logbuff.h> |
25 | 25 | ||
26 | /* TODO: Can we move these into arch/ headers? */ | 26 | /* TODO: Can we move these into arch/ headers? */ |
27 | #ifdef CONFIG_8xx | 27 | #ifdef CONFIG_8xx |
28 | #include <mpc8xx.h> | 28 | #include <mpc8xx.h> |
29 | #endif | 29 | #endif |
30 | #ifdef CONFIG_5xx | 30 | #ifdef CONFIG_5xx |
31 | #include <mpc5xx.h> | 31 | #include <mpc5xx.h> |
32 | #endif | 32 | #endif |
33 | #ifdef CONFIG_MPC5xxx | 33 | #ifdef CONFIG_MPC5xxx |
34 | #include <mpc5xxx.h> | 34 | #include <mpc5xxx.h> |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #include <os.h> | 37 | #include <os.h> |
38 | #include <post.h> | 38 | #include <post.h> |
39 | #include <spi.h> | 39 | #include <spi.h> |
40 | #include <trace.h> | 40 | #include <trace.h> |
41 | #include <watchdog.h> | 41 | #include <watchdog.h> |
42 | #include <asm/errno.h> | 42 | #include <asm/errno.h> |
43 | #include <asm/io.h> | 43 | #include <asm/io.h> |
44 | #ifdef CONFIG_MP | 44 | #ifdef CONFIG_MP |
45 | #include <asm/mp.h> | 45 | #include <asm/mp.h> |
46 | #endif | 46 | #endif |
47 | #include <asm/sections.h> | 47 | #include <asm/sections.h> |
48 | #ifdef CONFIG_X86 | 48 | #ifdef CONFIG_X86 |
49 | #include <asm/init_helpers.h> | 49 | #include <asm/init_helpers.h> |
50 | #include <asm/relocate.h> | 50 | #include <asm/relocate.h> |
51 | #endif | 51 | #endif |
52 | #ifdef CONFIG_SANDBOX | 52 | #ifdef CONFIG_SANDBOX |
53 | #include <asm/state.h> | 53 | #include <asm/state.h> |
54 | #endif | 54 | #endif |
55 | #include <linux/compiler.h> | 55 | #include <linux/compiler.h> |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * Pointer to initial global data area | 58 | * Pointer to initial global data area |
59 | * | 59 | * |
60 | * Here we initialize it if needed. | 60 | * Here we initialize it if needed. |
61 | */ | 61 | */ |
62 | #ifdef XTRN_DECLARE_GLOBAL_DATA_PTR | 62 | #ifdef XTRN_DECLARE_GLOBAL_DATA_PTR |
63 | #undef XTRN_DECLARE_GLOBAL_DATA_PTR | 63 | #undef XTRN_DECLARE_GLOBAL_DATA_PTR |
64 | #define XTRN_DECLARE_GLOBAL_DATA_PTR /* empty = allocate here */ | 64 | #define XTRN_DECLARE_GLOBAL_DATA_PTR /* empty = allocate here */ |
65 | DECLARE_GLOBAL_DATA_PTR = (gd_t *) (CONFIG_SYS_INIT_GD_ADDR); | 65 | DECLARE_GLOBAL_DATA_PTR = (gd_t *) (CONFIG_SYS_INIT_GD_ADDR); |
66 | #else | 66 | #else |
67 | DECLARE_GLOBAL_DATA_PTR; | 67 | DECLARE_GLOBAL_DATA_PTR; |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * sjg: IMO this code should be | 71 | * sjg: IMO this code should be |
72 | * refactored to a single function, something like: | 72 | * refactored to a single function, something like: |
73 | * | 73 | * |
74 | * void led_set_state(enum led_colour_t colour, int on); | 74 | * void led_set_state(enum led_colour_t colour, int on); |
75 | */ | 75 | */ |
76 | /************************************************************************ | 76 | /************************************************************************ |
77 | * Coloured LED functionality | 77 | * Coloured LED functionality |
78 | ************************************************************************ | 78 | ************************************************************************ |
79 | * May be supplied by boards if desired | 79 | * May be supplied by boards if desired |
80 | */ | 80 | */ |
81 | inline void __coloured_LED_init(void) {} | 81 | inline void __coloured_LED_init(void) {} |
82 | void coloured_LED_init(void) | 82 | void coloured_LED_init(void) |
83 | __attribute__((weak, alias("__coloured_LED_init"))); | 83 | __attribute__((weak, alias("__coloured_LED_init"))); |
84 | inline void __red_led_on(void) {} | 84 | inline void __red_led_on(void) {} |
85 | void red_led_on(void) __attribute__((weak, alias("__red_led_on"))); | 85 | void red_led_on(void) __attribute__((weak, alias("__red_led_on"))); |
86 | inline void __red_led_off(void) {} | 86 | inline void __red_led_off(void) {} |
87 | void red_led_off(void) __attribute__((weak, alias("__red_led_off"))); | 87 | void red_led_off(void) __attribute__((weak, alias("__red_led_off"))); |
88 | inline void __green_led_on(void) {} | 88 | inline void __green_led_on(void) {} |
89 | void green_led_on(void) __attribute__((weak, alias("__green_led_on"))); | 89 | void green_led_on(void) __attribute__((weak, alias("__green_led_on"))); |
90 | inline void __green_led_off(void) {} | 90 | inline void __green_led_off(void) {} |
91 | void green_led_off(void) __attribute__((weak, alias("__green_led_off"))); | 91 | void green_led_off(void) __attribute__((weak, alias("__green_led_off"))); |
92 | inline void __yellow_led_on(void) {} | 92 | inline void __yellow_led_on(void) {} |
93 | void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on"))); | 93 | void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on"))); |
94 | inline void __yellow_led_off(void) {} | 94 | inline void __yellow_led_off(void) {} |
95 | void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off"))); | 95 | void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off"))); |
96 | inline void __blue_led_on(void) {} | 96 | inline void __blue_led_on(void) {} |
97 | void blue_led_on(void) __attribute__((weak, alias("__blue_led_on"))); | 97 | void blue_led_on(void) __attribute__((weak, alias("__blue_led_on"))); |
98 | inline void __blue_led_off(void) {} | 98 | inline void __blue_led_off(void) {} |
99 | void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); | 99 | void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); |
100 | 100 | ||
101 | /* | 101 | /* |
102 | * Why is gd allocated a register? Prior to reloc it might be better to | 102 | * Why is gd allocated a register? Prior to reloc it might be better to |
103 | * just pass it around to each function in this file? | 103 | * just pass it around to each function in this file? |
104 | * | 104 | * |
105 | * After reloc one could argue that it is hardly used and doesn't need | 105 | * After reloc one could argue that it is hardly used and doesn't need |
106 | * to be in a register. Or if it is it should perhaps hold pointers to all | 106 | * to be in a register. Or if it is it should perhaps hold pointers to all |
107 | * global data for all modules, so that post-reloc we can avoid the massive | 107 | * global data for all modules, so that post-reloc we can avoid the massive |
108 | * literal pool we get on ARM. Or perhaps just encourage each module to use | 108 | * literal pool we get on ARM. Or perhaps just encourage each module to use |
109 | * a structure... | 109 | * a structure... |
110 | */ | 110 | */ |
111 | 111 | ||
112 | /* | 112 | /* |
113 | * Could the CONFIG_SPL_BUILD infection become a flag in gd? | 113 | * Could the CONFIG_SPL_BUILD infection become a flag in gd? |
114 | */ | 114 | */ |
115 | 115 | ||
116 | #if defined(CONFIG_WATCHDOG) | 116 | #if defined(CONFIG_WATCHDOG) |
117 | static int init_func_watchdog_init(void) | 117 | static int init_func_watchdog_init(void) |
118 | { | 118 | { |
119 | puts(" Watchdog enabled\n"); | 119 | puts(" Watchdog enabled\n"); |
120 | WATCHDOG_RESET(); | 120 | WATCHDOG_RESET(); |
121 | 121 | ||
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
124 | 124 | ||
125 | int init_func_watchdog_reset(void) | 125 | int init_func_watchdog_reset(void) |
126 | { | 126 | { |
127 | WATCHDOG_RESET(); | 127 | WATCHDOG_RESET(); |
128 | 128 | ||
129 | return 0; | 129 | return 0; |
130 | } | 130 | } |
131 | #endif /* CONFIG_WATCHDOG */ | 131 | #endif /* CONFIG_WATCHDOG */ |
132 | 132 | ||
133 | void __board_add_ram_info(int use_default) | 133 | void __board_add_ram_info(int use_default) |
134 | { | 134 | { |
135 | /* please define platform specific board_add_ram_info() */ | 135 | /* please define platform specific board_add_ram_info() */ |
136 | } | 136 | } |
137 | 137 | ||
138 | void board_add_ram_info(int) | 138 | void board_add_ram_info(int) |
139 | __attribute__ ((weak, alias("__board_add_ram_info"))); | 139 | __attribute__ ((weak, alias("__board_add_ram_info"))); |
140 | 140 | ||
141 | static int init_baud_rate(void) | 141 | static int init_baud_rate(void) |
142 | { | 142 | { |
143 | gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); | 143 | gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); |
144 | return 0; | 144 | return 0; |
145 | } | 145 | } |
146 | 146 | ||
147 | static int display_text_info(void) | 147 | static int display_text_info(void) |
148 | { | 148 | { |
149 | #ifndef CONFIG_SANDBOX | 149 | #ifndef CONFIG_SANDBOX |
150 | ulong bss_start, bss_end; | 150 | ulong bss_start, bss_end; |
151 | 151 | ||
152 | #ifdef CONFIG_SYS_SYM_OFFSETS | ||
153 | bss_start = _bss_start_ofs + _TEXT_BASE; | ||
154 | bss_end = _bss_end_ofs + _TEXT_BASE; | ||
155 | #else | ||
156 | bss_start = (ulong)&__bss_start; | 152 | bss_start = (ulong)&__bss_start; |
157 | bss_end = (ulong)&__bss_end; | 153 | bss_end = (ulong)&__bss_end; |
158 | #endif | 154 | |
159 | debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n", | 155 | debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n", |
160 | CONFIG_SYS_TEXT_BASE, bss_start, bss_end); | 156 | CONFIG_SYS_TEXT_BASE, bss_start, bss_end); |
161 | #endif | 157 | #endif |
162 | 158 | ||
163 | #ifdef CONFIG_MODEM_SUPPORT | 159 | #ifdef CONFIG_MODEM_SUPPORT |
164 | debug("Modem Support enabled\n"); | 160 | debug("Modem Support enabled\n"); |
165 | #endif | 161 | #endif |
166 | #ifdef CONFIG_USE_IRQ | 162 | #ifdef CONFIG_USE_IRQ |
167 | debug("IRQ Stack: %08lx\n", IRQ_STACK_START); | 163 | debug("IRQ Stack: %08lx\n", IRQ_STACK_START); |
168 | debug("FIQ Stack: %08lx\n", FIQ_STACK_START); | 164 | debug("FIQ Stack: %08lx\n", FIQ_STACK_START); |
169 | #endif | 165 | #endif |
170 | 166 | ||
171 | return 0; | 167 | return 0; |
172 | } | 168 | } |
173 | 169 | ||
174 | static int announce_dram_init(void) | 170 | static int announce_dram_init(void) |
175 | { | 171 | { |
176 | puts("DRAM: "); | 172 | puts("DRAM: "); |
177 | return 0; | 173 | return 0; |
178 | } | 174 | } |
179 | 175 | ||
180 | #ifdef CONFIG_PPC | 176 | #ifdef CONFIG_PPC |
181 | static int init_func_ram(void) | 177 | static int init_func_ram(void) |
182 | { | 178 | { |
183 | #ifdef CONFIG_BOARD_TYPES | 179 | #ifdef CONFIG_BOARD_TYPES |
184 | int board_type = gd->board_type; | 180 | int board_type = gd->board_type; |
185 | #else | 181 | #else |
186 | int board_type = 0; /* use dummy arg */ | 182 | int board_type = 0; /* use dummy arg */ |
187 | #endif | 183 | #endif |
188 | 184 | ||
189 | gd->ram_size = initdram(board_type); | 185 | gd->ram_size = initdram(board_type); |
190 | 186 | ||
191 | if (gd->ram_size > 0) | 187 | if (gd->ram_size > 0) |
192 | return 0; | 188 | return 0; |
193 | 189 | ||
194 | puts("*** failed ***\n"); | 190 | puts("*** failed ***\n"); |
195 | return 1; | 191 | return 1; |
196 | } | 192 | } |
197 | #endif | 193 | #endif |
198 | 194 | ||
199 | static int show_dram_config(void) | 195 | static int show_dram_config(void) |
200 | { | 196 | { |
201 | ulong size; | 197 | ulong size; |
202 | 198 | ||
203 | #ifdef CONFIG_NR_DRAM_BANKS | 199 | #ifdef CONFIG_NR_DRAM_BANKS |
204 | int i; | 200 | int i; |
205 | 201 | ||
206 | debug("\nRAM Configuration:\n"); | 202 | debug("\nRAM Configuration:\n"); |
207 | for (i = size = 0; i < CONFIG_NR_DRAM_BANKS; i++) { | 203 | for (i = size = 0; i < CONFIG_NR_DRAM_BANKS; i++) { |
208 | size += gd->bd->bi_dram[i].size; | 204 | size += gd->bd->bi_dram[i].size; |
209 | debug("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start); | 205 | debug("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start); |
210 | #ifdef DEBUG | 206 | #ifdef DEBUG |
211 | print_size(gd->bd->bi_dram[i].size, "\n"); | 207 | print_size(gd->bd->bi_dram[i].size, "\n"); |
212 | #endif | 208 | #endif |
213 | } | 209 | } |
214 | debug("\nDRAM: "); | 210 | debug("\nDRAM: "); |
215 | #else | 211 | #else |
216 | size = gd->ram_size; | 212 | size = gd->ram_size; |
217 | #endif | 213 | #endif |
218 | 214 | ||
219 | print_size(size, ""); | 215 | print_size(size, ""); |
220 | board_add_ram_info(0); | 216 | board_add_ram_info(0); |
221 | putc('\n'); | 217 | putc('\n'); |
222 | 218 | ||
223 | return 0; | 219 | return 0; |
224 | } | 220 | } |
225 | 221 | ||
226 | ulong get_effective_memsize(void) | 222 | ulong get_effective_memsize(void) |
227 | { | 223 | { |
228 | #ifndef CONFIG_VERY_BIG_RAM | 224 | #ifndef CONFIG_VERY_BIG_RAM |
229 | return gd->ram_size; | 225 | return gd->ram_size; |
230 | #else | 226 | #else |
231 | /* limit stack to what we can reasonable map */ | 227 | /* limit stack to what we can reasonable map */ |
232 | return ((gd->ram_size > CONFIG_MAX_MEM_MAPPED) ? | 228 | return ((gd->ram_size > CONFIG_MAX_MEM_MAPPED) ? |
233 | CONFIG_MAX_MEM_MAPPED : gd->ram_size); | 229 | CONFIG_MAX_MEM_MAPPED : gd->ram_size); |
234 | #endif | 230 | #endif |
235 | } | 231 | } |
236 | 232 | ||
237 | void __dram_init_banksize(void) | 233 | void __dram_init_banksize(void) |
238 | { | 234 | { |
239 | #if defined(CONFIG_NR_DRAM_BANKS) && defined(CONFIG_SYS_SDRAM_BASE) | 235 | #if defined(CONFIG_NR_DRAM_BANKS) && defined(CONFIG_SYS_SDRAM_BASE) |
240 | gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; | 236 | gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; |
241 | gd->bd->bi_dram[0].size = get_effective_memsize(); | 237 | gd->bd->bi_dram[0].size = get_effective_memsize(); |
242 | #endif | 238 | #endif |
243 | } | 239 | } |
244 | 240 | ||
245 | void dram_init_banksize(void) | 241 | void dram_init_banksize(void) |
246 | __attribute__((weak, alias("__dram_init_banksize"))); | 242 | __attribute__((weak, alias("__dram_init_banksize"))); |
247 | 243 | ||
248 | #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) | 244 | #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) |
249 | static int init_func_i2c(void) | 245 | static int init_func_i2c(void) |
250 | { | 246 | { |
251 | puts("I2C: "); | 247 | puts("I2C: "); |
252 | #ifdef CONFIG_SYS_I2C | 248 | #ifdef CONFIG_SYS_I2C |
253 | i2c_init_all(); | 249 | i2c_init_all(); |
254 | #else | 250 | #else |
255 | i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); | 251 | i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); |
256 | #endif | 252 | #endif |
257 | puts("ready\n"); | 253 | puts("ready\n"); |
258 | return 0; | 254 | return 0; |
259 | } | 255 | } |
260 | #endif | 256 | #endif |
261 | 257 | ||
262 | #if defined(CONFIG_HARD_SPI) | 258 | #if defined(CONFIG_HARD_SPI) |
263 | static int init_func_spi(void) | 259 | static int init_func_spi(void) |
264 | { | 260 | { |
265 | puts("SPI: "); | 261 | puts("SPI: "); |
266 | spi_init(); | 262 | spi_init(); |
267 | puts("ready\n"); | 263 | puts("ready\n"); |
268 | return 0; | 264 | return 0; |
269 | } | 265 | } |
270 | #endif | 266 | #endif |
271 | 267 | ||
272 | __maybe_unused | 268 | __maybe_unused |
273 | static int zero_global_data(void) | 269 | static int zero_global_data(void) |
274 | { | 270 | { |
275 | memset((void *)gd, '\0', sizeof(gd_t)); | 271 | memset((void *)gd, '\0', sizeof(gd_t)); |
276 | 272 | ||
277 | return 0; | 273 | return 0; |
278 | } | 274 | } |
279 | 275 | ||
280 | static int setup_mon_len(void) | 276 | static int setup_mon_len(void) |
281 | { | 277 | { |
282 | #ifdef CONFIG_SYS_SYM_OFFSETS | 278 | #ifdef __ARM__ |
283 | gd->mon_len = _bss_end_ofs; | 279 | gd->mon_len = (ulong)&__bss_end - (ulong)_start; |
284 | #elif defined(CONFIG_SANDBOX) | 280 | #elif defined(CONFIG_SANDBOX) |
285 | gd->mon_len = (ulong)&_end - (ulong)_init; | 281 | gd->mon_len = (ulong)&_end - (ulong)_init; |
286 | #else | 282 | #else |
287 | /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */ | 283 | /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */ |
288 | gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE; | 284 | gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE; |
289 | #endif | 285 | #endif |
290 | return 0; | 286 | return 0; |
291 | } | 287 | } |
292 | 288 | ||
293 | __weak int arch_cpu_init(void) | 289 | __weak int arch_cpu_init(void) |
294 | { | 290 | { |
295 | return 0; | 291 | return 0; |
296 | } | 292 | } |
297 | 293 | ||
298 | #ifdef CONFIG_OF_HOSTFILE | 294 | #ifdef CONFIG_OF_HOSTFILE |
299 | 295 | ||
300 | #define CHECK(x) err = (x); if (err) goto failed; | 296 | #define CHECK(x) err = (x); if (err) goto failed; |
301 | 297 | ||
302 | /* Create an empty device tree blob */ | 298 | /* Create an empty device tree blob */ |
303 | static int make_empty_fdt(void *fdt) | 299 | static int make_empty_fdt(void *fdt) |
304 | { | 300 | { |
305 | int err; | 301 | int err; |
306 | 302 | ||
307 | CHECK(fdt_create(fdt, 256)); | 303 | CHECK(fdt_create(fdt, 256)); |
308 | CHECK(fdt_finish_reservemap(fdt)); | 304 | CHECK(fdt_finish_reservemap(fdt)); |
309 | CHECK(fdt_begin_node(fdt, "")); | 305 | CHECK(fdt_begin_node(fdt, "")); |
310 | CHECK(fdt_end_node(fdt)); | 306 | CHECK(fdt_end_node(fdt)); |
311 | CHECK(fdt_finish(fdt)); | 307 | CHECK(fdt_finish(fdt)); |
312 | 308 | ||
313 | return 0; | 309 | return 0; |
314 | failed: | 310 | failed: |
315 | printf("Unable to create empty FDT: %s\n", fdt_strerror(err)); | 311 | printf("Unable to create empty FDT: %s\n", fdt_strerror(err)); |
316 | return -EACCES; | 312 | return -EACCES; |
317 | } | 313 | } |
318 | 314 | ||
319 | static int read_fdt_from_file(void) | 315 | static int read_fdt_from_file(void) |
320 | { | 316 | { |
321 | struct sandbox_state *state = state_get_current(); | 317 | struct sandbox_state *state = state_get_current(); |
322 | void *blob; | 318 | void *blob; |
323 | int size; | 319 | int size; |
324 | int err; | 320 | int err; |
325 | 321 | ||
326 | blob = map_sysmem(CONFIG_SYS_FDT_LOAD_ADDR, 0); | 322 | blob = map_sysmem(CONFIG_SYS_FDT_LOAD_ADDR, 0); |
327 | if (!state->fdt_fname) { | 323 | if (!state->fdt_fname) { |
328 | err = make_empty_fdt(blob); | 324 | err = make_empty_fdt(blob); |
329 | if (!err) | 325 | if (!err) |
330 | goto done; | 326 | goto done; |
331 | return err; | 327 | return err; |
332 | } | 328 | } |
333 | err = fs_set_blk_dev("host", NULL, FS_TYPE_SANDBOX); | 329 | err = fs_set_blk_dev("host", NULL, FS_TYPE_SANDBOX); |
334 | if (err) | 330 | if (err) |
335 | return err; | 331 | return err; |
336 | size = fs_read(state->fdt_fname, CONFIG_SYS_FDT_LOAD_ADDR, 0, 0); | 332 | size = fs_read(state->fdt_fname, CONFIG_SYS_FDT_LOAD_ADDR, 0, 0); |
337 | if (size < 0) | 333 | if (size < 0) |
338 | return -EIO; | 334 | return -EIO; |
339 | 335 | ||
340 | done: | 336 | done: |
341 | gd->fdt_blob = blob; | 337 | gd->fdt_blob = blob; |
342 | 338 | ||
343 | return 0; | 339 | return 0; |
344 | } | 340 | } |
345 | #endif | 341 | #endif |
346 | 342 | ||
347 | #ifdef CONFIG_SANDBOX | 343 | #ifdef CONFIG_SANDBOX |
348 | static int setup_ram_buf(void) | 344 | static int setup_ram_buf(void) |
349 | { | 345 | { |
350 | struct sandbox_state *state = state_get_current(); | 346 | struct sandbox_state *state = state_get_current(); |
351 | 347 | ||
352 | gd->arch.ram_buf = state->ram_buf; | 348 | gd->arch.ram_buf = state->ram_buf; |
353 | gd->ram_size = state->ram_size; | 349 | gd->ram_size = state->ram_size; |
354 | 350 | ||
355 | return 0; | 351 | return 0; |
356 | } | 352 | } |
357 | #endif | 353 | #endif |
358 | 354 | ||
359 | static int setup_fdt(void) | 355 | static int setup_fdt(void) |
360 | { | 356 | { |
361 | #ifdef CONFIG_OF_EMBED | 357 | #ifdef CONFIG_OF_EMBED |
362 | /* Get a pointer to the FDT */ | 358 | /* Get a pointer to the FDT */ |
363 | gd->fdt_blob = __dtb_dt_begin; | 359 | gd->fdt_blob = __dtb_dt_begin; |
364 | #elif defined CONFIG_OF_SEPARATE | 360 | #elif defined CONFIG_OF_SEPARATE |
365 | /* FDT is at end of image */ | 361 | /* FDT is at end of image */ |
366 | # ifdef CONFIG_SYS_SYM_OFFSETS | ||
367 | gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE); | ||
368 | # else | ||
369 | gd->fdt_blob = (ulong *)&_end; | 362 | gd->fdt_blob = (ulong *)&_end; |
370 | # endif | ||
371 | #elif defined(CONFIG_OF_HOSTFILE) | 363 | #elif defined(CONFIG_OF_HOSTFILE) |
372 | if (read_fdt_from_file()) { | 364 | if (read_fdt_from_file()) { |
373 | puts("Failed to read control FDT\n"); | 365 | puts("Failed to read control FDT\n"); |
374 | return -1; | 366 | return -1; |
375 | } | 367 | } |
376 | #endif | 368 | #endif |
377 | /* Allow the early environment to override the fdt address */ | 369 | /* Allow the early environment to override the fdt address */ |
378 | gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, | 370 | gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16, |
379 | (uintptr_t)gd->fdt_blob); | 371 | (uintptr_t)gd->fdt_blob); |
380 | return 0; | 372 | return 0; |
381 | } | 373 | } |
382 | 374 | ||
383 | /* Get the top of usable RAM */ | 375 | /* Get the top of usable RAM */ |
384 | __weak ulong board_get_usable_ram_top(ulong total_size) | 376 | __weak ulong board_get_usable_ram_top(ulong total_size) |
385 | { | 377 | { |
386 | return gd->ram_top; | 378 | return gd->ram_top; |
387 | } | 379 | } |
388 | 380 | ||
389 | static int setup_dest_addr(void) | 381 | static int setup_dest_addr(void) |
390 | { | 382 | { |
391 | debug("Monitor len: %08lX\n", gd->mon_len); | 383 | debug("Monitor len: %08lX\n", gd->mon_len); |
392 | /* | 384 | /* |
393 | * Ram is setup, size stored in gd !! | 385 | * Ram is setup, size stored in gd !! |
394 | */ | 386 | */ |
395 | debug("Ram size: %08lX\n", (ulong)gd->ram_size); | 387 | debug("Ram size: %08lX\n", (ulong)gd->ram_size); |
396 | #if defined(CONFIG_SYS_MEM_TOP_HIDE) | 388 | #if defined(CONFIG_SYS_MEM_TOP_HIDE) |
397 | /* | 389 | /* |
398 | * Subtract specified amount of memory to hide so that it won't | 390 | * Subtract specified amount of memory to hide so that it won't |
399 | * get "touched" at all by U-Boot. By fixing up gd->ram_size | 391 | * get "touched" at all by U-Boot. By fixing up gd->ram_size |
400 | * the Linux kernel should now get passed the now "corrected" | 392 | * the Linux kernel should now get passed the now "corrected" |
401 | * memory size and won't touch it either. This should work | 393 | * memory size and won't touch it either. This should work |
402 | * for arch/ppc and arch/powerpc. Only Linux board ports in | 394 | * for arch/ppc and arch/powerpc. Only Linux board ports in |
403 | * arch/powerpc with bootwrapper support, that recalculate the | 395 | * arch/powerpc with bootwrapper support, that recalculate the |
404 | * memory size from the SDRAM controller setup will have to | 396 | * memory size from the SDRAM controller setup will have to |
405 | * get fixed. | 397 | * get fixed. |
406 | */ | 398 | */ |
407 | gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; | 399 | gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE; |
408 | #endif | 400 | #endif |
409 | #ifdef CONFIG_SYS_SDRAM_BASE | 401 | #ifdef CONFIG_SYS_SDRAM_BASE |
410 | gd->ram_top = CONFIG_SYS_SDRAM_BASE; | 402 | gd->ram_top = CONFIG_SYS_SDRAM_BASE; |
411 | #endif | 403 | #endif |
412 | gd->ram_top += get_effective_memsize(); | 404 | gd->ram_top += get_effective_memsize(); |
413 | gd->ram_top = board_get_usable_ram_top(gd->mon_len); | 405 | gd->ram_top = board_get_usable_ram_top(gd->mon_len); |
414 | gd->relocaddr = gd->ram_top; | 406 | gd->relocaddr = gd->ram_top; |
415 | debug("Ram top: %08lX\n", (ulong)gd->ram_top); | 407 | debug("Ram top: %08lX\n", (ulong)gd->ram_top); |
416 | #if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500)) | 408 | #if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500)) |
417 | /* | 409 | /* |
418 | * We need to make sure the location we intend to put secondary core | 410 | * We need to make sure the location we intend to put secondary core |
419 | * boot code is reserved and not used by any part of u-boot | 411 | * boot code is reserved and not used by any part of u-boot |
420 | */ | 412 | */ |
421 | if (gd->relocaddr > determine_mp_bootpg(NULL)) { | 413 | if (gd->relocaddr > determine_mp_bootpg(NULL)) { |
422 | gd->relocaddr = determine_mp_bootpg(NULL); | 414 | gd->relocaddr = determine_mp_bootpg(NULL); |
423 | debug("Reserving MP boot page to %08lx\n", gd->relocaddr); | 415 | debug("Reserving MP boot page to %08lx\n", gd->relocaddr); |
424 | } | 416 | } |
425 | #endif | 417 | #endif |
426 | return 0; | 418 | return 0; |
427 | } | 419 | } |
428 | 420 | ||
429 | #if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) | 421 | #if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) |
430 | static int reserve_logbuffer(void) | 422 | static int reserve_logbuffer(void) |
431 | { | 423 | { |
432 | /* reserve kernel log buffer */ | 424 | /* reserve kernel log buffer */ |
433 | gd->relocaddr -= LOGBUFF_RESERVE; | 425 | gd->relocaddr -= LOGBUFF_RESERVE; |
434 | debug("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, | 426 | debug("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, |
435 | gd->relocaddr); | 427 | gd->relocaddr); |
436 | return 0; | 428 | return 0; |
437 | } | 429 | } |
438 | #endif | 430 | #endif |
439 | 431 | ||
440 | #ifdef CONFIG_PRAM | 432 | #ifdef CONFIG_PRAM |
441 | /* reserve protected RAM */ | 433 | /* reserve protected RAM */ |
442 | static int reserve_pram(void) | 434 | static int reserve_pram(void) |
443 | { | 435 | { |
444 | ulong reg; | 436 | ulong reg; |
445 | 437 | ||
446 | reg = getenv_ulong("pram", 10, CONFIG_PRAM); | 438 | reg = getenv_ulong("pram", 10, CONFIG_PRAM); |
447 | gd->relocaddr -= (reg << 10); /* size is in kB */ | 439 | gd->relocaddr -= (reg << 10); /* size is in kB */ |
448 | debug("Reserving %ldk for protected RAM at %08lx\n", reg, | 440 | debug("Reserving %ldk for protected RAM at %08lx\n", reg, |
449 | gd->relocaddr); | 441 | gd->relocaddr); |
450 | return 0; | 442 | return 0; |
451 | } | 443 | } |
452 | #endif /* CONFIG_PRAM */ | 444 | #endif /* CONFIG_PRAM */ |
453 | 445 | ||
454 | /* Round memory pointer down to next 4 kB limit */ | 446 | /* Round memory pointer down to next 4 kB limit */ |
455 | static int reserve_round_4k(void) | 447 | static int reserve_round_4k(void) |
456 | { | 448 | { |
457 | gd->relocaddr &= ~(4096 - 1); | 449 | gd->relocaddr &= ~(4096 - 1); |
458 | return 0; | 450 | return 0; |
459 | } | 451 | } |
460 | 452 | ||
461 | #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ | 453 | #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ |
462 | defined(CONFIG_ARM) | 454 | defined(CONFIG_ARM) |
463 | static int reserve_mmu(void) | 455 | static int reserve_mmu(void) |
464 | { | 456 | { |
465 | /* reserve TLB table */ | 457 | /* reserve TLB table */ |
466 | gd->arch.tlb_size = PGTABLE_SIZE; | 458 | gd->arch.tlb_size = PGTABLE_SIZE; |
467 | gd->relocaddr -= gd->arch.tlb_size; | 459 | gd->relocaddr -= gd->arch.tlb_size; |
468 | 460 | ||
469 | /* round down to next 64 kB limit */ | 461 | /* round down to next 64 kB limit */ |
470 | gd->relocaddr &= ~(0x10000 - 1); | 462 | gd->relocaddr &= ~(0x10000 - 1); |
471 | 463 | ||
472 | gd->arch.tlb_addr = gd->relocaddr; | 464 | gd->arch.tlb_addr = gd->relocaddr; |
473 | debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr, | 465 | debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr, |
474 | gd->arch.tlb_addr + gd->arch.tlb_size); | 466 | gd->arch.tlb_addr + gd->arch.tlb_size); |
475 | return 0; | 467 | return 0; |
476 | } | 468 | } |
477 | #endif | 469 | #endif |
478 | 470 | ||
479 | #ifdef CONFIG_LCD | 471 | #ifdef CONFIG_LCD |
480 | static int reserve_lcd(void) | 472 | static int reserve_lcd(void) |
481 | { | 473 | { |
482 | #ifdef CONFIG_FB_ADDR | 474 | #ifdef CONFIG_FB_ADDR |
483 | gd->fb_base = CONFIG_FB_ADDR; | 475 | gd->fb_base = CONFIG_FB_ADDR; |
484 | #else | 476 | #else |
485 | /* reserve memory for LCD display (always full pages) */ | 477 | /* reserve memory for LCD display (always full pages) */ |
486 | gd->relocaddr = lcd_setmem(gd->relocaddr); | 478 | gd->relocaddr = lcd_setmem(gd->relocaddr); |
487 | gd->fb_base = gd->relocaddr; | 479 | gd->fb_base = gd->relocaddr; |
488 | #endif /* CONFIG_FB_ADDR */ | 480 | #endif /* CONFIG_FB_ADDR */ |
489 | return 0; | 481 | return 0; |
490 | } | 482 | } |
491 | #endif /* CONFIG_LCD */ | 483 | #endif /* CONFIG_LCD */ |
492 | 484 | ||
493 | static int reserve_trace(void) | 485 | static int reserve_trace(void) |
494 | { | 486 | { |
495 | #ifdef CONFIG_TRACE | 487 | #ifdef CONFIG_TRACE |
496 | gd->relocaddr -= CONFIG_TRACE_BUFFER_SIZE; | 488 | gd->relocaddr -= CONFIG_TRACE_BUFFER_SIZE; |
497 | gd->trace_buff = map_sysmem(gd->relocaddr, CONFIG_TRACE_BUFFER_SIZE); | 489 | gd->trace_buff = map_sysmem(gd->relocaddr, CONFIG_TRACE_BUFFER_SIZE); |
498 | debug("Reserving %dk for trace data at: %08lx\n", | 490 | debug("Reserving %dk for trace data at: %08lx\n", |
499 | CONFIG_TRACE_BUFFER_SIZE >> 10, gd->relocaddr); | 491 | CONFIG_TRACE_BUFFER_SIZE >> 10, gd->relocaddr); |
500 | #endif | 492 | #endif |
501 | 493 | ||
502 | return 0; | 494 | return 0; |
503 | } | 495 | } |
504 | 496 | ||
505 | #if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \ | 497 | #if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \ |
506 | && !defined(CONFIG_ARM) && !defined(CONFIG_X86) | 498 | && !defined(CONFIG_ARM) && !defined(CONFIG_X86) |
507 | static int reserve_video(void) | 499 | static int reserve_video(void) |
508 | { | 500 | { |
509 | /* reserve memory for video display (always full pages) */ | 501 | /* reserve memory for video display (always full pages) */ |
510 | gd->relocaddr = video_setmem(gd->relocaddr); | 502 | gd->relocaddr = video_setmem(gd->relocaddr); |
511 | gd->fb_base = gd->relocaddr; | 503 | gd->fb_base = gd->relocaddr; |
512 | 504 | ||
513 | return 0; | 505 | return 0; |
514 | } | 506 | } |
515 | #endif | 507 | #endif |
516 | 508 | ||
517 | static int reserve_uboot(void) | 509 | static int reserve_uboot(void) |
518 | { | 510 | { |
519 | /* | 511 | /* |
520 | * reserve memory for U-Boot code, data & bss | 512 | * reserve memory for U-Boot code, data & bss |
521 | * round down to next 4 kB limit | 513 | * round down to next 4 kB limit |
522 | */ | 514 | */ |
523 | gd->relocaddr -= gd->mon_len; | 515 | gd->relocaddr -= gd->mon_len; |
524 | gd->relocaddr &= ~(4096 - 1); | 516 | gd->relocaddr &= ~(4096 - 1); |
525 | #ifdef CONFIG_E500 | 517 | #ifdef CONFIG_E500 |
526 | /* round down to next 64 kB limit so that IVPR stays aligned */ | 518 | /* round down to next 64 kB limit so that IVPR stays aligned */ |
527 | gd->relocaddr &= ~(65536 - 1); | 519 | gd->relocaddr &= ~(65536 - 1); |
528 | #endif | 520 | #endif |
529 | 521 | ||
530 | debug("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10, | 522 | debug("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10, |
531 | gd->relocaddr); | 523 | gd->relocaddr); |
532 | 524 | ||
533 | gd->start_addr_sp = gd->relocaddr; | 525 | gd->start_addr_sp = gd->relocaddr; |
534 | 526 | ||
535 | return 0; | 527 | return 0; |
536 | } | 528 | } |
537 | 529 | ||
538 | #ifndef CONFIG_SPL_BUILD | 530 | #ifndef CONFIG_SPL_BUILD |
539 | /* reserve memory for malloc() area */ | 531 | /* reserve memory for malloc() area */ |
540 | static int reserve_malloc(void) | 532 | static int reserve_malloc(void) |
541 | { | 533 | { |
542 | gd->start_addr_sp = gd->start_addr_sp - TOTAL_MALLOC_LEN; | 534 | gd->start_addr_sp = gd->start_addr_sp - TOTAL_MALLOC_LEN; |
543 | debug("Reserving %dk for malloc() at: %08lx\n", | 535 | debug("Reserving %dk for malloc() at: %08lx\n", |
544 | TOTAL_MALLOC_LEN >> 10, gd->start_addr_sp); | 536 | TOTAL_MALLOC_LEN >> 10, gd->start_addr_sp); |
545 | return 0; | 537 | return 0; |
546 | } | 538 | } |
547 | 539 | ||
548 | /* (permanently) allocate a Board Info struct */ | 540 | /* (permanently) allocate a Board Info struct */ |
549 | static int reserve_board(void) | 541 | static int reserve_board(void) |
550 | { | 542 | { |
551 | gd->start_addr_sp -= sizeof(bd_t); | 543 | gd->start_addr_sp -= sizeof(bd_t); |
552 | gd->bd = (bd_t *)map_sysmem(gd->start_addr_sp, sizeof(bd_t)); | 544 | gd->bd = (bd_t *)map_sysmem(gd->start_addr_sp, sizeof(bd_t)); |
553 | memset(gd->bd, '\0', sizeof(bd_t)); | 545 | memset(gd->bd, '\0', sizeof(bd_t)); |
554 | debug("Reserving %zu Bytes for Board Info at: %08lx\n", | 546 | debug("Reserving %zu Bytes for Board Info at: %08lx\n", |
555 | sizeof(bd_t), gd->start_addr_sp); | 547 | sizeof(bd_t), gd->start_addr_sp); |
556 | return 0; | 548 | return 0; |
557 | } | 549 | } |
558 | #endif | 550 | #endif |
559 | 551 | ||
560 | static int setup_machine(void) | 552 | static int setup_machine(void) |
561 | { | 553 | { |
562 | #ifdef CONFIG_MACH_TYPE | 554 | #ifdef CONFIG_MACH_TYPE |
563 | gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ | 555 | gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */ |
564 | #endif | 556 | #endif |
565 | return 0; | 557 | return 0; |
566 | } | 558 | } |
567 | 559 | ||
568 | static int reserve_global_data(void) | 560 | static int reserve_global_data(void) |
569 | { | 561 | { |
570 | gd->start_addr_sp -= sizeof(gd_t); | 562 | gd->start_addr_sp -= sizeof(gd_t); |
571 | gd->new_gd = (gd_t *)map_sysmem(gd->start_addr_sp, sizeof(gd_t)); | 563 | gd->new_gd = (gd_t *)map_sysmem(gd->start_addr_sp, sizeof(gd_t)); |
572 | debug("Reserving %zu Bytes for Global Data at: %08lx\n", | 564 | debug("Reserving %zu Bytes for Global Data at: %08lx\n", |
573 | sizeof(gd_t), gd->start_addr_sp); | 565 | sizeof(gd_t), gd->start_addr_sp); |
574 | return 0; | 566 | return 0; |
575 | } | 567 | } |
576 | 568 | ||
577 | static int reserve_fdt(void) | 569 | static int reserve_fdt(void) |
578 | { | 570 | { |
579 | /* | 571 | /* |
580 | * If the device tree is sitting immediate above our image then we | 572 | * If the device tree is sitting immediate above our image then we |
581 | * must relocate it. If it is embedded in the data section, then it | 573 | * must relocate it. If it is embedded in the data section, then it |
582 | * will be relocated with other data. | 574 | * will be relocated with other data. |
583 | */ | 575 | */ |
584 | if (gd->fdt_blob) { | 576 | if (gd->fdt_blob) { |
585 | gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32); | 577 | gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32); |
586 | 578 | ||
587 | gd->start_addr_sp -= gd->fdt_size; | 579 | gd->start_addr_sp -= gd->fdt_size; |
588 | gd->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size); | 580 | gd->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size); |
589 | debug("Reserving %lu Bytes for FDT at: %08lx\n", | 581 | debug("Reserving %lu Bytes for FDT at: %08lx\n", |
590 | gd->fdt_size, gd->start_addr_sp); | 582 | gd->fdt_size, gd->start_addr_sp); |
591 | } | 583 | } |
592 | 584 | ||
593 | return 0; | 585 | return 0; |
594 | } | 586 | } |
595 | 587 | ||
596 | static int reserve_stacks(void) | 588 | static int reserve_stacks(void) |
597 | { | 589 | { |
598 | #ifdef CONFIG_SPL_BUILD | 590 | #ifdef CONFIG_SPL_BUILD |
599 | # ifdef CONFIG_ARM | 591 | # ifdef CONFIG_ARM |
600 | gd->start_addr_sp -= 128; /* leave 32 words for abort-stack */ | 592 | gd->start_addr_sp -= 128; /* leave 32 words for abort-stack */ |
601 | gd->irq_sp = gd->start_addr_sp; | 593 | gd->irq_sp = gd->start_addr_sp; |
602 | # endif | 594 | # endif |
603 | #else | 595 | #else |
604 | # ifdef CONFIG_PPC | 596 | # ifdef CONFIG_PPC |
605 | ulong *s; | 597 | ulong *s; |
606 | # endif | 598 | # endif |
607 | 599 | ||
608 | /* setup stack pointer for exceptions */ | 600 | /* setup stack pointer for exceptions */ |
609 | gd->start_addr_sp -= 16; | 601 | gd->start_addr_sp -= 16; |
610 | gd->start_addr_sp &= ~0xf; | 602 | gd->start_addr_sp &= ~0xf; |
611 | gd->irq_sp = gd->start_addr_sp; | 603 | gd->irq_sp = gd->start_addr_sp; |
612 | 604 | ||
613 | /* | 605 | /* |
614 | * Handle architecture-specific things here | 606 | * Handle architecture-specific things here |
615 | * TODO(sjg@chromium.org): Perhaps create arch_reserve_stack() | 607 | * TODO(sjg@chromium.org): Perhaps create arch_reserve_stack() |
616 | * to handle this and put in arch/xxx/lib/stack.c | 608 | * to handle this and put in arch/xxx/lib/stack.c |
617 | */ | 609 | */ |
618 | # if defined(CONFIG_ARM) && !defined(CONFIG_ARM64) | 610 | # if defined(CONFIG_ARM) && !defined(CONFIG_ARM64) |
619 | # ifdef CONFIG_USE_IRQ | 611 | # ifdef CONFIG_USE_IRQ |
620 | gd->start_addr_sp -= (CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ); | 612 | gd->start_addr_sp -= (CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ); |
621 | debug("Reserving %zu Bytes for IRQ stack at: %08lx\n", | 613 | debug("Reserving %zu Bytes for IRQ stack at: %08lx\n", |
622 | CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ, gd->start_addr_sp); | 614 | CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ, gd->start_addr_sp); |
623 | 615 | ||
624 | /* 8-byte alignment for ARM ABI compliance */ | 616 | /* 8-byte alignment for ARM ABI compliance */ |
625 | gd->start_addr_sp &= ~0x07; | 617 | gd->start_addr_sp &= ~0x07; |
626 | # endif | 618 | # endif |
627 | /* leave 3 words for abort-stack, plus 1 for alignment */ | 619 | /* leave 3 words for abort-stack, plus 1 for alignment */ |
628 | gd->start_addr_sp -= 16; | 620 | gd->start_addr_sp -= 16; |
629 | # elif defined(CONFIG_PPC) | 621 | # elif defined(CONFIG_PPC) |
630 | /* Clear initial stack frame */ | 622 | /* Clear initial stack frame */ |
631 | s = (ulong *) gd->start_addr_sp; | 623 | s = (ulong *) gd->start_addr_sp; |
632 | *s = 0; /* Terminate back chain */ | 624 | *s = 0; /* Terminate back chain */ |
633 | *++s = 0; /* NULL return address */ | 625 | *++s = 0; /* NULL return address */ |
634 | # endif /* Architecture specific code */ | 626 | # endif /* Architecture specific code */ |
635 | 627 | ||
636 | return 0; | 628 | return 0; |
637 | #endif | 629 | #endif |
638 | } | 630 | } |
639 | 631 | ||
640 | static int display_new_sp(void) | 632 | static int display_new_sp(void) |
641 | { | 633 | { |
642 | debug("New Stack Pointer is: %08lx\n", gd->start_addr_sp); | 634 | debug("New Stack Pointer is: %08lx\n", gd->start_addr_sp); |
643 | 635 | ||
644 | return 0; | 636 | return 0; |
645 | } | 637 | } |
646 | 638 | ||
647 | #ifdef CONFIG_PPC | 639 | #ifdef CONFIG_PPC |
648 | static int setup_board_part1(void) | 640 | static int setup_board_part1(void) |
649 | { | 641 | { |
650 | bd_t *bd = gd->bd; | 642 | bd_t *bd = gd->bd; |
651 | 643 | ||
652 | /* | 644 | /* |
653 | * Save local variables to board info struct | 645 | * Save local variables to board info struct |
654 | */ | 646 | */ |
655 | 647 | ||
656 | bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; /* start of memory */ | 648 | bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; /* start of memory */ |
657 | bd->bi_memsize = gd->ram_size; /* size in bytes */ | 649 | bd->bi_memsize = gd->ram_size; /* size in bytes */ |
658 | 650 | ||
659 | #ifdef CONFIG_SYS_SRAM_BASE | 651 | #ifdef CONFIG_SYS_SRAM_BASE |
660 | bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */ | 652 | bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */ |
661 | bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */ | 653 | bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */ |
662 | #endif | 654 | #endif |
663 | 655 | ||
664 | #if defined(CONFIG_8xx) || defined(CONFIG_8260) || defined(CONFIG_5xx) || \ | 656 | #if defined(CONFIG_8xx) || defined(CONFIG_8260) || defined(CONFIG_5xx) || \ |
665 | defined(CONFIG_E500) || defined(CONFIG_MPC86xx) | 657 | defined(CONFIG_E500) || defined(CONFIG_MPC86xx) |
666 | bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */ | 658 | bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */ |
667 | #endif | 659 | #endif |
668 | #if defined(CONFIG_MPC5xxx) | 660 | #if defined(CONFIG_MPC5xxx) |
669 | bd->bi_mbar_base = CONFIG_SYS_MBAR; /* base of internal registers */ | 661 | bd->bi_mbar_base = CONFIG_SYS_MBAR; /* base of internal registers */ |
670 | #endif | 662 | #endif |
671 | #if defined(CONFIG_MPC83xx) | 663 | #if defined(CONFIG_MPC83xx) |
672 | bd->bi_immrbar = CONFIG_SYS_IMMR; | 664 | bd->bi_immrbar = CONFIG_SYS_IMMR; |
673 | #endif | 665 | #endif |
674 | 666 | ||
675 | return 0; | 667 | return 0; |
676 | } | 668 | } |
677 | 669 | ||
678 | static int setup_board_part2(void) | 670 | static int setup_board_part2(void) |
679 | { | 671 | { |
680 | bd_t *bd = gd->bd; | 672 | bd_t *bd = gd->bd; |
681 | 673 | ||
682 | bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */ | 674 | bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */ |
683 | bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */ | 675 | bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */ |
684 | #if defined(CONFIG_CPM2) | 676 | #if defined(CONFIG_CPM2) |
685 | bd->bi_cpmfreq = gd->arch.cpm_clk; | 677 | bd->bi_cpmfreq = gd->arch.cpm_clk; |
686 | bd->bi_brgfreq = gd->arch.brg_clk; | 678 | bd->bi_brgfreq = gd->arch.brg_clk; |
687 | bd->bi_sccfreq = gd->arch.scc_clk; | 679 | bd->bi_sccfreq = gd->arch.scc_clk; |
688 | bd->bi_vco = gd->arch.vco_out; | 680 | bd->bi_vco = gd->arch.vco_out; |
689 | #endif /* CONFIG_CPM2 */ | 681 | #endif /* CONFIG_CPM2 */ |
690 | #if defined(CONFIG_MPC512X) | 682 | #if defined(CONFIG_MPC512X) |
691 | bd->bi_ipsfreq = gd->arch.ips_clk; | 683 | bd->bi_ipsfreq = gd->arch.ips_clk; |
692 | #endif /* CONFIG_MPC512X */ | 684 | #endif /* CONFIG_MPC512X */ |
693 | #if defined(CONFIG_MPC5xxx) | 685 | #if defined(CONFIG_MPC5xxx) |
694 | bd->bi_ipbfreq = gd->arch.ipb_clk; | 686 | bd->bi_ipbfreq = gd->arch.ipb_clk; |
695 | bd->bi_pcifreq = gd->pci_clk; | 687 | bd->bi_pcifreq = gd->pci_clk; |
696 | #endif /* CONFIG_MPC5xxx */ | 688 | #endif /* CONFIG_MPC5xxx */ |
697 | 689 | ||
698 | return 0; | 690 | return 0; |
699 | } | 691 | } |
700 | #endif | 692 | #endif |
701 | 693 | ||
702 | #ifdef CONFIG_SYS_EXTBDINFO | 694 | #ifdef CONFIG_SYS_EXTBDINFO |
703 | static int setup_board_extra(void) | 695 | static int setup_board_extra(void) |
704 | { | 696 | { |
705 | bd_t *bd = gd->bd; | 697 | bd_t *bd = gd->bd; |
706 | 698 | ||
707 | strncpy((char *) bd->bi_s_version, "1.2", sizeof(bd->bi_s_version)); | 699 | strncpy((char *) bd->bi_s_version, "1.2", sizeof(bd->bi_s_version)); |
708 | strncpy((char *) bd->bi_r_version, U_BOOT_VERSION, | 700 | strncpy((char *) bd->bi_r_version, U_BOOT_VERSION, |
709 | sizeof(bd->bi_r_version)); | 701 | sizeof(bd->bi_r_version)); |
710 | 702 | ||
711 | bd->bi_procfreq = gd->cpu_clk; /* Processor Speed, In Hz */ | 703 | bd->bi_procfreq = gd->cpu_clk; /* Processor Speed, In Hz */ |
712 | bd->bi_plb_busfreq = gd->bus_clk; | 704 | bd->bi_plb_busfreq = gd->bus_clk; |
713 | #if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \ | 705 | #if defined(CONFIG_405GP) || defined(CONFIG_405EP) || \ |
714 | defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ | 706 | defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
715 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) | 707 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) |
716 | bd->bi_pci_busfreq = get_PCI_freq(); | 708 | bd->bi_pci_busfreq = get_PCI_freq(); |
717 | bd->bi_opbfreq = get_OPB_freq(); | 709 | bd->bi_opbfreq = get_OPB_freq(); |
718 | #elif defined(CONFIG_XILINX_405) | 710 | #elif defined(CONFIG_XILINX_405) |
719 | bd->bi_pci_busfreq = get_PCI_freq(); | 711 | bd->bi_pci_busfreq = get_PCI_freq(); |
720 | #endif | 712 | #endif |
721 | 713 | ||
722 | return 0; | 714 | return 0; |
723 | } | 715 | } |
724 | #endif | 716 | #endif |
725 | 717 | ||
726 | #ifdef CONFIG_POST | 718 | #ifdef CONFIG_POST |
727 | static int init_post(void) | 719 | static int init_post(void) |
728 | { | 720 | { |
729 | post_bootmode_init(); | 721 | post_bootmode_init(); |
730 | post_run(NULL, POST_ROM | post_bootmode_get(0)); | 722 | post_run(NULL, POST_ROM | post_bootmode_get(0)); |
731 | 723 | ||
732 | return 0; | 724 | return 0; |
733 | } | 725 | } |
734 | #endif | 726 | #endif |
735 | 727 | ||
736 | static int setup_baud_rate(void) | 728 | static int setup_baud_rate(void) |
737 | { | 729 | { |
738 | /* Ick, can we get rid of this line? */ | 730 | /* Ick, can we get rid of this line? */ |
739 | gd->bd->bi_baudrate = gd->baudrate; | 731 | gd->bd->bi_baudrate = gd->baudrate; |
740 | 732 | ||
741 | return 0; | 733 | return 0; |
742 | } | 734 | } |
743 | 735 | ||
744 | static int setup_dram_config(void) | 736 | static int setup_dram_config(void) |
745 | { | 737 | { |
746 | /* Ram is board specific, so move it to board code ... */ | 738 | /* Ram is board specific, so move it to board code ... */ |
747 | dram_init_banksize(); | 739 | dram_init_banksize(); |
748 | 740 | ||
749 | return 0; | 741 | return 0; |
750 | } | 742 | } |
751 | 743 | ||
752 | static int reloc_fdt(void) | 744 | static int reloc_fdt(void) |
753 | { | 745 | { |
754 | if (gd->new_fdt) { | 746 | if (gd->new_fdt) { |
755 | memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size); | 747 | memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size); |
756 | gd->fdt_blob = gd->new_fdt; | 748 | gd->fdt_blob = gd->new_fdt; |
757 | } | 749 | } |
758 | 750 | ||
759 | return 0; | 751 | return 0; |
760 | } | 752 | } |
761 | 753 | ||
762 | static int setup_reloc(void) | 754 | static int setup_reloc(void) |
763 | { | 755 | { |
764 | gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE; | 756 | gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE; |
765 | memcpy(gd->new_gd, (char *)gd, sizeof(gd_t)); | 757 | memcpy(gd->new_gd, (char *)gd, sizeof(gd_t)); |
766 | 758 | ||
767 | debug("Relocation Offset is: %08lx\n", gd->reloc_off); | 759 | debug("Relocation Offset is: %08lx\n", gd->reloc_off); |
768 | debug("Relocating to %08lx, new gd at %08lx, sp at %08lx\n", | 760 | debug("Relocating to %08lx, new gd at %08lx, sp at %08lx\n", |
769 | gd->relocaddr, (ulong)map_to_sysmem(gd->new_gd), | 761 | gd->relocaddr, (ulong)map_to_sysmem(gd->new_gd), |
770 | gd->start_addr_sp); | 762 | gd->start_addr_sp); |
771 | 763 | ||
772 | return 0; | 764 | return 0; |
773 | } | 765 | } |
774 | 766 | ||
775 | /* ARM calls relocate_code from its crt0.S */ | 767 | /* ARM calls relocate_code from its crt0.S */ |
776 | #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) | 768 | #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) |
777 | 769 | ||
778 | static int jump_to_copy(void) | 770 | static int jump_to_copy(void) |
779 | { | 771 | { |
780 | /* | 772 | /* |
781 | * x86 is special, but in a nice way. It uses a trampoline which | 773 | * x86 is special, but in a nice way. It uses a trampoline which |
782 | * enables the dcache if possible. | 774 | * enables the dcache if possible. |
783 | * | 775 | * |
784 | * For now, other archs use relocate_code(), which is implemented | 776 | * For now, other archs use relocate_code(), which is implemented |
785 | * similarly for all archs. When we do generic relocation, hopefully | 777 | * similarly for all archs. When we do generic relocation, hopefully |
786 | * we can make all archs enable the dcache prior to relocation. | 778 | * we can make all archs enable the dcache prior to relocation. |
787 | */ | 779 | */ |
788 | #ifdef CONFIG_X86 | 780 | #ifdef CONFIG_X86 |
789 | /* | 781 | /* |
790 | * SDRAM and console are now initialised. The final stack can now | 782 | * SDRAM and console are now initialised. The final stack can now |
791 | * be setup in SDRAM. Code execution will continue in Flash, but | 783 | * be setup in SDRAM. Code execution will continue in Flash, but |
792 | * with the stack in SDRAM and Global Data in temporary memory | 784 | * with the stack in SDRAM and Global Data in temporary memory |
793 | * (CPU cache) | 785 | * (CPU cache) |
794 | */ | 786 | */ |
795 | board_init_f_r_trampoline(gd->start_addr_sp); | 787 | board_init_f_r_trampoline(gd->start_addr_sp); |
796 | #else | 788 | #else |
797 | relocate_code(gd->start_addr_sp, gd->new_gd, gd->relocaddr); | 789 | relocate_code(gd->start_addr_sp, gd->new_gd, gd->relocaddr); |
798 | #endif | 790 | #endif |
799 | 791 | ||
800 | return 0; | 792 | return 0; |
801 | } | 793 | } |
802 | #endif | 794 | #endif |
803 | 795 | ||
804 | /* Record the board_init_f() bootstage (after arch_cpu_init()) */ | 796 | /* Record the board_init_f() bootstage (after arch_cpu_init()) */ |
805 | static int mark_bootstage(void) | 797 | static int mark_bootstage(void) |
806 | { | 798 | { |
807 | bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); | 799 | bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); |
808 | 800 | ||
809 | return 0; | 801 | return 0; |
810 | } | 802 | } |
811 | 803 | ||
812 | static init_fnc_t init_sequence_f[] = { | 804 | static init_fnc_t init_sequence_f[] = { |
813 | #ifdef CONFIG_SANDBOX | 805 | #ifdef CONFIG_SANDBOX |
814 | setup_ram_buf, | 806 | setup_ram_buf, |
815 | #endif | 807 | #endif |
816 | setup_mon_len, | 808 | setup_mon_len, |
817 | setup_fdt, | 809 | setup_fdt, |
818 | trace_early_init, | 810 | trace_early_init, |
819 | #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) | 811 | #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) |
820 | /* TODO: can this go into arch_cpu_init()? */ | 812 | /* TODO: can this go into arch_cpu_init()? */ |
821 | probecpu, | 813 | probecpu, |
822 | #endif | 814 | #endif |
823 | arch_cpu_init, /* basic arch cpu dependent setup */ | 815 | arch_cpu_init, /* basic arch cpu dependent setup */ |
824 | #ifdef CONFIG_X86 | 816 | #ifdef CONFIG_X86 |
825 | cpu_init_f, /* TODO(sjg@chromium.org): remove */ | 817 | cpu_init_f, /* TODO(sjg@chromium.org): remove */ |
826 | # ifdef CONFIG_OF_CONTROL | 818 | # ifdef CONFIG_OF_CONTROL |
827 | find_fdt, /* TODO(sjg@chromium.org): remove */ | 819 | find_fdt, /* TODO(sjg@chromium.org): remove */ |
828 | # endif | 820 | # endif |
829 | #endif | 821 | #endif |
830 | mark_bootstage, | 822 | mark_bootstage, |
831 | #ifdef CONFIG_OF_CONTROL | 823 | #ifdef CONFIG_OF_CONTROL |
832 | fdtdec_check_fdt, | 824 | fdtdec_check_fdt, |
833 | #endif | 825 | #endif |
834 | #if defined(CONFIG_BOARD_EARLY_INIT_F) | 826 | #if defined(CONFIG_BOARD_EARLY_INIT_F) |
835 | board_early_init_f, | 827 | board_early_init_f, |
836 | #endif | 828 | #endif |
837 | /* TODO: can any of this go into arch_cpu_init()? */ | 829 | /* TODO: can any of this go into arch_cpu_init()? */ |
838 | #if defined(CONFIG_PPC) && !defined(CONFIG_8xx_CPUCLK_DEFAULT) | 830 | #if defined(CONFIG_PPC) && !defined(CONFIG_8xx_CPUCLK_DEFAULT) |
839 | get_clocks, /* get CPU and bus clocks (etc.) */ | 831 | get_clocks, /* get CPU and bus clocks (etc.) */ |
840 | #if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M) \ | 832 | #if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M) \ |
841 | && !defined(CONFIG_TQM885D) | 833 | && !defined(CONFIG_TQM885D) |
842 | adjust_sdram_tbs_8xx, | 834 | adjust_sdram_tbs_8xx, |
843 | #endif | 835 | #endif |
844 | /* TODO: can we rename this to timer_init()? */ | 836 | /* TODO: can we rename this to timer_init()? */ |
845 | init_timebase, | 837 | init_timebase, |
846 | #endif | 838 | #endif |
847 | #ifdef CONFIG_ARM | 839 | #ifdef CONFIG_ARM |
848 | timer_init, /* initialize timer */ | 840 | timer_init, /* initialize timer */ |
849 | #endif | 841 | #endif |
850 | #ifdef CONFIG_SYS_ALLOC_DPRAM | 842 | #ifdef CONFIG_SYS_ALLOC_DPRAM |
851 | #if !defined(CONFIG_CPM2) | 843 | #if !defined(CONFIG_CPM2) |
852 | dpram_init, | 844 | dpram_init, |
853 | #endif | 845 | #endif |
854 | #endif | 846 | #endif |
855 | #if defined(CONFIG_BOARD_POSTCLK_INIT) | 847 | #if defined(CONFIG_BOARD_POSTCLK_INIT) |
856 | board_postclk_init, | 848 | board_postclk_init, |
857 | #endif | 849 | #endif |
858 | #ifdef CONFIG_FSL_ESDHC | 850 | #ifdef CONFIG_FSL_ESDHC |
859 | get_clocks, | 851 | get_clocks, |
860 | #endif | 852 | #endif |
861 | env_init, /* initialize environment */ | 853 | env_init, /* initialize environment */ |
862 | #if defined(CONFIG_8xx_CPUCLK_DEFAULT) | 854 | #if defined(CONFIG_8xx_CPUCLK_DEFAULT) |
863 | /* get CPU and bus clocks according to the environment variable */ | 855 | /* get CPU and bus clocks according to the environment variable */ |
864 | get_clocks_866, | 856 | get_clocks_866, |
865 | /* adjust sdram refresh rate according to the new clock */ | 857 | /* adjust sdram refresh rate according to the new clock */ |
866 | sdram_adjust_866, | 858 | sdram_adjust_866, |
867 | init_timebase, | 859 | init_timebase, |
868 | #endif | 860 | #endif |
869 | init_baud_rate, /* initialze baudrate settings */ | 861 | init_baud_rate, /* initialze baudrate settings */ |
870 | serial_init, /* serial communications setup */ | 862 | serial_init, /* serial communications setup */ |
871 | console_init_f, /* stage 1 init of console */ | 863 | console_init_f, /* stage 1 init of console */ |
872 | #ifdef CONFIG_SANDBOX | 864 | #ifdef CONFIG_SANDBOX |
873 | sandbox_early_getopt_check, | 865 | sandbox_early_getopt_check, |
874 | #endif | 866 | #endif |
875 | #ifdef CONFIG_OF_CONTROL | 867 | #ifdef CONFIG_OF_CONTROL |
876 | fdtdec_prepare_fdt, | 868 | fdtdec_prepare_fdt, |
877 | #endif | 869 | #endif |
878 | display_options, /* say that we are here */ | 870 | display_options, /* say that we are here */ |
879 | display_text_info, /* show debugging info if required */ | 871 | display_text_info, /* show debugging info if required */ |
880 | #if defined(CONFIG_8260) | 872 | #if defined(CONFIG_8260) |
881 | prt_8260_rsr, | 873 | prt_8260_rsr, |
882 | prt_8260_clks, | 874 | prt_8260_clks, |
883 | #endif /* CONFIG_8260 */ | 875 | #endif /* CONFIG_8260 */ |
884 | #if defined(CONFIG_MPC83xx) | 876 | #if defined(CONFIG_MPC83xx) |
885 | prt_83xx_rsr, | 877 | prt_83xx_rsr, |
886 | #endif | 878 | #endif |
887 | #ifdef CONFIG_PPC | 879 | #ifdef CONFIG_PPC |
888 | checkcpu, | 880 | checkcpu, |
889 | #endif | 881 | #endif |
890 | print_cpuinfo, /* display cpu info (and speed) */ | 882 | print_cpuinfo, /* display cpu info (and speed) */ |
891 | #if defined(CONFIG_MPC5xxx) | 883 | #if defined(CONFIG_MPC5xxx) |
892 | prt_mpc5xxx_clks, | 884 | prt_mpc5xxx_clks, |
893 | #endif /* CONFIG_MPC5xxx */ | 885 | #endif /* CONFIG_MPC5xxx */ |
894 | #if defined(CONFIG_DISPLAY_BOARDINFO) | 886 | #if defined(CONFIG_DISPLAY_BOARDINFO) |
895 | checkboard, /* display board info */ | 887 | checkboard, /* display board info */ |
896 | #endif | 888 | #endif |
897 | INIT_FUNC_WATCHDOG_INIT | 889 | INIT_FUNC_WATCHDOG_INIT |
898 | #if defined(CONFIG_MISC_INIT_F) | 890 | #if defined(CONFIG_MISC_INIT_F) |
899 | misc_init_f, | 891 | misc_init_f, |
900 | #endif | 892 | #endif |
901 | INIT_FUNC_WATCHDOG_RESET | 893 | INIT_FUNC_WATCHDOG_RESET |
902 | #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) | 894 | #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C) |
903 | init_func_i2c, | 895 | init_func_i2c, |
904 | #endif | 896 | #endif |
905 | #if defined(CONFIG_HARD_SPI) | 897 | #if defined(CONFIG_HARD_SPI) |
906 | init_func_spi, | 898 | init_func_spi, |
907 | #endif | 899 | #endif |
908 | #ifdef CONFIG_X86 | 900 | #ifdef CONFIG_X86 |
909 | dram_init_f, /* configure available RAM banks */ | 901 | dram_init_f, /* configure available RAM banks */ |
910 | calculate_relocation_address, | 902 | calculate_relocation_address, |
911 | #endif | 903 | #endif |
912 | announce_dram_init, | 904 | announce_dram_init, |
913 | /* TODO: unify all these dram functions? */ | 905 | /* TODO: unify all these dram functions? */ |
914 | #ifdef CONFIG_ARM | 906 | #ifdef CONFIG_ARM |
915 | dram_init, /* configure available RAM banks */ | 907 | dram_init, /* configure available RAM banks */ |
916 | #endif | 908 | #endif |
917 | #ifdef CONFIG_PPC | 909 | #ifdef CONFIG_PPC |
918 | init_func_ram, | 910 | init_func_ram, |
919 | #endif | 911 | #endif |
920 | #ifdef CONFIG_POST | 912 | #ifdef CONFIG_POST |
921 | post_init_f, | 913 | post_init_f, |
922 | #endif | 914 | #endif |
923 | INIT_FUNC_WATCHDOG_RESET | 915 | INIT_FUNC_WATCHDOG_RESET |
924 | #if defined(CONFIG_SYS_DRAM_TEST) | 916 | #if defined(CONFIG_SYS_DRAM_TEST) |
925 | testdram, | 917 | testdram, |
926 | #endif /* CONFIG_SYS_DRAM_TEST */ | 918 | #endif /* CONFIG_SYS_DRAM_TEST */ |
927 | INIT_FUNC_WATCHDOG_RESET | 919 | INIT_FUNC_WATCHDOG_RESET |
928 | 920 | ||
929 | #ifdef CONFIG_POST | 921 | #ifdef CONFIG_POST |
930 | init_post, | 922 | init_post, |
931 | #endif | 923 | #endif |
932 | INIT_FUNC_WATCHDOG_RESET | 924 | INIT_FUNC_WATCHDOG_RESET |
933 | /* | 925 | /* |
934 | * Now that we have DRAM mapped and working, we can | 926 | * Now that we have DRAM mapped and working, we can |
935 | * relocate the code and continue running from DRAM. | 927 | * relocate the code and continue running from DRAM. |
936 | * | 928 | * |
937 | * Reserve memory at end of RAM for (top down in that order): | 929 | * Reserve memory at end of RAM for (top down in that order): |
938 | * - area that won't get touched by U-Boot and Linux (optional) | 930 | * - area that won't get touched by U-Boot and Linux (optional) |
939 | * - kernel log buffer | 931 | * - kernel log buffer |
940 | * - protected RAM | 932 | * - protected RAM |
941 | * - LCD framebuffer | 933 | * - LCD framebuffer |
942 | * - monitor code | 934 | * - monitor code |
943 | * - board info struct | 935 | * - board info struct |
944 | */ | 936 | */ |
945 | setup_dest_addr, | 937 | setup_dest_addr, |
946 | #if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) | 938 | #if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) |
947 | reserve_logbuffer, | 939 | reserve_logbuffer, |
948 | #endif | 940 | #endif |
949 | #ifdef CONFIG_PRAM | 941 | #ifdef CONFIG_PRAM |
950 | reserve_pram, | 942 | reserve_pram, |
951 | #endif | 943 | #endif |
952 | reserve_round_4k, | 944 | reserve_round_4k, |
953 | #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ | 945 | #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) && \ |
954 | defined(CONFIG_ARM) | 946 | defined(CONFIG_ARM) |
955 | reserve_mmu, | 947 | reserve_mmu, |
956 | #endif | 948 | #endif |
957 | #ifdef CONFIG_LCD | 949 | #ifdef CONFIG_LCD |
958 | reserve_lcd, | 950 | reserve_lcd, |
959 | #endif | 951 | #endif |
960 | reserve_trace, | 952 | reserve_trace, |
961 | /* TODO: Why the dependency on CONFIG_8xx? */ | 953 | /* TODO: Why the dependency on CONFIG_8xx? */ |
962 | #if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \ | 954 | #if defined(CONFIG_VIDEO) && (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \ |
963 | && !defined(CONFIG_ARM) && !defined(CONFIG_X86) | 955 | && !defined(CONFIG_ARM) && !defined(CONFIG_X86) |
964 | reserve_video, | 956 | reserve_video, |
965 | #endif | 957 | #endif |
966 | reserve_uboot, | 958 | reserve_uboot, |
967 | #ifndef CONFIG_SPL_BUILD | 959 | #ifndef CONFIG_SPL_BUILD |
968 | reserve_malloc, | 960 | reserve_malloc, |
969 | reserve_board, | 961 | reserve_board, |
970 | #endif | 962 | #endif |
971 | setup_machine, | 963 | setup_machine, |
972 | reserve_global_data, | 964 | reserve_global_data, |
973 | reserve_fdt, | 965 | reserve_fdt, |
974 | reserve_stacks, | 966 | reserve_stacks, |
975 | setup_dram_config, | 967 | setup_dram_config, |
976 | show_dram_config, | 968 | show_dram_config, |
977 | #ifdef CONFIG_PPC | 969 | #ifdef CONFIG_PPC |
978 | setup_board_part1, | 970 | setup_board_part1, |
979 | INIT_FUNC_WATCHDOG_RESET | 971 | INIT_FUNC_WATCHDOG_RESET |
980 | setup_board_part2, | 972 | setup_board_part2, |
981 | #endif | 973 | #endif |
982 | setup_baud_rate, | 974 | setup_baud_rate, |
983 | display_new_sp, | 975 | display_new_sp, |
984 | #ifdef CONFIG_SYS_EXTBDINFO | 976 | #ifdef CONFIG_SYS_EXTBDINFO |
985 | setup_board_extra, | 977 | setup_board_extra, |
986 | #endif | 978 | #endif |
987 | INIT_FUNC_WATCHDOG_RESET | 979 | INIT_FUNC_WATCHDOG_RESET |
988 | reloc_fdt, | 980 | reloc_fdt, |
989 | setup_reloc, | 981 | setup_reloc, |
990 | #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) | 982 | #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) |
991 | jump_to_copy, | 983 | jump_to_copy, |
992 | #endif | 984 | #endif |
993 | NULL, | 985 | NULL, |
994 | }; | 986 | }; |
995 | 987 | ||
996 | void board_init_f(ulong boot_flags) | 988 | void board_init_f(ulong boot_flags) |
997 | { | 989 | { |
998 | #ifndef CONFIG_X86 | 990 | #ifndef CONFIG_X86 |
999 | gd_t data; | 991 | gd_t data; |
1000 | 992 | ||
1001 | gd = &data; | 993 | gd = &data; |
1002 | #endif | 994 | #endif |
1003 | 995 | ||
1004 | /* | 996 | /* |
1005 | * Clear global data before it is accessed at debug print | 997 | * Clear global data before it is accessed at debug print |
1006 | * in initcall_run_list. Otherwise the debug print probably | 998 | * in initcall_run_list. Otherwise the debug print probably |
1007 | * get the wrong vaule of gd->have_console. | 999 | * get the wrong vaule of gd->have_console. |
1008 | */ | 1000 | */ |
1009 | #if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \ | 1001 | #if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \ |
1010 | !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \ | 1002 | !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \ |
1011 | !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86) | 1003 | !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86) |
1012 | zero_global_data(); | 1004 | zero_global_data(); |
1013 | #endif | 1005 | #endif |
1014 | 1006 | ||
1015 | gd->flags = boot_flags; | 1007 | gd->flags = boot_flags; |
1016 | gd->have_console = 0; | 1008 | gd->have_console = 0; |
1017 | 1009 | ||
1018 | if (initcall_run_list(init_sequence_f)) | 1010 | if (initcall_run_list(init_sequence_f)) |
1019 | hang(); | 1011 | hang(); |
1020 | 1012 | ||
1021 | #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) | 1013 | #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) |
1022 | /* NOTREACHED - jump_to_copy() does not return */ | 1014 | /* NOTREACHED - jump_to_copy() does not return */ |
1023 | hang(); | 1015 | hang(); |
1024 | #endif | 1016 | #endif |
1025 | } | 1017 | } |
1026 | 1018 | ||
1027 | #ifdef CONFIG_X86 | 1019 | #ifdef CONFIG_X86 |
1028 | /* | 1020 | /* |
1029 | * For now this code is only used on x86. | 1021 | * For now this code is only used on x86. |
1030 | * | 1022 | * |
1031 | * init_sequence_f_r is the list of init functions which are run when | 1023 | * init_sequence_f_r is the list of init functions which are run when |
1032 | * U-Boot is executing from Flash with a semi-limited 'C' environment. | 1024 | * U-Boot is executing from Flash with a semi-limited 'C' environment. |
1033 | * The following limitations must be considered when implementing an | 1025 | * The following limitations must be considered when implementing an |
1034 | * '_f_r' function: | 1026 | * '_f_r' function: |
1035 | * - 'static' variables are read-only | 1027 | * - 'static' variables are read-only |
1036 | * - Global Data (gd->xxx) is read/write | 1028 | * - Global Data (gd->xxx) is read/write |
1037 | * | 1029 | * |
1038 | * The '_f_r' sequence must, as a minimum, copy U-Boot to RAM (if | 1030 | * The '_f_r' sequence must, as a minimum, copy U-Boot to RAM (if |
1039 | * supported). It _should_, if possible, copy global data to RAM and | 1031 | * supported). It _should_, if possible, copy global data to RAM and |
1040 | * initialise the CPU caches (to speed up the relocation process) | 1032 | * initialise the CPU caches (to speed up the relocation process) |
1041 | * | 1033 | * |
1042 | * NOTE: At present only x86 uses this route, but it is intended that | 1034 | * NOTE: At present only x86 uses this route, but it is intended that |
1043 | * all archs will move to this when generic relocation is implemented. | 1035 | * all archs will move to this when generic relocation is implemented. |
1044 | */ | 1036 | */ |
1045 | static init_fnc_t init_sequence_f_r[] = { | 1037 | static init_fnc_t init_sequence_f_r[] = { |
1046 | init_cache_f_r, | 1038 | init_cache_f_r, |
1047 | copy_uboot_to_ram, | 1039 | copy_uboot_to_ram, |
1048 | clear_bss, | 1040 | clear_bss, |
1049 | do_elf_reloc_fixups, | 1041 | do_elf_reloc_fixups, |
1050 | 1042 | ||
1051 | NULL, | 1043 | NULL, |
1052 | }; | 1044 | }; |
1053 | 1045 | ||
1054 | void board_init_f_r(void) | 1046 | void board_init_f_r(void) |
1055 | { | 1047 | { |
1056 | if (initcall_run_list(init_sequence_f_r)) | 1048 | if (initcall_run_list(init_sequence_f_r)) |
1057 | hang(); | 1049 | hang(); |
1058 | 1050 | ||
1059 | /* | 1051 | /* |
1060 | * U-Boot has been copied into SDRAM, the BSS has been cleared etc. | 1052 | * U-Boot has been copied into SDRAM, the BSS has been cleared etc. |
1061 | * Transfer execution from Flash to RAM by calculating the address | 1053 | * Transfer execution from Flash to RAM by calculating the address |
1062 | * of the in-RAM copy of board_init_r() and calling it | 1054 | * of the in-RAM copy of board_init_r() and calling it |
1063 | */ | 1055 | */ |
1064 | (board_init_r + gd->reloc_off)(gd, gd->relocaddr); | 1056 | (board_init_r + gd->reloc_off)(gd, gd->relocaddr); |
1065 | 1057 | ||
1066 | /* NOTREACHED - board_init_r() does not return */ | 1058 | /* NOTREACHED - board_init_r() does not return */ |
1067 | hang(); | 1059 | hang(); |
1068 | } | 1060 | } |
1069 | #endif /* CONFIG_X86 */ | 1061 | #endif /* CONFIG_X86 */ |
1070 | 1062 |
common/board_r.c
1 | /* | 1 | /* |
2 | * Copyright (c) 2011 The Chromium OS Authors. | 2 | * Copyright (c) 2011 The Chromium OS Authors. |
3 | * (C) Copyright 2002-2006 | 3 | * (C) Copyright 2002-2006 |
4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. | 4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
5 | * | 5 | * |
6 | * (C) Copyright 2002 | 6 | * (C) Copyright 2002 |
7 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> | 7 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
8 | * Marius Groeger <mgroeger@sysgo.de> | 8 | * Marius Groeger <mgroeger@sysgo.de> |
9 | * | 9 | * |
10 | * SPDX-License-Identifier: GPL-2.0+ | 10 | * SPDX-License-Identifier: GPL-2.0+ |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <common.h> | 13 | #include <common.h> |
14 | /* TODO: can we just include all these headers whether needed or not? */ | 14 | /* TODO: can we just include all these headers whether needed or not? */ |
15 | #if defined(CONFIG_CMD_BEDBUG) | 15 | #if defined(CONFIG_CMD_BEDBUG) |
16 | #include <bedbug/type.h> | 16 | #include <bedbug/type.h> |
17 | #endif | 17 | #endif |
18 | #ifdef CONFIG_HAS_DATAFLASH | 18 | #ifdef CONFIG_HAS_DATAFLASH |
19 | #include <dataflash.h> | 19 | #include <dataflash.h> |
20 | #endif | 20 | #endif |
21 | #include <environment.h> | 21 | #include <environment.h> |
22 | #include <fdtdec.h> | 22 | #include <fdtdec.h> |
23 | #if defined(CONFIG_CMD_IDE) | 23 | #if defined(CONFIG_CMD_IDE) |
24 | #include <ide.h> | 24 | #include <ide.h> |
25 | #endif | 25 | #endif |
26 | #include <initcall.h> | 26 | #include <initcall.h> |
27 | #ifdef CONFIG_PS2KBD | 27 | #ifdef CONFIG_PS2KBD |
28 | #include <keyboard.h> | 28 | #include <keyboard.h> |
29 | #endif | 29 | #endif |
30 | #if defined(CONFIG_CMD_KGDB) | 30 | #if defined(CONFIG_CMD_KGDB) |
31 | #include <kgdb.h> | 31 | #include <kgdb.h> |
32 | #endif | 32 | #endif |
33 | #include <logbuff.h> | 33 | #include <logbuff.h> |
34 | #include <malloc.h> | 34 | #include <malloc.h> |
35 | #ifdef CONFIG_BITBANGMII | 35 | #ifdef CONFIG_BITBANGMII |
36 | #include <miiphy.h> | 36 | #include <miiphy.h> |
37 | #endif | 37 | #endif |
38 | #include <mmc.h> | 38 | #include <mmc.h> |
39 | #include <nand.h> | 39 | #include <nand.h> |
40 | #include <onenand_uboot.h> | 40 | #include <onenand_uboot.h> |
41 | #include <scsi.h> | 41 | #include <scsi.h> |
42 | #include <serial.h> | 42 | #include <serial.h> |
43 | #include <spi.h> | 43 | #include <spi.h> |
44 | #include <stdio_dev.h> | 44 | #include <stdio_dev.h> |
45 | #include <trace.h> | 45 | #include <trace.h> |
46 | #include <watchdog.h> | 46 | #include <watchdog.h> |
47 | #ifdef CONFIG_ADDR_MAP | 47 | #ifdef CONFIG_ADDR_MAP |
48 | #include <asm/mmu.h> | 48 | #include <asm/mmu.h> |
49 | #endif | 49 | #endif |
50 | #include <asm/sections.h> | 50 | #include <asm/sections.h> |
51 | #ifdef CONFIG_X86 | 51 | #ifdef CONFIG_X86 |
52 | #include <asm/init_helpers.h> | 52 | #include <asm/init_helpers.h> |
53 | #endif | 53 | #endif |
54 | #include <linux/compiler.h> | 54 | #include <linux/compiler.h> |
55 | 55 | ||
56 | DECLARE_GLOBAL_DATA_PTR; | 56 | DECLARE_GLOBAL_DATA_PTR; |
57 | 57 | ||
58 | ulong monitor_flash_len; | 58 | ulong monitor_flash_len; |
59 | 59 | ||
60 | int __board_flash_wp_on(void) | 60 | int __board_flash_wp_on(void) |
61 | { | 61 | { |
62 | /* | 62 | /* |
63 | * Most flashes can't be detected when write protection is enabled, | 63 | * Most flashes can't be detected when write protection is enabled, |
64 | * so provide a way to let U-Boot gracefully ignore write protected | 64 | * so provide a way to let U-Boot gracefully ignore write protected |
65 | * devices. | 65 | * devices. |
66 | */ | 66 | */ |
67 | return 0; | 67 | return 0; |
68 | } | 68 | } |
69 | 69 | ||
70 | int board_flash_wp_on(void) | 70 | int board_flash_wp_on(void) |
71 | __attribute__ ((weak, alias("__board_flash_wp_on"))); | 71 | __attribute__ ((weak, alias("__board_flash_wp_on"))); |
72 | 72 | ||
73 | void __cpu_secondary_init_r(void) | 73 | void __cpu_secondary_init_r(void) |
74 | { | 74 | { |
75 | } | 75 | } |
76 | 76 | ||
77 | void cpu_secondary_init_r(void) | 77 | void cpu_secondary_init_r(void) |
78 | __attribute__ ((weak, alias("__cpu_secondary_init_r"))); | 78 | __attribute__ ((weak, alias("__cpu_secondary_init_r"))); |
79 | 79 | ||
80 | static int initr_secondary_cpu(void) | 80 | static int initr_secondary_cpu(void) |
81 | { | 81 | { |
82 | /* | 82 | /* |
83 | * after non-volatile devices & environment is setup and cpu code have | 83 | * after non-volatile devices & environment is setup and cpu code have |
84 | * another round to deal with any initialization that might require | 84 | * another round to deal with any initialization that might require |
85 | * full access to the environment or loading of some image (firmware) | 85 | * full access to the environment or loading of some image (firmware) |
86 | * from a non-volatile device | 86 | * from a non-volatile device |
87 | */ | 87 | */ |
88 | /* TODO: maybe define this for all archs? */ | 88 | /* TODO: maybe define this for all archs? */ |
89 | cpu_secondary_init_r(); | 89 | cpu_secondary_init_r(); |
90 | 90 | ||
91 | return 0; | 91 | return 0; |
92 | } | 92 | } |
93 | 93 | ||
94 | static int initr_trace(void) | 94 | static int initr_trace(void) |
95 | { | 95 | { |
96 | #ifdef CONFIG_TRACE | 96 | #ifdef CONFIG_TRACE |
97 | trace_init(gd->trace_buff, CONFIG_TRACE_BUFFER_SIZE); | 97 | trace_init(gd->trace_buff, CONFIG_TRACE_BUFFER_SIZE); |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | static int initr_reloc(void) | 103 | static int initr_reloc(void) |
104 | { | 104 | { |
105 | gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ | 105 | gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ |
106 | bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); | 106 | bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); |
107 | 107 | ||
108 | return 0; | 108 | return 0; |
109 | } | 109 | } |
110 | 110 | ||
111 | #ifdef CONFIG_ARM | 111 | #ifdef CONFIG_ARM |
112 | /* | 112 | /* |
113 | * Some of these functions are needed purely because the functions they | 113 | * Some of these functions are needed purely because the functions they |
114 | * call return void. If we change them to return 0, these stubs can go away. | 114 | * call return void. If we change them to return 0, these stubs can go away. |
115 | */ | 115 | */ |
116 | static int initr_caches(void) | 116 | static int initr_caches(void) |
117 | { | 117 | { |
118 | /* Enable caches */ | 118 | /* Enable caches */ |
119 | enable_caches(); | 119 | enable_caches(); |
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | __weak int fixup_cpu(void) | 124 | __weak int fixup_cpu(void) |
125 | { | 125 | { |
126 | return 0; | 126 | return 0; |
127 | } | 127 | } |
128 | 128 | ||
129 | static int initr_reloc_global_data(void) | 129 | static int initr_reloc_global_data(void) |
130 | { | 130 | { |
131 | #ifdef CONFIG_SYS_SYM_OFFSETS | 131 | #ifdef __ARM__ |
132 | monitor_flash_len = _end_ofs; | 132 | monitor_flash_len = _end - __image_copy_start; |
133 | #elif !defined(CONFIG_SANDBOX) | 133 | #elif !defined(CONFIG_SANDBOX) |
134 | monitor_flash_len = (ulong)&__init_end - gd->relocaddr; | 134 | monitor_flash_len = (ulong)&__init_end - gd->relocaddr; |
135 | #endif | 135 | #endif |
136 | #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) | 136 | #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) |
137 | /* | 137 | /* |
138 | * The gd->cpu pointer is set to an address in flash before relocation. | 138 | * The gd->cpu pointer is set to an address in flash before relocation. |
139 | * We need to update it to point to the same CPU entry in RAM. | 139 | * We need to update it to point to the same CPU entry in RAM. |
140 | * TODO: why not just add gd->reloc_ofs? | 140 | * TODO: why not just add gd->reloc_ofs? |
141 | */ | 141 | */ |
142 | gd->arch.cpu += gd->relocaddr - CONFIG_SYS_MONITOR_BASE; | 142 | gd->arch.cpu += gd->relocaddr - CONFIG_SYS_MONITOR_BASE; |
143 | 143 | ||
144 | /* | 144 | /* |
145 | * If we didn't know the cpu mask & # cores, we can save them of | 145 | * If we didn't know the cpu mask & # cores, we can save them of |
146 | * now rather than 'computing' them constantly | 146 | * now rather than 'computing' them constantly |
147 | */ | 147 | */ |
148 | fixup_cpu(); | 148 | fixup_cpu(); |
149 | #endif | 149 | #endif |
150 | #ifdef CONFIG_SYS_EXTRA_ENV_RELOC | 150 | #ifdef CONFIG_SYS_EXTRA_ENV_RELOC |
151 | /* | 151 | /* |
152 | * Some systems need to relocate the env_addr pointer early because the | 152 | * Some systems need to relocate the env_addr pointer early because the |
153 | * location it points to will get invalidated before env_relocate is | 153 | * location it points to will get invalidated before env_relocate is |
154 | * called. One example is on systems that might use a L2 or L3 cache | 154 | * called. One example is on systems that might use a L2 or L3 cache |
155 | * in SRAM mode and initialize that cache from SRAM mode back to being | 155 | * in SRAM mode and initialize that cache from SRAM mode back to being |
156 | * a cache in cpu_init_r. | 156 | * a cache in cpu_init_r. |
157 | */ | 157 | */ |
158 | gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE; | 158 | gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE; |
159 | #endif | 159 | #endif |
160 | return 0; | 160 | return 0; |
161 | } | 161 | } |
162 | 162 | ||
163 | static int initr_serial(void) | 163 | static int initr_serial(void) |
164 | { | 164 | { |
165 | serial_initialize(); | 165 | serial_initialize(); |
166 | return 0; | 166 | return 0; |
167 | } | 167 | } |
168 | 168 | ||
169 | #ifdef CONFIG_PPC | 169 | #ifdef CONFIG_PPC |
170 | static int initr_trap(void) | 170 | static int initr_trap(void) |
171 | { | 171 | { |
172 | /* | 172 | /* |
173 | * Setup trap handlers | 173 | * Setup trap handlers |
174 | */ | 174 | */ |
175 | trap_init(gd->relocaddr); | 175 | trap_init(gd->relocaddr); |
176 | 176 | ||
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | #endif | 179 | #endif |
180 | 180 | ||
181 | #ifdef CONFIG_ADDR_MAP | 181 | #ifdef CONFIG_ADDR_MAP |
182 | static int initr_addr_map(void) | 182 | static int initr_addr_map(void) |
183 | { | 183 | { |
184 | init_addr_map(); | 184 | init_addr_map(); |
185 | 185 | ||
186 | return 0; | 186 | return 0; |
187 | } | 187 | } |
188 | #endif | 188 | #endif |
189 | 189 | ||
190 | #ifdef CONFIG_LOGBUFFER | 190 | #ifdef CONFIG_LOGBUFFER |
191 | unsigned long logbuffer_base(void) | 191 | unsigned long logbuffer_base(void) |
192 | { | 192 | { |
193 | return gd->ram_top - LOGBUFF_LEN; | 193 | return gd->ram_top - LOGBUFF_LEN; |
194 | } | 194 | } |
195 | 195 | ||
196 | static int initr_logbuffer(void) | 196 | static int initr_logbuffer(void) |
197 | { | 197 | { |
198 | logbuff_init_ptrs(); | 198 | logbuff_init_ptrs(); |
199 | return 0; | 199 | return 0; |
200 | } | 200 | } |
201 | #endif | 201 | #endif |
202 | 202 | ||
203 | #ifdef CONFIG_POST | 203 | #ifdef CONFIG_POST |
204 | static int initr_post_backlog(void) | 204 | static int initr_post_backlog(void) |
205 | { | 205 | { |
206 | post_output_backlog(); | 206 | post_output_backlog(); |
207 | return 0; | 207 | return 0; |
208 | } | 208 | } |
209 | #endif | 209 | #endif |
210 | 210 | ||
211 | #ifdef CONFIG_SYS_DELAYED_ICACHE | 211 | #ifdef CONFIG_SYS_DELAYED_ICACHE |
212 | static int initr_icache_enable(void) | 212 | static int initr_icache_enable(void) |
213 | { | 213 | { |
214 | return 0; | 214 | return 0; |
215 | } | 215 | } |
216 | #endif | 216 | #endif |
217 | 217 | ||
218 | #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) | 218 | #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) |
219 | static int initr_unlock_ram_in_cache(void) | 219 | static int initr_unlock_ram_in_cache(void) |
220 | { | 220 | { |
221 | unlock_ram_in_cache(); /* it's time to unlock D-cache in e500 */ | 221 | unlock_ram_in_cache(); /* it's time to unlock D-cache in e500 */ |
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
224 | #endif | 224 | #endif |
225 | 225 | ||
226 | #ifdef CONFIG_PCI | 226 | #ifdef CONFIG_PCI |
227 | static int initr_pci(void) | 227 | static int initr_pci(void) |
228 | { | 228 | { |
229 | pci_init(); | 229 | pci_init(); |
230 | 230 | ||
231 | return 0; | 231 | return 0; |
232 | } | 232 | } |
233 | #endif | 233 | #endif |
234 | 234 | ||
235 | #ifdef CONFIG_WINBOND_83C553 | 235 | #ifdef CONFIG_WINBOND_83C553 |
236 | static int initr_w83c553f(void) | 236 | static int initr_w83c553f(void) |
237 | { | 237 | { |
238 | /* | 238 | /* |
239 | * Initialise the ISA bridge | 239 | * Initialise the ISA bridge |
240 | */ | 240 | */ |
241 | initialise_w83c553f(); | 241 | initialise_w83c553f(); |
242 | return 0; | 242 | return 0; |
243 | } | 243 | } |
244 | #endif | 244 | #endif |
245 | 245 | ||
246 | static int initr_barrier(void) | 246 | static int initr_barrier(void) |
247 | { | 247 | { |
248 | #ifdef CONFIG_PPC | 248 | #ifdef CONFIG_PPC |
249 | /* TODO: Can we not use dmb() macros for this? */ | 249 | /* TODO: Can we not use dmb() macros for this? */ |
250 | asm("sync ; isync"); | 250 | asm("sync ; isync"); |
251 | #endif | 251 | #endif |
252 | return 0; | 252 | return 0; |
253 | } | 253 | } |
254 | 254 | ||
255 | static int initr_malloc(void) | 255 | static int initr_malloc(void) |
256 | { | 256 | { |
257 | ulong malloc_start; | 257 | ulong malloc_start; |
258 | 258 | ||
259 | /* The malloc area is immediately below the monitor copy in DRAM */ | 259 | /* The malloc area is immediately below the monitor copy in DRAM */ |
260 | malloc_start = gd->relocaddr - TOTAL_MALLOC_LEN; | 260 | malloc_start = gd->relocaddr - TOTAL_MALLOC_LEN; |
261 | mem_malloc_init((ulong)map_sysmem(malloc_start, TOTAL_MALLOC_LEN), | 261 | mem_malloc_init((ulong)map_sysmem(malloc_start, TOTAL_MALLOC_LEN), |
262 | TOTAL_MALLOC_LEN); | 262 | TOTAL_MALLOC_LEN); |
263 | return 0; | 263 | return 0; |
264 | } | 264 | } |
265 | 265 | ||
266 | __weak int power_init_board(void) | 266 | __weak int power_init_board(void) |
267 | { | 267 | { |
268 | return 0; | 268 | return 0; |
269 | } | 269 | } |
270 | 270 | ||
271 | static int initr_announce(void) | 271 | static int initr_announce(void) |
272 | { | 272 | { |
273 | debug("Now running in RAM - U-Boot at: %08lx\n", gd->relocaddr); | 273 | debug("Now running in RAM - U-Boot at: %08lx\n", gd->relocaddr); |
274 | return 0; | 274 | return 0; |
275 | } | 275 | } |
276 | 276 | ||
277 | #if !defined(CONFIG_SYS_NO_FLASH) | 277 | #if !defined(CONFIG_SYS_NO_FLASH) |
278 | static int initr_flash(void) | 278 | static int initr_flash(void) |
279 | { | 279 | { |
280 | ulong flash_size = 0; | 280 | ulong flash_size = 0; |
281 | bd_t *bd = gd->bd; | 281 | bd_t *bd = gd->bd; |
282 | int ok; | 282 | int ok; |
283 | 283 | ||
284 | puts("Flash: "); | 284 | puts("Flash: "); |
285 | 285 | ||
286 | if (board_flash_wp_on()) { | 286 | if (board_flash_wp_on()) { |
287 | printf("Uninitialized - Write Protect On\n"); | 287 | printf("Uninitialized - Write Protect On\n"); |
288 | /* Since WP is on, we can't find real size. Set to 0 */ | 288 | /* Since WP is on, we can't find real size. Set to 0 */ |
289 | ok = 1; | 289 | ok = 1; |
290 | } else { | 290 | } else { |
291 | flash_size = flash_init(); | 291 | flash_size = flash_init(); |
292 | ok = flash_size > 0; | 292 | ok = flash_size > 0; |
293 | } | 293 | } |
294 | if (!ok) { | 294 | if (!ok) { |
295 | puts("*** failed ***\n"); | 295 | puts("*** failed ***\n"); |
296 | #ifdef CONFIG_PPC | 296 | #ifdef CONFIG_PPC |
297 | /* Why does PPC do this? */ | 297 | /* Why does PPC do this? */ |
298 | hang(); | 298 | hang(); |
299 | #endif | 299 | #endif |
300 | return -1; | 300 | return -1; |
301 | } | 301 | } |
302 | print_size(flash_size, ""); | 302 | print_size(flash_size, ""); |
303 | #ifdef CONFIG_SYS_FLASH_CHECKSUM | 303 | #ifdef CONFIG_SYS_FLASH_CHECKSUM |
304 | /* | 304 | /* |
305 | * Compute and print flash CRC if flashchecksum is set to 'y' | 305 | * Compute and print flash CRC if flashchecksum is set to 'y' |
306 | * | 306 | * |
307 | * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX | 307 | * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX |
308 | */ | 308 | */ |
309 | if (getenv_yesno("flashchecksum") == 1) { | 309 | if (getenv_yesno("flashchecksum") == 1) { |
310 | printf(" CRC: %08X", crc32(0, | 310 | printf(" CRC: %08X", crc32(0, |
311 | (const unsigned char *) CONFIG_SYS_FLASH_BASE, | 311 | (const unsigned char *) CONFIG_SYS_FLASH_BASE, |
312 | flash_size)); | 312 | flash_size)); |
313 | } | 313 | } |
314 | #endif /* CONFIG_SYS_FLASH_CHECKSUM */ | 314 | #endif /* CONFIG_SYS_FLASH_CHECKSUM */ |
315 | putc('\n'); | 315 | putc('\n'); |
316 | 316 | ||
317 | /* update start of FLASH memory */ | 317 | /* update start of FLASH memory */ |
318 | #ifdef CONFIG_SYS_FLASH_BASE | 318 | #ifdef CONFIG_SYS_FLASH_BASE |
319 | bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; | 319 | bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; |
320 | #endif | 320 | #endif |
321 | /* size of FLASH memory (final value) */ | 321 | /* size of FLASH memory (final value) */ |
322 | bd->bi_flashsize = flash_size; | 322 | bd->bi_flashsize = flash_size; |
323 | 323 | ||
324 | #if defined(CONFIG_SYS_UPDATE_FLASH_SIZE) | 324 | #if defined(CONFIG_SYS_UPDATE_FLASH_SIZE) |
325 | /* Make a update of the Memctrl. */ | 325 | /* Make a update of the Memctrl. */ |
326 | update_flash_size(flash_size); | 326 | update_flash_size(flash_size); |
327 | #endif | 327 | #endif |
328 | 328 | ||
329 | 329 | ||
330 | #if defined(CONFIG_OXC) || defined(CONFIG_RMU) | 330 | #if defined(CONFIG_OXC) || defined(CONFIG_RMU) |
331 | /* flash mapped at end of memory map */ | 331 | /* flash mapped at end of memory map */ |
332 | bd->bi_flashoffset = CONFIG_SYS_TEXT_BASE + flash_size; | 332 | bd->bi_flashoffset = CONFIG_SYS_TEXT_BASE + flash_size; |
333 | #elif CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE | 333 | #elif CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE |
334 | bd->bi_flashoffset = monitor_flash_len; /* reserved area for monitor */ | 334 | bd->bi_flashoffset = monitor_flash_len; /* reserved area for monitor */ |
335 | #endif | 335 | #endif |
336 | return 0; | 336 | return 0; |
337 | } | 337 | } |
338 | #endif | 338 | #endif |
339 | 339 | ||
340 | #ifdef CONFIG_PPC | 340 | #ifdef CONFIG_PPC |
341 | static int initr_spi(void) | 341 | static int initr_spi(void) |
342 | { | 342 | { |
343 | /* PPC does this here */ | 343 | /* PPC does this here */ |
344 | #ifdef CONFIG_SPI | 344 | #ifdef CONFIG_SPI |
345 | #if !defined(CONFIG_ENV_IS_IN_EEPROM) | 345 | #if !defined(CONFIG_ENV_IS_IN_EEPROM) |
346 | spi_init_f(); | 346 | spi_init_f(); |
347 | #endif | 347 | #endif |
348 | spi_init_r(); | 348 | spi_init_r(); |
349 | #endif | 349 | #endif |
350 | return 0; | 350 | return 0; |
351 | } | 351 | } |
352 | #endif | 352 | #endif |
353 | 353 | ||
354 | #ifdef CONFIG_CMD_NAND | 354 | #ifdef CONFIG_CMD_NAND |
355 | /* go init the NAND */ | 355 | /* go init the NAND */ |
356 | int initr_nand(void) | 356 | int initr_nand(void) |
357 | { | 357 | { |
358 | puts("NAND: "); | 358 | puts("NAND: "); |
359 | nand_init(); | 359 | nand_init(); |
360 | return 0; | 360 | return 0; |
361 | } | 361 | } |
362 | #endif | 362 | #endif |
363 | 363 | ||
364 | #if defined(CONFIG_CMD_ONENAND) | 364 | #if defined(CONFIG_CMD_ONENAND) |
365 | /* go init the NAND */ | 365 | /* go init the NAND */ |
366 | int initr_onenand(void) | 366 | int initr_onenand(void) |
367 | { | 367 | { |
368 | puts("NAND: "); | 368 | puts("NAND: "); |
369 | onenand_init(); | 369 | onenand_init(); |
370 | return 0; | 370 | return 0; |
371 | } | 371 | } |
372 | #endif | 372 | #endif |
373 | 373 | ||
374 | #ifdef CONFIG_GENERIC_MMC | 374 | #ifdef CONFIG_GENERIC_MMC |
375 | int initr_mmc(void) | 375 | int initr_mmc(void) |
376 | { | 376 | { |
377 | puts("MMC: "); | 377 | puts("MMC: "); |
378 | mmc_initialize(gd->bd); | 378 | mmc_initialize(gd->bd); |
379 | return 0; | 379 | return 0; |
380 | } | 380 | } |
381 | #endif | 381 | #endif |
382 | 382 | ||
383 | #ifdef CONFIG_HAS_DATAFLASH | 383 | #ifdef CONFIG_HAS_DATAFLASH |
384 | int initr_dataflash(void) | 384 | int initr_dataflash(void) |
385 | { | 385 | { |
386 | AT91F_DataflashInit(); | 386 | AT91F_DataflashInit(); |
387 | dataflash_print_info(); | 387 | dataflash_print_info(); |
388 | return 0; | 388 | return 0; |
389 | } | 389 | } |
390 | #endif | 390 | #endif |
391 | 391 | ||
392 | /* | 392 | /* |
393 | * Tell if it's OK to load the environment early in boot. | 393 | * Tell if it's OK to load the environment early in boot. |
394 | * | 394 | * |
395 | * If CONFIG_OF_CONFIG is defined, we'll check with the FDT to see | 395 | * If CONFIG_OF_CONFIG is defined, we'll check with the FDT to see |
396 | * if this is OK (defaulting to saying it's OK). | 396 | * if this is OK (defaulting to saying it's OK). |
397 | * | 397 | * |
398 | * NOTE: Loading the environment early can be a bad idea if security is | 398 | * NOTE: Loading the environment early can be a bad idea if security is |
399 | * important, since no verification is done on the environment. | 399 | * important, since no verification is done on the environment. |
400 | * | 400 | * |
401 | * @return 0 if environment should not be loaded, !=0 if it is ok to load | 401 | * @return 0 if environment should not be loaded, !=0 if it is ok to load |
402 | */ | 402 | */ |
403 | static int should_load_env(void) | 403 | static int should_load_env(void) |
404 | { | 404 | { |
405 | #ifdef CONFIG_OF_CONTROL | 405 | #ifdef CONFIG_OF_CONTROL |
406 | return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 1); | 406 | return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 1); |
407 | #elif defined CONFIG_DELAY_ENVIRONMENT | 407 | #elif defined CONFIG_DELAY_ENVIRONMENT |
408 | return 0; | 408 | return 0; |
409 | #else | 409 | #else |
410 | return 1; | 410 | return 1; |
411 | #endif | 411 | #endif |
412 | } | 412 | } |
413 | 413 | ||
414 | static int initr_env(void) | 414 | static int initr_env(void) |
415 | { | 415 | { |
416 | /* initialize environment */ | 416 | /* initialize environment */ |
417 | if (should_load_env()) | 417 | if (should_load_env()) |
418 | env_relocate(); | 418 | env_relocate(); |
419 | else | 419 | else |
420 | set_default_env(NULL); | 420 | set_default_env(NULL); |
421 | 421 | ||
422 | /* Initialize from environment */ | 422 | /* Initialize from environment */ |
423 | load_addr = getenv_ulong("loadaddr", 16, load_addr); | 423 | load_addr = getenv_ulong("loadaddr", 16, load_addr); |
424 | #if defined(CONFIG_SYS_EXTBDINFO) | 424 | #if defined(CONFIG_SYS_EXTBDINFO) |
425 | #if defined(CONFIG_405GP) || defined(CONFIG_405EP) | 425 | #if defined(CONFIG_405GP) || defined(CONFIG_405EP) |
426 | #if defined(CONFIG_I2CFAST) | 426 | #if defined(CONFIG_I2CFAST) |
427 | /* | 427 | /* |
428 | * set bi_iic_fast for linux taking environment variable | 428 | * set bi_iic_fast for linux taking environment variable |
429 | * "i2cfast" into account | 429 | * "i2cfast" into account |
430 | */ | 430 | */ |
431 | { | 431 | { |
432 | char *s = getenv("i2cfast"); | 432 | char *s = getenv("i2cfast"); |
433 | 433 | ||
434 | if (s && ((*s == 'y') || (*s == 'Y'))) { | 434 | if (s && ((*s == 'y') || (*s == 'Y'))) { |
435 | gd->bd->bi_iic_fast[0] = 1; | 435 | gd->bd->bi_iic_fast[0] = 1; |
436 | gd->bd->bi_iic_fast[1] = 1; | 436 | gd->bd->bi_iic_fast[1] = 1; |
437 | } | 437 | } |
438 | } | 438 | } |
439 | #endif /* CONFIG_I2CFAST */ | 439 | #endif /* CONFIG_I2CFAST */ |
440 | #endif /* CONFIG_405GP, CONFIG_405EP */ | 440 | #endif /* CONFIG_405GP, CONFIG_405EP */ |
441 | #endif /* CONFIG_SYS_EXTBDINFO */ | 441 | #endif /* CONFIG_SYS_EXTBDINFO */ |
442 | return 0; | 442 | return 0; |
443 | } | 443 | } |
444 | 444 | ||
445 | #ifdef CONFIG_HERMES | 445 | #ifdef CONFIG_HERMES |
446 | static int initr_hermes(void) | 446 | static int initr_hermes(void) |
447 | { | 447 | { |
448 | if ((gd->board_type >> 16) == 2) | 448 | if ((gd->board_type >> 16) == 2) |
449 | gd->bd->bi_ethspeed = gd->board_type & 0xFFFF; | 449 | gd->bd->bi_ethspeed = gd->board_type & 0xFFFF; |
450 | else | 450 | else |
451 | gd->bd->bi_ethspeed = 0xFFFF; | 451 | gd->bd->bi_ethspeed = 0xFFFF; |
452 | return 0; | 452 | return 0; |
453 | } | 453 | } |
454 | 454 | ||
455 | static int initr_hermes_start(void) | 455 | static int initr_hermes_start(void) |
456 | { | 456 | { |
457 | if (gd->bd->bi_ethspeed != 0xFFFF) | 457 | if (gd->bd->bi_ethspeed != 0xFFFF) |
458 | hermes_start_lxt980((int) gd->bd->bi_ethspeed); | 458 | hermes_start_lxt980((int) gd->bd->bi_ethspeed); |
459 | return 0; | 459 | return 0; |
460 | } | 460 | } |
461 | #endif | 461 | #endif |
462 | 462 | ||
463 | #ifdef CONFIG_SC3 | 463 | #ifdef CONFIG_SC3 |
464 | /* TODO: with new initcalls, move this into the driver */ | 464 | /* TODO: with new initcalls, move this into the driver */ |
465 | extern void sc3_read_eeprom(void); | 465 | extern void sc3_read_eeprom(void); |
466 | 466 | ||
467 | static int initr_sc3_read_eeprom(void) | 467 | static int initr_sc3_read_eeprom(void) |
468 | { | 468 | { |
469 | sc3_read_eeprom(); | 469 | sc3_read_eeprom(); |
470 | return 0; | 470 | return 0; |
471 | } | 471 | } |
472 | #endif | 472 | #endif |
473 | 473 | ||
474 | static int initr_jumptable(void) | 474 | static int initr_jumptable(void) |
475 | { | 475 | { |
476 | jumptable_init(); | 476 | jumptable_init(); |
477 | return 0; | 477 | return 0; |
478 | } | 478 | } |
479 | 479 | ||
480 | #if defined(CONFIG_API) | 480 | #if defined(CONFIG_API) |
481 | static int initr_api(void) | 481 | static int initr_api(void) |
482 | { | 482 | { |
483 | /* Initialize API */ | 483 | /* Initialize API */ |
484 | api_init(); | 484 | api_init(); |
485 | return 0; | 485 | return 0; |
486 | } | 486 | } |
487 | #endif | 487 | #endif |
488 | 488 | ||
489 | #ifdef CONFIG_DISPLAY_BOARDINFO_LATE | 489 | #ifdef CONFIG_DISPLAY_BOARDINFO_LATE |
490 | static int show_model_r(void) | 490 | static int show_model_r(void) |
491 | { | 491 | { |
492 | /* Put this here so it appears on the LCD, now it is ready */ | 492 | /* Put this here so it appears on the LCD, now it is ready */ |
493 | # ifdef CONFIG_OF_CONTROL | 493 | # ifdef CONFIG_OF_CONTROL |
494 | const char *model; | 494 | const char *model; |
495 | 495 | ||
496 | model = (char *)fdt_getprop(gd->fdt_blob, 0, "model", NULL); | 496 | model = (char *)fdt_getprop(gd->fdt_blob, 0, "model", NULL); |
497 | printf("Model: %s\n", model ? model : "<unknown>"); | 497 | printf("Model: %s\n", model ? model : "<unknown>"); |
498 | # else | 498 | # else |
499 | checkboard(); | 499 | checkboard(); |
500 | # endif | 500 | # endif |
501 | } | 501 | } |
502 | #endif | 502 | #endif |
503 | 503 | ||
504 | /* enable exceptions */ | 504 | /* enable exceptions */ |
505 | #ifdef CONFIG_ARM | 505 | #ifdef CONFIG_ARM |
506 | static int initr_enable_interrupts(void) | 506 | static int initr_enable_interrupts(void) |
507 | { | 507 | { |
508 | enable_interrupts(); | 508 | enable_interrupts(); |
509 | return 0; | 509 | return 0; |
510 | } | 510 | } |
511 | #endif | 511 | #endif |
512 | 512 | ||
513 | #ifdef CONFIG_CMD_NET | 513 | #ifdef CONFIG_CMD_NET |
514 | static int initr_ethaddr(void) | 514 | static int initr_ethaddr(void) |
515 | { | 515 | { |
516 | bd_t *bd = gd->bd; | 516 | bd_t *bd = gd->bd; |
517 | 517 | ||
518 | /* kept around for legacy kernels only ... ignore the next section */ | 518 | /* kept around for legacy kernels only ... ignore the next section */ |
519 | eth_getenv_enetaddr("ethaddr", bd->bi_enetaddr); | 519 | eth_getenv_enetaddr("ethaddr", bd->bi_enetaddr); |
520 | #ifdef CONFIG_HAS_ETH1 | 520 | #ifdef CONFIG_HAS_ETH1 |
521 | eth_getenv_enetaddr("eth1addr", bd->bi_enet1addr); | 521 | eth_getenv_enetaddr("eth1addr", bd->bi_enet1addr); |
522 | #endif | 522 | #endif |
523 | #ifdef CONFIG_HAS_ETH2 | 523 | #ifdef CONFIG_HAS_ETH2 |
524 | eth_getenv_enetaddr("eth2addr", bd->bi_enet2addr); | 524 | eth_getenv_enetaddr("eth2addr", bd->bi_enet2addr); |
525 | #endif | 525 | #endif |
526 | #ifdef CONFIG_HAS_ETH3 | 526 | #ifdef CONFIG_HAS_ETH3 |
527 | eth_getenv_enetaddr("eth3addr", bd->bi_enet3addr); | 527 | eth_getenv_enetaddr("eth3addr", bd->bi_enet3addr); |
528 | #endif | 528 | #endif |
529 | #ifdef CONFIG_HAS_ETH4 | 529 | #ifdef CONFIG_HAS_ETH4 |
530 | eth_getenv_enetaddr("eth4addr", bd->bi_enet4addr); | 530 | eth_getenv_enetaddr("eth4addr", bd->bi_enet4addr); |
531 | #endif | 531 | #endif |
532 | #ifdef CONFIG_HAS_ETH5 | 532 | #ifdef CONFIG_HAS_ETH5 |
533 | eth_getenv_enetaddr("eth5addr", bd->bi_enet5addr); | 533 | eth_getenv_enetaddr("eth5addr", bd->bi_enet5addr); |
534 | #endif | 534 | #endif |
535 | return 0; | 535 | return 0; |
536 | } | 536 | } |
537 | #endif /* CONFIG_CMD_NET */ | 537 | #endif /* CONFIG_CMD_NET */ |
538 | 538 | ||
539 | #ifdef CONFIG_CMD_KGDB | 539 | #ifdef CONFIG_CMD_KGDB |
540 | static int initr_kgdb(void) | 540 | static int initr_kgdb(void) |
541 | { | 541 | { |
542 | puts("KGDB: "); | 542 | puts("KGDB: "); |
543 | kgdb_init(); | 543 | kgdb_init(); |
544 | return 0; | 544 | return 0; |
545 | } | 545 | } |
546 | #endif | 546 | #endif |
547 | 547 | ||
548 | #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) | 548 | #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) |
549 | static int initr_status_led(void) | 549 | static int initr_status_led(void) |
550 | { | 550 | { |
551 | status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING); | 551 | status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING); |
552 | 552 | ||
553 | return 0; | 553 | return 0; |
554 | } | 554 | } |
555 | #endif | 555 | #endif |
556 | 556 | ||
557 | #if defined(CONFIG_CMD_SCSI) | 557 | #if defined(CONFIG_CMD_SCSI) |
558 | static int initr_scsi(void) | 558 | static int initr_scsi(void) |
559 | { | 559 | { |
560 | /* Not supported properly on ARM yet */ | 560 | /* Not supported properly on ARM yet */ |
561 | #ifndef CONFIG_ARM | 561 | #ifndef CONFIG_ARM |
562 | puts("SCSI: "); | 562 | puts("SCSI: "); |
563 | scsi_init(); | 563 | scsi_init(); |
564 | #endif | 564 | #endif |
565 | 565 | ||
566 | return 0; | 566 | return 0; |
567 | } | 567 | } |
568 | #endif /* CONFIG_CMD_NET */ | 568 | #endif /* CONFIG_CMD_NET */ |
569 | 569 | ||
570 | #if defined(CONFIG_CMD_DOC) | 570 | #if defined(CONFIG_CMD_DOC) |
571 | static int initr_doc(void) | 571 | static int initr_doc(void) |
572 | { | 572 | { |
573 | puts("DOC: "); | 573 | puts("DOC: "); |
574 | doc_init(); | 574 | doc_init(); |
575 | } | 575 | } |
576 | #endif | 576 | #endif |
577 | 577 | ||
578 | #ifdef CONFIG_BITBANGMII | 578 | #ifdef CONFIG_BITBANGMII |
579 | static int initr_bbmii(void) | 579 | static int initr_bbmii(void) |
580 | { | 580 | { |
581 | bb_miiphy_init(); | 581 | bb_miiphy_init(); |
582 | return 0; | 582 | return 0; |
583 | } | 583 | } |
584 | #endif | 584 | #endif |
585 | 585 | ||
586 | #ifdef CONFIG_CMD_NET | 586 | #ifdef CONFIG_CMD_NET |
587 | static int initr_net(void) | 587 | static int initr_net(void) |
588 | { | 588 | { |
589 | puts("Net: "); | 589 | puts("Net: "); |
590 | eth_initialize(gd->bd); | 590 | eth_initialize(gd->bd); |
591 | #if defined(CONFIG_RESET_PHY_R) | 591 | #if defined(CONFIG_RESET_PHY_R) |
592 | debug("Reset Ethernet PHY\n"); | 592 | debug("Reset Ethernet PHY\n"); |
593 | reset_phy(); | 593 | reset_phy(); |
594 | #endif | 594 | #endif |
595 | return 0; | 595 | return 0; |
596 | } | 596 | } |
597 | #endif | 597 | #endif |
598 | 598 | ||
599 | #ifdef CONFIG_POST | 599 | #ifdef CONFIG_POST |
600 | static int initr_post(void) | 600 | static int initr_post(void) |
601 | { | 601 | { |
602 | post_run(NULL, POST_RAM | post_bootmode_get(0)); | 602 | post_run(NULL, POST_RAM | post_bootmode_get(0)); |
603 | return 0; | 603 | return 0; |
604 | } | 604 | } |
605 | #endif | 605 | #endif |
606 | 606 | ||
607 | #if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE) | 607 | #if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE) |
608 | static int initr_pcmcia(void) | 608 | static int initr_pcmcia(void) |
609 | { | 609 | { |
610 | puts("PCMCIA:"); | 610 | puts("PCMCIA:"); |
611 | pcmcia_init(); | 611 | pcmcia_init(); |
612 | return 0; | 612 | return 0; |
613 | } | 613 | } |
614 | #endif | 614 | #endif |
615 | 615 | ||
616 | #if defined(CONFIG_CMD_IDE) | 616 | #if defined(CONFIG_CMD_IDE) |
617 | static int initr_ide(void) | 617 | static int initr_ide(void) |
618 | { | 618 | { |
619 | #ifdef CONFIG_IDE_8xx_PCCARD | 619 | #ifdef CONFIG_IDE_8xx_PCCARD |
620 | puts("PCMCIA:"); | 620 | puts("PCMCIA:"); |
621 | #else | 621 | #else |
622 | puts("IDE: "); | 622 | puts("IDE: "); |
623 | #endif | 623 | #endif |
624 | #if defined(CONFIG_START_IDE) | 624 | #if defined(CONFIG_START_IDE) |
625 | if (board_start_ide()) | 625 | if (board_start_ide()) |
626 | ide_init(); | 626 | ide_init(); |
627 | #else | 627 | #else |
628 | ide_init(); | 628 | ide_init(); |
629 | #endif | 629 | #endif |
630 | return 0; | 630 | return 0; |
631 | } | 631 | } |
632 | #endif | 632 | #endif |
633 | 633 | ||
634 | #if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER) | 634 | #if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER) |
635 | /* | 635 | /* |
636 | * Export available size of memory for Linux, taking into account the | 636 | * Export available size of memory for Linux, taking into account the |
637 | * protected RAM at top of memory | 637 | * protected RAM at top of memory |
638 | */ | 638 | */ |
639 | int initr_mem(void) | 639 | int initr_mem(void) |
640 | { | 640 | { |
641 | ulong pram = 0; | 641 | ulong pram = 0; |
642 | char memsz[32]; | 642 | char memsz[32]; |
643 | 643 | ||
644 | # ifdef CONFIG_PRAM | 644 | # ifdef CONFIG_PRAM |
645 | pram = getenv_ulong("pram", 10, CONFIG_PRAM); | 645 | pram = getenv_ulong("pram", 10, CONFIG_PRAM); |
646 | # endif | 646 | # endif |
647 | # if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) | 647 | # if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) |
648 | /* Also take the logbuffer into account (pram is in kB) */ | 648 | /* Also take the logbuffer into account (pram is in kB) */ |
649 | pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024; | 649 | pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024; |
650 | # endif | 650 | # endif |
651 | sprintf(memsz, "%ldk", (gd->ram_size / 1024) - pram); | 651 | sprintf(memsz, "%ldk", (gd->ram_size / 1024) - pram); |
652 | setenv("mem", memsz); | 652 | setenv("mem", memsz); |
653 | 653 | ||
654 | return 0; | 654 | return 0; |
655 | } | 655 | } |
656 | #endif | 656 | #endif |
657 | 657 | ||
658 | #ifdef CONFIG_CMD_BEDBUG | 658 | #ifdef CONFIG_CMD_BEDBUG |
659 | static int initr_bedbug(void) | 659 | static int initr_bedbug(void) |
660 | { | 660 | { |
661 | bedbug_init(); | 661 | bedbug_init(); |
662 | 662 | ||
663 | return 0; | 663 | return 0; |
664 | } | 664 | } |
665 | #endif | 665 | #endif |
666 | 666 | ||
667 | #ifdef CONFIG_PS2KBD | 667 | #ifdef CONFIG_PS2KBD |
668 | static int initr_kbd(void) | 668 | static int initr_kbd(void) |
669 | { | 669 | { |
670 | puts("PS/2: "); | 670 | puts("PS/2: "); |
671 | kbd_init(); | 671 | kbd_init(); |
672 | return 0; | 672 | return 0; |
673 | } | 673 | } |
674 | #endif | 674 | #endif |
675 | 675 | ||
676 | #ifdef CONFIG_MODEM_SUPPORT | 676 | #ifdef CONFIG_MODEM_SUPPORT |
677 | static int initr_modem(void) | 677 | static int initr_modem(void) |
678 | { | 678 | { |
679 | /* TODO: with new initcalls, move this into the driver */ | 679 | /* TODO: with new initcalls, move this into the driver */ |
680 | extern int do_mdm_init; | 680 | extern int do_mdm_init; |
681 | 681 | ||
682 | do_mdm_init = gd->do_mdm_init; | 682 | do_mdm_init = gd->do_mdm_init; |
683 | return 0; | 683 | return 0; |
684 | } | 684 | } |
685 | #endif | 685 | #endif |
686 | 686 | ||
687 | static int run_main_loop(void) | 687 | static int run_main_loop(void) |
688 | { | 688 | { |
689 | #ifdef CONFIG_SANDBOX | 689 | #ifdef CONFIG_SANDBOX |
690 | sandbox_main_loop_init(); | 690 | sandbox_main_loop_init(); |
691 | #endif | 691 | #endif |
692 | /* main_loop() can return to retry autoboot, if so just run it again */ | 692 | /* main_loop() can return to retry autoboot, if so just run it again */ |
693 | for (;;) | 693 | for (;;) |
694 | main_loop(); | 694 | main_loop(); |
695 | return 0; | 695 | return 0; |
696 | } | 696 | } |
697 | 697 | ||
698 | /* | 698 | /* |
699 | * Over time we hope to remove these functions with code fragments and | 699 | * Over time we hope to remove these functions with code fragments and |
700 | * stub funtcions, and instead call the relevant function directly. | 700 | * stub funtcions, and instead call the relevant function directly. |
701 | * | 701 | * |
702 | * We also hope to remove most of the driver-related init and do it if/when | 702 | * We also hope to remove most of the driver-related init and do it if/when |
703 | * the driver is later used. | 703 | * the driver is later used. |
704 | * | 704 | * |
705 | * TODO: perhaps reset the watchdog in the initcall function after each call? | 705 | * TODO: perhaps reset the watchdog in the initcall function after each call? |
706 | */ | 706 | */ |
707 | init_fnc_t init_sequence_r[] = { | 707 | init_fnc_t init_sequence_r[] = { |
708 | initr_trace, | 708 | initr_trace, |
709 | initr_reloc, | 709 | initr_reloc, |
710 | /* TODO: could x86/PPC have this also perhaps? */ | 710 | /* TODO: could x86/PPC have this also perhaps? */ |
711 | #ifdef CONFIG_ARM | 711 | #ifdef CONFIG_ARM |
712 | initr_caches, | 712 | initr_caches, |
713 | board_init, /* Setup chipselects */ | 713 | board_init, /* Setup chipselects */ |
714 | #endif | 714 | #endif |
715 | /* | 715 | /* |
716 | * TODO: printing of the clock inforamtion of the board is now | 716 | * TODO: printing of the clock inforamtion of the board is now |
717 | * implemented as part of bdinfo command. Currently only support for | 717 | * implemented as part of bdinfo command. Currently only support for |
718 | * davinci SOC's is added. Remove this check once all the board | 718 | * davinci SOC's is added. Remove this check once all the board |
719 | * implement this. | 719 | * implement this. |
720 | */ | 720 | */ |
721 | #ifdef CONFIG_CLOCKS | 721 | #ifdef CONFIG_CLOCKS |
722 | set_cpu_clk_info, /* Setup clock information */ | 722 | set_cpu_clk_info, /* Setup clock information */ |
723 | #endif | 723 | #endif |
724 | initr_reloc_global_data, | 724 | initr_reloc_global_data, |
725 | initr_serial, | 725 | initr_serial, |
726 | initr_announce, | 726 | initr_announce, |
727 | INIT_FUNC_WATCHDOG_RESET | 727 | INIT_FUNC_WATCHDOG_RESET |
728 | #ifdef CONFIG_PPC | 728 | #ifdef CONFIG_PPC |
729 | initr_trap, | 729 | initr_trap, |
730 | #endif | 730 | #endif |
731 | #ifdef CONFIG_ADDR_MAP | 731 | #ifdef CONFIG_ADDR_MAP |
732 | initr_addr_map, | 732 | initr_addr_map, |
733 | #endif | 733 | #endif |
734 | #if defined(CONFIG_BOARD_EARLY_INIT_R) | 734 | #if defined(CONFIG_BOARD_EARLY_INIT_R) |
735 | board_early_init_r, | 735 | board_early_init_r, |
736 | #endif | 736 | #endif |
737 | INIT_FUNC_WATCHDOG_RESET | 737 | INIT_FUNC_WATCHDOG_RESET |
738 | #ifdef CONFIG_LOGBUFFER | 738 | #ifdef CONFIG_LOGBUFFER |
739 | initr_logbuffer, | 739 | initr_logbuffer, |
740 | #endif | 740 | #endif |
741 | #ifdef CONFIG_POST | 741 | #ifdef CONFIG_POST |
742 | initr_post_backlog, | 742 | initr_post_backlog, |
743 | #endif | 743 | #endif |
744 | INIT_FUNC_WATCHDOG_RESET | 744 | INIT_FUNC_WATCHDOG_RESET |
745 | #ifdef CONFIG_SYS_DELAYED_ICACHE | 745 | #ifdef CONFIG_SYS_DELAYED_ICACHE |
746 | initr_icache_enable, | 746 | initr_icache_enable, |
747 | #endif | 747 | #endif |
748 | #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) | 748 | #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500) |
749 | initr_unlock_ram_in_cache, | 749 | initr_unlock_ram_in_cache, |
750 | #endif | 750 | #endif |
751 | #if defined(CONFIG_PCI) && defined(CONFIG_SYS_EARLY_PCI_INIT) | 751 | #if defined(CONFIG_PCI) && defined(CONFIG_SYS_EARLY_PCI_INIT) |
752 | /* | 752 | /* |
753 | * Do early PCI configuration _before_ the flash gets initialised, | 753 | * Do early PCI configuration _before_ the flash gets initialised, |
754 | * because PCU ressources are crucial for flash access on some boards. | 754 | * because PCU ressources are crucial for flash access on some boards. |
755 | */ | 755 | */ |
756 | initr_pci, | 756 | initr_pci, |
757 | #endif | 757 | #endif |
758 | #ifdef CONFIG_WINBOND_83C553 | 758 | #ifdef CONFIG_WINBOND_83C553 |
759 | initr_w83c553f, | 759 | initr_w83c553f, |
760 | #endif | 760 | #endif |
761 | initr_barrier, | 761 | initr_barrier, |
762 | initr_malloc, | 762 | initr_malloc, |
763 | bootstage_relocate, | 763 | bootstage_relocate, |
764 | #ifdef CONFIG_ARCH_EARLY_INIT_R | 764 | #ifdef CONFIG_ARCH_EARLY_INIT_R |
765 | arch_early_init_r, | 765 | arch_early_init_r, |
766 | #endif | 766 | #endif |
767 | power_init_board, | 767 | power_init_board, |
768 | #ifndef CONFIG_SYS_NO_FLASH | 768 | #ifndef CONFIG_SYS_NO_FLASH |
769 | initr_flash, | 769 | initr_flash, |
770 | #endif | 770 | #endif |
771 | INIT_FUNC_WATCHDOG_RESET | 771 | INIT_FUNC_WATCHDOG_RESET |
772 | #if defined(CONFIG_PPC) || defined(CONFIG_X86) | 772 | #if defined(CONFIG_PPC) || defined(CONFIG_X86) |
773 | /* initialize higher level parts of CPU like time base and timers */ | 773 | /* initialize higher level parts of CPU like time base and timers */ |
774 | cpu_init_r, | 774 | cpu_init_r, |
775 | #endif | 775 | #endif |
776 | #ifdef CONFIG_PPC | 776 | #ifdef CONFIG_PPC |
777 | initr_spi, | 777 | initr_spi, |
778 | #endif | 778 | #endif |
779 | #if defined(CONFIG_X86) && defined(CONFIG_SPI) | 779 | #if defined(CONFIG_X86) && defined(CONFIG_SPI) |
780 | init_func_spi, | 780 | init_func_spi, |
781 | #endif | 781 | #endif |
782 | #ifdef CONFIG_CMD_NAND | 782 | #ifdef CONFIG_CMD_NAND |
783 | initr_nand, | 783 | initr_nand, |
784 | #endif | 784 | #endif |
785 | #ifdef CONFIG_CMD_ONENAND | 785 | #ifdef CONFIG_CMD_ONENAND |
786 | initr_onenand, | 786 | initr_onenand, |
787 | #endif | 787 | #endif |
788 | #ifdef CONFIG_GENERIC_MMC | 788 | #ifdef CONFIG_GENERIC_MMC |
789 | initr_mmc, | 789 | initr_mmc, |
790 | #endif | 790 | #endif |
791 | #ifdef CONFIG_HAS_DATAFLASH | 791 | #ifdef CONFIG_HAS_DATAFLASH |
792 | initr_dataflash, | 792 | initr_dataflash, |
793 | #endif | 793 | #endif |
794 | initr_env, | 794 | initr_env, |
795 | INIT_FUNC_WATCHDOG_RESET | 795 | INIT_FUNC_WATCHDOG_RESET |
796 | initr_secondary_cpu, | 796 | initr_secondary_cpu, |
797 | #ifdef CONFIG_SC3 | 797 | #ifdef CONFIG_SC3 |
798 | initr_sc3_read_eeprom, | 798 | initr_sc3_read_eeprom, |
799 | #endif | 799 | #endif |
800 | #ifdef CONFIG_HERMES | 800 | #ifdef CONFIG_HERMES |
801 | initr_hermes, | 801 | initr_hermes, |
802 | #endif | 802 | #endif |
803 | #if defined(CONFIG_ID_EEPROM) || defined(CONFIG_SYS_I2C_MAC_OFFSET) | 803 | #if defined(CONFIG_ID_EEPROM) || defined(CONFIG_SYS_I2C_MAC_OFFSET) |
804 | mac_read_from_eeprom, | 804 | mac_read_from_eeprom, |
805 | #endif | 805 | #endif |
806 | INIT_FUNC_WATCHDOG_RESET | 806 | INIT_FUNC_WATCHDOG_RESET |
807 | #if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT) | 807 | #if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT) |
808 | /* | 808 | /* |
809 | * Do pci configuration | 809 | * Do pci configuration |
810 | */ | 810 | */ |
811 | initr_pci, | 811 | initr_pci, |
812 | #endif | 812 | #endif |
813 | stdio_init, | 813 | stdio_init, |
814 | initr_jumptable, | 814 | initr_jumptable, |
815 | #ifdef CONFIG_API | 815 | #ifdef CONFIG_API |
816 | initr_api, | 816 | initr_api, |
817 | #endif | 817 | #endif |
818 | console_init_r, /* fully init console as a device */ | 818 | console_init_r, /* fully init console as a device */ |
819 | #ifdef CONFIG_DISPLAY_BOARDINFO_LATE | 819 | #ifdef CONFIG_DISPLAY_BOARDINFO_LATE |
820 | show_model_r, | 820 | show_model_r, |
821 | #endif | 821 | #endif |
822 | #ifdef CONFIG_ARCH_MISC_INIT | 822 | #ifdef CONFIG_ARCH_MISC_INIT |
823 | arch_misc_init, /* miscellaneous arch-dependent init */ | 823 | arch_misc_init, /* miscellaneous arch-dependent init */ |
824 | #endif | 824 | #endif |
825 | #ifdef CONFIG_MISC_INIT_R | 825 | #ifdef CONFIG_MISC_INIT_R |
826 | misc_init_r, /* miscellaneous platform-dependent init */ | 826 | misc_init_r, /* miscellaneous platform-dependent init */ |
827 | #endif | 827 | #endif |
828 | #ifdef CONFIG_HERMES | 828 | #ifdef CONFIG_HERMES |
829 | initr_hermes_start, | 829 | initr_hermes_start, |
830 | #endif | 830 | #endif |
831 | INIT_FUNC_WATCHDOG_RESET | 831 | INIT_FUNC_WATCHDOG_RESET |
832 | #ifdef CONFIG_CMD_KGDB | 832 | #ifdef CONFIG_CMD_KGDB |
833 | initr_kgdb, | 833 | initr_kgdb, |
834 | #endif | 834 | #endif |
835 | #ifdef CONFIG_X86 | 835 | #ifdef CONFIG_X86 |
836 | board_early_init_r, | 836 | board_early_init_r, |
837 | #endif | 837 | #endif |
838 | interrupt_init, | 838 | interrupt_init, |
839 | #if defined(CONFIG_ARM) || defined(CONFIG_x86) | 839 | #if defined(CONFIG_ARM) || defined(CONFIG_x86) |
840 | initr_enable_interrupts, | 840 | initr_enable_interrupts, |
841 | #endif | 841 | #endif |
842 | #ifdef CONFIG_X86 | 842 | #ifdef CONFIG_X86 |
843 | timer_init, /* initialize timer */ | 843 | timer_init, /* initialize timer */ |
844 | #endif | 844 | #endif |
845 | #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) | 845 | #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) |
846 | initr_status_led, | 846 | initr_status_led, |
847 | #endif | 847 | #endif |
848 | /* PPC has a udelay(20) here dating from 2002. Why? */ | 848 | /* PPC has a udelay(20) here dating from 2002. Why? */ |
849 | #ifdef CONFIG_CMD_NET | 849 | #ifdef CONFIG_CMD_NET |
850 | initr_ethaddr, | 850 | initr_ethaddr, |
851 | #endif | 851 | #endif |
852 | #ifdef CONFIG_BOARD_LATE_INIT | 852 | #ifdef CONFIG_BOARD_LATE_INIT |
853 | board_late_init, | 853 | board_late_init, |
854 | #endif | 854 | #endif |
855 | #ifdef CONFIG_CMD_SCSI | 855 | #ifdef CONFIG_CMD_SCSI |
856 | INIT_FUNC_WATCHDOG_RESET | 856 | INIT_FUNC_WATCHDOG_RESET |
857 | initr_scsi, | 857 | initr_scsi, |
858 | #endif | 858 | #endif |
859 | #ifdef CONFIG_CMD_DOC | 859 | #ifdef CONFIG_CMD_DOC |
860 | INIT_FUNC_WATCHDOG_RESET | 860 | INIT_FUNC_WATCHDOG_RESET |
861 | initr_doc, | 861 | initr_doc, |
862 | #endif | 862 | #endif |
863 | #ifdef CONFIG_BITBANGMII | 863 | #ifdef CONFIG_BITBANGMII |
864 | initr_bbmii, | 864 | initr_bbmii, |
865 | #endif | 865 | #endif |
866 | #ifdef CONFIG_CMD_NET | 866 | #ifdef CONFIG_CMD_NET |
867 | INIT_FUNC_WATCHDOG_RESET | 867 | INIT_FUNC_WATCHDOG_RESET |
868 | initr_net, | 868 | initr_net, |
869 | #endif | 869 | #endif |
870 | #ifdef CONFIG_POST | 870 | #ifdef CONFIG_POST |
871 | initr_post, | 871 | initr_post, |
872 | #endif | 872 | #endif |
873 | #if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE) | 873 | #if defined(CONFIG_CMD_PCMCIA) && !defined(CONFIG_CMD_IDE) |
874 | initr_pcmcia, | 874 | initr_pcmcia, |
875 | #endif | 875 | #endif |
876 | #if defined(CONFIG_CMD_IDE) | 876 | #if defined(CONFIG_CMD_IDE) |
877 | initr_ide, | 877 | initr_ide, |
878 | #endif | 878 | #endif |
879 | #ifdef CONFIG_LAST_STAGE_INIT | 879 | #ifdef CONFIG_LAST_STAGE_INIT |
880 | INIT_FUNC_WATCHDOG_RESET | 880 | INIT_FUNC_WATCHDOG_RESET |
881 | /* | 881 | /* |
882 | * Some parts can be only initialized if all others (like | 882 | * Some parts can be only initialized if all others (like |
883 | * Interrupts) are up and running (i.e. the PC-style ISA | 883 | * Interrupts) are up and running (i.e. the PC-style ISA |
884 | * keyboard). | 884 | * keyboard). |
885 | */ | 885 | */ |
886 | last_stage_init, | 886 | last_stage_init, |
887 | #endif | 887 | #endif |
888 | #ifdef CONFIG_CMD_BEDBUG | 888 | #ifdef CONFIG_CMD_BEDBUG |
889 | INIT_FUNC_WATCHDOG_RESET | 889 | INIT_FUNC_WATCHDOG_RESET |
890 | initr_bedbug, | 890 | initr_bedbug, |
891 | #endif | 891 | #endif |
892 | #if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER) | 892 | #if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER) |
893 | initr_mem, | 893 | initr_mem, |
894 | #endif | 894 | #endif |
895 | #ifdef CONFIG_PS2KBD | 895 | #ifdef CONFIG_PS2KBD |
896 | initr_kbd, | 896 | initr_kbd, |
897 | #endif | 897 | #endif |
898 | #ifdef CONFIG_MODEM_SUPPORT | 898 | #ifdef CONFIG_MODEM_SUPPORT |
899 | initr_modem, | 899 | initr_modem, |
900 | #endif | 900 | #endif |
901 | run_main_loop, | 901 | run_main_loop, |
902 | }; | 902 | }; |
903 | 903 | ||
904 | void board_init_r(gd_t *new_gd, ulong dest_addr) | 904 | void board_init_r(gd_t *new_gd, ulong dest_addr) |
905 | { | 905 | { |
906 | #ifdef CONFIG_NEEDS_MANUAL_RELOC | 906 | #ifdef CONFIG_NEEDS_MANUAL_RELOC |
907 | int i; | 907 | int i; |
908 | #endif | 908 | #endif |
909 | 909 | ||
910 | #ifndef CONFIG_X86 | 910 | #ifndef CONFIG_X86 |
911 | gd = new_gd; | 911 | gd = new_gd; |
912 | #endif | 912 | #endif |
913 | 913 | ||
914 | #ifdef CONFIG_NEEDS_MANUAL_RELOC | 914 | #ifdef CONFIG_NEEDS_MANUAL_RELOC |
915 | for (i = 0; i < ARRAY_SIZE(init_sequence_r); i++) | 915 | for (i = 0; i < ARRAY_SIZE(init_sequence_r); i++) |
916 | init_sequence_r[i] += gd->reloc_off; | 916 | init_sequence_r[i] += gd->reloc_off; |
917 | #endif | 917 | #endif |
918 | 918 | ||
919 | if (initcall_run_list(init_sequence_r)) | 919 | if (initcall_run_list(init_sequence_r)) |
920 | hang(); | 920 | hang(); |
921 | 921 | ||
922 | /* NOTREACHED - run_main_loop() does not return */ | 922 | /* NOTREACHED - run_main_loop() does not return */ |
923 | hang(); | 923 | hang(); |
924 | } | 924 | } |
925 | 925 |
include/asm-generic/sections.h
1 | /* | 1 | /* |
2 | * Copyright (c) 2011 The Chromium OS Authors. | 2 | * Copyright (c) 2011 The Chromium OS Authors. |
3 | * | 3 | * |
4 | * SPDX-License-Identifier: GPL-2.0+ | 4 | * SPDX-License-Identifier: GPL-2.0+ |
5 | */ | 5 | */ |
6 | 6 | ||
7 | /* Taken from Linux kernel, commit f56c3196 */ | 7 | /* Taken from Linux kernel, commit f56c3196 */ |
8 | 8 | ||
9 | #ifndef _ASM_GENERIC_SECTIONS_H_ | 9 | #ifndef _ASM_GENERIC_SECTIONS_H_ |
10 | #define _ASM_GENERIC_SECTIONS_H_ | 10 | #define _ASM_GENERIC_SECTIONS_H_ |
11 | 11 | ||
12 | /* References to section boundaries */ | 12 | /* References to section boundaries */ |
13 | 13 | ||
14 | extern char _text[], _stext[], _etext[]; | 14 | extern char _text[], _stext[], _etext[]; |
15 | extern char _data[], _sdata[], _edata[]; | 15 | extern char _data[], _sdata[], _edata[]; |
16 | extern char __bss_start[], __bss_stop[]; | 16 | extern char __bss_start[], __bss_stop[]; |
17 | extern char __init_begin[], __init_end[]; | 17 | extern char __init_begin[], __init_end[]; |
18 | extern char _sinittext[], _einittext[]; | 18 | extern char _sinittext[], _einittext[]; |
19 | extern char _end[], _init[]; | 19 | extern char _end[], _init[]; |
20 | extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; | 20 | extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; |
21 | extern char __kprobes_text_start[], __kprobes_text_end[]; | 21 | extern char __kprobes_text_start[], __kprobes_text_end[]; |
22 | extern char __entry_text_start[], __entry_text_end[]; | 22 | extern char __entry_text_start[], __entry_text_end[]; |
23 | extern char __initdata_begin[], __initdata_end[]; | 23 | extern char __initdata_begin[], __initdata_end[]; |
24 | extern char __start_rodata[], __end_rodata[]; | 24 | extern char __start_rodata[], __end_rodata[]; |
25 | 25 | ||
26 | /* Start and end of .ctors section - used for constructor calls. */ | 26 | /* Start and end of .ctors section - used for constructor calls. */ |
27 | extern char __ctors_start[], __ctors_end[]; | 27 | extern char __ctors_start[], __ctors_end[]; |
28 | 28 | ||
29 | /* function descriptor handling (if any). Override | 29 | /* function descriptor handling (if any). Override |
30 | * in asm/sections.h */ | 30 | * in asm/sections.h */ |
31 | #ifndef dereference_function_descriptor | 31 | #ifndef dereference_function_descriptor |
32 | #define dereference_function_descriptor(p) (p) | 32 | #define dereference_function_descriptor(p) (p) |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | /* random extra sections (if any). Override | 35 | /* random extra sections (if any). Override |
36 | * in asm/sections.h */ | 36 | * in asm/sections.h */ |
37 | #ifndef arch_is_kernel_text | 37 | #ifndef arch_is_kernel_text |
38 | static inline int arch_is_kernel_text(unsigned long addr) | 38 | static inline int arch_is_kernel_text(unsigned long addr) |
39 | { | 39 | { |
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | #ifndef arch_is_kernel_data | 44 | #ifndef arch_is_kernel_data |
45 | static inline int arch_is_kernel_data(unsigned long addr) | 45 | static inline int arch_is_kernel_data(unsigned long addr) |
46 | { | 46 | { |
47 | return 0; | 47 | return 0; |
48 | } | 48 | } |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | /* U-Boot-specific things begin here */ | 51 | /* U-Boot-specific things begin here */ |
52 | 52 | ||
53 | /* Start of U-Boot text region */ | 53 | /* Start of U-Boot text region */ |
54 | extern char __text_start[]; | 54 | extern char __text_start[]; |
55 | 55 | ||
56 | /* This marks the end of the text region which must be relocated */ | 56 | /* This marks the end of the text region which must be relocated */ |
57 | extern char __image_copy_end[]; | 57 | extern char __image_copy_end[]; |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * This is the U-Boot entry point - prior to relocation it should be same | 60 | * This is the U-Boot entry point - prior to relocation it should be same |
61 | * as __text_start | 61 | * as __text_start |
62 | */ | 62 | */ |
63 | extern void _start(void); | 63 | extern void _start(void); |
64 | 64 | ||
65 | /* | 65 | /* |
66 | * ARM needs to use offsets for symbols, since the values of some symbols | 66 | * ARM defines its symbols as char[]. Other arches define them as ulongs. |
67 | * are not resolved prior to relocation (and are just 0). Maybe this can be | ||
68 | * resolved, or maybe other architectures are similar, iwc this should be | ||
69 | * promoted to an architecture option. | ||
70 | */ | 67 | */ |
71 | #ifdef CONFIG_ARM | 68 | #ifdef CONFIG_ARM |
72 | #define CONFIG_SYS_SYM_OFFSETS | ||
73 | #endif | ||
74 | 69 | ||
75 | #ifdef CONFIG_SYS_SYM_OFFSETS | 70 | extern char __bss_start[]; |
76 | /* Start/end of the relocation entries, as an offset from _start */ | 71 | extern char __bss_end[]; |
77 | extern ulong _rel_dyn_start_ofs; | 72 | extern char __image_copy_start[]; |
78 | extern ulong _rel_dyn_end_ofs; | 73 | extern char __image_copy_end[]; |
79 | 74 | extern char __rel_dyn_start[]; | |
80 | /* End of the region to be relocated, as an offset form _start */ | 75 | extern char __rel_dyn_end[]; |
81 | extern ulong _image_copy_end_ofs; | ||
82 | |||
83 | extern ulong _bss_start_ofs; /* BSS start relative to _start */ | ||
84 | extern ulong _bss_end_ofs; /* BSS end relative to _start */ | ||
85 | extern ulong _end_ofs; /* end of image relative to _start */ | ||
86 | |||
87 | extern ulong _TEXT_BASE; /* code start */ | ||
88 | 76 | ||
89 | #else /* don't use offsets: */ | 77 | #else /* don't use offsets: */ |
90 | 78 | ||
91 | /* Exports from the Linker Script */ | 79 | /* Exports from the Linker Script */ |
92 | extern ulong __data_end; | 80 | extern ulong __data_end; |
93 | extern ulong __rel_dyn_start; | 81 | extern ulong __rel_dyn_start; |
94 | extern ulong __rel_dyn_end; | 82 | extern ulong __rel_dyn_end; |
95 | extern ulong __bss_end; | 83 | extern ulong __bss_end; |
96 | 84 | ||
97 | extern ulong _TEXT_BASE; /* code start */ | 85 | extern ulong _TEXT_BASE; /* code start */ |
98 | 86 | ||
99 | #endif | 87 | #endif |
100 | 88 | ||
101 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ | 89 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ |
102 | 90 |