Merge remote-tracking branch 'scott/next' into next
Freescale updates from Scott. Mostly support for critical and machine check exceptions on 64-bit BookE, some new PCI suspend/resume work and misc bits.
···88Required properties :99 - compatible : Should be "fsl-usb2-mph" for multi port host USB1010 controllers, or "fsl-usb2-dr" for dual role USB controllers1111- or "fsl,mpc5121-usb2-dr" for dual role USB controllers of MPC51211111+ or "fsl,mpc5121-usb2-dr" for dual role USB controllers of MPC5121.1212+ Wherever applicable, the IP version of the USB controller should1313+ also be mentioned (for eg. fsl-usb2-dr-v2.2 for bsc9132).1214 - phy_type : For multi port host USB controllers, should be one of1315 "ulpi", or "serial". For dual role USB controllers, should be1416 one of "ulpi", "utmi", "utmi_wide", or "serial".
···287287extern int mmu_vmemmap_psize;288288289289struct tlb_core_data {290290+ /*291291+ * Per-core spinlock for e6500 TLB handlers (no tlbsrx.)292292+ * Must be the first struct element.293293+ */294294+ u8 lock;295295+290296 /* For software way selection, as on Freescale TLB1 */291297 u8 esel_next, esel_max, esel_first;292292-293293- /* Per-core spinlock for e6500 TLB handlers (no tlbsrx.) */294294- u8 lock;295298};296299297300#ifdef CONFIG_PPC64
+6-3
arch/powerpc/include/asm/paca.h
···116116 /* Shared by all threads of a core -- points to tcd of first thread */117117 struct tlb_core_data *tcd_ptr;118118119119- /* We can have up to 3 levels of reentrancy in the TLB miss handler */120120- u64 extlb[3][EX_TLB_SIZE / sizeof(u64)];119119+ /*120120+ * We can have up to 3 levels of reentrancy in the TLB miss handler,121121+ * in each of four exception levels (normal, crit, mcheck, debug).122122+ */123123+ u64 extlb[12][EX_TLB_SIZE / sizeof(u64)];121124 u64 exmc[8]; /* used for machine checks */122125 u64 excrit[8]; /* used for crit interrupts */123126 u64 exdbg[8]; /* used for debug interrupts */···149146 u8 io_sync; /* writel() needs spin_unlock sync */150147 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */151148 u8 nap_state_lost; /* NV GPR values lost in power7_idle */152152- u64 sprg3; /* Saved user-visible sprg */149149+ u64 sprg_vdso; /* Saved user-visible sprg */153150#ifdef CONFIG_PPC_TRANSACTIONAL_MEM154151 u64 tm_scratch; /* TM scratch area for reclaim */155152#endif
···715715 unsigned long cpu, node, val;716716717717 /*718718- * SPRG3 contains the CPU in the bottom 16 bits and the NUMA node in719719- * the next 16 bits. The VDSO uses this to implement getcpu().718718+ * SPRG_VDSO contains the CPU in the bottom 16 bits and the NUMA node719719+ * in the next 16 bits. The VDSO uses this to implement getcpu().720720 */721721 cpu = get_cpu();722722 WARN_ON_ONCE(cpu > 0xffff);···725725 WARN_ON_ONCE(node > 0xffff);726726727727 val = (cpu & 0xfff) | ((node & 0xffff) << 16);728728- mtspr(SPRN_SPRG3, val);729729- get_paca()->sprg3 = val;728728+ mtspr(SPRN_SPRG_VDSO_WRITE, val);729729+ get_paca()->sprg_vdso = val;730730731731 put_cpu();732732
···3939 * *4040 **********************************************************************/41414242+/*4343+ * Note that, unlike non-bolted handlers, TLB_EXFRAME is not4444+ * modified by the TLB miss handlers themselves, since the TLB miss4545+ * handler code will not itself cause a recursive TLB miss.4646+ *4747+ * TLB_EXFRAME will be modified when crit/mc/debug exceptions are4848+ * entered/exited.4949+ */4250.macro tlb_prolog_bolted intnum addr4343- mtspr SPRN_SPRG_GEN_SCRATCH,r135151+ mtspr SPRN_SPRG_GEN_SCRATCH,r125252+ mfspr r12,SPRN_SPRG_TLB_EXFRAME5353+ std r13,EX_TLB_R13(r12)5454+ std r10,EX_TLB_R10(r12)4455 mfspr r13,SPRN_SPRG_PACA4545- std r10,PACA_EXTLB+EX_TLB_R10(r13)5656+4657 mfcr r104747- std r11,PACA_EXTLB+EX_TLB_R11(r13)5858+ std r11,EX_TLB_R11(r12)4859#ifdef CONFIG_KVM_BOOKE_HV4960BEGIN_FTR_SECTION5061 mfspr r11, SPRN_SRR15162END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)5263#endif5364 DO_KVM \intnum, SPRN_SRR15454- std r16,PACA_EXTLB+EX_TLB_R16(r13)6565+ std r16,EX_TLB_R16(r12)5566 mfspr r16,\addr /* get faulting address */5656- std r14,PACA_EXTLB+EX_TLB_R14(r13)6767+ std r14,EX_TLB_R14(r12)5768 ld r14,PACAPGD(r13)5858- std r15,PACA_EXTLB+EX_TLB_R15(r13)5959- std r10,PACA_EXTLB+EX_TLB_CR(r13)6060- TLB_MISS_PROLOG_STATS_BOLTED6969+ std r15,EX_TLB_R15(r12)7070+ std r10,EX_TLB_CR(r12)7171+ TLB_MISS_PROLOG_STATS6172.endm62736374.macro tlb_epilog_bolted6464- ld r14,PACA_EXTLB+EX_TLB_CR(r13)6565- ld r10,PACA_EXTLB+EX_TLB_R10(r13)6666- ld r11,PACA_EXTLB+EX_TLB_R11(r13)7575+ ld r14,EX_TLB_CR(r12)7676+ ld r10,EX_TLB_R10(r12)7777+ ld r11,EX_TLB_R11(r12)7878+ ld r13,EX_TLB_R13(r12)6779 mtcr r146868- ld r14,PACA_EXTLB+EX_TLB_R14(r13)6969- ld r15,PACA_EXTLB+EX_TLB_R15(r13)7070- TLB_MISS_RESTORE_STATS_BOLTED7171- ld r16,PACA_EXTLB+EX_TLB_R16(r13)7272- mfspr r13,SPRN_SPRG_GEN_SCRATCH8080+ ld r14,EX_TLB_R14(r12)8181+ ld r15,EX_TLB_R15(r12)8282+ TLB_MISS_RESTORE_STATS8383+ ld r16,EX_TLB_R16(r12)8484+ mfspr r12,SPRN_SPRG_GEN_SCRATCH7385.endm74867587/* Data TLB miss */···296284 * r14 = page table base297285 * r13 = PACA298286 * r11 = tlb_per_core ptr299299- * r10 = crap (free to use)287287+ * r10 = cpu number300288 */301289tlb_miss_common_e6500:302290 /*···305293 *306294 * MAS6:IND should be already set based on MAS4307295 */308308- addi r10,r11,TCD_LOCK309309-1: lbarx r15,0,r10296296+1: lbarx r15,0,r11297297+ lhz r10,PACAPACAINDEX(r13)310298 cmpdi r15,0299299+ cmpdi cr1,r15,1 /* set cr1.eq = 0 for non-recursive */311300 bne 2f312312- li r15,1313313- stbcx. r15,0,r10301301+ stbcx. r10,0,r11314302 bne 1b303303+3:315304 .subsection 1316316-2: lbz r15,0(r10)305305+2: cmpd cr1,r15,r10 /* recursive lock due to mcheck/crit/etc? */306306+ beq cr1,3b /* unlock will happen if cr1.eq = 0 */307307+ lbz r15,0(r11)317308 cmpdi r15,0318309 bne 2b319310 b 1b···394379395380tlb_miss_done_e6500:396381 .macro tlb_unlock_e6500382382+ beq cr1,1f /* no unlock if lock was recursively grabbed */397383 li r15,0398384 isync399399- stb r15,TCD_LOCK(r11)385385+ stb r15,0(r11)386386+1:400387 .endm401388402389 tlb_unlock_e6500
+11
arch/powerpc/mm/tlb_nohash.c
···144144int book3e_htw_mode; /* HW tablewalk? Value is PPC_HTW_* */145145unsigned long linear_map_top; /* Top of linear mapping */146146147147+148148+/*149149+ * Number of bytes to add to SPRN_SPRG_TLB_EXFRAME on crit/mcheck/debug150150+ * exceptions. This is used for bolted and e6500 TLB miss handlers which151151+ * do not modify this SPRG in the TLB miss code; for other TLB miss handlers,152152+ * this is set to zero.153153+ */154154+int extlb_level_exc;155155+147156#endif /* CONFIG_PPC64 */148157149158#ifdef CONFIG_PPC_FSL_BOOK3E···568559 break;569560#ifdef CONFIG_PPC_FSL_BOOK3E570561 case PPC_HTW_E6500:562562+ extlb_level_exc = EX_TLB_SIZE;571563 patch_exception(0x1c0, exc_data_tlb_miss_e6500_book3e);572564 patch_exception(0x1e0, exc_instruction_tlb_miss_e6500_book3e);573565 break;···662652 memblock_enforce_memory_limit(linear_map_top);663653664654 if (book3e_htw_mode == PPC_HTW_NONE) {655655+ extlb_level_exc = EX_TLB_SIZE;665656 patch_exception(0x1c0, exc_data_tlb_miss_bolted_book3e);666657 patch_exception(0x1e0,667658 exc_instruction_tlb_miss_bolted_book3e);
···138138 val &= ~WDTP_MASK;139139 val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period));140140141141-#ifdef CONFIG_PPC_BOOK3E_64142142- /*143143- * Crit ints are currently broken on PPC64 Book-E, so144144- * just disable them for now.145145- */146146- val &= ~TCR_WIE;147147-#endif148148-149141 mtspr(SPRN_TCR, val);150142}151143