Skip to content

Commit d8bfb96

Browse files
committed
Merge tag 'powerpc-4.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull more powerpc updates from Michael Ellerman: "Some more powerpc updates for 4.9: Freescale updates from Scott Wood: - qbman support (a prerequisite for datapath drivers such as ethernet) - a PCI DMA fix+improvement - reset handler changes - more 8xx optimizations - some cleanups and fixes.' Fixes: - selftests/powerpc: Add missing binaries to .gitignores (Michael Ellerman) - selftests/powerpc: Fix build break caused by EXPORT_SYMBOL changes (Michael Ellerman) - powerpc/pseries: Fix stack corruption in htpe code (Laurent Dufour) - powerpc/64s: Fix power4_fixup_nap placement (Nicholas Piggin) - powerpc/64: Fix incorrect return value from __copy_tofrom_user (Paul Mackerras) - powerpc/mm/hash64: Fix might_have_hea() check (Michael Ellerman) Other: - MAINTAINERS: Remove myself from PA Semi entries (Olof Johansson) - MAINTAINERS: Drop separate pseries entry (Michael Ellerman) - MAINTAINERS: Update powerpc website & add selftests (Michael Ellerman): * tag 'powerpc-4.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (35 commits) powerpc/mm/hash64: Fix might_have_hea() check powerpc/64: Fix incorrect return value from __copy_tofrom_user powerpc/64s: Fix power4_fixup_nap placement powerpc/pseries: Fix stack corruption in htpe code selftests/powerpc: Fix build break caused by EXPORT_SYMBOL changes MAINTAINERS: Update powerpc website & add selftests MAINTAINERS: Drop separate pseries entry MAINTAINERS: Remove myself from PA Semi entries selftests/powerpc: Add missing binaries to .gitignores arch/powerpc: Add CONFIG_FSL_DPAA to corenetXX_smp_defconfig soc/qman: Add self-test for QMan driver soc/bman: Add self-test for BMan driver soc/fsl: Introduce DPAA 1.x QMan device driver soc/fsl: Introduce DPAA 1.x BMan device driver powerpc/8xx: make user addr DTLB miss the short path powerpc/8xx: Move additional DTLBMiss handlers out of exception area powerpc/8xx: use r3 to scratch CR in ITLBmiss soc/fsl/qe: fix gpio save_regs functions powerpc/8xx: add dedicated machine check handler powerpc/8xx: add system_reset_exception ...
2 parents 11ed3e0 + 08bf75b commit d8bfb96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+8631
-266
lines changed

MAINTAINERS

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7201,17 +7201,11 @@ F: drivers/lightnvm/
72017201
F: include/linux/lightnvm.h
72027202
F: include/uapi/linux/lightnvm.h
72037203

7204-
LINUX FOR IBM pSERIES (RS/6000)
7205-
M: Paul Mackerras <[email protected]>
7206-
W: http://www.ibm.com/linux/ltc/projects/ppc
7207-
S: Supported
7208-
F: arch/powerpc/boot/rs6000.h
7209-
72107204
LINUX FOR POWERPC (32-BIT AND 64-BIT)
72117205
M: Benjamin Herrenschmidt <[email protected]>
72127206
M: Paul Mackerras <[email protected]>
72137207
M: Michael Ellerman <[email protected]>
7214-
W: http://www.penguinppc.org/
7208+
W: https://github.com/linuxppc/linux/wiki
72157209
72167210
Q: http://patchwork.ozlabs.org/project/linuxppc-dev/list/
72177211
T: git git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
@@ -7226,6 +7220,7 @@ F: drivers/net/ethernet/ibm/ibmvnic.*
72267220
F: drivers/pci/hotplug/pnv_php.c
72277221
F: drivers/pci/hotplug/rpa*
72287222
F: drivers/scsi/ibmvscsi/
7223+
F: tools/testing/selftests/powerpc
72297224
N: opal
72307225
N: /pmac
72317226
N: powermac
@@ -7282,9 +7277,8 @@ F: arch/powerpc/platforms/83xx/
72827277
F: arch/powerpc/platforms/85xx/
72837278

72847279
LINUX FOR POWERPC PA SEMI PWRFICIENT
7285-
M: Olof Johansson <[email protected]>
72867280
7287-
S: Maintained
7281+
S: Orphan
72887282
F: arch/powerpc/platforms/pasemi/
72897283
F: drivers/*/*pasemi*
72907284
F: drivers/*/*/*pasemi*
@@ -9019,15 +9013,13 @@ S: Maintained
90199013
F: drivers/net/wireless/intersil/p54/
90209014

90219015
PA SEMI ETHERNET DRIVER
9022-
M: Olof Johansson <[email protected]>
90239016
9024-
S: Maintained
9017+
S: Orphan
90259018
F: drivers/net/ethernet/pasemi/*
90269019

90279020
PA SEMI SMBUS DRIVER
9028-
M: Olof Johansson <[email protected]>
90299021
9030-
S: Maintained
9022+
S: Orphan
90319023
F: drivers/i2c/busses/i2c-pasemi.c
90329024

90339025
PADATA PARALLEL EXECUTION MECHANISM

arch/powerpc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ mpc85xx_smp_defconfig:
318318
PHONY += corenet32_smp_defconfig
319319
corenet32_smp_defconfig:
320320
$(call merge_into_defconfig,corenet_basic_defconfig,\
321-
85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw)
321+
85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw dpaa)
322322

323323
PHONY += corenet64_smp_defconfig
324324
corenet64_smp_defconfig:
325325
$(call merge_into_defconfig,corenet_basic_defconfig,\
326-
85xx-64bit 85xx-smp altivec 85xx-hw fsl-emb-nonhw)
326+
85xx-64bit 85xx-smp altivec 85xx-hw fsl-emb-nonhw dpaa)
327327

328328
PHONY += mpc86xx_defconfig
329329
mpc86xx_defconfig:

arch/powerpc/configs/dpaa.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_FSL_DPAA=y

arch/powerpc/include/asm/cputable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ extern int machine_check_e500mc(struct pt_regs *regs);
4343
extern int machine_check_e500(struct pt_regs *regs);
4444
extern int machine_check_e200(struct pt_regs *regs);
4545
extern int machine_check_47x(struct pt_regs *regs);
46+
int machine_check_8xx(struct pt_regs *regs);
4647

4748
extern void cpu_down_flush_e500v2(void);
4849
extern void cpu_down_flush_e500mc(void);

arch/powerpc/include/asm/hw_irq.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ static inline unsigned long arch_local_irq_save(void)
155155
unsigned long flags = arch_local_save_flags();
156156
#ifdef CONFIG_BOOKE
157157
asm volatile("wrteei 0" : : : "memory");
158+
#elif defined(CONFIG_PPC_8xx)
159+
wrtspr(SPRN_EID);
158160
#else
159161
SET_MSR_EE(flags & ~MSR_EE);
160162
#endif
@@ -165,6 +167,8 @@ static inline void arch_local_irq_disable(void)
165167
{
166168
#ifdef CONFIG_BOOKE
167169
asm volatile("wrteei 0" : : : "memory");
170+
#elif defined(CONFIG_PPC_8xx)
171+
wrtspr(SPRN_EID);
168172
#else
169173
arch_local_irq_save();
170174
#endif
@@ -174,6 +178,8 @@ static inline void arch_local_irq_enable(void)
174178
{
175179
#ifdef CONFIG_BOOKE
176180
asm volatile("wrteei 1" : : : "memory");
181+
#elif defined(CONFIG_PPC_8xx)
182+
wrtspr(SPRN_EIE);
177183
#else
178184
unsigned long msr = mfmsr();
179185
SET_MSR_EE(msr | MSR_EE);

arch/powerpc/include/asm/ppc-opcode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
#define PPC_INST_LWSYNC 0x7c2004ac
153153
#define PPC_INST_SYNC 0x7c0004ac
154154
#define PPC_INST_SYNC_MASK 0xfc0007fe
155+
#define PPC_INST_ISYNC 0x4c00012c
155156
#define PPC_INST_LXVD2X 0x7c000698
156157
#define PPC_INST_MCRXR 0x7c000400
157158
#define PPC_INST_MCRXR_MASK 0xfc0007fe

arch/powerpc/include/asm/reg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,8 @@ static inline void mtmsr_isync(unsigned long val)
12501250
: "r" ((unsigned long)(v)) \
12511251
: "memory")
12521252
#endif
1253+
#define wrtspr(rn) asm volatile("mtspr " __stringify(rn) ",0" : \
1254+
: : "memory")
12531255

12541256
extern unsigned long msr_check_and_set(unsigned long bits);
12551257
extern bool strict_msr_control;

arch/powerpc/include/asm/reg_8xx.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
#define SPRN_MD_RAM0 825
2626
#define SPRN_MD_RAM1 826
2727

28+
/* Special MSR manipulation registers */
29+
#define SPRN_EIE 80 /* External interrupt enable (EE=1, RI=1) */
30+
#define SPRN_EID 81 /* External interrupt disable (EE=0, RI=1) */
31+
2832
/* Commands. Only the first few are available to the instruction cache.
2933
*/
3034
#define IDC_ENABLE 0x02000000 /* Cache enable */

arch/powerpc/kernel/cputable.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
12481248
.mmu_features = MMU_FTR_TYPE_8xx,
12491249
.icache_bsize = 16,
12501250
.dcache_bsize = 16,
1251+
.machine_check = machine_check_8xx,
12511252
.platform = "ppc823",
12521253
},
12531254
#endif /* CONFIG_8xx */

arch/powerpc/kernel/exceptions-64s.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ __end_interrupts:
13771377
DEFINE_FIXED_SYMBOL(__end_interrupts)
13781378

13791379
#ifdef CONFIG_PPC_970_NAP
1380-
TRAMP_REAL_BEGIN(power4_fixup_nap)
1380+
EXC_COMMON_BEGIN(power4_fixup_nap)
13811381
andc r9,r9,r10
13821382
std r9,TI_LOCAL_FLAGS(r11)
13831383
ld r10,_LINK(r1) /* make idle task do the */

arch/powerpc/kernel/head_8xx.S

Lines changed: 63 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ i##n: \
226226
ret_from_except)
227227

228228
/* System reset */
229-
EXCEPTION(0x100, Reset, unknown_exception, EXC_XFER_STD)
229+
EXCEPTION(0x100, Reset, system_reset_exception, EXC_XFER_STD)
230230

231231
/* Machine check */
232232
. = 0x200
@@ -321,31 +321,28 @@ SystemCall:
321321
#endif
322322

323323
InstructionTLBMiss:
324-
#ifdef CONFIG_8xx_CPU6
324+
#if defined(CONFIG_8xx_CPU6) || defined(CONFIG_MODULES) || defined (CONFIG_DEBUG_PAGEALLOC)
325325
mtspr SPRN_SPRG_SCRATCH2, r3
326326
#endif
327327
EXCEPTION_PROLOG_0
328328

329329
/* If we are faulting a kernel address, we have to use the
330330
* kernel page tables.
331331
*/
332+
mfspr r10, SPRN_SRR0 /* Get effective address of fault */
333+
INVALIDATE_ADJACENT_PAGES_CPU15(r11, r10)
332334
#if defined(CONFIG_MODULES) || defined (CONFIG_DEBUG_PAGEALLOC)
333335
/* Only modules will cause ITLB Misses as we always
334336
* pin the first 8MB of kernel memory */
335-
mfspr r11, SPRN_SRR0 /* Get effective address of fault */
336-
INVALIDATE_ADJACENT_PAGES_CPU15(r10, r11)
337-
mfcr r10
338-
IS_KERNEL(r11, r11)
337+
mfcr r3
338+
IS_KERNEL(r11, r10)
339+
#endif
339340
mfspr r11, SPRN_M_TW /* Get level 1 table */
341+
#if defined(CONFIG_MODULES) || defined (CONFIG_DEBUG_PAGEALLOC)
340342
BRANCH_UNLESS_KERNEL(3f)
341343
lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
342344
3:
343-
mtcr r10
344-
mfspr r10, SPRN_SRR0 /* Get effective address of fault */
345-
#else
346-
mfspr r10, SPRN_SRR0 /* Get effective address of fault */
347-
INVALIDATE_ADJACENT_PAGES_CPU15(r11, r10)
348-
mfspr r11, SPRN_M_TW /* Get level 1 table base address */
345+
mtcr r3
349346
#endif
350347
/* Insert level 1 index */
351348
rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29
@@ -377,58 +374,39 @@ InstructionTLBMiss:
377374
MTSPR_CPU6(SPRN_MI_RPN, r10, r3) /* Update TLB entry */
378375

379376
/* Restore registers */
380-
#ifdef CONFIG_8xx_CPU6
377+
#if defined(CONFIG_8xx_CPU6) || defined(CONFIG_MODULES) || defined (CONFIG_DEBUG_PAGEALLOC)
381378
mfspr r3, SPRN_SPRG_SCRATCH2
382379
#endif
383380
EXCEPTION_EPILOG_0
384381
rfi
385382

386-
/*
387-
* Bottom part of DataStoreTLBMiss handler for IMMR area
388-
* not enough space in the DataStoreTLBMiss area
389-
*/
390-
DTLBMissIMMR:
391-
mtcr r10
392-
/* Set 512k byte guarded page and mark it valid */
393-
li r10, MD_PS512K | MD_GUARDED | MD_SVALID
394-
MTSPR_CPU6(SPRN_MD_TWC, r10, r11)
395-
mfspr r10, SPRN_IMMR /* Get current IMMR */
396-
rlwinm r10, r10, 0, 0xfff80000 /* Get 512 kbytes boundary */
397-
ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \
398-
_PAGE_PRESENT | _PAGE_NO_CACHE
399-
MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */
400-
401-
li r11, RPN_PATTERN
402-
mtspr SPRN_DAR, r11 /* Tag DAR */
403-
EXCEPTION_EPILOG_0
404-
rfi
405-
406383
. = 0x1200
407384
DataStoreTLBMiss:
385+
mtspr SPRN_SPRG_SCRATCH2, r3
408386
EXCEPTION_PROLOG_0
409-
mfcr r10
387+
mfcr r3
410388

411389
/* If we are faulting a kernel address, we have to use the
412390
* kernel page tables.
413391
*/
414-
mfspr r11, SPRN_MD_EPN
415-
rlwinm r11, r11, 16, 0xfff8
392+
mfspr r10, SPRN_MD_EPN
393+
rlwinm r10, r10, 16, 0xfff8
394+
cmpli cr0, r10, PAGE_OFFSET@h
395+
mfspr r11, SPRN_M_TW /* Get level 1 table */
396+
blt+ 3f
416397
#ifndef CONFIG_PIN_TLB_IMMR
417-
cmpli cr0, r11, VIRT_IMMR_BASE@h
398+
cmpli cr0, r10, VIRT_IMMR_BASE@h
418399
#endif
419-
cmpli cr7, r11, PAGE_OFFSET@h
400+
_ENTRY(DTLBMiss_cmp)
401+
cmpli cr7, r10, (PAGE_OFFSET + 0x1800000)@h
402+
lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
420403
#ifndef CONFIG_PIN_TLB_IMMR
421404
_ENTRY(DTLBMiss_jmp)
422405
beq- DTLBMissIMMR
423406
#endif
424-
bge- cr7, 4f
425-
426-
mfspr r11, SPRN_M_TW /* Get level 1 table */
407+
blt cr7, DTLBMissLinear
427408
3:
428-
mtcr r10
429-
#ifdef CONFIG_8xx_CPU6
430-
mtspr SPRN_SPRG_SCRATCH2, r3
431-
#endif
409+
mtcr r3
432410
mfspr r10, SPRN_MD_EPN
433411

434412
/* Insert level 1 index */
@@ -481,30 +459,7 @@ _ENTRY(DTLBMiss_jmp)
481459
MTSPR_CPU6(SPRN_MD_RPN, r10, r3) /* Update TLB entry */
482460

483461
/* Restore registers */
484-
#ifdef CONFIG_8xx_CPU6
485462
mfspr r3, SPRN_SPRG_SCRATCH2
486-
#endif
487-
mtspr SPRN_DAR, r11 /* Tag DAR */
488-
EXCEPTION_EPILOG_0
489-
rfi
490-
491-
4:
492-
_ENTRY(DTLBMiss_cmp)
493-
cmpli cr0, r11, (PAGE_OFFSET + 0x1800000)@h
494-
lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
495-
bge- 3b
496-
497-
mtcr r10
498-
/* Set 8M byte page and mark it valid */
499-
li r10, MD_PS8MEG | MD_SVALID
500-
MTSPR_CPU6(SPRN_MD_TWC, r10, r11)
501-
mfspr r10, SPRN_MD_EPN
502-
rlwinm r10, r10, 0, 0x0f800000 /* 8xx supports max 256Mb RAM */
503-
ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \
504-
_PAGE_PRESENT
505-
MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */
506-
507-
li r11, RPN_PATTERN
508463
mtspr SPRN_DAR, r11 /* Tag DAR */
509464
EXCEPTION_EPILOG_0
510465
rfi
@@ -570,6 +525,43 @@ DARFixed:/* Return from dcbx instruction bug workaround */
570525

571526
. = 0x2000
572527

528+
/*
529+
* Bottom part of DataStoreTLBMiss handlers for IMMR area and linear RAM.
530+
* not enough space in the DataStoreTLBMiss area.
531+
*/
532+
DTLBMissIMMR:
533+
mtcr r3
534+
/* Set 512k byte guarded page and mark it valid */
535+
li r10, MD_PS512K | MD_GUARDED | MD_SVALID
536+
MTSPR_CPU6(SPRN_MD_TWC, r10, r11)
537+
mfspr r10, SPRN_IMMR /* Get current IMMR */
538+
rlwinm r10, r10, 0, 0xfff80000 /* Get 512 kbytes boundary */
539+
ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \
540+
_PAGE_PRESENT | _PAGE_NO_CACHE
541+
MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */
542+
543+
li r11, RPN_PATTERN
544+
mtspr SPRN_DAR, r11 /* Tag DAR */
545+
mfspr r3, SPRN_SPRG_SCRATCH2
546+
EXCEPTION_EPILOG_0
547+
rfi
548+
549+
DTLBMissLinear:
550+
mtcr r3
551+
/* Set 8M byte page and mark it valid */
552+
li r11, MD_PS8MEG | MD_SVALID
553+
MTSPR_CPU6(SPRN_MD_TWC, r11, r3)
554+
rlwinm r10, r10, 16, 0x0f800000 /* 8xx supports max 256Mb RAM */
555+
ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \
556+
_PAGE_PRESENT
557+
MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */
558+
559+
li r11, RPN_PATTERN
560+
mtspr SPRN_DAR, r11 /* Tag DAR */
561+
mfspr r3, SPRN_SPRG_SCRATCH2
562+
EXCEPTION_EPILOG_0
563+
rfi
564+
573565
/* This is the procedure to calculate the data EA for buggy dcbx,dcbi instructions
574566
* by decoding the registers used by the dcbx instruction and adding them.
575567
* DAR is set to the calculated address.
@@ -586,7 +578,9 @@ FixupDAR:/* Entry point for dcbx workaround. */
586578
rlwinm r11, r10, 16, 0xfff8
587579
_ENTRY(FixupDAR_cmp)
588580
cmpli cr7, r11, (PAGE_OFFSET + 0x1800000)@h
589-
blt- cr7, 200f
581+
/* create physical page address from effective address */
582+
tophys(r11, r10)
583+
blt- cr7, 201f
590584
lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
591585
/* Insert level 1 index */
592586
3: rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29
@@ -616,10 +610,6 @@ _ENTRY(FixupDAR_cmp)
616610
141: mfspr r10,SPRN_SPRG_SCRATCH2
617611
b DARFixed /* Nope, go back to normal TLB processing */
618612

619-
/* create physical page address from effective address */
620-
200: tophys(r11, r10)
621-
b 201b
622-
623613
144: mfspr r10, SPRN_DSISR
624614
rlwinm r10, r10,0,7,5 /* Clear store bit for buggy dcbst insn */
625615
mtspr SPRN_DSISR, r10

0 commit comments

Comments
 (0)