/* SPDX-License-Identifier: GPL-2.0-or-later */
/* low-level asm for "intrigue" (PA8500-8700 CPU perf counters)
*
* Copyright (C) 2001 Randolph Chung <tausq at parisc-linux.org>
* Copyright (C) 2001 Hewlett-Packard (Grant Grundler)
*/
#include <asm/assembly.h>
#include <linux/init.h>
#include <linux/linkage.h>
#ifdef CONFIG_64BIT
.level 2.0w
#endif /* CONFIG_64BIT */
#define MTDIAG_1(gr) .word 0x14201840 + gr*0x10000
#define MTDIAG_2(gr) .word 0x14401840 + gr*0x10000
#define MFDIAG_1(gr) .word 0x142008A0 + gr
#define MFDIAG_2(gr) .word 0x144008A0 + gr
#define STDIAG(dr) .word 0x14000AA0 + dr*0x200000
#define SFDIAG(dr) .word 0x14000BA0 + dr*0x200000
#define DR2_SLOW_RET 53
;
; Enable the performance counters
;
; The coprocessor only needs to be enabled when
; starting/stopping the coprocessor with the pmenb/pmdis.
;
.text
ENTRY(perf_intrigue_enable_perf_counters)
.proc
.callinfo frame=0,NO_CALLS
.entry
ldi 0x20,%r25 ; load up perfmon bit
mfctl ccr,%r26 ; get coprocessor register
or %r25,%r26,%r26 ; set bit
mtctl %r26,ccr ; turn on performance coprocessor
pmenb ; enable performance monitor
ssm 0,0 ; dummy op to ensure completion
sync ; follow ERS
andcm %r26,%r25,%r26 ; clear bit now
mtctl %r26,ccr ; turn off performance coprocessor
nop ; NOPs as specified in ERS
nop
nop
nop
nop
nop
nop
bve (%r2)
nop
.exit
.procend
ENDPROC(perf_intrigue_enable_perf_counters)
ENTRY(perf_intrigue_disable_perf_counters)
.proc
.callinfo frame=0,NO_CALLS
.entry
ldi 0x20,%r25 ; load up perfmon bit
mfctl ccr,%r26 ; get coprocessor register
or %r25,%r26,%r26 ; set bit
mtctl %r26,ccr ; turn on performance coprocessor
pmdis ; disable performance monitor
ssm 0,0 ; dummy op to ensure completion
andcm %r26,%r25,%r26 ; clear bit now
bve (%r2)
mtctl %r26,ccr ; turn off performance coprocessor
.exit
.procend
ENDPROC(perf_intrigue_disable_perf_counters)
;***********************************************************************
;*
;
|