Path: blob/master/arch/powerpc/kernel/cpu_setup_power7.S
10818 views
/*1* This file contains low level CPU setup functions.2* Copyright (C) 2003 Benjamin Herrenschmidt ([email protected])3*4* This program is free software; you can redistribute it and/or5* modify it under the terms of the GNU General Public License6* as published by the Free Software Foundation; either version7* 2 of the License, or (at your option) any later version.8*9*/1011#include <asm/processor.h>12#include <asm/page.h>13#include <asm/cputable.h>14#include <asm/ppc_asm.h>15#include <asm/asm-offsets.h>16#include <asm/cache.h>1718/* Entry: r3 = crap, r4 = ptr to cputable entry19*20* Note that we can be called twice for pseudo-PVRs21*/22_GLOBAL(__setup_cpu_power7)23mflr r1124bl __init_hvmode_20625mtlr r1126beqlr27li r0,028mtspr SPRN_LPID,r029bl __init_LPCR30bl __init_TLB31mtlr r1132blr3334_GLOBAL(__restore_cpu_power7)35mflr r1136mfmsr r337rldicl. r0,r3,4,6338beqlr39li r0,040mtspr SPRN_LPID,r041bl __init_LPCR42bl __init_TLB43mtlr r1144blr4546__init_hvmode_206:47/* Disable CPU_FTR_HVMODE_206 and exit if MSR:HV is not set */48mfmsr r349rldicl. r0,r3,4,6350bnelr51ld r5,CPU_SPEC_FEATURES(r4)52LOAD_REG_IMMEDIATE(r6,CPU_FTR_HVMODE_206)53xor r5,r5,r654std r5,CPU_SPEC_FEATURES(r4)55blr5657__init_LPCR:58/* Setup a sane LPCR:59*60* LPES = 0b01 (HSRR0/1 used for 0x500)61* PECE = 0b11162* DPFD = 463*64* Other bits untouched for now65*/66mfspr r3,SPRN_LPCR67ori r3,r3,(LPCR_LPES0|LPCR_LPES1)68xori r3,r3, LPCR_LPES069ori r3,r3,(LPCR_PECE0|LPCR_PECE1|LPCR_PECE2)70li r5,771sldi r5,r5,LPCR_DPFD_SH72andc r3,r3,r573li r5,474sldi r5,r5,LPCR_DPFD_SH75or r3,r3,r576mtspr SPRN_LPCR,r377isync78blr7980__init_TLB:81/* Clear the TLB */82li r6,12883mtctr r684li r7,0xc00 /* IS field = 0b11 */85ptesync862: tlbiel r787addi r7,r7,0x100088bdnz 2b89ptesync901: blr919293