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 mflr r3 /* Save our actual starting address. */
70 /* The following functions we call must not modify r3 or r4.....
73 /* On PReP we must look at the OpenFirmware pointer and sanity
74 * test it. On other platforms, we disable the MMU right now
77 #ifdef CONFIG_PPC_PREP
79 * Save the OF pointer to r25, but only if the entry point is in a sane
80 * location; if not we store 0. If there is no entry point, or it is
81 * invalid, we establish the default MSR value immediately. Otherwise,
82 * we defer doing that, to allow OF functions to be called, until we
83 * begin uncompressing the kernel.
85 lis r8,0x0fff /* r8 = 0x0fffffff */
88 subc r8,r8,r5 /* r8 = (r5 <= r8) ? ~0 : 0 */
92 and. r5,r5,r8 /* r5 will be cleared if (r5 > r8) */
95 li r8,MSR_IP|MSR_FP /* Not OF: set MSR immediately */
103 bl disable_6xx_l1cache
109 mfmsr r8 /* Turn off interrupts */
115 /* We do this because some boot roms don't initialize the
116 * processor correctly. Don't do this if you want to debug
117 * using a BDM device.
119 li r4,0 /* Zero DER to prevent FRZ */
123 #ifdef CONFIG_REDWOOD_4
124 /* All of this Redwood 4 stuff will soon disappear when the
125 * boot rom is straightened out.
127 mr r29, r3 /* Easier than changing the other code */
132 #if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP)
133 mr r4,r29 /* put the board info pointer where the relocate
134 * routine will find it
138 /* Get the load address.
140 subi r3, r3, 4 /* Get the actual IP, not NIP */