diff options
46 files changed, 534 insertions, 319 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index d3654a264e..44dd82b791 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -139,17 +139,14 @@ drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/ | |||
139 | 139 | ||
140 | drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ | 140 | drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ |
141 | 141 | ||
142 | defaultimage-$(CONFIG_PPC32) := zImage | 142 | # Default to zImage, override when needed |
143 | defaultimage-y := zImage | ||
143 | defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux | 144 | defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux |
144 | defaultimage-$(CONFIG_PPC_PSERIES) := zImage | ||
145 | KBUILD_IMAGE := $(defaultimage-y) | 145 | KBUILD_IMAGE := $(defaultimage-y) |
146 | all: $(KBUILD_IMAGE) | 146 | all: $(KBUILD_IMAGE) |
147 | 147 | ||
148 | CPPFLAGS_vmlinux.lds := -Upowerpc | 148 | CPPFLAGS_vmlinux.lds := -Upowerpc |
149 | 149 | ||
150 | # All the instructions talk about "make bzImage". | ||
151 | bzImage: zImage | ||
152 | |||
153 | BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage | 150 | BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage |
154 | 151 | ||
155 | .PHONY: $(BOOT_TARGETS) | 152 | .PHONY: $(BOOT_TARGETS) |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 56399c5c93..840aad43a9 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -135,7 +135,7 @@ int main(void) | |||
135 | DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc)); | 135 | DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc)); |
136 | DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb)); | 136 | DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb)); |
137 | DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp)); | 137 | DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp)); |
138 | DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca)); | 138 | DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr)); |
139 | DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); | 139 | DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); |
140 | 140 | ||
141 | DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0)); | 141 | DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0)); |
diff --git a/arch/powerpc/kernel/cpu_setup_power4.S b/arch/powerpc/kernel/cpu_setup_power4.S index cca942fe61..b61d86e7ce 100644 --- a/arch/powerpc/kernel/cpu_setup_power4.S +++ b/arch/powerpc/kernel/cpu_setup_power4.S | |||
@@ -130,7 +130,7 @@ _GLOBAL(__save_cpu_setup) | |||
130 | mfcr r7 | 130 | mfcr r7 |
131 | 131 | ||
132 | /* Get storage ptr */ | 132 | /* Get storage ptr */ |
133 | LOADADDR(r5,cpu_state_storage) | 133 | LOAD_REG_IMMEDIATE(r5,cpu_state_storage) |
134 | 134 | ||
135 | /* We only deal with 970 for now */ | 135 | /* We only deal with 970 for now */ |
136 | mfspr r0,SPRN_PVR | 136 | mfspr r0,SPRN_PVR |
@@ -164,7 +164,7 @@ _GLOBAL(__restore_cpu_setup) | |||
164 | /* Get storage ptr (FIXME when using anton reloc as we | 164 | /* Get storage ptr (FIXME when using anton reloc as we |
165 | * are running with translation disabled here | 165 | * are running with translation disabled here |
166 | */ | 166 | */ |
167 | LOADADDR(r5,cpu_state_storage) | 167 | LOAD_REG_IMMEDIATE(r5,cpu_state_storage) |
168 | 168 | ||
169 | /* We only deal with 970 for now */ | 169 | /* We only deal with 970 for now */ |
170 | mfspr r0,SPRN_PVR | 170 | mfspr r0,SPRN_PVR |
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 036b71d2ad..d8da2a35c0 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
@@ -988,7 +988,7 @@ _GLOBAL(enter_rtas) | |||
988 | stwu r1,-INT_FRAME_SIZE(r1) | 988 | stwu r1,-INT_FRAME_SIZE(r1) |
989 | mflr r0 | 989 | mflr r0 |
990 | stw r0,INT_FRAME_SIZE+4(r1) | 990 | stw r0,INT_FRAME_SIZE+4(r1) |
991 | LOADADDR(r4, rtas) | 991 | LOAD_REG_ADDR(r4, rtas) |
992 | lis r6,1f@ha /* physical return address for rtas */ | 992 | lis r6,1f@ha /* physical return address for rtas */ |
993 | addi r6,r6,1f@l | 993 | addi r6,r6,1f@l |
994 | tophys(r6,r6) | 994 | tophys(r6,r6) |
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index aacebb33e9..5420363188 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -511,7 +511,8 @@ restore: | |||
511 | cmpdi 0,r5,0 | 511 | cmpdi 0,r5,0 |
512 | beq 4f | 512 | beq 4f |
513 | /* Check for pending interrupts (iSeries) */ | 513 | /* Check for pending interrupts (iSeries) */ |
514 | ld r3,PACALPPACA+LPPACAANYINT(r13) | 514 | ld r3,PACALPPACAPTR(r13) |
515 | ld r3,LPPACAANYINT(r3) | ||
515 | cmpdi r3,0 | 516 | cmpdi r3,0 |
516 | beq+ 4f /* skip do_IRQ if no interrupts */ | 517 | beq+ 4f /* skip do_IRQ if no interrupts */ |
517 | 518 | ||
@@ -689,9 +690,8 @@ _GLOBAL(enter_rtas) | |||
689 | std r6,PACASAVEDMSR(r13) | 690 | std r6,PACASAVEDMSR(r13) |
690 | 691 | ||
691 | /* Setup our real return addr */ | 692 | /* Setup our real return addr */ |
692 | SET_REG_TO_LABEL(r4,.rtas_return_loc) | 693 | LOAD_REG_ADDR(r4,.rtas_return_loc) |
693 | SET_REG_TO_CONST(r9,PAGE_OFFSET) | 694 | clrldi r4,r4,2 /* convert to realmode address */ |
694 | sub r4,r4,r9 | ||
695 | mtlr r4 | 695 | mtlr r4 |
696 | 696 | ||
697 | li r0,0 | 697 | li r0,0 |
@@ -706,7 +706,7 @@ _GLOBAL(enter_rtas) | |||
706 | sync /* disable interrupts so SRR0/1 */ | 706 | sync /* disable interrupts so SRR0/1 */ |
707 | mtmsrd r0 /* don't get trashed */ | 707 | mtmsrd r0 /* don't get trashed */ |
708 | 708 | ||
709 | SET_REG_TO_LABEL(r4,rtas) | 709 | LOAD_REG_ADDR(r4, rtas) |
710 | ld r5,RTASENTRY(r4) /* get the rtas->entry value */ | 710 | ld r5,RTASENTRY(r4) /* get the rtas->entry value */ |
711 | ld r4,RTASBASE(r4) /* get the rtas->base value */ | 711 | ld r4,RTASBASE(r4) /* get the rtas->base value */ |
712 | 712 | ||
@@ -718,8 +718,7 @@ _GLOBAL(enter_rtas) | |||
718 | _STATIC(rtas_return_loc) | 718 | _STATIC(rtas_return_loc) |
719 | /* relocation is off at this point */ | 719 | /* relocation is off at this point */ |
720 | mfspr r4,SPRN_SPRG3 /* Get PACA */ | 720 | mfspr r4,SPRN_SPRG3 /* Get PACA */ |
721 | SET_REG_TO_CONST(r5, PAGE_OFFSET) | 721 | clrldi r4,r4,2 /* convert to realmode address */ |
722 | sub r4,r4,r5 /* RELOC the PACA base pointer */ | ||
723 | 722 | ||
724 | mfmsr r6 | 723 | mfmsr r6 |
725 | li r0,MSR_RI | 724 | li r0,MSR_RI |
@@ -728,7 +727,7 @@ _STATIC(rtas_return_loc) | |||
728 | mtmsrd r6 | 727 | mtmsrd r6 |
729 | 728 | ||
730 | ld r1,PACAR1(r4) /* Restore our SP */ | 729 | ld r1,PACAR1(r4) /* Restore our SP */ |
731 | LOADADDR(r3,.rtas_restore_regs) | 730 | LOAD_REG_IMMEDIATE(r3,.rtas_restore_regs) |
732 | ld r4,PACASAVEDMSR(r4) /* Restore our MSR */ | 731 | ld r4,PACASAVEDMSR(r4) /* Restore our MSR */ |
733 | 732 | ||
734 | mtspr SPRN_SRR0,r3 | 733 | mtspr SPRN_SRR0,r3 |
diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S index b780b42c95..e4362dfa37 100644 --- a/arch/powerpc/kernel/fpu.S +++ b/arch/powerpc/kernel/fpu.S | |||
@@ -39,9 +39,9 @@ _GLOBAL(load_up_fpu) | |||
39 | * to another. Instead we call giveup_fpu in switch_to. | 39 | * to another. Instead we call giveup_fpu in switch_to. |
40 | */ | 40 | */ |
41 | #ifndef CONFIG_SMP | 41 | #ifndef CONFIG_SMP |
42 | LOADBASE(r3, last_task_used_math) | 42 | LOAD_REG_ADDRBASE(r3, last_task_used_math) |
43 | toreal(r3) | 43 | toreal(r3) |
44 | PPC_LL r4,OFF(last_task_used_math)(r3) | 44 | PPC_LL r4,ADDROFF(last_task_used_math)(r3) |
45 | PPC_LCMPI 0,r4,0 | 45 | PPC_LCMPI 0,r4,0 |
46 | beq 1f | 46 | beq 1f |
47 | toreal(r4) | 47 | toreal(r4) |
@@ -77,7 +77,7 @@ _GLOBAL(load_up_fpu) | |||
77 | #ifndef CONFIG_SMP | 77 | #ifndef CONFIG_SMP |
78 | subi r4,r5,THREAD | 78 | subi r4,r5,THREAD |
79 | fromreal(r4) | 79 | fromreal(r4) |
80 | PPC_STL r4,OFF(last_task_used_math)(r3) | 80 | PPC_STL r4,ADDROFF(last_task_used_math)(r3) |
81 | #endif /* CONFIG_SMP */ | 81 | #endif /* CONFIG_SMP */ |
82 | /* restore registers and return */ | 82 | /* restore registers and return */ |
83 | /* we haven't used ctr or xer or lr */ | 83 | /* we haven't used ctr or xer or lr */ |
@@ -113,8 +113,8 @@ _GLOBAL(giveup_fpu) | |||
113 | 1: | 113 | 1: |
114 | #ifndef CONFIG_SMP | 114 | #ifndef CONFIG_SMP |
115 | li r5,0 | 115 | li r5,0 |
116 | LOADBASE(r4,last_task_used_math) | 116 | LOAD_REG_ADDRBASE(r4,last_task_used_math) |
117 | PPC_STL r5,OFF(last_task_used_math)(r4) | 117 | PPC_STL r5,ADDROFF(last_task_used_math)(r4) |
118 | #endif /* CONFIG_SMP */ | 118 | #endif /* CONFIG_SMP */ |
119 | blr | 119 | blr |
120 | 120 | ||
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 1c066d1253..3082684663 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -154,12 +154,12 @@ _GLOBAL(__secondary_hold) | |||
154 | bne 100b | 154 | bne 100b |
155 | 155 | ||
156 | #ifdef CONFIG_HMT | 156 | #ifdef CONFIG_HMT |
157 | LOADADDR(r4, .hmt_init) | 157 | SET_REG_IMMEDIATE(r4, .hmt_init) |
158 | mtctr r4 | 158 | mtctr r4 |
159 | bctr | 159 | bctr |
160 | #else | 160 | #else |
161 | #ifdef CONFIG_SMP | 161 | #ifdef CONFIG_SMP |
162 | LOADADDR(r4, .pSeries_secondary_smp_init) | 162 | LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) |
163 | mtctr r4 | 163 | mtctr r4 |
164 | mr r3,r24 | 164 | mr r3,r24 |
165 | bctr | 165 | bctr |
@@ -205,9 +205,10 @@ exception_marker: | |||
205 | #define EX_LR 72 | 205 | #define EX_LR 72 |
206 | 206 | ||
207 | /* | 207 | /* |
208 | * We're short on space and time in the exception prolog, so we can't use | 208 | * We're short on space and time in the exception prolog, so we can't |
209 | * the normal LOADADDR macro. Normally we just need the low halfword of the | 209 | * use the normal SET_REG_IMMEDIATE macro. Normally we just need the |
210 | * address, but for Kdump we need the whole low word. | 210 | * low halfword of the address, but for Kdump we need the whole low |
211 | * word. | ||
211 | */ | 212 | */ |
212 | #ifdef CONFIG_CRASH_DUMP | 213 | #ifdef CONFIG_CRASH_DUMP |
213 | #define LOAD_HANDLER(reg, label) \ | 214 | #define LOAD_HANDLER(reg, label) \ |
@@ -254,8 +255,9 @@ exception_marker: | |||
254 | 255 | ||
255 | #define EXCEPTION_PROLOG_ISERIES_2 \ | 256 | #define EXCEPTION_PROLOG_ISERIES_2 \ |
256 | mfmsr r10; \ | 257 | mfmsr r10; \ |
257 | ld r11,PACALPPACA+LPPACASRR0(r13); \ | 258 | ld r12,PACALPPACAPTR(r13); \ |
258 | ld r12,PACALPPACA+LPPACASRR1(r13); \ | 259 | ld r11,LPPACASRR0(r12); \ |
260 | ld r12,LPPACASRR1(r12); \ | ||
259 | ori r10,r10,MSR_RI; \ | 261 | ori r10,r10,MSR_RI; \ |
260 | mtmsrd r10,1 | 262 | mtmsrd r10,1 |
261 | 263 | ||
@@ -634,7 +636,8 @@ data_access_slb_iSeries: | |||
634 | std r12,PACA_EXSLB+EX_R12(r13) | 636 | std r12,PACA_EXSLB+EX_R12(r13) |
635 | mfspr r10,SPRN_SPRG1 | 637 | mfspr r10,SPRN_SPRG1 |
636 | std r10,PACA_EXSLB+EX_R13(r13) | 638 | std r10,PACA_EXSLB+EX_R13(r13) |
637 | ld r12,PACALPPACA+LPPACASRR1(r13); | 639 | ld r12,PACALPPACAPTR(r13) |
640 | ld r12,LPPACASRR1(r12) | ||
638 | b .slb_miss_realmode | 641 | b .slb_miss_realmode |
639 | 642 | ||
640 | STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN) | 643 | STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN) |
@@ -644,7 +647,8 @@ instruction_access_slb_iSeries: | |||
644 | mtspr SPRN_SPRG1,r13 /* save r13 */ | 647 | mtspr SPRN_SPRG1,r13 /* save r13 */ |
645 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ | 648 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ |
646 | std r3,PACA_EXSLB+EX_R3(r13) | 649 | std r3,PACA_EXSLB+EX_R3(r13) |
647 | ld r3,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */ | 650 | ld r3,PACALPPACAPTR(r13) |
651 | ld r3,LPPACASRR0(r3) /* get SRR0 value */ | ||
648 | std r9,PACA_EXSLB+EX_R9(r13) | 652 | std r9,PACA_EXSLB+EX_R9(r13) |
649 | mfcr r9 | 653 | mfcr r9 |
650 | #ifdef __DISABLED__ | 654 | #ifdef __DISABLED__ |
@@ -656,7 +660,8 @@ instruction_access_slb_iSeries: | |||
656 | std r12,PACA_EXSLB+EX_R12(r13) | 660 | std r12,PACA_EXSLB+EX_R12(r13) |
657 | mfspr r10,SPRN_SPRG1 | 661 | mfspr r10,SPRN_SPRG1 |
658 | std r10,PACA_EXSLB+EX_R13(r13) | 662 | std r10,PACA_EXSLB+EX_R13(r13) |
659 | ld r12,PACALPPACA+LPPACASRR1(r13); | 663 | ld r12,PACALPPACAPTR(r13) |
664 | ld r12,LPPACASRR1(r12) | ||
660 | b .slb_miss_realmode | 665 | b .slb_miss_realmode |
661 | 666 | ||
662 | #ifdef __DISABLED__ | 667 | #ifdef __DISABLED__ |
@@ -713,7 +718,7 @@ system_reset_iSeries: | |||
713 | lbz r23,PACAPROCSTART(r13) /* Test if this processor | 718 | lbz r23,PACAPROCSTART(r13) /* Test if this processor |
714 | * should start */ | 719 | * should start */ |
715 | sync | 720 | sync |
716 | LOADADDR(r3,current_set) | 721 | LOAD_REG_IMMEDIATE(r3,current_set) |
717 | sldi r28,r24,3 /* get current_set[cpu#] */ | 722 | sldi r28,r24,3 /* get current_set[cpu#] */ |
718 | ldx r3,r3,r28 | 723 | ldx r3,r3,r28 |
719 | addi r1,r3,THREAD_SIZE | 724 | addi r1,r3,THREAD_SIZE |
@@ -745,17 +750,19 @@ iSeries_secondary_smp_loop: | |||
745 | .globl decrementer_iSeries_masked | 750 | .globl decrementer_iSeries_masked |
746 | decrementer_iSeries_masked: | 751 | decrementer_iSeries_masked: |
747 | li r11,1 | 752 | li r11,1 |
748 | stb r11,PACALPPACA+LPPACADECRINT(r13) | 753 | ld r12,PACALPPACAPTR(r13) |
749 | LOADBASE(r12,tb_ticks_per_jiffy) | 754 | stb r11,LPPACADECRINT(r12) |
750 | lwz r12,OFF(tb_ticks_per_jiffy)(r12) | 755 | LOAD_REG_ADDRBASE(r12,tb_ticks_per_jiffy) |
756 | lwz r12,ADDROFF(tb_ticks_per_jiffy)(r12) | ||
751 | mtspr SPRN_DEC,r12 | 757 | mtspr SPRN_DEC,r12 |
752 | /* fall through */ | 758 | /* fall through */ |
753 | 759 | ||
754 | .globl hardware_interrupt_iSeries_masked | 760 | .globl hardware_interrupt_iSeries_masked |
755 | hardware_interrupt_iSeries_masked: | 761 | hardware_interrupt_iSeries_masked: |
756 | mtcrf 0x80,r9 /* Restore regs */ | 762 | mtcrf 0x80,r9 /* Restore regs */ |
757 | ld r11,PACALPPACA+LPPACASRR0(r13) | 763 | ld r12,PACALPPACAPTR(r13) |
758 | ld r12,PACALPPACA+LPPACASRR1(r13) | 764 | ld r11,LPPACASRR0(r12) |
765 | ld r12,LPPACASRR1(r12) | ||
759 | mtspr SPRN_SRR0,r11 | 766 | mtspr SPRN_SRR0,r11 |
760 | mtspr SPRN_SRR1,r12 | 767 | mtspr SPRN_SRR1,r12 |
761 | ld r9,PACA_EXGEN+EX_R9(r13) | 768 | ld r9,PACA_EXGEN+EX_R9(r13) |
@@ -994,7 +1001,8 @@ _GLOBAL(slb_miss_realmode) | |||
994 | ld r3,PACA_EXSLB+EX_R3(r13) | 1001 | ld r3,PACA_EXSLB+EX_R3(r13) |
995 | lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ | 1002 | lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ |
996 | #ifdef CONFIG_PPC_ISERIES | 1003 | #ifdef CONFIG_PPC_ISERIES |
997 | ld r11,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */ | 1004 | ld r11,PACALPPACAPTR(r13) |
1005 | ld r11,LPPACASRR0(r11) /* get SRR0 value */ | ||
998 | #endif /* CONFIG_PPC_ISERIES */ | 1006 | #endif /* CONFIG_PPC_ISERIES */ |
999 | 1007 | ||
1000 | mtlr r10 | 1008 | mtlr r10 |
@@ -1412,7 +1420,7 @@ _GLOBAL(pSeries_secondary_smp_init) | |||
1412 | * physical cpu id in r24, we need to search the pacas to find | 1420 | * physical cpu id in r24, we need to search the pacas to find |
1413 | * which logical id maps to our physical one. | 1421 | * which logical id maps to our physical one. |
1414 | */ | 1422 | */ |
1415 | LOADADDR(r13, paca) /* Get base vaddr of paca array */ | 1423 | LOAD_REG_IMMEDIATE(r13, paca) /* Get base vaddr of paca array */ |
1416 | li r5,0 /* logical cpu id */ | 1424 | li r5,0 /* logical cpu id */ |
1417 | 1: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */ | 1425 | 1: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */ |
1418 | cmpw r6,r24 /* Compare to our id */ | 1426 | cmpw r6,r24 /* Compare to our id */ |
@@ -1446,8 +1454,8 @@ _GLOBAL(pSeries_secondary_smp_init) | |||
1446 | #ifdef CONFIG_PPC_ISERIES | 1454 | #ifdef CONFIG_PPC_ISERIES |
1447 | _STATIC(__start_initialization_iSeries) | 1455 | _STATIC(__start_initialization_iSeries) |
1448 | /* Clear out the BSS */ | 1456 | /* Clear out the BSS */ |
1449 | LOADADDR(r11,__bss_stop) | 1457 | LOAD_REG_IMMEDIATE(r11,__bss_stop) |
1450 | LOADADDR(r8,__bss_start) | 1458 | LOAD_REG_IMMEDIATE(r8,__bss_start) |
1451 | sub r11,r11,r8 /* bss size */ | 1459 | sub r11,r11,r8 /* bss size */ |
1452 | addi r11,r11,7 /* round up to an even double word */ | 1460 | addi r11,r11,7 /* round up to an even double word */ |
1453 | rldicl. r11,r11,61,3 /* shift right by 3 */ | 1461 | rldicl. r11,r11,61,3 /* shift right by 3 */ |
@@ -1458,17 +1466,17 @@ _STATIC(__start_initialization_iSeries) | |||
1458 | 3: stdu r0,8(r8) | 1466 | 3: stdu r0,8(r8) |
1459 | bdnz 3b | 1467 | bdnz 3b |
1460 | 4: | 1468 | 4: |
1461 | LOADADDR(r1,init_thread_union) | 1469 | LOAD_REG_IMMEDIATE(r1,init_thread_union) |
1462 | addi r1,r1,THREAD_SIZE | 1470 | addi r1,r1,THREAD_SIZE |
1463 | li r0,0 | 1471 | li r0,0 |
1464 | stdu r0,-STACK_FRAME_OVERHEAD(r1) | 1472 | stdu r0,-STACK_FRAME_OVERHEAD(r1) |
1465 | 1473 | ||
1466 | LOADADDR(r3,cpu_specs) | 1474 | LOAD_REG_IMMEDIATE(r3,cpu_specs) |
1467 | LOADADDR(r4,cur_cpu_spec) | 1475 | LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) |
1468 | li r5,0 | 1476 | li r5,0 |
1469 | bl .identify_cpu | 1477 | bl .identify_cpu |
1470 | 1478 | ||
1471 | LOADADDR(r2,__toc_start) | 1479 | LOAD_REG_IMMEDIATE(r2,__toc_start) |
1472 | addi r2,r2,0x4000 | 1480 | addi r2,r2,0x4000 |
1473 | addi r2,r2,0x4000 | 1481 | addi r2,r2,0x4000 |
1474 | 1482 | ||
@@ -1528,7 +1536,7 @@ _GLOBAL(__start_initialization_multiplatform) | |||
1528 | li r24,0 | 1536 | li r24,0 |
1529 | 1537 | ||
1530 | /* Switch off MMU if not already */ | 1538 | /* Switch off MMU if not already */ |
1531 | LOADADDR(r4, .__after_prom_start - KERNELBASE) | 1539 | LOAD_REG_IMMEDIATE(r4, .__after_prom_start - KERNELBASE) |
1532 | add r4,r4,r30 | 1540 | add r4,r4,r30 |
1533 | bl .__mmu_off | 1541 | bl .__mmu_off |
1534 | b .__after_prom_start | 1542 | b .__after_prom_start |
@@ -1548,7 +1556,7 @@ _STATIC(__boot_from_prom) | |||
1548 | /* put a relocation offset into r3 */ | 1556 | /* put a relocation offset into r3 */ |
1549 | bl .reloc_offset | 1557 | bl .reloc_offset |
1550 | 1558 | ||
1551 | LOADADDR(r2,__toc_start) | 1559 | LOAD_REG_IMMEDIATE(r2,__toc_start) |
1552 | addi r2,r2,0x4000 | 1560 | addi r2,r2,0x4000 |
1553 | addi r2,r2,0x4000 | 1561 | addi r2,r2,0x4000 |
1554 | 1562 | ||
@@ -1588,9 +1596,9 @@ _STATIC(__after_prom_start) | |||
1588 | */ | 1596 | */ |
1589 | bl .reloc_offset | 1597 | bl .reloc_offset |
1590 | mr r26,r3 | 1598 | mr r26,r3 |
1591 | SET_REG_TO_CONST(r27,KERNELBASE) | 1599 | LOAD_REG_IMMEDIATE(r27, KERNELBASE) |
1592 | 1600 | ||
1593 | LOADADDR(r3, PHYSICAL_START) /* target addr */ | 1601 | LOAD_REG_IMMEDIATE(r3, PHYSICAL_START) /* target addr */ |
1594 | 1602 | ||
1595 | // XXX FIXME: Use phys returned by OF (r30) | 1603 | // XXX FIXME: Use phys returned by OF (r30) |
1596 | add r4,r27,r26 /* source addr */ | 1604 | add r4,r27,r26 /* source addr */ |
@@ -1598,7 +1606,7 @@ _STATIC(__after_prom_start) | |||
1598 | /* i.e. where we are running */ | 1606 | /* i.e. where we are running */ |
1599 | /* the source addr */ | 1607 | /* the source addr */ |
1600 | 1608 | ||
1601 | LOADADDR(r5,copy_to_here) /* # bytes of memory to copy */ | 1609 | LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */ |
1602 | sub r5,r5,r27 | 1610 | sub r5,r5,r27 |
1603 | 1611 | ||
1604 | li r6,0x100 /* Start offset, the first 0x100 */ | 1612 | li r6,0x100 /* Start offset, the first 0x100 */ |
@@ -1608,11 +1616,11 @@ _STATIC(__after_prom_start) | |||
1608 | /* this includes the code being */ | 1616 | /* this includes the code being */ |
1609 | /* executed here. */ | 1617 | /* executed here. */ |
1610 | 1618 | ||
1611 | LOADADDR(r0, 4f) /* Jump to the copy of this code */ | 1619 | LOAD_REG_IMMEDIATE(r0, 4f) /* Jump to the copy of this code */ |
1612 | mtctr r0 /* that we just made/relocated */ | 1620 | mtctr r0 /* that we just made/relocated */ |
1613 | bctr | 1621 | bctr |
1614 | 1622 | ||
1615 | 4: LOADADDR(r5,klimit) | 1623 | 4: LOAD_REG_IMMEDIATE(r5,klimit) |
1616 | add r5,r5,r26 | 1624 | add r5,r5,r26 |
1617 | ld r5,0(r5) /* get the value of klimit */ | 1625 | ld r5,0(r5) /* get the value of klimit */ |
1618 | sub r5,r5,r27 | 1626 | sub r5,r5,r27 |
@@ -1694,7 +1702,7 @@ _GLOBAL(pmac_secondary_start) | |||
1694 | mtmsrd r3 /* RI on */ | 1702 | mtmsrd r3 /* RI on */ |
1695 | 1703 | ||
1696 | /* Set up a paca value for this processor. */ | 1704 | /* Set up a paca value for this processor. */ |
1697 | LOADADDR(r4, paca) /* Get base vaddr of paca array */ | 1705 | LOAD_REG_IMMEDIATE(r4, paca) /* Get base vaddr of paca array */ |
1698 | mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ | 1706 | mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ |
1699 | add r13,r13,r4 /* for this processor. */ | 1707 | add r13,r13,r4 /* for this processor. */ |
1700 | mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ | 1708 | mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ |
@@ -1731,7 +1739,7 @@ _GLOBAL(__secondary_start) | |||
1731 | bl .early_setup_secondary | 1739 | bl .early_setup_secondary |
1732 | 1740 | ||
1733 | /* Initialize the kernel stack. Just a repeat for iSeries. */ | 1741 | /* Initialize the kernel stack. Just a repeat for iSeries. */ |
1734 | LOADADDR(r3,current_set) | 1742 | LOAD_REG_ADDR(r3, current_set) |
1735 | sldi r28,r24,3 /* get current_set[cpu#] */ | 1743 | sldi r28,r24,3 /* get current_set[cpu#] */ |
1736 | ldx r1,r3,r28 | 1744 | ldx r1,r3,r28 |
1737 | addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD | 1745 | addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD |
@@ -1742,8 +1750,8 @@ _GLOBAL(__secondary_start) | |||
1742 | mtlr r7 | 1750 | mtlr r7 |
1743 | 1751 | ||
1744 | /* enable MMU and jump to start_secondary */ | 1752 | /* enable MMU and jump to start_secondary */ |
1745 | LOADADDR(r3,.start_secondary_prolog) | 1753 | LOAD_REG_ADDR(r3, .start_secondary_prolog) |
1746 | SET_REG_TO_CONST(r4, MSR_KERNEL) | 1754 | LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) |
1747 | #ifdef DO_SOFT_DISABLE | 1755 | #ifdef DO_SOFT_DISABLE |
1748 | ori r4,r4,MSR_EE | 1756 | ori r4,r4,MSR_EE |
1749 | #endif | 1757 | #endif |
@@ -1792,8 +1800,8 @@ _STATIC(start_here_multiplatform) | |||
1792 | * be detached from the kernel completely. Besides, we need | 1800 | * be detached from the kernel completely. Besides, we need |
1793 | * to clear it now for kexec-style entry. | 1801 | * to clear it now for kexec-style entry. |
1794 | */ | 1802 | */ |
1795 | LOADADDR(r11,__bss_stop) | 1803 | LOAD_REG_IMMEDIATE(r11,__bss_stop) |
1796 | LOADADDR(r8,__bss_start) | 1804 | LOAD_REG_IMMEDIATE(r8,__bss_start) |
1797 | sub r11,r11,r8 /* bss size */ | 1805 | sub r11,r11,r8 /* bss size */ |
1798 | addi r11,r11,7 /* round up to an even double word */ | 1806 | addi r11,r11,7 /* round up to an even double word */ |
1799 | rldicl. r11,r11,61,3 /* shift right by 3 */ | 1807 | rldicl. r11,r11,61,3 /* shift right by 3 */ |
@@ -1831,7 +1839,7 @@ _STATIC(start_here_multiplatform) | |||
1831 | /* up the htab. This is done because we have relocated the */ | 1839 | /* up the htab. This is done because we have relocated the */ |
1832 | /* kernel but are still running in real mode. */ | 1840 | /* kernel but are still running in real mode. */ |
1833 | 1841 | ||
1834 | LOADADDR(r3,init_thread_union) | 1842 | LOAD_REG_IMMEDIATE(r3,init_thread_union) |
1835 | add r3,r3,r26 | 1843 | add r3,r3,r26 |
1836 | 1844 | ||
1837 | /* set up a stack pointer (physical address) */ | 1845 | /* set up a stack pointer (physical address) */ |
@@ -1840,14 +1848,14 @@ _STATIC(start_here_multiplatform) | |||
1840 | stdu r0,-STACK_FRAME_OVERHEAD(r1) | 1848 | stdu r0,-STACK_FRAME_OVERHEAD(r1) |
1841 | 1849 | ||
1842 | /* set up the TOC (physical address) */ | 1850 | /* set up the TOC (physical address) */ |
1843 | LOADADDR(r2,__toc_start) | 1851 | LOAD_REG_IMMEDIATE(r2,__toc_start) |
1844 | addi r2,r2,0x4000 | 1852 | addi r2,r2,0x4000 |
1845 | addi r2,r2,0x4000 | 1853 | addi r2,r2,0x4000 |
1846 | add r2,r2,r26 | 1854 | add r2,r2,r26 |
1847 | 1855 | ||
1848 | LOADADDR(r3,cpu_specs) | 1856 | LOAD_REG_IMMEDIATE(r3, cpu_specs) |
1849 | add r3,r3,r26 | 1857 | add r3,r3,r26 |
1850 | LOADADDR(r4,cur_cpu_spec) | 1858 | LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) |
1851 | add r4,r4,r26 | 1859 | add r4,r4,r26 |
1852 | mr r5,r26 | 1860 | mr r5,r26 |
1853 | bl .identify_cpu | 1861 | bl .identify_cpu |
@@ -1863,11 +1871,11 @@ _STATIC(start_here_multiplatform) | |||
1863 | * nowhere it can be initialized differently before we reach this | 1871 | * nowhere it can be initialized differently before we reach this |
1864 | * code | 1872 | * code |
1865 | */ | 1873 | */ |
1866 | LOADADDR(r27, boot_cpuid) | 1874 | LOAD_REG_IMMEDIATE(r27, boot_cpuid) |
1867 | add r27,r27,r26 | 1875 | add r27,r27,r26 |
1868 | lwz r27,0(r27) | 1876 | lwz r27,0(r27) |
1869 | 1877 | ||
1870 | LOADADDR(r24, paca) /* Get base vaddr of paca array */ | 1878 | LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */ |
1871 | mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ | 1879 | mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ |
1872 | add r13,r13,r24 /* for this processor. */ | 1880 | add r13,r13,r24 /* for this processor. */ |
1873 | add r13,r13,r26 /* convert to physical addr */ | 1881 | add r13,r13,r26 /* convert to physical addr */ |
@@ -1880,8 +1888,8 @@ _STATIC(start_here_multiplatform) | |||
1880 | mr r3,r31 | 1888 | mr r3,r31 |
1881 | bl .early_setup | 1889 | bl .early_setup |
1882 | 1890 | ||
1883 | LOADADDR(r3,.start_here_common) | 1891 | LOAD_REG_IMMEDIATE(r3, .start_here_common) |
1884 | SET_REG_TO_CONST(r4, MSR_KERNEL) | 1892 | LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) |
1885 | mtspr SPRN_SRR0,r3 | 1893 | mtspr SPRN_SRR0,r3 |
1886 | mtspr SPRN_SRR1,r4 | 1894 | mtspr SPRN_SRR1,r4 |
1887 | rfid | 1895 | rfid |
@@ -1895,7 +1903,7 @@ _STATIC(start_here_common) | |||
1895 | /* The following code sets up the SP and TOC now that we are */ | 1903 | /* The following code sets up the SP and TOC now that we are */ |
1896 | /* running with translation enabled. */ | 1904 | /* running with translation enabled. */ |
1897 | 1905 | ||
1898 | LOADADDR(r3,init_thread_union) | 1906 | LOAD_REG_IMMEDIATE(r3,init_thread_union) |
1899 | 1907 | ||
1900 | /* set up the stack */ | 1908 | /* set up the stack */ |
1901 | addi r1,r3,THREAD_SIZE | 1909 | addi r1,r3,THREAD_SIZE |
@@ -1908,16 +1916,16 @@ _STATIC(start_here_common) | |||
1908 | li r3,0 | 1916 | li r3,0 |
1909 | bl .do_cpu_ftr_fixups | 1917 | bl .do_cpu_ftr_fixups |
1910 | 1918 | ||
1911 | LOADADDR(r26, boot_cpuid) | 1919 | LOAD_REG_IMMEDIATE(r26, boot_cpuid) |
1912 | lwz r26,0(r26) | 1920 | lwz r26,0(r26) |
1913 | 1921 | ||
1914 | LOADADDR(r24, paca) /* Get base vaddr of paca array */ | 1922 | LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */ |
1915 | mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */ | 1923 | mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */ |
1916 | add r13,r13,r24 /* for this processor. */ | 1924 | add r13,r13,r24 /* for this processor. */ |
1917 | mtspr SPRN_SPRG3,r13 | 1925 | mtspr SPRN_SPRG3,r13 |
1918 | 1926 | ||
1919 | /* ptr to current */ | 1927 | /* ptr to current */ |
1920 | LOADADDR(r4,init_task) | 1928 | LOAD_REG_IMMEDIATE(r4, init_task) |
1921 | std r4,PACACURRENT(r13) | 1929 | std r4,PACACURRENT(r13) |
1922 | 1930 | ||
1923 | /* Load the TOC */ | 1931 | /* Load the TOC */ |
@@ -1940,7 +1948,7 @@ _STATIC(start_here_common) | |||
1940 | 1948 | ||
1941 | _GLOBAL(hmt_init) | 1949 | _GLOBAL(hmt_init) |
1942 | #ifdef CONFIG_HMT | 1950 | #ifdef CONFIG_HMT |
1943 | LOADADDR(r5, hmt_thread_data) | 1951 | LOAD_REG_IMMEDIATE(r5, hmt_thread_data) |
1944 | mfspr r7,SPRN_PVR | 1952 | mfspr r7,SPRN_PVR |
1945 | srwi r7,r7,16 | 1953 | srwi r7,r7,16 |
1946 | cmpwi r7,0x34 /* Pulsar */ | 1954 | cmpwi r7,0x34 /* Pulsar */ |
@@ -1961,7 +1969,7 @@ _GLOBAL(hmt_init) | |||
1961 | b 101f | 1969 | b 101f |
1962 | 1970 | ||
1963 | __hmt_secondary_hold: | 1971 | __hmt_secondary_hold: |
1964 | LOADADDR(r5, hmt_thread_data) | 1972 | LOAD_REG_IMMEDIATE(r5, hmt_thread_data) |
1965 | clrldi r5,r5,4 | 1973 | clrldi r5,r5,4 |
1966 | li r7,0 | 1974 | li r7,0 |
1967 | mfspr r6,SPRN_PIR | 1975 | mfspr r6,SPRN_PIR |
@@ -1989,7 +1997,7 @@ __hmt_secondary_hold: | |||
1989 | 1997 | ||
1990 | #ifdef CONFIG_HMT | 1998 | #ifdef CONFIG_HMT |
1991 | _GLOBAL(hmt_start_secondary) | 1999 | _GLOBAL(hmt_start_secondary) |
1992 | LOADADDR(r4,__hmt_secondary_hold) | 2000 | LOAD_REG_IMMEDIATE(r4,__hmt_secondary_hold) |
1993 | clrldi r4,r4,4 | 2001 | clrldi r4,r4,4 |
1994 | mtspr SPRN_NIADORM, r4 | 2002 | mtspr SPRN_NIADORM, r4 |
1995 | mfspr r4, SPRN_MSRDORM | 2003 | mfspr r4, SPRN_MSRDORM |
diff --git a/arch/powerpc/kernel/idle_power4.S b/arch/powerpc/kernel/idle_power4.S index 1494e2f177..c16b4afab5 100644 --- a/arch/powerpc/kernel/idle_power4.S +++ b/arch/powerpc/kernel/idle_power4.S | |||
@@ -38,14 +38,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP) | |||
38 | /* We must dynamically check for the NAP feature as it | 38 | /* We must dynamically check for the NAP feature as it |
39 | * can be cleared by CPU init after the fixups are done | 39 | * can be cleared by CPU init after the fixups are done |
40 | */ | 40 | */ |
41 | LOADBASE(r3,cur_cpu_spec) | 41 | LOAD_REG_ADDRBASE(r3,cur_cpu_spec) |
42 | ld r4,OFF(cur_cpu_spec)(r3) | 42 | ld r4,ADDROFF(cur_cpu_spec)(r3) |
43 | ld r4,CPU_SPEC_FEATURES(r4) | 43 | ld r4,CPU_SPEC_FEATURES(r4) |
44 | andi. r0,r4,CPU_FTR_CAN_NAP | 44 | andi. r0,r4,CPU_FTR_CAN_NAP |
45 | beqlr | 45 | beqlr |
46 | /* Now check if user or arch enabled NAP mode */ | 46 | /* Now check if user or arch enabled NAP mode */ |
47 | LOADBASE(r3,powersave_nap) | 47 | LOAD_REG_ADDRBASE(r3,powersave_nap) |
48 | lwz r4,OFF(powersave_nap)(r3) | 48 | lwz r4,ADDROFF(powersave_nap)(r3) |
49 | cmpwi 0,r4,0 | 49 | cmpwi 0,r4,0 |
50 | beqlr | 50 | beqlr |
51 | 51 | ||
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 5651032d87..d1fffce86d 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -238,14 +238,10 @@ void do_IRQ(struct pt_regs *regs) | |||
238 | irq_exit(); | 238 | irq_exit(); |
239 | 239 | ||
240 | #ifdef CONFIG_PPC_ISERIES | 240 | #ifdef CONFIG_PPC_ISERIES |
241 | { | 241 | if (get_lppaca()->int_dword.fields.decr_int) { |
242 | struct paca_struct *lpaca = get_paca(); | 242 | get_lppaca()->int_dword.fields.decr_int = 0; |
243 | 243 | /* Signal a fake decrementer interrupt */ | |
244 | if (lpaca->lppaca.int_dword.fields.decr_int) { | 244 | timer_interrupt(regs); |
245 | lpaca->lppaca.int_dword.fields.decr_int = 0; | ||
246 | /* Signal a fake decrementer interrupt */ | ||
247 | timer_interrupt(regs); | ||
248 | } | ||
249 | } | 245 | } |
250 | #endif | 246 | #endif |
251 | } | 247 | } |
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 9dda16ccde..1ae96a8ed7 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -55,15 +55,13 @@ static unsigned long get_purr(void) | |||
55 | { | 55 | { |
56 | unsigned long sum_purr = 0; | 56 | unsigned long sum_purr = 0; |
57 | int cpu; | 57 | int cpu; |
58 | struct paca_struct *lpaca; | ||
59 | 58 | ||
60 | for_each_cpu(cpu) { | 59 | for_each_cpu(cpu) { |
61 | lpaca = paca + cpu; | 60 | sum_purr += lppaca[cpu].emulated_time_base; |
62 | sum_purr += lpaca->lppaca.emulated_time_base; | ||
63 | 61 | ||
64 | #ifdef PURR_DEBUG | 62 | #ifdef PURR_DEBUG |
65 | printk(KERN_INFO "get_purr for cpu (%d) has value (%ld) \n", | 63 | printk(KERN_INFO "get_purr for cpu (%d) has value (%ld) \n", |
66 | cpu, lpaca->lppaca.emulated_time_base); | 64 | cpu, lppaca[cpu].emulated_time_base); |
67 | #endif | 65 | #endif |
68 | } | 66 | } |
69 | return sum_purr; | 67 | return sum_purr; |
@@ -79,12 +77,11 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
79 | unsigned long pool_id, lp_index; | 77 | unsigned long pool_id, lp_index; |
80 | int shared, entitled_capacity, max_entitled_capacity; | 78 | int shared, entitled_capacity, max_entitled_capacity; |
81 | int processors, max_processors; | 79 | int processors, max_processors; |
82 | struct paca_struct *lpaca = get_paca(); | ||
83 | unsigned long purr = get_purr(); | 80 | unsigned long purr = get_purr(); |
84 | 81 | ||
85 | seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS); | 82 | seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS); |
86 | 83 | ||
87 | shared = (int)(lpaca->lppaca_ptr->shared_proc); | 84 | shared = (int)(get_lppaca()->shared_proc); |
88 | seq_printf(m, "serial_number=%c%c%c%c%c%c%c\n", | 85 | seq_printf(m, "serial_number=%c%c%c%c%c%c%c\n", |
89 | e2a(xItExtVpdPanel.mfgID[2]), | 86 | e2a(xItExtVpdPanel.mfgID[2]), |
90 | e2a(xItExtVpdPanel.mfgID[3]), | 87 | e2a(xItExtVpdPanel.mfgID[3]), |
@@ -402,7 +399,7 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
402 | (h_resource >> 0 * 8) & 0xffff); | 399 | (h_resource >> 0 * 8) & 0xffff); |
403 | 400 | ||
404 | /* pool related entries are apropriate for shared configs */ | 401 | /* pool related entries are apropriate for shared configs */ |
405 | if (paca[0].lppaca.shared_proc) { | 402 | if (lppaca[0].shared_proc) { |
406 | 403 | ||
407 | h_pic(&pool_idle_time, &pool_procs); | 404 | h_pic(&pool_idle_time, &pool_procs); |
408 | 405 | ||
@@ -451,7 +448,7 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
451 | seq_printf(m, "partition_potential_processors=%d\n", | 448 | seq_printf(m, "partition_potential_processors=%d\n", |
452 | partition_potential_processors); | 449 | partition_potential_processors); |
453 | 450 | ||
454 | seq_printf(m, "shared_processor_mode=%d\n", paca[0].lppaca.shared_proc); | 451 | seq_printf(m, "shared_processor_mode=%d\n", lppaca[0].shared_proc); |
455 | 452 | ||
456 | return 0; | 453 | return 0; |
457 | } | 454 | } |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 01d0d97a16..be98202340 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -68,7 +68,7 @@ _GLOBAL(reloc_offset) | |||
68 | mflr r0 | 68 | mflr r0 |
69 | bl 1f | 69 | bl 1f |
70 | 1: mflr r3 | 70 | 1: mflr r3 |
71 | LOADADDR(r4,1b) | 71 | LOAD_REG_IMMEDIATE(r4,1b) |
72 | subf r3,r4,r3 | 72 | subf r3,r4,r3 |
73 | mtlr r0 | 73 | mtlr r0 |
74 | blr | 74 | blr |
@@ -80,7 +80,7 @@ _GLOBAL(add_reloc_offset) | |||
80 | mflr r0 | 80 | mflr r0 |
81 | bl 1f | 81 | bl 1f |
82 | 1: mflr r5 | 82 | 1: mflr r5 |
83 | LOADADDR(r4,1b) | 83 | LOAD_REG_IMMEDIATE(r4,1b) |
84 | subf r5,r4,r5 | 84 | subf r5,r4,r5 |
85 | add r3,r3,r5 | 85 | add r3,r3,r5 |
86 | mtlr r0 | 86 | mtlr r0 |
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index ae48a002f8..2778cce058 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -39,7 +39,7 @@ _GLOBAL(reloc_offset) | |||
39 | mflr r0 | 39 | mflr r0 |
40 | bl 1f | 40 | bl 1f |
41 | 1: mflr r3 | 41 | 1: mflr r3 |
42 | LOADADDR(r4,1b) | 42 | LOAD_REG_IMMEDIATE(r4,1b) |
43 | subf r3,r4,r3 | 43 | subf r3,r4,r3 |
44 | mtlr r0 | 44 | mtlr r0 |
45 | blr | 45 | blr |
@@ -51,7 +51,7 @@ _GLOBAL(add_reloc_offset) | |||
51 | mflr r0 | 51 | mflr r0 |
52 | bl 1f | 52 | bl 1f |
53 | 1: mflr r5 | 53 | 1: mflr r5 |
54 | LOADADDR(r4,1b) | 54 | LOAD_REG_IMMEDIATE(r4,1b) |
55 | subf r5,r4,r5 | 55 | subf r5,r4,r5 |
56 | add r3,r3,r5 | 56 | add r3,r3,r5 |
57 | mtlr r0 | 57 | mtlr r0 |
@@ -498,15 +498,15 @@ _GLOBAL(identify_cpu) | |||
498 | */ | 498 | */ |
499 | _GLOBAL(do_cpu_ftr_fixups) | 499 | _GLOBAL(do_cpu_ftr_fixups) |
500 | /* Get CPU 0 features */ | 500 | /* Get CPU 0 features */ |
501 | LOADADDR(r6,cur_cpu_spec) | 501 | LOAD_REG_IMMEDIATE(r6,cur_cpu_spec) |
502 | sub r6,r6,r3 | 502 | sub r6,r6,r3 |
503 | ld r4,0(r6) | 503 | ld r4,0(r6) |
504 | sub r4,r4,r3 | 504 | sub r4,r4,r3 |
505 | ld r4,CPU_SPEC_FEATURES(r4) | 505 | ld r4,CPU_SPEC_FEATURES(r4) |
506 | /* Get the fixup table */ | 506 | /* Get the fixup table */ |
507 | LOADADDR(r6,__start___ftr_fixup) | 507 | LOAD_REG_IMMEDIATE(r6,__start___ftr_fixup) |
508 | sub r6,r6,r3 | 508 | sub r6,r6,r3 |
509 | LOADADDR(r7,__stop___ftr_fixup) | 509 | LOAD_REG_IMMEDIATE(r7,__stop___ftr_fixup) |
510 | sub r7,r7,r3 | 510 | sub r7,r7,r3 |
511 | /* Do the fixup */ | 511 | /* Do the fixup */ |
512 | 1: cmpld r6,r7 | 512 | 1: cmpld r6,r7 |
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index 999bdd8167..5d1b708086 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c | |||
@@ -25,6 +25,28 @@ | |||
25 | * field correctly */ | 25 | * field correctly */ |
26 | extern unsigned long __toc_start; | 26 | extern unsigned long __toc_start; |
27 | 27 | ||
28 | /* | ||
29 | * iSeries structure which the hypervisor knows about - this structure | ||
30 | * should not cross a page boundary. The vpa_init/register_vpa call | ||
31 | * is now known to fail if the lppaca structure crosses a page | ||
32 | * boundary. The lppaca is also used on POWER5 pSeries boxes. The | ||
33 | * lppaca is 640 bytes long, and cannot readily change since the | ||
34 | * hypervisor knows its layout, so a 1kB alignment will suffice to | ||
35 | * ensure that it doesn't cross a page boundary. | ||
36 | */ | ||
37 | struct lppaca lppaca[] = { | ||
38 | [0 ... (NR_CPUS-1)] = { | ||
39 | .desc = 0xd397d781, /* "LpPa" */ | ||
40 | .size = sizeof(struct lppaca), | ||
41 | .dyn_proc_status = 2, | ||
42 | .decr_val = 0x00ff0000, | ||
43 | .fpregs_in_use = 1, | ||
44 | .end_of_quantum = 0xfffffffffffffffful, | ||
45 | .slb_count = 64, | ||
46 | .vmxregs_in_use = 0, | ||
47 | }, | ||
48 | }; | ||
49 | |||
28 | /* The Paca is an array with one entry per processor. Each contains an | 50 | /* The Paca is an array with one entry per processor. Each contains an |
29 | * lppaca, which contains the information shared between the | 51 | * lppaca, which contains the information shared between the |
30 | * hypervisor and Linux. | 52 | * hypervisor and Linux. |
@@ -35,27 +57,17 @@ extern unsigned long __toc_start; | |||
35 | * processor (not thread). | 57 | * processor (not thread). |
36 | */ | 58 | */ |
37 | #define PACA_INIT_COMMON(number, start, asrr, asrv) \ | 59 | #define PACA_INIT_COMMON(number, start, asrr, asrv) \ |
60 | .lppaca_ptr = &lppaca[number], \ | ||
38 | .lock_token = 0x8000, \ | 61 | .lock_token = 0x8000, \ |
39 | .paca_index = (number), /* Paca Index */ \ | 62 | .paca_index = (number), /* Paca Index */ \ |
40 | .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \ | 63 | .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \ |
41 | .stab_real = (asrr), /* Real pointer to segment table */ \ | 64 | .stab_real = (asrr), /* Real pointer to segment table */ \ |
42 | .stab_addr = (asrv), /* Virt pointer to segment table */ \ | 65 | .stab_addr = (asrv), /* Virt pointer to segment table */ \ |
43 | .cpu_start = (start), /* Processor start */ \ | 66 | .cpu_start = (start), /* Processor start */ \ |
44 | .hw_cpu_id = 0xffff, \ | 67 | .hw_cpu_id = 0xffff, |
45 | .lppaca = { \ | ||
46 | .desc = 0xd397d781, /* "LpPa" */ \ | ||
47 | .size = sizeof(struct lppaca), \ | ||
48 | .dyn_proc_status = 2, \ | ||
49 | .decr_val = 0x00ff0000, \ | ||
50 | .fpregs_in_use = 1, \ | ||
51 | .end_of_quantum = 0xfffffffffffffffful, \ | ||
52 | .slb_count = 64, \ | ||
53 | .vmxregs_in_use = 0, \ | ||
54 | }, \ | ||
55 | 68 | ||
56 | #ifdef CONFIG_PPC_ISERIES | 69 | #ifdef CONFIG_PPC_ISERIES |
57 | #define PACA_INIT_ISERIES(number) \ | 70 | #define PACA_INIT_ISERIES(number) \ |
58 | .lppaca_ptr = &paca[number].lppaca, \ | ||
59 | .reg_save_ptr = &iseries_reg_save[number], | 71 | .reg_save_ptr = &iseries_reg_save[number], |
60 | 72 | ||
61 | #define PACA_INIT(number) \ | 73 | #define PACA_INIT(number) \ |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 02e2115323..d50c8df018 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -1627,6 +1627,11 @@ static void of_node_release(struct kref *kref) | |||
1627 | kfree(prop->value); | 1627 | kfree(prop->value); |
1628 | kfree(prop); | 1628 | kfree(prop); |
1629 | prop = next; | 1629 | prop = next; |
1630 | |||
1631 | if (!prop) { | ||
1632 | prop = node->deadprops; | ||
1633 | node->deadprops = NULL; | ||
1634 | } | ||
1630 | } | 1635 | } |
1631 | kfree(node->intrs); | 1636 | kfree(node->intrs); |
1632 | kfree(node->full_name); | 1637 | kfree(node->full_name); |
@@ -1774,22 +1779,32 @@ static int __init prom_reconfig_setup(void) | |||
1774 | __initcall(prom_reconfig_setup); | 1779 | __initcall(prom_reconfig_setup); |
1775 | #endif | 1780 | #endif |
1776 | 1781 | ||
1777 | /* | 1782 | struct property *of_find_property(struct device_node *np, const char *name, |
1778 | * Find a property with a given name for a given node | 1783 | int *lenp) |
1779 | * and return the value. | ||
1780 | */ | ||
1781 | unsigned char *get_property(struct device_node *np, const char *name, | ||
1782 | int *lenp) | ||
1783 | { | 1784 | { |
1784 | struct property *pp; | 1785 | struct property *pp; |
1785 | 1786 | ||
1787 | read_lock(&devtree_lock); | ||
1786 | for (pp = np->properties; pp != 0; pp = pp->next) | 1788 | for (pp = np->properties; pp != 0; pp = pp->next) |
1787 | if (strcmp(pp->name, name) == 0) { | 1789 | if (strcmp(pp->name, name) == 0) { |
1788 | if (lenp != 0) | 1790 | if (lenp != 0) |
1789 | *lenp = pp->length; | 1791 | *lenp = pp->length; |
1790 | return pp->value; | 1792 | break; |
1791 | } | 1793 | } |
1792 | return NULL; | 1794 | read_unlock(&devtree_lock); |
1795 | |||
1796 | return pp; | ||
1797 | } | ||
1798 | |||
1799 | /* | ||
1800 | * Find a property with a given name for a given node | ||
1801 | * and return the value. | ||
1802 | */ | ||
1803 | unsigned char *get_property(struct device_node *np, const char *name, | ||
1804 | int *lenp) | ||
1805 | { | ||
1806 | struct property *pp = of_find_property(np,name,lenp); | ||
1807 | return pp ? pp->value : NULL; | ||
1793 | } | 1808 | } |
1794 | EXPORT_SYMBOL(get_property); | 1809 | EXPORT_SYMBOL(get_property); |
1795 | 1810 | ||
@@ -1823,4 +1838,82 @@ int prom_add_property(struct device_node* np, struct property* prop) | |||
1823 | return 0; | 1838 | return 0; |
1824 | } | 1839 | } |
1825 | 1840 | ||
1841 | /* | ||
1842 | * Remove a property from a node. Note that we don't actually | ||
1843 | * remove it, since we have given out who-knows-how-many pointers | ||
1844 | * to the data using get-property. Instead we just move the property | ||
1845 | * to the "dead properties" list, so it won't be found any more. | ||
1846 | */ | ||
1847 | int prom_remove_property(struct device_node *np, struct property *prop) | ||
1848 | { | ||
1849 | struct property **next; | ||
1850 | int found = 0; | ||
1826 | 1851 | ||
1852 | write_lock(&devtree_lock); | ||
1853 | next = &np->properties; | ||
1854 | while (*next) { | ||
1855 | if (*next == prop) { | ||
1856 | /* found the node */ | ||
1857 | *next = prop->next; | ||
1858 | prop->next = np->deadprops; | ||
1859 | np->deadprops = prop; | ||
1860 | found = 1; | ||
1861 | break; | ||
1862 | } | ||
1863 | next = &(*next)->next; | ||
1864 | } | ||
1865 | write_unlock(&devtree_lock); | ||
1866 | |||
1867 | if (!found) | ||
1868 | return -ENODEV; | ||
1869 | |||
1870 | #ifdef CONFIG_PROC_DEVICETREE | ||
1871 | /* try to remove the proc node as well */ | ||
1872 | if (np->pde) | ||
1873 | proc_device_tree_remove_prop(np->pde, prop); | ||
1874 | #endif /* CONFIG_PROC_DEVICETREE */ | ||
1875 | |||
1876 | return 0; | ||
1877 | } | ||
1878 | |||
1879 | /* | ||
1880 | * Update a property in a node. Note that we don't actually | ||
1881 | * remove it, since we have given out who-knows-how-many pointers | ||
1882 | * to the data using get-property. Instead we just move the property | ||
1883 | * to the "dead properties" list, and add the new property to the | ||
1884 | * property list | ||
1885 | */ | ||
1886 | int prom_update_property(struct device_node *np, | ||
1887 | struct property *newprop, | ||
1888 | struct property *oldprop) | ||
1889 | { | ||
1890 | struct property **next; | ||
1891 | int found = 0; | ||
1892 | |||
1893 | write_lock(&devtree_lock); | ||
1894 | next = &np->properties; | ||
1895 | while (*next) { | ||
1896 | if (*next == oldprop) { | ||
1897 | /* found the node */ | ||
1898 | newprop->next = oldprop->next; | ||
1899 | *next = newprop; | ||
1900 | oldprop->next = np->deadprops; | ||
1901 | np->deadprops = oldprop; | ||
1902 | found = 1; | ||
1903 | break; | ||
1904 | } | ||
1905 | next = &(*next)->next; | ||
1906 | } | ||
1907 | write_unlock(&devtree_lock); | ||
1908 | |||
1909 | if (!found) | ||
1910 | return -ENODEV; | ||
1911 | |||
1912 | #ifdef CONFIG_PROC_DEVICETREE | ||
1913 | /* try to add to proc as well if it was initialized */ | ||
1914 | if (np->pde) | ||
1915 | proc_device_tree_update_prop(np->pde, newprop, oldprop); | ||
1916 | #endif /* CONFIG_PROC_DEVICETREE */ | ||
1917 | |||
1918 | return 0; | ||
1919 | } | ||
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 56f50e91bd..c4a294d657 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -431,7 +431,7 @@ void timer_interrupt(struct pt_regs * regs) | |||
431 | profile_tick(CPU_PROFILING, regs); | 431 | profile_tick(CPU_PROFILING, regs); |
432 | 432 | ||
433 | #ifdef CONFIG_PPC_ISERIES | 433 | #ifdef CONFIG_PPC_ISERIES |
434 | get_paca()->lppaca.int_dword.fields.decr_int = 0; | 434 | get_lppaca()->int_dword.fields.decr_int = 0; |
435 | #endif | 435 | #endif |
436 | 436 | ||
437 | while ((ticks = tb_ticks_since(per_cpu(last_jiffy, cpu))) | 437 | while ((ticks = tb_ticks_since(per_cpu(last_jiffy, cpu))) |
diff --git a/arch/powerpc/lib/locks.c b/arch/powerpc/lib/locks.c index 35bd03c41d..8362fa272c 100644 --- a/arch/powerpc/lib/locks.c +++ b/arch/powerpc/lib/locks.c | |||
@@ -28,15 +28,13 @@ | |||
28 | void __spin_yield(raw_spinlock_t *lock) | 28 | void __spin_yield(raw_spinlock_t *lock) |
29 | { | 29 | { |
30 | unsigned int lock_value, holder_cpu, yield_count; | 30 | unsigned int lock_value, holder_cpu, yield_count; |
31 | struct paca_struct *holder_paca; | ||
32 | 31 | ||
33 | lock_value = lock->slock; | 32 | lock_value = lock->slock; |
34 | if (lock_value == 0) | 33 | if (lock_value == 0) |
35 | return; | 34 | return; |
36 | holder_cpu = lock_value & 0xffff; | 35 | holder_cpu = lock_value & 0xffff; |
37 | BUG_ON(holder_cpu >= NR_CPUS); | 36 | BUG_ON(holder_cpu >= NR_CPUS); |
38 | holder_paca = &paca[holder_cpu]; | 37 | yield_count = lppaca[holder_cpu].yield_count; |
39 | yield_count = holder_paca->lppaca.yield_count; | ||
40 | if ((yield_count & 1) == 0) | 38 | if ((yield_count & 1) == 0) |
41 | return; /* virtual cpu is currently running */ | 39 | return; /* virtual cpu is currently running */ |
42 | rmb(); | 40 | rmb(); |
@@ -60,15 +58,13 @@ void __rw_yield(raw_rwlock_t *rw) | |||
60 | { | 58 | { |
61 | int lock_value; | 59 | int lock_value; |
62 | unsigned int holder_cpu, yield_count; | 60 | unsigned int holder_cpu, yield_count; |
63 | struct paca_struct *holder_paca; | ||
64 | 61 | ||
65 | lock_value = rw->lock; | 62 | lock_value = rw->lock; |
66 | if (lock_value >= 0) | 63 | if (lock_value >= 0) |
67 | return; /* no write lock at present */ | 64 | return; /* no write lock at present */ |
68 | holder_cpu = lock_value & 0xffff; | 65 | holder_cpu = lock_value & 0xffff; |
69 | BUG_ON(holder_cpu >= NR_CPUS); | 66 | BUG_ON(holder_cpu >= NR_CPUS); |
70 | holder_paca = &paca[holder_cpu]; | 67 | yield_count = lppaca[holder_cpu].yield_count; |
71 | yield_count = holder_paca->lppaca.yield_count; | ||
72 | if ((yield_count & 1) == 0) | 68 | if ((yield_count & 1) == 0) |
73 | return; /* virtual cpu is currently running */ | 69 | return; /* virtual cpu is currently running */ |
74 | rmb(); | 70 | rmb(); |
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c index 83442ea774..be3fbfc24e 100644 --- a/arch/powerpc/platforms/iseries/irq.c +++ b/arch/powerpc/platforms/iseries/irq.c | |||
@@ -334,14 +334,12 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus, | |||
334 | */ | 334 | */ |
335 | int iSeries_get_irq(struct pt_regs *regs) | 335 | int iSeries_get_irq(struct pt_regs *regs) |
336 | { | 336 | { |
337 | struct paca_struct *lpaca; | ||
338 | /* -2 means ignore this interrupt */ | 337 | /* -2 means ignore this interrupt */ |
339 | int irq = -2; | 338 | int irq = -2; |
340 | 339 | ||
341 | lpaca = get_paca(); | ||
342 | #ifdef CONFIG_SMP | 340 | #ifdef CONFIG_SMP |
343 | if (lpaca->lppaca.int_dword.fields.ipi_cnt) { | 341 | if (get_lppaca()->int_dword.fields.ipi_cnt) { |
344 | lpaca->lppaca.int_dword.fields.ipi_cnt = 0; | 342 | get_lppaca()->int_dword.fields.ipi_cnt = 0; |
345 | iSeries_smp_message_recv(regs); | 343 | iSeries_smp_message_recv(regs); |
346 | } | 344 | } |
347 | #endif /* CONFIG_SMP */ | 345 | #endif /* CONFIG_SMP */ |
diff --git a/arch/powerpc/platforms/iseries/misc.S b/arch/powerpc/platforms/iseries/misc.S index dfe7aa1ba0..7641fc7e55 100644 --- a/arch/powerpc/platforms/iseries/misc.S +++ b/arch/powerpc/platforms/iseries/misc.S | |||
@@ -44,7 +44,8 @@ _GLOBAL(local_irq_restore) | |||
44 | /* Check pending interrupts */ | 44 | /* Check pending interrupts */ |
45 | /* A decrementer, IPI or PMC interrupt may have occurred | 45 | /* A decrementer, IPI or PMC interrupt may have occurred |
46 | * while we were in the hypervisor (which enables) */ | 46 | * while we were in the hypervisor (which enables) */ |
47 | ld r4,PACALPPACA+LPPACAANYINT(r13) | 47 | ld r4,PACALPPACAPTR(r13) |
48 | ld r4,LPPACAANYINT(r4) | ||
48 | cmpdi r4,0 | 49 | cmpdi r4,0 |
49 | beqlr | 50 | beqlr |
50 | 51 | ||
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index c6bbe5c251..3f8790146b 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
@@ -538,7 +538,7 @@ static unsigned long __init build_iSeries_Memory_Map(void) | |||
538 | */ | 538 | */ |
539 | static void __init iSeries_setup_arch(void) | 539 | static void __init iSeries_setup_arch(void) |
540 | { | 540 | { |
541 | if (get_paca()->lppaca.shared_proc) { | 541 | if (get_lppaca()->shared_proc) { |
542 | ppc_md.idle_loop = iseries_shared_idle; | 542 | ppc_md.idle_loop = iseries_shared_idle; |
543 | printk(KERN_INFO "Using shared processor idle loop\n"); | 543 | printk(KERN_INFO "Using shared processor idle loop\n"); |
544 | } else { | 544 | } else { |
@@ -647,7 +647,7 @@ static void yield_shared_processor(void) | |||
647 | * The decrementer stops during the yield. Force a fake decrementer | 647 | * The decrementer stops during the yield. Force a fake decrementer |
648 | * here and let the timer_interrupt code sort out the actual time. | 648 | * here and let the timer_interrupt code sort out the actual time. |
649 | */ | 649 | */ |
650 | get_paca()->lppaca.int_dword.fields.decr_int = 1; | 650 | get_lppaca()->int_dword.fields.decr_int = 1; |
651 | process_iSeries_events(); | 651 | process_iSeries_events(); |
652 | } | 652 | } |
653 | 653 | ||
@@ -883,7 +883,7 @@ void dt_cpus(struct iseries_flat_dt *dt) | |||
883 | pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE); | 883 | pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE); |
884 | 884 | ||
885 | for (i = 0; i < NR_CPUS; i++) { | 885 | for (i = 0; i < NR_CPUS; i++) { |
886 | if (paca[i].lppaca.dyn_proc_status >= 2) | 886 | if (lppaca[i].dyn_proc_status >= 2) |
887 | continue; | 887 | continue; |
888 | 888 | ||
889 | snprintf(p, 32 - (p - buf), "@%d", i); | 889 | snprintf(p, 32 - (p - buf), "@%d", i); |
@@ -891,7 +891,7 @@ void dt_cpus(struct iseries_flat_dt *dt) | |||
891 | 891 | ||
892 | dt_prop_str(dt, "device_type", "cpu"); | 892 | dt_prop_str(dt, "device_type", "cpu"); |
893 | 893 | ||
894 | index = paca[i].lppaca.dyn_hv_phys_proc_index; | 894 | index = lppaca[i].dyn_hv_phys_proc_index; |
895 | d = &xIoHriProcessorVpd[index]; | 895 | d = &xIoHriProcessorVpd[index]; |
896 | 896 | ||
897 | dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024); | 897 | dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024); |
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c index fcb094ec6a..6f9d407a70 100644 --- a/arch/powerpc/platforms/iseries/smp.c +++ b/arch/powerpc/platforms/iseries/smp.c | |||
@@ -91,7 +91,7 @@ static void smp_iSeries_kick_cpu(int nr) | |||
91 | BUG_ON((nr < 0) || (nr >= NR_CPUS)); | 91 | BUG_ON((nr < 0) || (nr >= NR_CPUS)); |
92 | 92 | ||
93 | /* Verify that our partition has a processor nr */ | 93 | /* Verify that our partition has a processor nr */ |
94 | if (paca[nr].lppaca.dyn_proc_status >= 2) | 94 | if (lppaca[nr].dyn_proc_status >= 2) |
95 | return; | 95 | return; |
96 | 96 | ||
97 | /* The processor is currently spinning, waiting | 97 | /* The processor is currently spinning, waiting |
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 1fe445ab78..8952528d31 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
@@ -254,11 +254,11 @@ out: | |||
254 | void vpa_init(int cpu) | 254 | void vpa_init(int cpu) |
255 | { | 255 | { |
256 | int hwcpu = get_hard_smp_processor_id(cpu); | 256 | int hwcpu = get_hard_smp_processor_id(cpu); |
257 | unsigned long vpa = __pa(&paca[cpu].lppaca); | 257 | unsigned long vpa = __pa(&lppaca[cpu]); |
258 | long ret; | 258 | long ret; |
259 | 259 | ||
260 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) | 260 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) |
261 | paca[cpu].lppaca.vmxregs_in_use = 1; | 261 | lppaca[cpu].vmxregs_in_use = 1; |
262 | 262 | ||
263 | ret = register_vpa(hwcpu, vpa); | 263 | ret = register_vpa(hwcpu, vpa); |
264 | 264 | ||
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index d8864164db..86cfa6ecdc 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -350,6 +350,100 @@ static int do_remove_node(char *buf) | |||
350 | return rv; | 350 | return rv; |
351 | } | 351 | } |
352 | 352 | ||
353 | static char *parse_node(char *buf, size_t bufsize, struct device_node **npp) | ||
354 | { | ||
355 | char *handle_str; | ||
356 | phandle handle; | ||
357 | *npp = NULL; | ||
358 | |||
359 | handle_str = buf; | ||
360 | |||
361 | buf = strchr(buf, ' '); | ||
362 | if (!buf) | ||
363 | return NULL; | ||
364 | *buf = '\0'; | ||
365 | buf++; | ||
366 | |||
367 | handle = simple_strtoul(handle_str, NULL, 10); | ||
368 | |||
369 | *npp = of_find_node_by_phandle(handle); | ||
370 | return buf; | ||
371 | } | ||
372 | |||
373 | static int do_add_property(char *buf, size_t bufsize) | ||
374 | { | ||
375 | struct property *prop = NULL; | ||
376 | struct device_node *np; | ||
377 | unsigned char *value; | ||
378 | char *name, *end; | ||
379 | int length; | ||
380 | end = buf + bufsize; | ||
381 | buf = parse_node(buf, bufsize, &np); | ||
382 | |||
383 | if (!np) | ||
384 | return -ENODEV; | ||
385 | |||
386 | if (parse_next_property(buf, end, &name, &length, &value) == NULL) | ||
387 | return -EINVAL; | ||
388 | |||
389 | prop = new_property(name, length, value, NULL); | ||
390 | if (!prop) | ||
391 | return -ENOMEM; | ||
392 | |||
393 | prom_add_property(np, prop); | ||
394 | |||
395 | return 0; | ||
396 | } | ||
397 | |||
398 | static int do_remove_property(char *buf, size_t bufsize) | ||
399 | { | ||
400 | struct device_node *np; | ||
401 | char *tmp; | ||
402 | struct property *prop; | ||
403 | buf = parse_node(buf, bufsize, &np); | ||
404 | |||
405 | if (!np) | ||
406 | return -ENODEV; | ||
407 | |||
408 | tmp = strchr(buf,' '); | ||
409 | if (tmp) | ||
410 | *tmp = '\0'; | ||
411 | |||
412 | if (strlen(buf) == 0) | ||
413 | return -EINVAL; | ||
414 | |||
415 | prop = of_find_property(np, buf, NULL); | ||
416 | |||
417 | return prom_remove_property(np, prop); | ||
418 | } | ||
419 | |||
420 | static int do_update_property(char *buf, size_t bufsize) | ||
421 | { | ||
422 | struct device_node *np; | ||
423 | unsigned char *value; | ||
424 | char *name, *end; | ||
425 | int length; | ||
426 | struct property *newprop, *oldprop; | ||
427 | buf = parse_node(buf, bufsize, &np); | ||
428 | end = buf + bufsize; | ||
429 | |||
430 | if (!np) | ||
431 | return -ENODEV; | ||
432 | |||
433 | if (parse_next_property(buf, end, &name, &length, &value) == NULL) | ||
434 | return -EINVAL; | ||
435 | |||
436 | newprop = new_property(name, length, value, NULL); | ||
437 | if (!newprop) | ||
438 | return -ENOMEM; | ||
439 | |||
440 | oldprop = of_find_property(np, name,NULL); | ||
441 | if (!oldprop) | ||
442 | return -ENODEV; | ||
443 | |||
444 | return prom_update_property(np, newprop, oldprop); | ||
445 | } | ||
446 | |||
353 | /** | 447 | /** |
354 | * ofdt_write - perform operations on the Open Firmware device tree | 448 | * ofdt_write - perform operations on the Open Firmware device tree |
355 | * | 449 | * |
@@ -392,6 +486,12 @@ static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t coun | |||
392 | rv = do_add_node(tmp, count - (tmp - kbuf)); | 486 | rv = do_add_node(tmp, count - (tmp - kbuf)); |
393 | else if (!strcmp(kbuf, "remove_node")) | 487 | else if (!strcmp(kbuf, "remove_node")) |
394 | rv = do_remove_node(tmp); | 488 | rv = do_remove_node(tmp); |
489 | else if (!strcmp(kbuf, "add_property")) | ||
490 | rv = do_add_property(tmp, count - (tmp - kbuf)); | ||
491 | else if (!strcmp(kbuf, "remove_property")) | ||
492 | rv = do_remove_property(tmp, count - (tmp - kbuf)); | ||
493 | else if (!strcmp(kbuf, "update_property")) | ||
494 | rv = do_update_property(tmp, count - (tmp - kbuf)); | ||
395 | else | 495 | else |
396 | rv = -EINVAL; | 496 | rv = -EINVAL; |
397 | out: | 497 | out: |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 68b7f086d6..da6cebaf72 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -190,7 +190,7 @@ static void pseries_lpar_enable_pmcs(void) | |||
190 | 190 | ||
191 | /* instruct hypervisor to maintain PMCs */ | 191 | /* instruct hypervisor to maintain PMCs */ |
192 | if (firmware_has_feature(FW_FEATURE_SPLPAR)) | 192 | if (firmware_has_feature(FW_FEATURE_SPLPAR)) |
193 | get_paca()->lppaca.pmcregs_in_use = 1; | 193 | get_lppaca()->pmcregs_in_use = 1; |
194 | } | 194 | } |
195 | 195 | ||
196 | static void __init pSeries_setup_arch(void) | 196 | static void __init pSeries_setup_arch(void) |
@@ -234,7 +234,7 @@ static void __init pSeries_setup_arch(void) | |||
234 | /* Choose an idle loop */ | 234 | /* Choose an idle loop */ |
235 | if (firmware_has_feature(FW_FEATURE_SPLPAR)) { | 235 | if (firmware_has_feature(FW_FEATURE_SPLPAR)) { |
236 | vpa_init(boot_cpuid); | 236 | vpa_init(boot_cpuid); |
237 | if (get_paca()->lppaca.shared_proc) { | 237 | if (get_lppaca()->shared_proc) { |
238 | printk(KERN_INFO "Using shared processor idle loop\n"); | 238 | printk(KERN_INFO "Using shared processor idle loop\n"); |
239 | ppc_md.idle_loop = pseries_shared_idle; | 239 | ppc_md.idle_loop = pseries_shared_idle; |
240 | } else { | 240 | } else { |
@@ -444,10 +444,10 @@ DECLARE_PER_CPU(unsigned long, smt_snooze_delay); | |||
444 | 444 | ||
445 | static inline void dedicated_idle_sleep(unsigned int cpu) | 445 | static inline void dedicated_idle_sleep(unsigned int cpu) |
446 | { | 446 | { |
447 | struct paca_struct *ppaca = &paca[cpu ^ 1]; | 447 | struct lppaca *plppaca = &lppaca[cpu ^ 1]; |
448 | 448 | ||
449 | /* Only sleep if the other thread is not idle */ | 449 | /* Only sleep if the other thread is not idle */ |
450 | if (!(ppaca->lppaca.idle)) { | 450 | if (!(plppaca->idle)) { |
451 | local_irq_disable(); | 451 | local_irq_disable(); |
452 | 452 | ||
453 | /* | 453 | /* |
@@ -480,7 +480,6 @@ static inline void dedicated_idle_sleep(unsigned int cpu) | |||
480 | 480 | ||
481 | static void pseries_dedicated_idle(void) | 481 | static void pseries_dedicated_idle(void) |
482 | { | 482 | { |
483 | struct paca_struct *lpaca = get_paca(); | ||
484 | unsigned int cpu = smp_processor_id(); | 483 | unsigned int cpu = smp_processor_id(); |
485 | unsigned long start_snooze; | 484 | unsigned long start_snooze; |
486 | unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay); | 485 | unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay); |
@@ -491,7 +490,7 @@ static void pseries_dedicated_idle(void) | |||
491 | * Indicate to the HV that we are idle. Now would be | 490 | * Indicate to the HV that we are idle. Now would be |
492 | * a good time to find other work to dispatch. | 491 | * a good time to find other work to dispatch. |
493 | */ | 492 | */ |
494 | lpaca->lppaca.idle = 1; | 493 | get_lppaca()->idle = 1; |
495 | 494 | ||
496 | if (!need_resched()) { | 495 | if (!need_resched()) { |
497 | start_snooze = get_tb() + | 496 | start_snooze = get_tb() + |
@@ -518,7 +517,7 @@ static void pseries_dedicated_idle(void) | |||
518 | HMT_medium(); | 517 | HMT_medium(); |
519 | } | 518 | } |
520 | 519 | ||
521 | lpaca->lppaca.idle = 0; | 520 | get_lppaca()->idle = 0; |
522 | ppc64_runlatch_on(); | 521 | ppc64_runlatch_on(); |
523 | 522 | ||
524 | preempt_enable_no_resched(); | 523 | preempt_enable_no_resched(); |
@@ -532,7 +531,6 @@ static void pseries_dedicated_idle(void) | |||
532 | 531 | ||
533 | static void pseries_shared_idle(void) | 532 | static void pseries_shared_idle(void) |
534 | { | 533 | { |
535 | struct paca_struct *lpaca = get_paca(); | ||
536 | unsigned int cpu = smp_processor_id(); | 534 | unsigned int cpu = smp_processor_id(); |
537 | 535 | ||
538 | while (1) { | 536 | while (1) { |
@@ -540,7 +538,7 @@ static void pseries_shared_idle(void) | |||
540 | * Indicate to the HV that we are idle. Now would be | 538 | * Indicate to the HV that we are idle. Now would be |
541 | * a good time to find other work to dispatch. | 539 | * a good time to find other work to dispatch. |
542 | */ | 540 | */ |
543 | lpaca->lppaca.idle = 1; | 541 | get_lppaca()->idle = 1; |
544 | 542 | ||
545 | while (!need_resched() && !cpu_is_offline(cpu)) { | 543 | while (!need_resched() && !cpu_is_offline(cpu)) { |
546 | local_irq_disable(); | 544 | local_irq_disable(); |
@@ -564,7 +562,7 @@ static void pseries_shared_idle(void) | |||
564 | HMT_medium(); | 562 | HMT_medium(); |
565 | } | 563 | } |
566 | 564 | ||
567 | lpaca->lppaca.idle = 0; | 565 | get_lppaca()->idle = 0; |
568 | ppc64_runlatch_on(); | 566 | ppc64_runlatch_on(); |
569 | 567 | ||
570 | preempt_enable_no_resched(); | 568 | preempt_enable_no_resched(); |
@@ -588,7 +586,7 @@ static void pseries_kexec_cpu_down(int crash_shutdown, int secondary) | |||
588 | { | 586 | { |
589 | /* Don't risk a hypervisor call if we're crashing */ | 587 | /* Don't risk a hypervisor call if we're crashing */ |
590 | if (!crash_shutdown) { | 588 | if (!crash_shutdown) { |
591 | unsigned long vpa = __pa(&get_paca()->lppaca); | 589 | unsigned long vpa = __pa(get_lppaca()); |
592 | 590 | ||
593 | if (unregister_vpa(hard_smp_processor_id(), vpa)) { | 591 | if (unregister_vpa(hard_smp_processor_id(), vpa)) { |
594 | printk("VPA deregistration of cpu %u (hw_cpu_id %d) " | 592 | printk("VPA deregistration of cpu %u (hw_cpu_id %d) " |
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c b/arch/ppc/platforms/83xx/mpc834x_sys.c index 04bdc39bf4..012e1e652c 100644 --- a/arch/ppc/platforms/83xx/mpc834x_sys.c +++ b/arch/ppc/platforms/83xx/mpc834x_sys.c | |||
@@ -51,9 +51,6 @@ | |||
51 | 51 | ||
52 | #include <syslib/ppc83xx_setup.h> | 52 | #include <syslib/ppc83xx_setup.h> |
53 | 53 | ||
54 | static const char *GFAR_PHY_0 = "phy0:0"; | ||
55 | static const char *GFAR_PHY_1 = "phy0:1"; | ||
56 | |||
57 | #ifndef CONFIG_PCI | 54 | #ifndef CONFIG_PCI |
58 | unsigned long isa_io_base = 0; | 55 | unsigned long isa_io_base = 0; |
59 | unsigned long isa_mem_base = 0; | 56 | unsigned long isa_mem_base = 0; |
@@ -129,20 +126,21 @@ mpc834x_sys_setup_arch(void) | |||
129 | mdata->irq[1] = MPC83xx_IRQ_EXT2; | 126 | mdata->irq[1] = MPC83xx_IRQ_EXT2; |
130 | mdata->irq[2] = -1; | 127 | mdata->irq[2] = -1; |
131 | mdata->irq[31] = -1; | 128 | mdata->irq[31] = -1; |
132 | mdata->paddr += binfo->bi_immr_base; | ||
133 | 129 | ||
134 | /* setup the board related information for the enet controllers */ | 130 | /* setup the board related information for the enet controllers */ |
135 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1); | 131 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC1); |
136 | if (pdata) { | 132 | if (pdata) { |
137 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 133 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
138 | pdata->bus_id = GFAR_PHY_0; | 134 | pdata->bus_id = 0; |
135 | pdata->phy_id = 0; | ||
139 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); | 136 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); |
140 | } | 137 | } |
141 | 138 | ||
142 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2); | 139 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC83xx_TSEC2); |
143 | if (pdata) { | 140 | if (pdata) { |
144 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 141 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
145 | pdata->bus_id = GFAR_PHY_1; | 142 | pdata->bus_id = 0; |
143 | pdata->phy_id = 1; | ||
146 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); | 144 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); |
147 | } | 145 | } |
148 | 146 | ||
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c index c5cde97c6e..2eceb1e6f4 100644 --- a/arch/ppc/platforms/85xx/mpc8540_ads.c +++ b/arch/ppc/platforms/85xx/mpc8540_ads.c | |||
@@ -52,10 +52,6 @@ | |||
52 | 52 | ||
53 | #include <syslib/ppc85xx_setup.h> | 53 | #include <syslib/ppc85xx_setup.h> |
54 | 54 | ||
55 | static const char *GFAR_PHY_0 = "phy0:0"; | ||
56 | static const char *GFAR_PHY_1 = "phy0:1"; | ||
57 | static const char *GFAR_PHY_3 = "phy0:3"; | ||
58 | |||
59 | /* ************************************************************************ | 55 | /* ************************************************************************ |
60 | * | 56 | * |
61 | * Setup the architecture | 57 | * Setup the architecture |
@@ -102,27 +98,29 @@ mpc8540ads_setup_arch(void) | |||
102 | mdata->irq[2] = -1; | 98 | mdata->irq[2] = -1; |
103 | mdata->irq[3] = MPC85xx_IRQ_EXT5; | 99 | mdata->irq[3] = MPC85xx_IRQ_EXT5; |
104 | mdata->irq[31] = -1; | 100 | mdata->irq[31] = -1; |
105 | mdata->paddr += binfo->bi_immr_base; | ||
106 | 101 | ||
107 | /* setup the board related information for the enet controllers */ | 102 | /* setup the board related information for the enet controllers */ |
108 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); | 103 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); |
109 | if (pdata) { | 104 | if (pdata) { |
110 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 105 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
111 | pdata->bus_id = GFAR_PHY_0; | 106 | pdata->bus_id = 0; |
107 | pdata->phy_id = 0; | ||
112 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); | 108 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); |
113 | } | 109 | } |
114 | 110 | ||
115 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); | 111 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); |
116 | if (pdata) { | 112 | if (pdata) { |
117 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 113 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
118 | pdata->bus_id = GFAR_PHY_1; | 114 | pdata->bus_id = 0; |
115 | pdata->phy_id = 1; | ||
119 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); | 116 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); |
120 | } | 117 | } |
121 | 118 | ||
122 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC); | 119 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC); |
123 | if (pdata) { | 120 | if (pdata) { |
124 | pdata->board_flags = 0; | 121 | pdata->board_flags = 0; |
125 | pdata->bus_id = GFAR_PHY_3; | 122 | pdata->bus_id = 0; |
123 | pdata->phy_id = 3; | ||
126 | memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6); | 124 | memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6); |
127 | } | 125 | } |
128 | 126 | ||
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c index 8e39a55170..442c7ff195 100644 --- a/arch/ppc/platforms/85xx/mpc8560_ads.c +++ b/arch/ppc/platforms/85xx/mpc8560_ads.c | |||
@@ -56,10 +56,6 @@ | |||
56 | #include <syslib/ppc85xx_setup.h> | 56 | #include <syslib/ppc85xx_setup.h> |
57 | 57 | ||
58 | 58 | ||
59 | static const char *GFAR_PHY_0 = "phy0:0"; | ||
60 | static const char *GFAR_PHY_1 = "phy0:1"; | ||
61 | static const char *GFAR_PHY_3 = "phy0:3"; | ||
62 | |||
63 | /* ************************************************************************ | 59 | /* ************************************************************************ |
64 | * | 60 | * |
65 | * Setup the architecture | 61 | * Setup the architecture |
@@ -99,20 +95,21 @@ mpc8560ads_setup_arch(void) | |||
99 | mdata->irq[2] = -1; | 95 | mdata->irq[2] = -1; |
100 | mdata->irq[3] = MPC85xx_IRQ_EXT5; | 96 | mdata->irq[3] = MPC85xx_IRQ_EXT5; |
101 | mdata->irq[31] = -1; | 97 | mdata->irq[31] = -1; |
102 | mdata->paddr += binfo->bi_immr_base; | ||
103 | 98 | ||
104 | /* setup the board related information for the enet controllers */ | 99 | /* setup the board related information for the enet controllers */ |
105 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); | 100 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); |
106 | if (pdata) { | 101 | if (pdata) { |
107 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 102 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
108 | pdata->bus_id = GFAR_PHY_0; | 103 | pdata->bus_id = 0; |
104 | pdata->phy_id = 0; | ||
109 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); | 105 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); |
110 | } | 106 | } |
111 | 107 | ||
112 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); | 108 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); |
113 | if (pdata) { | 109 | if (pdata) { |
114 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 110 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
115 | pdata->bus_id = GFAR_PHY_1; | 111 | pdata->bus_id = 0; |
112 | pdata->phy_id = 1; | ||
116 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); | 113 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); |
117 | } | 114 | } |
118 | 115 | ||
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c index 2959e3c408..b332ebae6b 100644 --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c | |||
@@ -395,9 +395,6 @@ mpc85xx_cds_pcibios_fixup(void) | |||
395 | 395 | ||
396 | TODC_ALLOC(); | 396 | TODC_ALLOC(); |
397 | 397 | ||
398 | static const char *GFAR_PHY_0 = "phy0:0"; | ||
399 | static const char *GFAR_PHY_1 = "phy0:1"; | ||
400 | |||
401 | /* ************************************************************************ | 398 | /* ************************************************************************ |
402 | * | 399 | * |
403 | * Setup the architecture | 400 | * Setup the architecture |
@@ -461,34 +458,37 @@ mpc85xx_cds_setup_arch(void) | |||
461 | mdata->irq[2] = -1; | 458 | mdata->irq[2] = -1; |
462 | mdata->irq[3] = -1; | 459 | mdata->irq[3] = -1; |
463 | mdata->irq[31] = -1; | 460 | mdata->irq[31] = -1; |
464 | mdata->paddr += binfo->bi_immr_base; | ||
465 | 461 | ||
466 | /* setup the board related information for the enet controllers */ | 462 | /* setup the board related information for the enet controllers */ |
467 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); | 463 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); |
468 | if (pdata) { | 464 | if (pdata) { |
469 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 465 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
470 | pdata->bus_id = GFAR_PHY_0; | 466 | pdata->bus_id = 0; |
467 | pdata->phy_id = 0; | ||
471 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); | 468 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); |
472 | } | 469 | } |
473 | 470 | ||
474 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); | 471 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); |
475 | if (pdata) { | 472 | if (pdata) { |
476 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 473 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
477 | pdata->bus_id = GFAR_PHY_1; | 474 | pdata->bus_id = 0; |
475 | pdata->phy_id = 1; | ||
478 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); | 476 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); |
479 | } | 477 | } |
480 | 478 | ||
481 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1); | 479 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1); |
482 | if (pdata) { | 480 | if (pdata) { |
483 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 481 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
484 | pdata->bus_id = GFAR_PHY_0; | 482 | pdata->bus_id = 0; |
483 | pdata->phy_id = 0; | ||
485 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); | 484 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); |
486 | } | 485 | } |
487 | 486 | ||
488 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2); | 487 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2); |
489 | if (pdata) { | 488 | if (pdata) { |
490 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 489 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
491 | pdata->bus_id = GFAR_PHY_1; | 490 | pdata->bus_id = 0; |
491 | pdata->phy_id = 1; | ||
492 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); | 492 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); |
493 | } | 493 | } |
494 | 494 | ||
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c index 45a5b81b4e..e777ba824a 100644 --- a/arch/ppc/platforms/85xx/sbc8560.c +++ b/arch/ppc/platforms/85xx/sbc8560.c | |||
@@ -91,9 +91,6 @@ sbc8560_early_serial_map(void) | |||
91 | } | 91 | } |
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | static const char *GFAR_PHY_25 = "phy0:25"; | ||
95 | static const char *GFAR_PHY_26 = "phy0:26"; | ||
96 | |||
97 | /* ************************************************************************ | 94 | /* ************************************************************************ |
98 | * | 95 | * |
99 | * Setup the architecture | 96 | * Setup the architecture |
@@ -136,20 +133,21 @@ sbc8560_setup_arch(void) | |||
136 | mdata->irq[25] = MPC85xx_IRQ_EXT6; | 133 | mdata->irq[25] = MPC85xx_IRQ_EXT6; |
137 | mdata->irq[26] = MPC85xx_IRQ_EXT7; | 134 | mdata->irq[26] = MPC85xx_IRQ_EXT7; |
138 | mdata->irq[31] = -1; | 135 | mdata->irq[31] = -1; |
139 | mdata->paddr += binfo->bi_immr_base; | ||
140 | 136 | ||
141 | /* setup the board related information for the enet controllers */ | 137 | /* setup the board related information for the enet controllers */ |
142 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); | 138 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); |
143 | if (pdata) { | 139 | if (pdata) { |
144 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 140 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
145 | pdata->bus_id = GFAR_PHY_25; | 141 | pdata->bus_id = 0; |
142 | pdata->phy_id = 25; | ||
146 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); | 143 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); |
147 | } | 144 | } |
148 | 145 | ||
149 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); | 146 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); |
150 | if (pdata) { | 147 | if (pdata) { |
151 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 148 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
152 | pdata->bus_id = GFAR_PHY_26; | 149 | pdata->bus_id = 0; |
150 | pdata->phy_id = 26; | ||
153 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); | 151 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); |
154 | } | 152 | } |
155 | 153 | ||
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c index 15ce9d0706..061bb7cf2d 100644 --- a/arch/ppc/platforms/85xx/stx_gp3.c +++ b/arch/ppc/platforms/85xx/stx_gp3.c | |||
@@ -93,9 +93,6 @@ static u8 gp3_openpic_initsenses[] __initdata = { | |||
93 | 0x0, /* External 11: */ | 93 | 0x0, /* External 11: */ |
94 | }; | 94 | }; |
95 | 95 | ||
96 | static const char *GFAR_PHY_2 = "phy0:2"; | ||
97 | static const char *GFAR_PHY_4 = "phy0:4"; | ||
98 | |||
99 | /* | 96 | /* |
100 | * Setup the architecture | 97 | * Setup the architecture |
101 | */ | 98 | */ |
@@ -130,20 +127,21 @@ gp3_setup_arch(void) | |||
130 | mdata->irq[2] = MPC85xx_IRQ_EXT5; | 127 | mdata->irq[2] = MPC85xx_IRQ_EXT5; |
131 | mdata->irq[4] = MPC85xx_IRQ_EXT5; | 128 | mdata->irq[4] = MPC85xx_IRQ_EXT5; |
132 | mdata->irq[31] = -1; | 129 | mdata->irq[31] = -1; |
133 | mdata->paddr += binfo->bi_immr_base; | ||
134 | 130 | ||
135 | /* setup the board related information for the enet controllers */ | 131 | /* setup the board related information for the enet controllers */ |
136 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); | 132 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); |
137 | if (pdata) { | 133 | if (pdata) { |
138 | /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */ | 134 | /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */ |
139 | pdata->bus_id = GFAR_PHY_2; | 135 | pdata->bus_id = 0; |
136 | pdata->phy_id = 2; | ||
140 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); | 137 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); |
141 | } | 138 | } |
142 | 139 | ||
143 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); | 140 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); |
144 | if (pdata) { | 141 | if (pdata) { |
145 | /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */ | 142 | /* pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */ |
146 | pdata->bus_id = GFAR_PHY_4; | 143 | pdata->bus_id = 0; |
144 | pdata->phy_id = 4; | ||
147 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); | 145 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); |
148 | } | 146 | } |
149 | 147 | ||
diff --git a/arch/ppc/platforms/85xx/tqm85xx.c b/arch/ppc/platforms/85xx/tqm85xx.c index c6dfd8f0f9..b436f4d0a3 100644 --- a/arch/ppc/platforms/85xx/tqm85xx.c +++ b/arch/ppc/platforms/85xx/tqm85xx.c | |||
@@ -91,12 +91,6 @@ static u_char tqm85xx_openpic_initsenses[] __initdata = { | |||
91 | 0x0, /* External 11: */ | 91 | 0x0, /* External 11: */ |
92 | }; | 92 | }; |
93 | 93 | ||
94 | static const char *GFAR_PHY_0 = "phy0:2"; | ||
95 | static const char *GFAR_PHY_1 = "phy0:1"; | ||
96 | #ifdef CONFIG_MPC8540 | ||
97 | static const char *GFAR_PHY_3 = "phy0:3"; | ||
98 | #endif | ||
99 | |||
100 | /* ************************************************************************ | 94 | /* ************************************************************************ |
101 | * | 95 | * |
102 | * Setup the architecture | 96 | * Setup the architecture |
@@ -149,20 +143,21 @@ tqm85xx_setup_arch(void) | |||
149 | mdata->irq[2] = -1; | 143 | mdata->irq[2] = -1; |
150 | mdata->irq[3] = MPC85xx_IRQ_EXT8; | 144 | mdata->irq[3] = MPC85xx_IRQ_EXT8; |
151 | mdata->irq[31] = -1; | 145 | mdata->irq[31] = -1; |
152 | mdata->paddr += binfo->bi_immr_base; | ||
153 | 146 | ||
154 | /* setup the board related information for the enet controllers */ | 147 | /* setup the board related information for the enet controllers */ |
155 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); | 148 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1); |
156 | if (pdata) { | 149 | if (pdata) { |
157 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 150 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
158 | pdata->bus_id = GFAR_PHY_0; | 151 | pdata->bus_id = 0; |
152 | pdata->phy_id = 2; | ||
159 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); | 153 | memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6); |
160 | } | 154 | } |
161 | 155 | ||
162 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); | 156 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2); |
163 | if (pdata) { | 157 | if (pdata) { |
164 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; | 158 | pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; |
165 | pdata->bus_id = GFAR_PHY_1; | 159 | pdata->bus_id = 0; |
160 | pdata->phy_id = 1; | ||
166 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); | 161 | memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); |
167 | } | 162 | } |
168 | 163 | ||
@@ -170,7 +165,8 @@ tqm85xx_setup_arch(void) | |||
170 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC); | 165 | pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC); |
171 | if (pdata) { | 166 | if (pdata) { |
172 | pdata->board_flags = 0; | 167 | pdata->board_flags = 0; |
173 | pdata->bus_id = GFAR_PHY_3; | 168 | pdata->bus_id = 0; |
169 | pdata->phy_id = 3; | ||
174 | memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6); | 170 | memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6); |
175 | } | 171 | } |
176 | #endif | 172 | #endif |
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c index 847df44099..f9b95de70e 100644 --- a/arch/ppc/syslib/mpc83xx_devices.c +++ b/arch/ppc/syslib/mpc83xx_devices.c | |||
@@ -28,7 +28,6 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | struct gianfar_mdio_data mpc83xx_mdio_pdata = { | 30 | struct gianfar_mdio_data mpc83xx_mdio_pdata = { |
31 | .paddr = 0x24520, | ||
32 | }; | 31 | }; |
33 | 32 | ||
34 | static struct gianfar_platform_data mpc83xx_tsec1_pdata = { | 33 | static struct gianfar_platform_data mpc83xx_tsec1_pdata = { |
@@ -226,7 +225,14 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
226 | .name = "fsl-gianfar_mdio", | 225 | .name = "fsl-gianfar_mdio", |
227 | .id = 0, | 226 | .id = 0, |
228 | .dev.platform_data = &mpc83xx_mdio_pdata, | 227 | .dev.platform_data = &mpc83xx_mdio_pdata, |
229 | .num_resources = 0, | 228 | .num_resources = 1, |
229 | .resource = (struct resource[]) { | ||
230 | { | ||
231 | .start = 0x24520, | ||
232 | .end = 0x2453f, | ||
233 | .flags = IORESOURCE_MEM, | ||
234 | }, | ||
235 | }, | ||
230 | }, | 236 | }, |
231 | }; | 237 | }; |
232 | 238 | ||
diff --git a/arch/ppc/syslib/mpc85xx_devices.c b/arch/ppc/syslib/mpc85xx_devices.c index 69949d2556..00e9b6ff2f 100644 --- a/arch/ppc/syslib/mpc85xx_devices.c +++ b/arch/ppc/syslib/mpc85xx_devices.c | |||
@@ -26,7 +26,6 @@ | |||
26 | * what CCSRBAR is, will get fixed up by mach_mpc85xx_fixup | 26 | * what CCSRBAR is, will get fixed up by mach_mpc85xx_fixup |
27 | */ | 27 | */ |
28 | struct gianfar_mdio_data mpc85xx_mdio_pdata = { | 28 | struct gianfar_mdio_data mpc85xx_mdio_pdata = { |
29 | .paddr = MPC85xx_MIIM_OFFSET, | ||
30 | }; | 29 | }; |
31 | 30 | ||
32 | static struct gianfar_platform_data mpc85xx_tsec1_pdata = { | 31 | static struct gianfar_platform_data mpc85xx_tsec1_pdata = { |
@@ -720,7 +719,14 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
720 | .name = "fsl-gianfar_mdio", | 719 | .name = "fsl-gianfar_mdio", |
721 | .id = 0, | 720 | .id = 0, |
722 | .dev.platform_data = &mpc85xx_mdio_pdata, | 721 | .dev.platform_data = &mpc85xx_mdio_pdata, |
723 | .num_resources = 0, | 722 | .num_resources = 1, |
723 | .resource = (struct resource[]) { | ||
724 | { | ||
725 | .start = 0x24520, | ||
726 | .end = 0x2453f, | ||
727 | .flags = IORESOURCE_MEM, | ||
728 | }, | ||
729 | }, | ||
724 | }, | 730 | }, |
725 | }; | 731 | }; |
726 | 732 | ||
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c index fb117b7480..9bdd077d6f 100644 --- a/fs/proc/proc_devtree.c +++ b/fs/proc/proc_devtree.c | |||
@@ -81,6 +81,30 @@ void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop | |||
81 | __proc_device_tree_add_prop(pde, prop); | 81 | __proc_device_tree_add_prop(pde, prop); |
82 | } | 82 | } |
83 | 83 | ||
84 | void proc_device_tree_remove_prop(struct proc_dir_entry *pde, | ||
85 | struct property *prop) | ||
86 | { | ||
87 | remove_proc_entry(prop->name, pde); | ||
88 | } | ||
89 | |||
90 | void proc_device_tree_update_prop(struct proc_dir_entry *pde, | ||
91 | struct property *newprop, | ||
92 | struct property *oldprop) | ||
93 | { | ||
94 | struct proc_dir_entry *ent; | ||
95 | |||
96 | for (ent = pde->subdir; ent != NULL; ent = ent->next) | ||
97 | if (ent->data == oldprop) | ||
98 | break; | ||
99 | if (ent == NULL) { | ||
100 | printk(KERN_WARNING "device-tree: property \"%s\" " | ||
101 | " does not exist\n", oldprop->name); | ||
102 | } else { | ||
103 | ent->data = newprop; | ||
104 | ent->size = newprop->length; | ||
105 | } | ||
106 | } | ||
107 | |||
84 | /* | 108 | /* |
85 | * Process a node, adding entries for its children and its properties. | 109 | * Process a node, adding entries for its children and its properties. |
86 | */ | 110 | */ |
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h index 248f9aec95..147a38dcc7 100644 --- a/include/asm-powerpc/atomic.h +++ b/include/asm-powerpc/atomic.h | |||
@@ -36,7 +36,7 @@ static __inline__ int atomic_add_return(int a, atomic_t *v) | |||
36 | int t; | 36 | int t; |
37 | 37 | ||
38 | __asm__ __volatile__( | 38 | __asm__ __volatile__( |
39 | EIEIO_ON_SMP | 39 | LWSYNC_ON_SMP |
40 | "1: lwarx %0,0,%2 # atomic_add_return\n\ | 40 | "1: lwarx %0,0,%2 # atomic_add_return\n\ |
41 | add %0,%1,%0\n" | 41 | add %0,%1,%0\n" |
42 | PPC405_ERR77(0,%2) | 42 | PPC405_ERR77(0,%2) |
@@ -72,7 +72,7 @@ static __inline__ int atomic_sub_return(int a, atomic_t *v) | |||
72 | int t; | 72 | int t; |
73 | 73 | ||
74 | __asm__ __volatile__( | 74 | __asm__ __volatile__( |
75 | EIEIO_ON_SMP | 75 | LWSYNC_ON_SMP |
76 | "1: lwarx %0,0,%2 # atomic_sub_return\n\ | 76 | "1: lwarx %0,0,%2 # atomic_sub_return\n\ |
77 | subf %0,%1,%0\n" | 77 | subf %0,%1,%0\n" |
78 | PPC405_ERR77(0,%2) | 78 | PPC405_ERR77(0,%2) |
@@ -106,7 +106,7 @@ static __inline__ int atomic_inc_return(atomic_t *v) | |||
106 | int t; | 106 | int t; |
107 | 107 | ||
108 | __asm__ __volatile__( | 108 | __asm__ __volatile__( |
109 | EIEIO_ON_SMP | 109 | LWSYNC_ON_SMP |
110 | "1: lwarx %0,0,%1 # atomic_inc_return\n\ | 110 | "1: lwarx %0,0,%1 # atomic_inc_return\n\ |
111 | addic %0,%0,1\n" | 111 | addic %0,%0,1\n" |
112 | PPC405_ERR77(0,%1) | 112 | PPC405_ERR77(0,%1) |
@@ -150,7 +150,7 @@ static __inline__ int atomic_dec_return(atomic_t *v) | |||
150 | int t; | 150 | int t; |
151 | 151 | ||
152 | __asm__ __volatile__( | 152 | __asm__ __volatile__( |
153 | EIEIO_ON_SMP | 153 | LWSYNC_ON_SMP |
154 | "1: lwarx %0,0,%1 # atomic_dec_return\n\ | 154 | "1: lwarx %0,0,%1 # atomic_dec_return\n\ |
155 | addic %0,%0,-1\n" | 155 | addic %0,%0,-1\n" |
156 | PPC405_ERR77(0,%1) | 156 | PPC405_ERR77(0,%1) |
@@ -176,19 +176,19 @@ static __inline__ int atomic_dec_return(atomic_t *v) | |||
176 | * Atomically adds @a to @v, so long as it was not @u. | 176 | * Atomically adds @a to @v, so long as it was not @u. |
177 | * Returns non-zero if @v was not @u, and zero otherwise. | 177 | * Returns non-zero if @v was not @u, and zero otherwise. |
178 | */ | 178 | */ |
179 | #define atomic_add_unless(v, a, u) \ | 179 | #define atomic_add_unless(v, a, u) \ |
180 | ({ \ | 180 | ({ \ |
181 | int c, old; \ | 181 | int c, old; \ |
182 | c = atomic_read(v); \ | 182 | c = atomic_read(v); \ |
183 | for (;;) { \ | 183 | for (;;) { \ |
184 | if (unlikely(c == (u))) \ | 184 | if (unlikely(c == (u))) \ |
185 | break; \ | 185 | break; \ |
186 | old = atomic_cmpxchg((v), c, c + (a)); \ | 186 | old = atomic_cmpxchg((v), c, c + (a)); \ |
187 | if (likely(old == c)) \ | 187 | if (likely(old == c)) \ |
188 | break; \ | 188 | break; \ |
189 | c = old; \ | 189 | c = old; \ |
190 | } \ | 190 | } \ |
191 | c != (u); \ | 191 | c != (u); \ |
192 | }) | 192 | }) |
193 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | 193 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) |
194 | 194 | ||
@@ -204,7 +204,7 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v) | |||
204 | int t; | 204 | int t; |
205 | 205 | ||
206 | __asm__ __volatile__( | 206 | __asm__ __volatile__( |
207 | EIEIO_ON_SMP | 207 | LWSYNC_ON_SMP |
208 | "1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ | 208 | "1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ |
209 | addic. %0,%0,-1\n\ | 209 | addic. %0,%0,-1\n\ |
210 | blt- 2f\n" | 210 | blt- 2f\n" |
@@ -253,7 +253,7 @@ static __inline__ long atomic64_add_return(long a, atomic64_t *v) | |||
253 | long t; | 253 | long t; |
254 | 254 | ||
255 | __asm__ __volatile__( | 255 | __asm__ __volatile__( |
256 | EIEIO_ON_SMP | 256 | LWSYNC_ON_SMP |
257 | "1: ldarx %0,0,%2 # atomic64_add_return\n\ | 257 | "1: ldarx %0,0,%2 # atomic64_add_return\n\ |
258 | add %0,%1,%0\n\ | 258 | add %0,%1,%0\n\ |
259 | stdcx. %0,0,%2 \n\ | 259 | stdcx. %0,0,%2 \n\ |
@@ -287,7 +287,7 @@ static __inline__ long atomic64_sub_return(long a, atomic64_t *v) | |||
287 | long t; | 287 | long t; |
288 | 288 | ||
289 | __asm__ __volatile__( | 289 | __asm__ __volatile__( |
290 | EIEIO_ON_SMP | 290 | LWSYNC_ON_SMP |
291 | "1: ldarx %0,0,%2 # atomic64_sub_return\n\ | 291 | "1: ldarx %0,0,%2 # atomic64_sub_return\n\ |
292 | subf %0,%1,%0\n\ | 292 | subf %0,%1,%0\n\ |
293 | stdcx. %0,0,%2 \n\ | 293 | stdcx. %0,0,%2 \n\ |
@@ -319,7 +319,7 @@ static __inline__ long atomic64_inc_return(atomic64_t *v) | |||
319 | long t; | 319 | long t; |
320 | 320 | ||
321 | __asm__ __volatile__( | 321 | __asm__ __volatile__( |
322 | EIEIO_ON_SMP | 322 | LWSYNC_ON_SMP |
323 | "1: ldarx %0,0,%1 # atomic64_inc_return\n\ | 323 | "1: ldarx %0,0,%1 # atomic64_inc_return\n\ |
324 | addic %0,%0,1\n\ | 324 | addic %0,%0,1\n\ |
325 | stdcx. %0,0,%1 \n\ | 325 | stdcx. %0,0,%1 \n\ |
@@ -361,7 +361,7 @@ static __inline__ long atomic64_dec_return(atomic64_t *v) | |||
361 | long t; | 361 | long t; |
362 | 362 | ||
363 | __asm__ __volatile__( | 363 | __asm__ __volatile__( |
364 | EIEIO_ON_SMP | 364 | LWSYNC_ON_SMP |
365 | "1: ldarx %0,0,%1 # atomic64_dec_return\n\ | 365 | "1: ldarx %0,0,%1 # atomic64_dec_return\n\ |
366 | addic %0,%0,-1\n\ | 366 | addic %0,%0,-1\n\ |
367 | stdcx. %0,0,%1\n\ | 367 | stdcx. %0,0,%1\n\ |
@@ -386,7 +386,7 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v) | |||
386 | long t; | 386 | long t; |
387 | 387 | ||
388 | __asm__ __volatile__( | 388 | __asm__ __volatile__( |
389 | EIEIO_ON_SMP | 389 | LWSYNC_ON_SMP |
390 | "1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\ | 390 | "1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\ |
391 | addic. %0,%0,-1\n\ | 391 | addic. %0,%0,-1\n\ |
392 | blt- 2f\n\ | 392 | blt- 2f\n\ |
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index 1996eaa8ae..bf6941a810 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h | |||
@@ -112,7 +112,7 @@ static __inline__ int test_and_set_bit(unsigned long nr, | |||
112 | unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); | 112 | unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); |
113 | 113 | ||
114 | __asm__ __volatile__( | 114 | __asm__ __volatile__( |
115 | EIEIO_ON_SMP | 115 | LWSYNC_ON_SMP |
116 | "1:" PPC_LLARX "%0,0,%3 # test_and_set_bit\n" | 116 | "1:" PPC_LLARX "%0,0,%3 # test_and_set_bit\n" |
117 | "or %1,%0,%2 \n" | 117 | "or %1,%0,%2 \n" |
118 | PPC405_ERR77(0,%3) | 118 | PPC405_ERR77(0,%3) |
@@ -134,7 +134,7 @@ static __inline__ int test_and_clear_bit(unsigned long nr, | |||
134 | unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); | 134 | unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); |
135 | 135 | ||
136 | __asm__ __volatile__( | 136 | __asm__ __volatile__( |
137 | EIEIO_ON_SMP | 137 | LWSYNC_ON_SMP |
138 | "1:" PPC_LLARX "%0,0,%3 # test_and_clear_bit\n" | 138 | "1:" PPC_LLARX "%0,0,%3 # test_and_clear_bit\n" |
139 | "andc %1,%0,%2 \n" | 139 | "andc %1,%0,%2 \n" |
140 | PPC405_ERR77(0,%3) | 140 | PPC405_ERR77(0,%3) |
@@ -156,7 +156,7 @@ static __inline__ int test_and_change_bit(unsigned long nr, | |||
156 | unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); | 156 | unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); |
157 | 157 | ||
158 | __asm__ __volatile__( | 158 | __asm__ __volatile__( |
159 | EIEIO_ON_SMP | 159 | LWSYNC_ON_SMP |
160 | "1:" PPC_LLARX "%0,0,%3 # test_and_change_bit\n" | 160 | "1:" PPC_LLARX "%0,0,%3 # test_and_change_bit\n" |
161 | "xor %1,%0,%2 \n" | 161 | "xor %1,%0,%2 \n" |
162 | PPC405_ERR77(0,%3) | 162 | PPC405_ERR77(0,%3) |
diff --git a/include/asm-powerpc/futex.h b/include/asm-powerpc/futex.h index f0319d50b1..39e85f320a 100644 --- a/include/asm-powerpc/futex.h +++ b/include/asm-powerpc/futex.h | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | 12 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ |
13 | __asm__ __volatile ( \ | 13 | __asm__ __volatile ( \ |
14 | SYNC_ON_SMP \ | 14 | LWSYNC_ON_SMP \ |
15 | "1: lwarx %0,0,%2\n" \ | 15 | "1: lwarx %0,0,%2\n" \ |
16 | insn \ | 16 | insn \ |
17 | PPC405_ERR77(0, %2) \ | 17 | PPC405_ERR77(0, %2) \ |
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index da7af5a720..38ca9ad611 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h | |||
@@ -6,7 +6,10 @@ | |||
6 | 6 | ||
7 | #define H_Success 0 | 7 | #define H_Success 0 |
8 | #define H_Busy 1 /* Hardware busy -- retry later */ | 8 | #define H_Busy 1 /* Hardware busy -- retry later */ |
9 | #define H_Closed 2 /* Resource closed */ | ||
9 | #define H_Constrained 4 /* Resource request constrained to max allowed */ | 10 | #define H_Constrained 4 /* Resource request constrained to max allowed */ |
11 | #define H_InProgress 14 /* Kind of like busy */ | ||
12 | #define H_Continue 18 /* Returned from H_Join on success */ | ||
10 | #define H_LongBusyStartRange 9900 /* Start of long busy range */ | 13 | #define H_LongBusyStartRange 9900 /* Start of long busy range */ |
11 | #define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ | 14 | #define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ |
12 | #define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ | 15 | #define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ |
@@ -114,6 +117,8 @@ | |||
114 | #define H_REGISTER_VTERM 0x154 | 117 | #define H_REGISTER_VTERM 0x154 |
115 | #define H_FREE_VTERM 0x158 | 118 | #define H_FREE_VTERM 0x158 |
116 | #define H_POLL_PENDING 0x1D8 | 119 | #define H_POLL_PENDING 0x1D8 |
120 | #define H_JOIN 0x298 | ||
121 | #define H_ENABLE_CRQ 0x2B0 | ||
117 | 122 | ||
118 | #ifndef __ASSEMBLY__ | 123 | #ifndef __ASSEMBLY__ |
119 | 124 | ||
diff --git a/include/asm-powerpc/lppaca.h b/include/asm-powerpc/lppaca.h index ff82ea7c48..cd9f11f1ef 100644 --- a/include/asm-powerpc/lppaca.h +++ b/include/asm-powerpc/lppaca.h | |||
@@ -29,7 +29,9 @@ | |||
29 | //---------------------------------------------------------------------------- | 29 | //---------------------------------------------------------------------------- |
30 | #include <asm/types.h> | 30 | #include <asm/types.h> |
31 | 31 | ||
32 | struct lppaca { | 32 | /* The Hypervisor barfs if the lppaca crosses a page boundary. A 1k |
33 | * alignment is sufficient to prevent this */ | ||
34 | struct __attribute__((__aligned__(0x400))) lppaca { | ||
33 | //============================================================================= | 35 | //============================================================================= |
34 | // CACHE_LINE_1 0x0000 - 0x007F Contains read-only data | 36 | // CACHE_LINE_1 0x0000 - 0x007F Contains read-only data |
35 | // NOTE: The xDynXyz fields are fields that will be dynamically changed by | 37 | // NOTE: The xDynXyz fields are fields that will be dynamically changed by |
@@ -129,5 +131,7 @@ struct lppaca { | |||
129 | u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF | 131 | u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF |
130 | }; | 132 | }; |
131 | 133 | ||
134 | extern struct lppaca lppaca[]; | ||
135 | |||
132 | #endif /* __KERNEL__ */ | 136 | #endif /* __KERNEL__ */ |
133 | #endif /* _ASM_POWERPC_LPPACA_H */ | 137 | #endif /* _ASM_POWERPC_LPPACA_H */ |
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h index a64b4d425d..c9add8f1ad 100644 --- a/include/asm-powerpc/paca.h +++ b/include/asm-powerpc/paca.h | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | register struct paca_struct *local_paca asm("r13"); | 24 | register struct paca_struct *local_paca asm("r13"); |
25 | #define get_paca() local_paca | 25 | #define get_paca() local_paca |
26 | #define get_lppaca() (get_paca()->lppaca_ptr) | ||
26 | 27 | ||
27 | struct task_struct; | 28 | struct task_struct; |
28 | 29 | ||
@@ -95,19 +96,6 @@ struct paca_struct { | |||
95 | u64 saved_r1; /* r1 save for RTAS calls */ | 96 | u64 saved_r1; /* r1 save for RTAS calls */ |
96 | u64 saved_msr; /* MSR saved here by enter_rtas */ | 97 | u64 saved_msr; /* MSR saved here by enter_rtas */ |
97 | u8 proc_enabled; /* irq soft-enable flag */ | 98 | u8 proc_enabled; /* irq soft-enable flag */ |
98 | |||
99 | /* | ||
100 | * iSeries structure which the hypervisor knows about - | ||
101 | * this structure should not cross a page boundary. | ||
102 | * The vpa_init/register_vpa call is now known to fail if the | ||
103 | * lppaca structure crosses a page boundary. | ||
104 | * The lppaca is also used on POWER5 pSeries boxes. | ||
105 | * The lppaca is 640 bytes long, and cannot readily change | ||
106 | * since the hypervisor knows its layout, so a 1kB | ||
107 | * alignment will suffice to ensure that it doesn't | ||
108 | * cross a page boundary. | ||
109 | */ | ||
110 | struct lppaca lppaca __attribute__((__aligned__(0x400))); | ||
111 | }; | 99 | }; |
112 | 100 | ||
113 | extern struct paca_struct paca[]; | 101 | extern struct paca_struct paca[]; |
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h index 0dc798d46e..ab8688d390 100644 --- a/include/asm-powerpc/ppc_asm.h +++ b/include/asm-powerpc/ppc_asm.h | |||
@@ -156,52 +156,56 @@ n: | |||
156 | #endif | 156 | #endif |
157 | 157 | ||
158 | /* | 158 | /* |
159 | * LOADADDR( rn, name ) | 159 | * LOAD_REG_IMMEDIATE(rn, expr) |
160 | * loads the address of 'name' into 'rn' | 160 | * Loads the value of the constant expression 'expr' into register 'rn' |
161 | * using immediate instructions only. Use this when it's important not | ||
162 | * to reference other data (i.e. on ppc64 when the TOC pointer is not | ||
163 | * valid). | ||
161 | * | 164 | * |
162 | * LOADBASE( rn, name ) | 165 | * LOAD_REG_ADDR(rn, name) |
163 | * loads the address (possibly without the low 16 bits) of 'name' into 'rn' | 166 | * Loads the address of label 'name' into register 'rn'. Use this when |
164 | * suitable for base+disp addressing | 167 | * you don't particularly need immediate instructions only, but you need |
168 | * the whole address in one register (e.g. it's a structure address and | ||
169 | * you want to access various offsets within it). On ppc32 this is | ||
170 | * identical to LOAD_REG_IMMEDIATE. | ||
171 | * | ||
172 | * LOAD_REG_ADDRBASE(rn, name) | ||
173 | * ADDROFF(name) | ||
174 | * LOAD_REG_ADDRBASE loads part of the address of label 'name' into | ||
175 | * register 'rn'. ADDROFF(name) returns the remainder of the address as | ||
176 | * a constant expression. ADDROFF(name) is a signed expression < 16 bits | ||
177 | * in size, so is suitable for use directly as an offset in load and store | ||
178 | * instructions. Use this when loading/storing a single word or less as: | ||
179 | * LOAD_REG_ADDRBASE(rX, name) | ||
180 | * ld rY,ADDROFF(name)(rX) | ||
165 | */ | 181 | */ |
166 | #ifdef __powerpc64__ | 182 | #ifdef __powerpc64__ |
167 | #define LOADADDR(rn,name) \ | 183 | #define LOAD_REG_IMMEDIATE(reg,expr) \ |
168 | lis rn,name##@highest; \ | 184 | lis (reg),(expr)@highest; \ |
169 | ori rn,rn,name##@higher; \ | 185 | ori (reg),(reg),(expr)@higher; \ |
170 | rldicr rn,rn,32,31; \ | 186 | rldicr (reg),(reg),32,31; \ |
171 | oris rn,rn,name##@h; \ | 187 | oris (reg),(reg),(expr)@h; \ |
172 | ori rn,rn,name##@l | 188 | ori (reg),(reg),(expr)@l; |
173 | 189 | ||
174 | #define LOADBASE(rn,name) \ | 190 | #define LOAD_REG_ADDR(reg,name) \ |
175 | ld rn,name@got(r2) | 191 | ld (reg),name@got(r2) |
176 | 192 | ||
177 | #define OFF(name) 0 | 193 | #define LOAD_REG_ADDRBASE(reg,name) LOAD_REG_ADDR(reg,name) |
178 | 194 | #define ADDROFF(name) 0 | |
179 | #define SET_REG_TO_CONST(reg, value) \ | ||
180 | lis reg,(((value)>>48)&0xFFFF); \ | ||
181 | ori reg,reg,(((value)>>32)&0xFFFF); \ | ||
182 | rldicr reg,reg,32,31; \ | ||
183 | oris reg,reg,(((value)>>16)&0xFFFF); \ | ||
184 | ori reg,reg,((value)&0xFFFF); | ||
185 | |||
186 | #define SET_REG_TO_LABEL(reg, label) \ | ||
187 | lis reg,(label)@highest; \ | ||
188 | ori reg,reg,(label)@higher; \ | ||
189 | rldicr reg,reg,32,31; \ | ||
190 | oris reg,reg,(label)@h; \ | ||
191 | ori reg,reg,(label)@l; | ||
192 | 195 | ||
193 | /* offsets for stack frame layout */ | 196 | /* offsets for stack frame layout */ |
194 | #define LRSAVE 16 | 197 | #define LRSAVE 16 |
195 | 198 | ||
196 | #else /* 32-bit */ | 199 | #else /* 32-bit */ |
197 | #define LOADADDR(rn,name) \ | ||
198 | lis rn,name@ha; \ | ||
199 | addi rn,rn,name@l | ||
200 | 200 | ||
201 | #define LOADBASE(rn,name) \ | 201 | #define LOAD_REG_IMMEDIATE(reg,expr) \ |
202 | lis rn,name@ha | 202 | lis (reg),(expr)@ha; \ |
203 | addi (reg),(reg),(expr)@l; | ||
204 | |||
205 | #define LOAD_REG_ADDR(reg,name) LOAD_REG_IMMEDIATE(reg, name) | ||
203 | 206 | ||
204 | #define OFF(name) name@l | 207 | #define LOAD_REG_ADDRBASE(reg, name) lis (reg),name@ha |
208 | #define ADDROFF(name) name@l | ||
205 | 209 | ||
206 | /* offsets for stack frame layout */ | 210 | /* offsets for stack frame layout */ |
207 | #define LRSAVE 4 | 211 | #define LRSAVE 4 |
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 329e9bf622..5b2bd4eefb 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
@@ -87,6 +87,7 @@ struct device_node { | |||
87 | char *full_name; | 87 | char *full_name; |
88 | 88 | ||
89 | struct property *properties; | 89 | struct property *properties; |
90 | struct property *deadprops; /* removed properties */ | ||
90 | struct device_node *parent; | 91 | struct device_node *parent; |
91 | struct device_node *child; | 92 | struct device_node *child; |
92 | struct device_node *sibling; | 93 | struct device_node *sibling; |
@@ -135,6 +136,9 @@ extern struct device_node *of_find_all_nodes(struct device_node *prev); | |||
135 | extern struct device_node *of_get_parent(const struct device_node *node); | 136 | extern struct device_node *of_get_parent(const struct device_node *node); |
136 | extern struct device_node *of_get_next_child(const struct device_node *node, | 137 | extern struct device_node *of_get_next_child(const struct device_node *node, |
137 | struct device_node *prev); | 138 | struct device_node *prev); |
139 | extern struct property *of_find_property(struct device_node *np, | ||
140 | const char *name, | ||
141 | int *lenp); | ||
138 | extern struct device_node *of_node_get(struct device_node *node); | 142 | extern struct device_node *of_node_get(struct device_node *node); |
139 | extern void of_node_put(struct device_node *node); | 143 | extern void of_node_put(struct device_node *node); |
140 | 144 | ||
@@ -164,6 +168,10 @@ extern int prom_n_size_cells(struct device_node* np); | |||
164 | extern int prom_n_intr_cells(struct device_node* np); | 168 | extern int prom_n_intr_cells(struct device_node* np); |
165 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); | 169 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); |
166 | extern int prom_add_property(struct device_node* np, struct property* prop); | 170 | extern int prom_add_property(struct device_node* np, struct property* prop); |
171 | extern int prom_remove_property(struct device_node *np, struct property *prop); | ||
172 | extern int prom_update_property(struct device_node *np, | ||
173 | struct property *newprop, | ||
174 | struct property *oldprop); | ||
167 | 175 | ||
168 | #ifdef CONFIG_PPC32 | 176 | #ifdef CONFIG_PPC32 |
169 | /* | 177 | /* |
diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h index 754900901c..895cb6d3a4 100644 --- a/include/asm-powerpc/spinlock.h +++ b/include/asm-powerpc/spinlock.h | |||
@@ -46,7 +46,7 @@ static __inline__ unsigned long __spin_trylock(raw_spinlock_t *lock) | |||
46 | 46 | ||
47 | token = LOCK_TOKEN; | 47 | token = LOCK_TOKEN; |
48 | __asm__ __volatile__( | 48 | __asm__ __volatile__( |
49 | "1: lwarx %0,0,%2 # __spin_trylock\n\ | 49 | "1: lwarx %0,0,%2\n\ |
50 | cmpwi 0,%0,0\n\ | 50 | cmpwi 0,%0,0\n\ |
51 | bne- 2f\n\ | 51 | bne- 2f\n\ |
52 | stwcx. %1,0,%2\n\ | 52 | stwcx. %1,0,%2\n\ |
@@ -80,7 +80,7 @@ static int __inline__ __raw_spin_trylock(raw_spinlock_t *lock) | |||
80 | 80 | ||
81 | #if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES) | 81 | #if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES) |
82 | /* We only yield to the hypervisor if we are in shared processor mode */ | 82 | /* We only yield to the hypervisor if we are in shared processor mode */ |
83 | #define SHARED_PROCESSOR (get_paca()->lppaca.shared_proc) | 83 | #define SHARED_PROCESSOR (get_lppaca()->shared_proc) |
84 | extern void __spin_yield(raw_spinlock_t *lock); | 84 | extern void __spin_yield(raw_spinlock_t *lock); |
85 | extern void __rw_yield(raw_rwlock_t *lock); | 85 | extern void __rw_yield(raw_rwlock_t *lock); |
86 | #else /* SPLPAR || ISERIES */ | 86 | #else /* SPLPAR || ISERIES */ |
@@ -124,8 +124,8 @@ static void __inline__ __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long | |||
124 | 124 | ||
125 | static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock) | 125 | static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock) |
126 | { | 126 | { |
127 | __asm__ __volatile__(SYNC_ON_SMP" # __raw_spin_unlock" | 127 | __asm__ __volatile__("# __raw_spin_unlock\n\t" |
128 | : : :"memory"); | 128 | LWSYNC_ON_SMP: : :"memory"); |
129 | lock->slock = 0; | 129 | lock->slock = 0; |
130 | } | 130 | } |
131 | 131 | ||
@@ -167,7 +167,7 @@ static long __inline__ __read_trylock(raw_rwlock_t *rw) | |||
167 | long tmp; | 167 | long tmp; |
168 | 168 | ||
169 | __asm__ __volatile__( | 169 | __asm__ __volatile__( |
170 | "1: lwarx %0,0,%1 # read_trylock\n" | 170 | "1: lwarx %0,0,%1\n" |
171 | __DO_SIGN_EXTEND | 171 | __DO_SIGN_EXTEND |
172 | " addic. %0,%0,1\n\ | 172 | " addic. %0,%0,1\n\ |
173 | ble- 2f\n" | 173 | ble- 2f\n" |
@@ -192,7 +192,7 @@ static __inline__ long __write_trylock(raw_rwlock_t *rw) | |||
192 | 192 | ||
193 | token = WRLOCK_TOKEN; | 193 | token = WRLOCK_TOKEN; |
194 | __asm__ __volatile__( | 194 | __asm__ __volatile__( |
195 | "1: lwarx %0,0,%2 # write_trylock\n\ | 195 | "1: lwarx %0,0,%2\n\ |
196 | cmpwi 0,%0,0\n\ | 196 | cmpwi 0,%0,0\n\ |
197 | bne- 2f\n" | 197 | bne- 2f\n" |
198 | PPC405_ERR77(0,%1) | 198 | PPC405_ERR77(0,%1) |
@@ -249,8 +249,9 @@ static void __inline__ __raw_read_unlock(raw_rwlock_t *rw) | |||
249 | long tmp; | 249 | long tmp; |
250 | 250 | ||
251 | __asm__ __volatile__( | 251 | __asm__ __volatile__( |
252 | "eieio # read_unlock\n\ | 252 | "# read_unlock\n\t" |
253 | 1: lwarx %0,0,%1\n\ | 253 | LWSYNC_ON_SMP |
254 | "1: lwarx %0,0,%1\n\ | ||
254 | addic %0,%0,-1\n" | 255 | addic %0,%0,-1\n" |
255 | PPC405_ERR77(0,%1) | 256 | PPC405_ERR77(0,%1) |
256 | " stwcx. %0,0,%1\n\ | 257 | " stwcx. %0,0,%1\n\ |
@@ -262,8 +263,8 @@ static void __inline__ __raw_read_unlock(raw_rwlock_t *rw) | |||
262 | 263 | ||
263 | static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) | 264 | static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) |
264 | { | 265 | { |
265 | __asm__ __volatile__(SYNC_ON_SMP" # write_unlock" | 266 | __asm__ __volatile__("# write_unlock\n\t" |
266 | : : :"memory"); | 267 | LWSYNC_ON_SMP: : :"memory"); |
267 | rw->lock = 0; | 268 | rw->lock = 0; |
268 | } | 269 | } |
269 | 270 | ||
diff --git a/include/asm-powerpc/synch.h b/include/asm-powerpc/synch.h index 794870ab8f..c90d9d9aae 100644 --- a/include/asm-powerpc/synch.h +++ b/include/asm-powerpc/synch.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _ASM_POWERPC_SYNCH_H | 2 | #define _ASM_POWERPC_SYNCH_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #include <linux/stringify.h> | ||
6 | |||
5 | #ifdef __powerpc64__ | 7 | #ifdef __powerpc64__ |
6 | #define __SUBARCH_HAS_LWSYNC | 8 | #define __SUBARCH_HAS_LWSYNC |
7 | #endif | 9 | #endif |
@@ -12,20 +14,12 @@ | |||
12 | # define LWSYNC sync | 14 | # define LWSYNC sync |
13 | #endif | 15 | #endif |
14 | 16 | ||
15 | |||
16 | /* | ||
17 | * Arguably the bitops and *xchg operations don't imply any memory barrier | ||
18 | * or SMP ordering, but in fact a lot of drivers expect them to imply | ||
19 | * both, since they do on x86 cpus. | ||
20 | */ | ||
21 | #ifdef CONFIG_SMP | 17 | #ifdef CONFIG_SMP |
22 | #define EIEIO_ON_SMP "eieio\n" | ||
23 | #define ISYNC_ON_SMP "\n\tisync" | 18 | #define ISYNC_ON_SMP "\n\tisync" |
24 | #define SYNC_ON_SMP __stringify(LWSYNC) "\n" | 19 | #define LWSYNC_ON_SMP __stringify(LWSYNC) "\n" |
25 | #else | 20 | #else |
26 | #define EIEIO_ON_SMP | ||
27 | #define ISYNC_ON_SMP | 21 | #define ISYNC_ON_SMP |
28 | #define SYNC_ON_SMP | 22 | #define LWSYNC_ON_SMP |
29 | #endif | 23 | #endif |
30 | 24 | ||
31 | static inline void eieio(void) | 25 | static inline void eieio(void) |
@@ -38,14 +32,5 @@ static inline void isync(void) | |||
38 | __asm__ __volatile__ ("isync" : : : "memory"); | 32 | __asm__ __volatile__ ("isync" : : : "memory"); |
39 | } | 33 | } |
40 | 34 | ||
41 | #ifdef CONFIG_SMP | ||
42 | #define eieio_on_smp() eieio() | ||
43 | #define isync_on_smp() isync() | ||
44 | #else | ||
45 | #define eieio_on_smp() __asm__ __volatile__("": : :"memory") | ||
46 | #define isync_on_smp() __asm__ __volatile__("": : :"memory") | ||
47 | #endif | ||
48 | |||
49 | #endif /* __KERNEL__ */ | 35 | #endif /* __KERNEL__ */ |
50 | #endif /* _ASM_POWERPC_SYNCH_H */ | 36 | #endif /* _ASM_POWERPC_SYNCH_H */ |
51 | |||
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index 9b822afa7d..d9bf53653b 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -212,7 +212,7 @@ __xchg_u32(volatile void *p, unsigned long val) | |||
212 | unsigned long prev; | 212 | unsigned long prev; |
213 | 213 | ||
214 | __asm__ __volatile__( | 214 | __asm__ __volatile__( |
215 | EIEIO_ON_SMP | 215 | LWSYNC_ON_SMP |
216 | "1: lwarx %0,0,%2 \n" | 216 | "1: lwarx %0,0,%2 \n" |
217 | PPC405_ERR77(0,%2) | 217 | PPC405_ERR77(0,%2) |
218 | " stwcx. %3,0,%2 \n\ | 218 | " stwcx. %3,0,%2 \n\ |
@@ -232,7 +232,7 @@ __xchg_u64(volatile void *p, unsigned long val) | |||
232 | unsigned long prev; | 232 | unsigned long prev; |
233 | 233 | ||
234 | __asm__ __volatile__( | 234 | __asm__ __volatile__( |
235 | EIEIO_ON_SMP | 235 | LWSYNC_ON_SMP |
236 | "1: ldarx %0,0,%2 \n" | 236 | "1: ldarx %0,0,%2 \n" |
237 | PPC405_ERR77(0,%2) | 237 | PPC405_ERR77(0,%2) |
238 | " stdcx. %3,0,%2 \n\ | 238 | " stdcx. %3,0,%2 \n\ |
@@ -287,7 +287,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) | |||
287 | unsigned int prev; | 287 | unsigned int prev; |
288 | 288 | ||
289 | __asm__ __volatile__ ( | 289 | __asm__ __volatile__ ( |
290 | EIEIO_ON_SMP | 290 | LWSYNC_ON_SMP |
291 | "1: lwarx %0,0,%2 # __cmpxchg_u32\n\ | 291 | "1: lwarx %0,0,%2 # __cmpxchg_u32\n\ |
292 | cmpw 0,%0,%3\n\ | 292 | cmpw 0,%0,%3\n\ |
293 | bne- 2f\n" | 293 | bne- 2f\n" |
@@ -311,7 +311,7 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) | |||
311 | unsigned long prev; | 311 | unsigned long prev; |
312 | 312 | ||
313 | __asm__ __volatile__ ( | 313 | __asm__ __volatile__ ( |
314 | EIEIO_ON_SMP | 314 | LWSYNC_ON_SMP |
315 | "1: ldarx %0,0,%2 # __cmpxchg_u64\n\ | 315 | "1: ldarx %0,0,%2 # __cmpxchg_u64\n\ |
316 | cmpd 0,%0,%3\n\ | 316 | cmpd 0,%0,%3\n\ |
317 | bne- 2f\n\ | 317 | bne- 2f\n\ |
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index d9b86a1727..baddc9ab57 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h | |||
@@ -175,11 +175,10 @@ static inline void set_dec(int val) | |||
175 | set_dec_cpu6(val); | 175 | set_dec_cpu6(val); |
176 | #else | 176 | #else |
177 | #ifdef CONFIG_PPC_ISERIES | 177 | #ifdef CONFIG_PPC_ISERIES |
178 | struct paca_struct *lpaca = get_paca(); | ||
179 | int cur_dec; | 178 | int cur_dec; |
180 | 179 | ||
181 | if (lpaca->lppaca.shared_proc) { | 180 | if (get_lppaca()->shared_proc) { |
182 | lpaca->lppaca.virtual_decr = val; | 181 | get_lppaca()->virtual_decr = val; |
183 | cur_dec = get_dec(); | 182 | cur_dec = get_dec(); |
184 | if (cur_dec > val) | 183 | if (cur_dec > val) |
185 | HvCall_setVirtualDecr(); | 184 | HvCall_setVirtualDecr(); |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 74488e4916..aa6322d451 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -146,6 +146,11 @@ struct property; | |||
146 | extern void proc_device_tree_init(void); | 146 | extern void proc_device_tree_init(void); |
147 | extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); | 147 | extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); |
148 | extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); | 148 | extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); |
149 | extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde, | ||
150 | struct property *prop); | ||
151 | extern void proc_device_tree_update_prop(struct proc_dir_entry *pde, | ||
152 | struct property *newprop, | ||
153 | struct property *oldprop); | ||
149 | #endif /* CONFIG_PROC_DEVICETREE */ | 154 | #endif /* CONFIG_PROC_DEVICETREE */ |
150 | 155 | ||
151 | extern struct proc_dir_entry *proc_symlink(const char *, | 156 | extern struct proc_dir_entry *proc_symlink(const char *, |