1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  *   linux/arch/parisc/kernel/pa7300lc.c
4  *	- PA7300LC-specific functions
5  *
6  *   Copyright (C) 2000 Philipp Rumpf */
7 
8 #include <linux/sched.h>
9 #include <linux/sched/debug.h>
10 #include <linux/smp.h>
11 #include <linux/kernel.h>
12 #include <asm/io.h>
13 #include <asm/ptrace.h>
14 #include <asm/machdep.h>
15 
16 /* CPU register indices */
17 
18 #define MIOC_STATUS	0xf040
19 #define MIOC_CONTROL	0xf080
20 #define MDERRADD	0xf0e0
21 #define DMAERR		0xf0e8
22 #define DIOERR		0xf0ec
23 #define HIDMAMEM	0xf0f4
24 
25 /* this returns the HPA of the CPU it was called on */
cpu_hpa(void)26 static u32 cpu_hpa(void)
27 {
28 	return 0xfffb0000;
29 }
30 
pa7300lc_lpmc(int code,struct pt_regs * regs)31 static void pa7300lc_lpmc(int code, struct pt_regs *regs)
32 {
33 	u32 hpa;
34 	printk(KERN_WARNING "LPMC on CPU %d\n", smp_processor_id());
35 
36 	show_regs(regs);
37 
38 	hpa = cpu_hpa();
39 	printk(KERN_WARNING
40 		"MIOC_CONTROL %08x\n" "MIOC_STATUS  %08x\n"
41 		"MDERRADD     %08x\n" "DMAERR       %08x\n"
42 		"DIOERR       %08x\n" "HIDMAMEM     %08x\n",
43 		gsc_readl(hpa+MIOC_CONTROL), gsc_readl(hpa+MIOC_STATUS),
44 		gsc_readl(hpa+MDERRADD), gsc_readl(hpa+DMAERR),
45 		gsc_readl(hpa+DIOERR), gsc_readl(hpa+HIDMAMEM));
46 }
47 
pa7300lc_init(void)48 void pa7300lc_init(void)
49 {
50 	cpu_lpmc = pa7300lc_lpmc;
51 }
52