aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r--arch/powerpc/kernel/head_64.S41
1 files changed, 33 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 8a8bf79ef044..1c066d125375 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -154,11 +154,15 @@ _GLOBAL(__secondary_hold)
154 bne 100b 154 bne 100b
155 155
156#ifdef CONFIG_HMT 156#ifdef CONFIG_HMT
157 b .hmt_init 157 LOADADDR(r4, .hmt_init)
158 mtctr r4
159 bctr
158#else 160#else
159#ifdef CONFIG_SMP 161#ifdef CONFIG_SMP
162 LOADADDR(r4, .pSeries_secondary_smp_init)
163 mtctr r4
160 mr r3,r24 164 mr r3,r24
161 b .pSeries_secondary_smp_init 165 bctr
162#else 166#else
163 BUG_OPCODE 167 BUG_OPCODE
164#endif 168#endif
@@ -200,6 +204,20 @@ exception_marker:
200#define EX_R3 64 204#define EX_R3 64
201#define EX_LR 72 205#define EX_LR 72
202 206
207/*
208 * We're short on space and time in the exception prolog, so we can't use
209 * the normal LOADADDR macro. Normally we just need the low halfword of the
210 * address, but for Kdump we need the whole low word.
211 */
212#ifdef CONFIG_CRASH_DUMP
213#define LOAD_HANDLER(reg, label) \
214 oris reg,reg,(label)@h; /* virt addr of handler ... */ \
215 ori reg,reg,(label)@l; /* .. and the rest */
216#else
217#define LOAD_HANDLER(reg, label) \
218 ori reg,reg,(label)@l; /* virt addr of handler ... */
219#endif
220
203#define EXCEPTION_PROLOG_PSERIES(area, label) \ 221#define EXCEPTION_PROLOG_PSERIES(area, label) \
204 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ 222 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
205 std r9,area+EX_R9(r13); /* save r9 - r12 */ \ 223 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
@@ -212,7 +230,7 @@ exception_marker:
212 clrrdi r12,r13,32; /* get high part of &label */ \ 230 clrrdi r12,r13,32; /* get high part of &label */ \
213 mfmsr r10; \ 231 mfmsr r10; \
214 mfspr r11,SPRN_SRR0; /* save SRR0 */ \ 232 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
215 ori r12,r12,(label)@l; /* virt addr of handler */ \ 233 LOAD_HANDLER(r12,label) \
216 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \ 234 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
217 mtspr SPRN_SRR0,r12; \ 235 mtspr SPRN_SRR0,r12; \
218 mfspr r12,SPRN_SRR1; /* and SRR1 */ \ 236 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
@@ -553,6 +571,7 @@ slb_miss_user_pseries:
553 * Vectors for the FWNMI option. Share common code. 571 * Vectors for the FWNMI option. Share common code.
554 */ 572 */
555 .globl system_reset_fwnmi 573 .globl system_reset_fwnmi
574 .align 7
556system_reset_fwnmi: 575system_reset_fwnmi:
557 HMT_MEDIUM 576 HMT_MEDIUM
558 mtspr SPRN_SPRG1,r13 /* save r13 */ 577 mtspr SPRN_SPRG1,r13 /* save r13 */
@@ -560,6 +579,7 @@ system_reset_fwnmi:
560 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) 579 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
561 580
562 .globl machine_check_fwnmi 581 .globl machine_check_fwnmi
582 .align 7
563machine_check_fwnmi: 583machine_check_fwnmi:
564 HMT_MEDIUM 584 HMT_MEDIUM
565 mtspr SPRN_SPRG1,r13 /* save r13 */ 585 mtspr SPRN_SPRG1,r13 /* save r13 */
@@ -726,7 +746,8 @@ iSeries_secondary_smp_loop:
726decrementer_iSeries_masked: 746decrementer_iSeries_masked:
727 li r11,1 747 li r11,1
728 stb r11,PACALPPACA+LPPACADECRINT(r13) 748 stb r11,PACALPPACA+LPPACADECRINT(r13)
729 lwz r12,PACADEFAULTDECR(r13) 749 LOADBASE(r12,tb_ticks_per_jiffy)
750 lwz r12,OFF(tb_ticks_per_jiffy)(r12)
730 mtspr SPRN_DEC,r12 751 mtspr SPRN_DEC,r12
731 /* fall through */ 752 /* fall through */
732 753
@@ -1345,7 +1366,7 @@ _GLOBAL(do_stab_bolted)
1345 * fixed address (the linker can't compute (u64)&initial_stab >> 1366 * fixed address (the linker can't compute (u64)&initial_stab >>
1346 * PAGE_SHIFT). 1367 * PAGE_SHIFT).
1347 */ 1368 */
1348 . = STAB0_PHYS_ADDR /* 0x6000 */ 1369 . = STAB0_OFFSET /* 0x6000 */
1349 .globl initial_stab 1370 .globl initial_stab
1350initial_stab: 1371initial_stab:
1351 .space 4096 1372 .space 4096
@@ -1485,11 +1506,13 @@ _STATIC(__mmu_off)
1485 * 1506 *
1486 */ 1507 */
1487_GLOBAL(__start_initialization_multiplatform) 1508_GLOBAL(__start_initialization_multiplatform)
1509#ifdef CONFIG_PPC_MULTIPLATFORM
1488 /* 1510 /*
1489 * Are we booted from a PROM Of-type client-interface ? 1511 * Are we booted from a PROM Of-type client-interface ?
1490 */ 1512 */
1491 cmpldi cr0,r5,0 1513 cmpldi cr0,r5,0
1492 bne .__boot_from_prom /* yes -> prom */ 1514 bne .__boot_from_prom /* yes -> prom */
1515#endif
1493 1516
1494 /* Save parameters */ 1517 /* Save parameters */
1495 mr r31,r3 1518 mr r31,r3
@@ -1510,6 +1533,7 @@ _GLOBAL(__start_initialization_multiplatform)
1510 bl .__mmu_off 1533 bl .__mmu_off
1511 b .__after_prom_start 1534 b .__after_prom_start
1512 1535
1536#ifdef CONFIG_PPC_MULTIPLATFORM
1513_STATIC(__boot_from_prom) 1537_STATIC(__boot_from_prom)
1514 /* Save parameters */ 1538 /* Save parameters */
1515 mr r31,r3 1539 mr r31,r3
@@ -1542,6 +1566,7 @@ _STATIC(__boot_from_prom)
1542 bl .prom_init 1566 bl .prom_init
1543 /* We never return */ 1567 /* We never return */
1544 trap 1568 trap
1569#endif
1545 1570
1546/* 1571/*
1547 * At this point, r3 contains the physical address we are running at, 1572 * At this point, r3 contains the physical address we are running at,
@@ -1550,7 +1575,7 @@ _STATIC(__boot_from_prom)
1550_STATIC(__after_prom_start) 1575_STATIC(__after_prom_start)
1551 1576
1552/* 1577/*
1553 * We need to run with __start at physical address 0. 1578 * We need to run with __start at physical address PHYSICAL_START.
1554 * This will leave some code in the first 256B of 1579 * This will leave some code in the first 256B of
1555 * real memory, which are reserved for software use. 1580 * real memory, which are reserved for software use.
1556 * The remainder of the first page is loaded with the fixed 1581 * The remainder of the first page is loaded with the fixed
@@ -1565,7 +1590,7 @@ _STATIC(__after_prom_start)
1565 mr r26,r3 1590 mr r26,r3
1566 SET_REG_TO_CONST(r27,KERNELBASE) 1591 SET_REG_TO_CONST(r27,KERNELBASE)
1567 1592
1568 li r3,0 /* target addr */ 1593 LOADADDR(r3, PHYSICAL_START) /* target addr */
1569 1594
1570 // XXX FIXME: Use phys returned by OF (r30) 1595 // XXX FIXME: Use phys returned by OF (r30)
1571 add r4,r27,r26 /* source addr */ 1596 add r4,r27,r26 /* source addr */
@@ -1846,7 +1871,7 @@ _STATIC(start_here_multiplatform)
1846 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ 1871 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */
1847 add r13,r13,r24 /* for this processor. */ 1872 add r13,r13,r24 /* for this processor. */
1848 add r13,r13,r26 /* convert to physical addr */ 1873 add r13,r13,r26 /* convert to physical addr */
1849 mtspr SPRN_SPRG3,r13 /* PPPBBB: Temp... -Peter */ 1874 mtspr SPRN_SPRG3,r13
1850 1875
1851 /* Do very early kernel initializations, including initial hash table, 1876 /* Do very early kernel initializations, including initial hash table,
1852 * stab and slb setup before we turn on relocation. */ 1877 * stab and slb setup before we turn on relocation. */