Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-17
STALE3732d

[PATCH 1/4] powerpc/perf: Initialise PMU related regs on POWER9

From: Madhavan Srinivasan <hidden>
Date: 2016-06-11 07:19:31
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

Add two new init functions __init_PMU_300 and __init_PMU_HV_300
to initialise PMU related regs on POWER9.

Signed-off-by: Madhavan Srinivasan <redacted>
---
 arch/powerpc/kernel/cpu_setup_power.S | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff --git a/arch/powerpc/kernel/cpu_setup_power.S b/arch/powerpc/kernel/cpu_setup_power.S
index 584e119fa8b0..a2080fde0cc5 100644
--- a/arch/powerpc/kernel/cpu_setup_power.S
+++ b/arch/powerpc/kernel/cpu_setup_power.S
@@ -87,6 +87,7 @@ _GLOBAL(__restore_cpu_power8)
 _GLOBAL(__setup_cpu_power9)
 	mflr	r11
 	bl	__init_FSCR
+	bl	__init_PMU_300
 	bl	__init_hvmode_206
 	mtlr	r11
 	beqlr
@@ -97,12 +98,14 @@ _GLOBAL(__setup_cpu_power9)
 	bl	__init_LPCR
 	bl	__init_HFSCR
 	bl	__init_tlb_power9
+	bl	__init_PMU_HV_300
 	mtlr	r11
 	blr
 
 _GLOBAL(__restore_cpu_power9)
 	mflr	r11
 	bl	__init_FSCR
+	bl	__init_PMU_300
 	mfmsr	r3
 	rldicl.	r0,r3,4,63
 	mtlr	r11
@@ -114,6 +117,7 @@ _GLOBAL(__restore_cpu_power9)
 	bl	__init_LPCR
 	bl	__init_HFSCR
 	bl	__init_tlb_power9
+	bl	__init_PMU_HV_300
 	mtlr	r11
 	blr
 
@@ -219,3 +223,16 @@ __init_PMU:
 	mtspr	SPRN_MMCR1,r5
 	mtspr	SPRN_MMCR2,r5
 	blr
+
+__init_PMU_HV_300:
+	li	r5,0
+	mtspr	SPRN_MMCRC,r5
+	blr
+
+__init_PMU_300:
+	li	r5,0
+	mtspr	SPRN_MMCRA,r5
+	mtspr	SPRN_MMCR0,r5
+	mtspr	SPRN_MMCR1,r5
+	mtspr	SPRN_MMCR2,r5
+	blr
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help