2 * Initial board bringup code for many different boards.
6 * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others).
8 * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
14 #include <linux/config.h>
16 #include <asm/cache.h>
17 #include <asm/ppc_asm.h>
22 * Begin at some arbitrary location in RAM or Flash
23 * Initialize core registers
24 * Configure memory controller (Not executing from RAM)
25 * Move the boot code to the link address (8M)
28 * Decompress the kernel to 0x0
29 * Jump to the kernel entry
36 #ifdef CONFIG_IBM_OPENBIOS
37 /* The IBM "Tree" bootrom knows that the address of the bootrom
38 * read only structure is 4 bytes after _start.
40 .long 0x62726f6d # structure ID - "brom"
41 .long 0x5f726f00 # - "_ro\0"
42 .long 1 # structure version
43 .long bootrom_cmdline # address of *bootrom_cmdline
48 /* We have some really bad firmware. We must disable the L1
49 * icache/dcache now or the board won't boot.
58 #if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP)
59 mr r29,r3 /* On the MBX860, r3 is the board info pointer.
60 * On the RPXSUPER, r3 points to the NVRAM
62 * On PReP, r3 is the pointer to the residual data.
66 #if defined(CONFIG_XILINX_VIRTEX_4_FX)
67 /* PPC errata 213: only for Virtex-4 FX */
73 mflr r3 /* Save our actual starting address. */
75 /* The following functions we call must not modify r3 or r4.....
78 /* On PReP we must look at the OpenFirmware pointer and sanity
79 * test it. On other platforms, we disable the MMU right now
82 #ifdef CONFIG_PPC_PREP
84 * Save the OF pointer to r25, but only if the entry point is in a sane
85 * location; if not we store 0. If there is no entry point, or it is
86 * invalid, we establish the default MSR value immediately. Otherwise,
87 * we defer doing that, to allow OF functions to be called, until we
88 * begin uncompressing the kernel.
90 lis r8,0x0fff /* r8 = 0x0fffffff */
93 subc r8,r8,r5 /* r8 = (r5 <= r8) ? ~0 : 0 */
97 and. r5,r5,r8 /* r5 will be cleared if (r5 > r8) */
100 li r8,MSR_IP|MSR_FP /* Not OF: set MSR immediately */
108 bl disable_6xx_l1cache
114 mfmsr r8 /* Turn off interrupts */
120 /* We do this because some boot roms don't initialize the
121 * processor correctly. Don't do this if you want to debug
122 * using a BDM device.
124 li r4,0 /* Zero DER to prevent FRZ */
128 #if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP)
129 mr r4,r29 /* put the board info pointer where the relocate
130 * routine will find it
134 /* Get the load address.
136 subi r3, r3, 4 /* Get the actual IP, not NIP */