1284345Ssjg/* SPDX-License-Identifier: GPL-2.0 */
2284345Ssjg#ifndef LINUX_BCMA_DRIVER_MIPS_H_
3284345Ssjg#define LINUX_BCMA_DRIVER_MIPS_H_
4284345Ssjg
5284345Ssjg#define BCMA_MIPS_IPSFLAG		0x0F08
6284345Ssjg/* which sbflags get routed to mips interrupt 1 */
7284345Ssjg#define  BCMA_MIPS_IPSFLAG_IRQ1		0x0000003F
8284345Ssjg#define  BCMA_MIPS_IPSFLAG_IRQ1_SHIFT	0
9284345Ssjg/* which sbflags get routed to mips interrupt 2 */
10284345Ssjg#define  BCMA_MIPS_IPSFLAG_IRQ2		0x00003F00
11284345Ssjg#define  BCMA_MIPS_IPSFLAG_IRQ2_SHIFT	8
12284345Ssjg/* which sbflags get routed to mips interrupt 3 */
13284345Ssjg#define  BCMA_MIPS_IPSFLAG_IRQ3		0x003F0000
14284345Ssjg#define  BCMA_MIPS_IPSFLAG_IRQ3_SHIFT	16
15284345Ssjg/* which sbflags get routed to mips interrupt 4 */
16284345Ssjg#define  BCMA_MIPS_IPSFLAG_IRQ4		0x3F000000
17284345Ssjg#define  BCMA_MIPS_IPSFLAG_IRQ4_SHIFT	24
18284345Ssjg
19284345Ssjg/* MIPS 74K core registers */
20284345Ssjg#define BCMA_MIPS_MIPS74K_CORECTL	0x0000
21284345Ssjg#define BCMA_MIPS_MIPS74K_EXCEPTBASE	0x0004
22284345Ssjg#define BCMA_MIPS_MIPS74K_BIST		0x000C
23284345Ssjg#define BCMA_MIPS_MIPS74K_INTMASK_INT0	0x0014
24#define BCMA_MIPS_MIPS74K_INTMASK(int) \
25	((int) * 4 + BCMA_MIPS_MIPS74K_INTMASK_INT0)
26#define BCMA_MIPS_MIPS74K_NMIMASK	0x002C
27#define BCMA_MIPS_MIPS74K_GPIOSEL	0x0040
28#define BCMA_MIPS_MIPS74K_GPIOOUT	0x0044
29#define BCMA_MIPS_MIPS74K_GPIOEN	0x0048
30#define BCMA_MIPS_MIPS74K_CLKCTLST	0x01E0
31
32#define BCMA_MIPS_OOBSELINA74		0x004
33#define BCMA_MIPS_OOBSELOUTA30		0x100
34
35struct bcma_device;
36
37struct bcma_drv_mips {
38	struct bcma_device *core;
39	u8 setup_done:1;
40	u8 early_setup_done:1;
41};
42
43extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
44
45#endif /* LINUX_BCMA_DRIVER_MIPS_H_ */
46