blob: b61363d557b571abee2d1092d8153390ea8c5a6b [file] [log] [blame]
Paul Mackerras14cf11a2005-09-26 16:04:21 +10001/*
Paul Mackerras14cf11a2005-09-26 16:04:21 +10002 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
6 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
7 * Adapted for Power Macintosh by Paul Mackerras.
8 * Low-level exception handlers and MMU support
9 * rewritten by Paul Mackerras.
10 * Copyright (C) 1996 Paul Mackerras.
11 *
12 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
13 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
14 *
Benjamin Herrenschmidt0ebc4cd2009-06-02 21:17:38 +000015 * This file contains the entry point for the 64-bit kernel along
16 * with some early initialization code common to all 64-bit powerpc
17 * variants.
Paul Mackerras14cf11a2005-09-26 16:04:21 +100018 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version
22 * 2 of the License, or (at your option) any later version.
23 */
24
Paul Mackerras14cf11a2005-09-26 16:04:21 +100025#include <linux/threads.h>
Paul Mackerrasb5bbeb22005-10-10 14:01:07 +100026#include <asm/reg.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100027#include <asm/page.h>
28#include <asm/mmu.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100029#include <asm/ppc_asm.h>
30#include <asm/asm-offsets.h>
31#include <asm/bug.h>
32#include <asm/cputable.h>
33#include <asm/setup.h>
34#include <asm/hvcall.h>
David Gibson6cb7bfe2005-10-21 15:45:50 +100035#include <asm/thread_info.h>
Stephen Rothwell3f639ee2006-09-25 18:19:00 +100036#include <asm/firmware.h>
Stephen Rothwell16a15a32007-08-20 14:58:36 +100037#include <asm/page_64.h>
Benjamin Herrenschmidt945feb12008-04-17 14:35:01 +100038#include <asm/irqflags.h>
Alexander Graf2191d652010-04-16 00:11:32 +020039#include <asm/kvm_book3s_asm.h>
Stephen Rothwell46f52212010-11-18 15:06:17 +000040#include <asm/ptrace.h>
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +110041#include <asm/hw_irq.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100042
Lucas De Marchi25985ed2011-03-30 22:57:33 -030043/* The physical memory is laid out such that the secondary processor
Benjamin Herrenschmidt0ebc4cd2009-06-02 21:17:38 +000044 * spin code sits at 0x0000...0x00ff. On server, the vectors follow
45 * using the layout described in exceptions-64s.S
Paul Mackerras14cf11a2005-09-26 16:04:21 +100046 */
47
48/*
49 * Entering into this code we make the following assumptions:
Benjamin Herrenschmidt0ebc4cd2009-06-02 21:17:38 +000050 *
51 * For pSeries or server processors:
Paul Mackerras14cf11a2005-09-26 16:04:21 +100052 * 1. The MMU is off & open firmware is running in real mode.
53 * 2. The kernel is entered at __start
Benjamin Herrenschmidt27f44882011-09-19 18:27:58 +000054 * -or- For OPAL entry:
55 * 1. The MMU is off, processor in HV mode, primary CPU enters at 0
Benjamin Herrenschmidtdaea1172011-09-19 17:44:59 +000056 * with device-tree in gpr3. We also get OPAL base in r8 and
57 * entry in r9 for debugging purposes
Benjamin Herrenschmidt27f44882011-09-19 18:27:58 +000058 * 2. Secondary processors enter at 0x60 with PIR in gpr3
Paul Mackerras14cf11a2005-09-26 16:04:21 +100059 *
Benjamin Herrenschmidt0ebc4cd2009-06-02 21:17:38 +000060 * For Book3E processors:
61 * 1. The MMU is on running in AS0 in a state defined in ePAPR
62 * 2. The kernel is entered at __start
Paul Mackerras14cf11a2005-09-26 16:04:21 +100063 */
64
65 .text
66 .globl _stext
67_stext:
Paul Mackerras14cf11a2005-09-26 16:04:21 +100068_GLOBAL(__start)
69 /* NOP this out unconditionally */
70BEGIN_FTR_SECTION
Paul Mackerrasb85a0462005-10-06 10:59:19 +100071 b .__start_initialization_multiplatform
Paul Mackerras14cf11a2005-09-26 16:04:21 +100072END_FTR_SECTION(0, 1)
Paul Mackerras14cf11a2005-09-26 16:04:21 +100073
74 /* Catch branch to 0 in real mode */
75 trap
76
Paul Mackerras1f6a93e2008-08-30 11:40:24 +100077 /* Secondary processors spin on this value until it becomes nonzero.
78 * When it does it contains the real address of the descriptor
79 * of the function that the cpu should jump to to continue
80 * initialization.
81 */
Paul Mackerras14cf11a2005-09-26 16:04:21 +100082 .globl __secondary_hold_spinloop
83__secondary_hold_spinloop:
84 .llong 0x0
85
86 /* Secondary processors write this value with their cpu # */
87 /* after they enter the spin loop immediately below. */
88 .globl __secondary_hold_acknowledge
89__secondary_hold_acknowledge:
90 .llong 0x0
91
Sonny Rao928a3192010-11-18 00:35:07 +000092#ifdef CONFIG_RELOCATABLE
Milton Miller8b8b0cc2008-10-23 18:41:09 +000093 /* This flag is set to 1 by a loader if the kernel should run
94 * at the loaded address instead of the linked address. This
95 * is used by kexec-tools to keep the the kdump kernel in the
96 * crash_kernel region. The loader is responsible for
97 * observing the alignment requirement.
98 */
99 /* Do not move this variable as kexec-tools knows about it. */
100 . = 0x5c
101 .globl __run_at_load
102__run_at_load:
103 .long 0x72756e30 /* "run0" -- relocate to 0 by default */
104#endif
105
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000106 . = 0x60
107/*
Geoff Levand75423b72007-06-16 08:06:23 +1000108 * The following code is used to hold secondary processors
109 * in a spin loop after they have entered the kernel, but
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000110 * before the bulk of the kernel has been relocated. This code
111 * is relocated to physical address 0x60 before prom_init is run.
112 * All of it must fit below the first exception vector at 0x100.
Paul Mackerras1f6a93e2008-08-30 11:40:24 +1000113 * Use .globl here not _GLOBAL because we want __secondary_hold
114 * to be the actual text address, not a descriptor.
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000115 */
Paul Mackerras1f6a93e2008-08-30 11:40:24 +1000116 .globl __secondary_hold
117__secondary_hold:
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000118#ifndef CONFIG_PPC_BOOK3E
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000119 mfmsr r24
120 ori r24,r24,MSR_RI
121 mtmsrd r24 /* RI on */
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000122#endif
Anton Blanchardf1870f72006-02-13 18:11:13 +1100123 /* Grab our physical cpu number */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000124 mr r24,r3
Jimi Xenidis96f013f2012-12-03 17:05:47 +0000125 /* stash r4 for book3e */
126 mr r25,r4
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000127
128 /* Tell the master cpu we're here */
129 /* Relocation is off & we are located at an address less */
130 /* than 0x100, so only need to grab low order offset. */
Paul Mackerrase31aa452008-08-30 11:41:12 +1000131 std r24,__secondary_hold_acknowledge-_stext(0)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000132 sync
133
Jimi Xenidis96f013f2012-12-03 17:05:47 +0000134 li r26,0
135#ifdef CONFIG_PPC_BOOK3E
136 tovirt(r26,r26)
137#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000138 /* All secondary cpus wait here until told to start. */
Jimi Xenidis96f013f2012-12-03 17:05:47 +0000139100: ld r4,__secondary_hold_spinloop-_stext(r26)
Paul Mackerras1f6a93e2008-08-30 11:40:24 +1000140 cmpdi 0,r4,0
141 beq 100b
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000142
Anton Blanchardf1870f72006-02-13 18:11:13 +1100143#if defined(CONFIG_SMP) || defined(CONFIG_KEXEC)
Jimi Xenidis96f013f2012-12-03 17:05:47 +0000144#ifdef CONFIG_PPC_BOOK3E
145 tovirt(r4,r4)
146#endif
Paul Mackerras1f6a93e2008-08-30 11:40:24 +1000147 ld r4,0(r4) /* deref function descriptor */
Michael Ellerman758438a2005-12-05 15:49:00 -0600148 mtctr r4
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000149 mr r3,r24
Jimi Xenidis96f013f2012-12-03 17:05:47 +0000150 /*
151 * it may be the case that other platforms have r4 right to
152 * begin with, this gives us some safety in case it is not
153 */
154#ifdef CONFIG_PPC_BOOK3E
155 mr r4,r25
156#else
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000157 li r4,0
Jimi Xenidis96f013f2012-12-03 17:05:47 +0000158#endif
Benjamin Herrenschmidtdd797732011-04-05 14:34:58 +1000159 /* Make sure that patched code is visible */
160 isync
Michael Ellerman758438a2005-12-05 15:49:00 -0600161 bctr
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000162#else
163 BUG_OPCODE
164#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000165
166/* This value is used to mark exception frames on the stack. */
167 .section ".toc","aw"
168exception_marker:
169 .tc ID_72656773_68657265[TC],0x7265677368657265
170 .text
171
172/*
Benjamin Herrenschmidt0ebc4cd2009-06-02 21:17:38 +0000173 * On server, we include the exception vectors code here as it
174 * relies on absolute addressing which is only possible within
175 * this compilation unit
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000176 */
Benjamin Herrenschmidt0ebc4cd2009-06-02 21:17:38 +0000177#ifdef CONFIG_PPC_BOOK3S
178#include "exceptions-64s.S"
Paul Mackerras1f6a93e2008-08-30 11:40:24 +1000179#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000180
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000181_GLOBAL(generic_secondary_thread_init)
182 mr r24,r3
183
184 /* turn on 64-bit mode */
185 bl .enable_64b_mode
186
187 /* get a valid TOC pointer, wherever we're mapped at */
188 bl .relative_toc
Anton Blanchard1fbe9cf2012-11-26 17:41:08 +0000189 tovirt(r2,r2)
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000190
191#ifdef CONFIG_PPC_BOOK3E
192 /* Book3E initialization */
193 mr r3,r24
194 bl .book3e_secondary_thread_init
195#endif
196 b generic_secondary_common_init
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000197
198/*
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500199 * On pSeries and most other platforms, secondary processors spin
200 * in the following code.
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000201 * At entry, r3 = this processor's number (physical cpu id)
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000202 *
203 * On Book3E, r4 = 1 to indicate that the initial TLB entry for
204 * this core already exists (setup via some other mechanism such
205 * as SCOM before entry).
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000206 */
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500207_GLOBAL(generic_secondary_smp_init)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000208 mr r24,r3
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000209 mr r25,r4
210
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000211 /* turn on 64-bit mode */
212 bl .enable_64b_mode
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000213
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000214 /* get a valid TOC pointer, wherever we're mapped at */
Paul Mackerrase31aa452008-08-30 11:41:12 +1000215 bl .relative_toc
Anton Blanchard1fbe9cf2012-11-26 17:41:08 +0000216 tovirt(r2,r2)
Paul Mackerrase31aa452008-08-30 11:41:12 +1000217
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000218#ifdef CONFIG_PPC_BOOK3E
219 /* Book3E initialization */
220 mr r3,r24
221 mr r4,r25
222 bl .book3e_secondary_core_init
223#endif
224
225generic_secondary_common_init:
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000226 /* Set up a paca value for this processor. Since we have the
227 * physical cpu id in r24, we need to search the pacas to find
228 * which logical id maps to our physical one.
229 */
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000230 LOAD_REG_ADDR(r13, paca) /* Load paca pointer */
231 ld r13,0(r13) /* Get base vaddr of paca array */
Milton Miller768d18a2011-05-10 19:28:37 +0000232#ifndef CONFIG_SMP
233 addi r13,r13,PACA_SIZE /* know r13 if used accidentally */
234 b .kexec_wait /* wait for next kernel if !SMP */
235#else
236 LOAD_REG_ADDR(r7, nr_cpu_ids) /* Load nr_cpu_ids address */
237 lwz r7,0(r7) /* also the max paca allocated */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000238 li r5,0 /* logical cpu id */
2391: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */
240 cmpw r6,r24 /* Compare to our id */
241 beq 2f
242 addi r13,r13,PACA_SIZE /* Loop to next PACA on miss */
243 addi r5,r5,1
Milton Miller768d18a2011-05-10 19:28:37 +0000244 cmpw r5,r7 /* Check if more pacas exist */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000245 blt 1b
246
247 mr r3,r24 /* not found, copy phys to r3 */
248 b .kexec_wait /* next kernel might do better */
249
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +11002502: SET_PACA(r13)
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000251#ifdef CONFIG_PPC_BOOK3E
252 addi r12,r13,PACA_EXTLB /* and TLB exc frame in another */
253 mtspr SPRN_SPRG_TLB_EXFRAME,r12
254#endif
255
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000256 /* From now on, r24 is expected to be logical cpuid */
257 mr r24,r5
Sonny Raob6f6b982008-07-12 09:00:26 +1000258
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500259 /* See if we need to call a cpu state restore handler */
Paul Mackerrase31aa452008-08-30 11:41:12 +1000260 LOAD_REG_ADDR(r23, cur_cpu_spec)
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500261 ld r23,0(r23)
262 ld r23,CPU_SPEC_RESTORE(r23)
263 cmpdi 0,r23,0
Benjamin Herrenschmidt9d07bc82011-03-16 14:54:35 +1100264 beq 3f
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500265 ld r23,0(r23)
266 mtctr r23
267 bctrl
268
Matt Evans7ac87ab2011-05-25 18:09:12 +00002693: LOAD_REG_ADDR(r3, spinning_secondaries) /* Decrement spinning_secondaries */
Benjamin Herrenschmidt9d07bc82011-03-16 14:54:35 +1100270 lwarx r4,0,r3
271 subi r4,r4,1
272 stwcx. r4,0,r3
273 bne 3b
274 isync
275
2764: HMT_LOW
Benjamin Herrenschmidtad0693e2011-02-01 12:13:09 +1100277 lbz r23,PACAPROCSTART(r13) /* Test if this processor should */
278 /* start. */
Benjamin Herrenschmidtad0693e2011-02-01 12:13:09 +1100279 cmpwi 0,r23,0
Benjamin Herrenschmidt9d07bc82011-03-16 14:54:35 +1100280 beq 4b /* Loop until told to go */
Benjamin Herrenschmidtad0693e2011-02-01 12:13:09 +1100281
282 sync /* order paca.run and cur_cpu_spec */
Benjamin Herrenschmidt9d07bc82011-03-16 14:54:35 +1100283 isync /* In case code patching happened */
Benjamin Herrenschmidtad0693e2011-02-01 12:13:09 +1100284
Benjamin Herrenschmidt9d07bc82011-03-16 14:54:35 +1100285 /* Create a temp kernel stack for use before relocation is on. */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000286 ld r1,PACAEMERGSP(r13)
287 subi r1,r1,STACK_FRAME_OVERHEAD
288
Stephen Rothwellc7056772006-11-27 14:59:50 +1100289 b __secondary_start
Milton Miller768d18a2011-05-10 19:28:37 +0000290#endif /* SMP */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000291
Paul Mackerrase31aa452008-08-30 11:41:12 +1000292/*
293 * Turn the MMU off.
294 * Assumes we're mapped EA == RA if the MMU is on.
295 */
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000296#ifdef CONFIG_PPC_BOOK3S
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000297_STATIC(__mmu_off)
298 mfmsr r3
299 andi. r0,r3,MSR_IR|MSR_DR
300 beqlr
Paul Mackerrase31aa452008-08-30 11:41:12 +1000301 mflr r4
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000302 andc r3,r3,r0
303 mtspr SPRN_SRR0,r4
304 mtspr SPRN_SRR1,r3
305 sync
306 rfid
307 b . /* prevent speculative execution */
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000308#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000309
310
311/*
312 * Here is our main kernel entry point. We support currently 2 kind of entries
313 * depending on the value of r5.
314 *
315 * r5 != NULL -> OF entry, we go to prom_init, "legacy" parameter content
316 * in r3...r7
317 *
318 * r5 == NULL -> kexec style entry. r3 is a physical pointer to the
319 * DT block, r4 is a physical pointer to the kernel itself
320 *
321 */
322_GLOBAL(__start_initialization_multiplatform)
Paul Mackerrase31aa452008-08-30 11:41:12 +1000323 /* Make sure we are running in 64 bits mode */
324 bl .enable_64b_mode
325
326 /* Get TOC pointer (current runtime address) */
327 bl .relative_toc
328
329 /* find out where we are now */
330 bcl 20,31,$+4
3310: mflr r26 /* r26 = runtime addr here */
332 addis r26,r26,(_stext - 0b)@ha
333 addi r26,r26,(_stext - 0b)@l /* current runtime base addr */
334
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000335 /*
336 * Are we booted from a PROM Of-type client-interface ?
337 */
338 cmpldi cr0,r5,0
Stephen Rothwell939e60f62007-07-31 16:44:13 +1000339 beq 1f
340 b .__boot_from_prom /* yes -> prom */
3411:
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000342 /* Save parameters */
343 mr r31,r3
344 mr r30,r4
Benjamin Herrenschmidtdaea1172011-09-19 17:44:59 +0000345#ifdef CONFIG_PPC_EARLY_DEBUG_OPAL
346 /* Save OPAL entry */
347 mr r28,r8
348 mr r29,r9
349#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000350
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000351#ifdef CONFIG_PPC_BOOK3E
352 bl .start_initialization_book3e
353 b .__after_prom_start
354#else
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000355 /* Setup some critical 970 SPRs before switching MMU off */
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500356 mfspr r0,SPRN_PVR
357 srwi r0,r0,16
358 cmpwi r0,0x39 /* 970 */
359 beq 1f
360 cmpwi r0,0x3c /* 970FX */
361 beq 1f
362 cmpwi r0,0x44 /* 970MP */
Olof Johansson190a24f2006-10-25 17:32:40 -0500363 beq 1f
364 cmpwi r0,0x45 /* 970GX */
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500365 bne 2f
3661: bl .__cpu_preinit_ppc970
3672:
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000368
Paul Mackerrase31aa452008-08-30 11:41:12 +1000369 /* Switch off MMU if not already off */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000370 bl .__mmu_off
371 b .__after_prom_start
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000372#endif /* CONFIG_PPC_BOOK3E */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000373
Stephen Rothwell939e60f62007-07-31 16:44:13 +1000374_INIT_STATIC(__boot_from_prom)
Benjamin Herrenschmidt28794d32009-03-10 17:53:27 +0000375#ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000376 /* Save parameters */
377 mr r31,r3
378 mr r30,r4
379 mr r29,r5
380 mr r28,r6
381 mr r27,r7
382
Olaf Hering60888572006-03-23 21:50:59 +0100383 /*
384 * Align the stack to 16-byte boundary
385 * Depending on the size and layout of the ELF sections in the initial
Paul Mackerrase31aa452008-08-30 11:41:12 +1000386 * boot binary, the stack pointer may be unaligned on PowerMac
Olaf Hering60888572006-03-23 21:50:59 +0100387 */
Linus Torvaldsc05b4772006-03-04 15:00:45 -0800388 rldicr r1,r1,0,59
389
Paul Mackerras549e8152008-08-30 11:43:47 +1000390#ifdef CONFIG_RELOCATABLE
391 /* Relocate code for where we are now */
392 mr r3,r26
393 bl .relocate
394#endif
395
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000396 /* Restore parameters */
397 mr r3,r31
398 mr r4,r30
399 mr r5,r29
400 mr r6,r28
401 mr r7,r27
402
403 /* Do all of the interaction with OF client interface */
Paul Mackerras549e8152008-08-30 11:43:47 +1000404 mr r8,r26
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000405 bl .prom_init
Benjamin Herrenschmidt28794d32009-03-10 17:53:27 +0000406#endif /* #CONFIG_PPC_OF_BOOT_TRAMPOLINE */
407
408 /* We never return. We also hit that trap if trying to boot
409 * from OF while CONFIG_PPC_OF_BOOT_TRAMPOLINE isn't selected */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000410 trap
411
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000412_STATIC(__after_prom_start)
Paul Mackerras549e8152008-08-30 11:43:47 +1000413#ifdef CONFIG_RELOCATABLE
414 /* process relocations for the final address of the kernel */
415 lis r25,PAGE_OFFSET@highest /* compute virtual base of kernel */
416 sldi r25,r25,32
Milton Miller8b8b0cc2008-10-23 18:41:09 +0000417 lwz r7,__run_at_load-_stext(r26)
Sonny Rao928a3192010-11-18 00:35:07 +0000418 cmplwi cr0,r7,1 /* flagged to stay where we are ? */
Mohan Kumar M54622f12008-10-21 17:38:10 +0000419 bne 1f
420 add r25,r25,r26
Mohan Kumar M54622f12008-10-21 17:38:10 +00004211: mr r3,r25
Paul Mackerras549e8152008-08-30 11:43:47 +1000422 bl .relocate
423#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000424
425/*
Paul Mackerrase31aa452008-08-30 11:41:12 +1000426 * We need to run with _stext at physical address PHYSICAL_START.
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000427 * This will leave some code in the first 256B of
428 * real memory, which are reserved for software use.
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000429 *
430 * Note: This process overwrites the OF exception vectors.
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000431 */
Paul Mackerras549e8152008-08-30 11:43:47 +1000432 li r3,0 /* target addr */
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000433#ifdef CONFIG_PPC_BOOK3E
434 tovirt(r3,r3) /* on booke, we already run at PAGE_OFFSET */
435#endif
Paul Mackerras549e8152008-08-30 11:43:47 +1000436 mr. r4,r26 /* In some cases the loader may */
Paul Mackerrase31aa452008-08-30 11:41:12 +1000437 beq 9f /* have already put us at zero */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000438 li r6,0x100 /* Start offset, the first 0x100 */
439 /* bytes were copied earlier. */
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000440#ifdef CONFIG_PPC_BOOK3E
441 tovirt(r6,r6) /* on booke, we already run at PAGE_OFFSET */
442#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000443
Anton Blanchard11ee7e92012-11-11 19:01:05 +0000444#ifdef CONFIG_RELOCATABLE
Mohan Kumar M54622f12008-10-21 17:38:10 +0000445/*
446 * Check if the kernel has to be running as relocatable kernel based on the
Milton Miller8b8b0cc2008-10-23 18:41:09 +0000447 * variable __run_at_load, if it is set the kernel is treated as relocatable
Mohan Kumar M54622f12008-10-21 17:38:10 +0000448 * kernel, otherwise it will be moved to PHYSICAL_START
449 */
Milton Miller8b8b0cc2008-10-23 18:41:09 +0000450 lwz r7,__run_at_load-_stext(r26)
451 cmplwi cr0,r7,1
Mohan Kumar M54622f12008-10-21 17:38:10 +0000452 bne 3f
453
Michael Neulingc1fb6812012-11-02 17:21:43 +1100454 /* just copy interrupts */
455 LOAD_REG_IMMEDIATE(r5, __end_interrupts - _stext)
Mohan Kumar M54622f12008-10-21 17:38:10 +0000456 b 5f
4573:
458#endif
459 lis r5,(copy_to_here - _stext)@ha
460 addi r5,r5,(copy_to_here - _stext)@l /* # bytes of memory to copy */
461
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000462 bl .copy_and_flush /* copy the first n bytes */
463 /* this includes the code being */
464 /* executed here. */
Paul Mackerrase31aa452008-08-30 11:41:12 +1000465 addis r8,r3,(4f - _stext)@ha /* Jump to the copy of this code */
466 addi r8,r8,(4f - _stext)@l /* that we just made */
467 mtctr r8
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000468 bctr
469
Mohan Kumar M54622f12008-10-21 17:38:10 +0000470p_end: .llong _end - _stext
471
Paul Mackerrase31aa452008-08-30 11:41:12 +10004724: /* Now copy the rest of the kernel up to _end */
473 addis r5,r26,(p_end - _stext)@ha
474 ld r5,(p_end - _stext)@l(r5) /* get _end */
Mohan Kumar M54622f12008-10-21 17:38:10 +00004755: bl .copy_and_flush /* copy the rest */
Paul Mackerrase31aa452008-08-30 11:41:12 +1000476
4779: b .start_here_multiplatform
478
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000479/*
480 * Copy routine used to copy the kernel to start at physical address 0
481 * and flush and invalidate the caches as needed.
482 * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset
483 * on exit, r3, r4, r5 are unchanged, r6 is updated to be >= r5.
484 *
485 * Note: this routine *only* clobbers r0, r6 and lr
486 */
487_GLOBAL(copy_and_flush)
488 addi r5,r5,-8
489 addi r6,r6,-8
Olof Johansson5a2fe382006-09-06 14:34:41 -05004904: li r0,8 /* Use the smallest common */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000491 /* denominator cache line */
492 /* size. This results in */
493 /* extra cache line flushes */
494 /* but operation is correct. */
495 /* Can't get cache line size */
496 /* from NACA as it is being */
497 /* moved too. */
498
499 mtctr r0 /* put # words/line in ctr */
5003: addi r6,r6,8 /* copy a cache line */
501 ldx r0,r6,r4
502 stdx r0,r6,r3
503 bdnz 3b
504 dcbst r6,r3 /* write it to memory */
505 sync
506 icbi r6,r3 /* flush the icache line */
507 cmpld 0,r6,r5
508 blt 4b
509 sync
510 addi r5,r5,8
511 addi r6,r6,8
Michael Neuling29ce3c52013-04-24 00:30:09 +0000512 isync
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000513 blr
514
515.align 8
516copy_to_here:
517
518#ifdef CONFIG_SMP
519#ifdef CONFIG_PPC_PMAC
520/*
521 * On PowerMac, secondary processors starts from the reset vector, which
522 * is temporarily turned into a call to one of the functions below.
523 */
524 .section ".text";
525 .align 2 ;
526
Paul Mackerras35499c02005-10-22 16:02:39 +1000527 .globl __secondary_start_pmac_0
528__secondary_start_pmac_0:
529 /* NB the entries for cpus 0, 1, 2 must each occupy 8 bytes. */
530 li r24,0
531 b 1f
532 li r24,1
533 b 1f
534 li r24,2
535 b 1f
536 li r24,3
5371:
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000538
539_GLOBAL(pmac_secondary_start)
540 /* turn on 64-bit mode */
541 bl .enable_64b_mode
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000542
Benjamin Herrenschmidtc478b582009-01-11 19:03:45 +0000543 li r0,0
544 mfspr r3,SPRN_HID4
545 rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */
546 sync
547 mtspr SPRN_HID4,r3
548 isync
549 sync
550 slbia
551
Paul Mackerrase31aa452008-08-30 11:41:12 +1000552 /* get TOC pointer (real address) */
553 bl .relative_toc
Anton Blanchard1fbe9cf2012-11-26 17:41:08 +0000554 tovirt(r2,r2)
Paul Mackerrase31aa452008-08-30 11:41:12 +1000555
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000556 /* Copy some CPU settings from CPU 0 */
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500557 bl .__restore_cpu_ppc970
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000558
559 /* pSeries do that early though I don't think we really need it */
560 mfmsr r3
561 ori r3,r3,MSR_RI
562 mtmsrd r3 /* RI on */
563
564 /* Set up a paca value for this processor. */
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000565 LOAD_REG_ADDR(r4,paca) /* Load paca pointer */
566 ld r4,0(r4) /* Get base vaddr of paca array */
Paul Mackerrase31aa452008-08-30 11:41:12 +1000567 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000568 add r13,r13,r4 /* for this processor. */
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +1100569 SET_PACA(r13) /* Save vaddr of paca in an SPRG*/
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000570
Benjamin Herrenschmidt62cc67b2011-02-21 16:49:58 +1100571 /* Mark interrupts soft and hard disabled (they might be enabled
572 * in the PACA when doing hotplug)
573 */
574 li r0,0
575 stb r0,PACASOFTIRQEN(r13)
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100576 li r0,PACA_IRQ_HARD_DIS
577 stb r0,PACAIRQHAPPENED(r13)
Benjamin Herrenschmidt62cc67b2011-02-21 16:49:58 +1100578
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000579 /* Create a temp kernel stack for use before relocation is on. */
580 ld r1,PACAEMERGSP(r13)
581 subi r1,r1,STACK_FRAME_OVERHEAD
582
Stephen Rothwellc7056772006-11-27 14:59:50 +1100583 b __secondary_start
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000584
585#endif /* CONFIG_PPC_PMAC */
586
587/*
588 * This function is called after the master CPU has released the
589 * secondary processors. The execution environment is relocation off.
590 * The paca for this processor has the following fields initialized at
591 * this point:
592 * 1. Processor number
593 * 2. Segment table pointer (virtual address)
594 * On entry the following are set:
Benjamin Herrenschmidt4f8cf362012-02-28 13:44:58 +1100595 * r1 = stack pointer (real addr of temp stack)
Benjamin Herrenschmidtee43eb72009-07-14 20:52:54 +0000596 * r24 = cpu# (in Linux terms)
597 * r13 = paca virtual address
598 * SPRG_PACA = paca virtual address
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000599 */
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000600 .section ".text";
601 .align 2 ;
602
Stephen Rothwellfc68e862007-08-22 13:44:58 +1000603 .globl __secondary_start
Stephen Rothwellc7056772006-11-27 14:59:50 +1100604__secondary_start:
Paul Mackerras799d6042005-11-10 13:37:51 +1100605 /* Set thread priority to MEDIUM */
606 HMT_MEDIUM
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000607
Benjamin Herrenschmidt4f8cf362012-02-28 13:44:58 +1100608 /* Initialize the kernel stack */
David Gibsone58c3492006-01-13 14:56:25 +1100609 LOAD_REG_ADDR(r3, current_set)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000610 sldi r28,r24,3 /* get current_set[cpu#] */
Michael Neuling54a83402010-08-25 21:04:25 +0000611 ldx r14,r3,r28
612 addi r14,r14,THREAD_SIZE-STACK_FRAME_OVERHEAD
613 std r14,PACAKSAVE(r13)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000614
Matt Evansf7616222010-08-12 20:58:28 +0000615 /* Do early setup for that CPU (stab, slb, hash table pointer) */
616 bl .early_setup_secondary
617
Michael Neuling54a83402010-08-25 21:04:25 +0000618 /*
619 * setup the new stack pointer, but *don't* use this until
620 * translation is on.
621 */
622 mr r1, r14
623
Paul Mackerras799d6042005-11-10 13:37:51 +1100624 /* Clear backchain so we get nice backtraces */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000625 li r7,0
626 mtlr r7
627
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100628 /* Mark interrupts soft and hard disabled (they might be enabled
629 * in the PACA when doing hotplug)
630 */
Benjamin Herrenschmidt4f8cf362012-02-28 13:44:58 +1100631 stb r7,PACASOFTIRQEN(r13)
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100632 li r0,PACA_IRQ_HARD_DIS
633 stb r0,PACAIRQHAPPENED(r13)
Benjamin Herrenschmidt4f8cf362012-02-28 13:44:58 +1100634
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000635 /* enable MMU and jump to start_secondary */
David Gibsone58c3492006-01-13 14:56:25 +1100636 LOAD_REG_ADDR(r3, .start_secondary_prolog)
637 LOAD_REG_IMMEDIATE(r4, MSR_KERNEL)
Paul Mackerrasd04c56f2006-10-04 16:47:49 +1000638
Paul Mackerrasb5bbeb22005-10-10 14:01:07 +1000639 mtspr SPRN_SRR0,r3
640 mtspr SPRN_SRR1,r4
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000641 RFI
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000642 b . /* prevent speculative execution */
643
644/*
645 * Running with relocation on at this point. All we want to do is
Paul Mackerrase31aa452008-08-30 11:41:12 +1000646 * zero the stack back-chain pointer and get the TOC virtual address
647 * before going into C code.
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000648 */
649_GLOBAL(start_secondary_prolog)
Paul Mackerrase31aa452008-08-30 11:41:12 +1000650 ld r2,PACATOC(r13)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000651 li r3,0
652 std r3,0(r1) /* Zero the stack frame pointer */
653 bl .start_secondary
Paul Mackerras799d6042005-11-10 13:37:51 +1100654 b .
Vaidyanathan Srinivasan8dbce532010-03-01 02:58:09 +0000655/*
656 * Reset stack pointer and call start_secondary
657 * to continue with online operation when woken up
658 * from cede in cpu offline.
659 */
660_GLOBAL(start_secondary_resume)
661 ld r1,PACAKSAVE(r13) /* Reload kernel stack pointer */
662 li r3,0
663 std r3,0(r1) /* Zero the stack frame pointer */
664 bl .start_secondary
665 b .
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000666#endif
667
668/*
669 * This subroutine clobbers r11 and r12
670 */
671_GLOBAL(enable_64b_mode)
672 mfmsr r11 /* grab the current MSR */
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000673#ifdef CONFIG_PPC_BOOK3E
674 oris r11,r11,0x8000 /* CM bit set, we'll set ICM later */
675 mtmsr r11
676#else /* CONFIG_PPC_BOOK3E */
Michael Ellerman9f0b0792011-04-07 21:56:03 +0000677 li r12,(MSR_64BIT | MSR_ISF)@highest
Paul Mackerrase31aa452008-08-30 11:41:12 +1000678 sldi r12,r12,48
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000679 or r11,r11,r12
680 mtmsrd r11
681 isync
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000682#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000683 blr
684
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000685/*
Paul Mackerrase31aa452008-08-30 11:41:12 +1000686 * This puts the TOC pointer into r2, offset by 0x8000 (as expected
687 * by the toolchain). It computes the correct value for wherever we
688 * are running at the moment, using position-independent code.
Anton Blanchard1fbe9cf2012-11-26 17:41:08 +0000689 *
690 * Note: The compiler constructs pointers using offsets from the
691 * TOC in -mcmodel=medium mode. After we relocate to 0 but before
692 * the MMU is on we need our TOC to be a virtual address otherwise
693 * these pointers will be real addresses which may get stored and
694 * accessed later with the MMU on. We use tovirt() at the call
695 * sites to handle this.
Paul Mackerrase31aa452008-08-30 11:41:12 +1000696 */
697_GLOBAL(relative_toc)
698 mflr r0
699 bcl 20,31,$+4
Benjamin Herrenschmidte5505922011-09-19 17:44:51 +00007000: mflr r11
701 ld r2,(p_toc - 0b)(r11)
702 add r2,r2,r11
Paul Mackerrase31aa452008-08-30 11:41:12 +1000703 mtlr r0
704 blr
705
706p_toc: .llong __toc_start + 0x8000 - 0b
707
708/*
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000709 * This is where the main kernel code starts.
710 */
Stephen Rothwell939e60f62007-07-31 16:44:13 +1000711_INIT_STATIC(start_here_multiplatform)
Anton Blanchard1fbe9cf2012-11-26 17:41:08 +0000712 /* set up the TOC */
713 bl .relative_toc
714 tovirt(r2,r2)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000715
716 /* Clear out the BSS. It may have been done in prom_init,
717 * already but that's irrelevant since prom_init will soon
718 * be detached from the kernel completely. Besides, we need
719 * to clear it now for kexec-style entry.
720 */
Paul Mackerrase31aa452008-08-30 11:41:12 +1000721 LOAD_REG_ADDR(r11,__bss_stop)
722 LOAD_REG_ADDR(r8,__bss_start)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000723 sub r11,r11,r8 /* bss size */
724 addi r11,r11,7 /* round up to an even double word */
Paul Mackerrase31aa452008-08-30 11:41:12 +1000725 srdi. r11,r11,3 /* shift right by 3 */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000726 beq 4f
727 addi r8,r8,-8
728 li r0,0
729 mtctr r11 /* zero this many doublewords */
7303: stdu r0,8(r8)
731 bdnz 3b
7324:
733
Benjamin Herrenschmidtdaea1172011-09-19 17:44:59 +0000734#ifdef CONFIG_PPC_EARLY_DEBUG_OPAL
735 /* Setup OPAL entry */
Benjamin Herrenschmidtab7f9612012-10-21 14:30:52 +0000736 LOAD_REG_ADDR(r11, opal)
Benjamin Herrenschmidtdaea1172011-09-19 17:44:59 +0000737 std r28,0(r11);
738 std r29,8(r11);
739#endif
740
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000741#ifndef CONFIG_PPC_BOOK3E
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000742 mfmsr r6
743 ori r6,r6,MSR_RI
744 mtmsrd r6 /* RI on */
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000745#endif
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000746
Paul Mackerras549e8152008-08-30 11:43:47 +1000747#ifdef CONFIG_RELOCATABLE
748 /* Save the physical address we're running at in kernstart_addr */
749 LOAD_REG_ADDR(r4, kernstart_addr)
750 clrldi r0,r25,2
751 std r0,0(r4)
752#endif
753
Paul Mackerrase31aa452008-08-30 11:41:12 +1000754 /* The following gets the stack set up with the regs */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000755 /* pointing to the real addr of the kernel stack. This is */
756 /* all done to support the C function call below which sets */
757 /* up the htab. This is done because we have relocated the */
758 /* kernel but are still running in real mode. */
759
Paul Mackerrase31aa452008-08-30 11:41:12 +1000760 LOAD_REG_ADDR(r3,init_thread_union)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000761
Paul Mackerrase31aa452008-08-30 11:41:12 +1000762 /* set up a stack pointer */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000763 addi r1,r3,THREAD_SIZE
764 li r0,0
765 stdu r0,-STACK_FRAME_OVERHEAD(r1)
766
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000767 /* Do very early kernel initializations, including initial hash table,
768 * stab and slb setup before we turn on relocation. */
769
770 /* Restore parameters passed from prom_init/kexec */
771 mr r3,r31
Benjamin Herrenschmidtee43eb72009-07-14 20:52:54 +0000772 bl .early_setup /* also sets r13 and SPRG_PACA */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000773
Paul Mackerrase31aa452008-08-30 11:41:12 +1000774 LOAD_REG_ADDR(r3, .start_here_common)
775 ld r4,PACAKMSR(r13)
Paul Mackerrasb5bbeb22005-10-10 14:01:07 +1000776 mtspr SPRN_SRR0,r3
777 mtspr SPRN_SRR1,r4
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +0000778 RFI
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000779 b . /* prevent speculative execution */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000780
781 /* This is where all platforms converge execution */
Stephen Rothwellfc68e862007-08-22 13:44:58 +1000782_INIT_GLOBAL(start_here_common)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000783 /* relocation is on at this point */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000784 std r1,PACAKSAVE(r13)
785
Paul Mackerrase31aa452008-08-30 11:41:12 +1000786 /* Load the TOC (virtual address) */
787 ld r2,PACATOC(r13)
788
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100789 /* Do more system initializations in virtual mode */
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000790 bl .setup_system
791
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100792 /* Mark interrupts soft and hard disabled (they might be enabled
793 * in the PACA when doing hotplug)
794 */
795 li r0,0
796 stb r0,PACASOFTIRQEN(r13)
797 li r0,PACA_IRQ_HARD_DIS
798 stb r0,PACAIRQHAPPENED(r13)
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000799
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100800 /* Generic kernel entry */
Benjamin Herrenschmidtff3da2e2008-04-02 15:58:40 +1100801 bl .start_kernel
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000802
Anton Blanchardf1870f72006-02-13 18:11:13 +1100803 /* Not reached */
804 BUG_OPCODE
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000805
Paul Mackerras14cf11a2005-09-26 16:04:21 +1000806/*
807 * We put a few things here that have to be page-aligned.
808 * This stuff goes at the beginning of the bss, which is page-aligned.
809 */
810 .section ".bss"
811
812 .align PAGE_SHIFT
813
814 .globl empty_zero_page
815empty_zero_page:
816 .space PAGE_SIZE
817
818 .globl swapper_pg_dir
819swapper_pg_dir:
Stephen Rothwellee7a76d2007-09-18 17:22:59 +1000820 .space PGD_TABLE_SIZE