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