xref: /linux/arch/sparc/include/asm/pcr.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
23eb8057bSDavid S. Miller #ifndef __PCR_H
33eb8057bSDavid S. Miller #define __PCR_H
43eb8057bSDavid S. Miller 
53eb8057bSDavid S. Miller struct pcr_ops {
609d053c7SDavid S. Miller 	u64 (*read_pcr)(unsigned long);
709d053c7SDavid S. Miller 	void (*write_pcr)(unsigned long, u64);
809d053c7SDavid S. Miller 	u64 (*read_pic)(unsigned long);
909d053c7SDavid S. Miller 	void (*write_pic)(unsigned long, u64);
1073a6b053SDavid S. Miller 	u64 (*nmi_picl_value)(unsigned int nmi_hz);
11ce4a925cSDavid S. Miller 	u64 pcr_nmi_enable;
12ce4a925cSDavid S. Miller 	u64 pcr_nmi_disable;
133eb8057bSDavid S. Miller };
143eb8057bSDavid S. Miller extern const struct pcr_ops *pcr_ops;
153eb8057bSDavid S. Miller 
16f05a6865SSam Ravnborg void deferred_pcr_work_irq(int irq, struct pt_regs *regs);
17f05a6865SSam Ravnborg void schedule_deferred_pcr_work(void);
183eb8057bSDavid S. Miller 
193eb8057bSDavid S. Miller #define PCR_PIC_PRIV		0x00000001 /* PIC access is privileged */
203eb8057bSDavid S. Miller #define PCR_STRACE		0x00000002 /* Trace supervisor events  */
213eb8057bSDavid S. Miller #define PCR_UTRACE		0x00000004 /* Trace user events        */
223eb8057bSDavid S. Miller #define PCR_N2_HTRACE		0x00000008 /* Trace hypervisor events  */
233eb8057bSDavid S. Miller #define PCR_N2_TOE_OV0		0x00000010 /* Trap if PIC 0 overflows  */
243eb8057bSDavid S. Miller #define PCR_N2_TOE_OV1		0x00000020 /* Trap if PIC 1 overflows  */
253eb8057bSDavid S. Miller #define PCR_N2_MASK0		0x00003fc0
263eb8057bSDavid S. Miller #define PCR_N2_MASK0_SHIFT	6
273eb8057bSDavid S. Miller #define PCR_N2_SL0		0x0003c000
283eb8057bSDavid S. Miller #define PCR_N2_SL0_SHIFT	14
293eb8057bSDavid S. Miller #define PCR_N2_OV0		0x00040000
303eb8057bSDavid S. Miller #define PCR_N2_MASK1		0x07f80000
313eb8057bSDavid S. Miller #define PCR_N2_MASK1_SHIFT	19
323eb8057bSDavid S. Miller #define PCR_N2_SL1		0x78000000
333eb8057bSDavid S. Miller #define PCR_N2_SL1_SHIFT	27
343eb8057bSDavid S. Miller #define PCR_N2_OV1		0x80000000
353eb8057bSDavid S. Miller 
366faaeb8eSDavid S. Miller #define PCR_N4_OV		0x00000001 /* PIC overflow             */
376faaeb8eSDavid S. Miller #define PCR_N4_TOE		0x00000002 /* Trap On Event            */
386faaeb8eSDavid S. Miller #define PCR_N4_UTRACE		0x00000004 /* Trace user events        */
396faaeb8eSDavid S. Miller #define PCR_N4_STRACE		0x00000008 /* Trace supervisor events  */
406faaeb8eSDavid S. Miller #define PCR_N4_HTRACE		0x00000010 /* Trace hypervisor events  */
416faaeb8eSDavid S. Miller #define PCR_N4_MASK		0x000007e0 /* Event mask               */
426faaeb8eSDavid S. Miller #define PCR_N4_MASK_SHIFT	5
436faaeb8eSDavid S. Miller #define PCR_N4_SL		0x0000f800 /* Event Select             */
446faaeb8eSDavid S. Miller #define PCR_N4_SL_SHIFT		11
456faaeb8eSDavid S. Miller #define PCR_N4_PICNPT		0x00010000 /* PIC non-privileged trap  */
466faaeb8eSDavid S. Miller #define PCR_N4_PICNHT		0x00020000 /* PIC non-hypervisor trap  */
476faaeb8eSDavid S. Miller #define PCR_N4_NTC		0x00040000 /* Next-To-Commit wrap      */
486faaeb8eSDavid S. Miller 
49f05a6865SSam Ravnborg int pcr_arch_init(void);
50b62818e5SDavid S. Miller 
513eb8057bSDavid S. Miller #endif /* __PCR_H */
52