1 #ifndef __MACH_SDK7786_FPGA_H
2 #define __MACH_SDK7786_FPGA_H
5 #include <linux/types.h>
6 #include <linux/bitops.h>
9 #define SRSTR_MAGIC 0x1971 /* Fixed magical read value */
14 #define INTTESTR 0x040
20 #define NMIMR_MAN_NMIM BIT(0) /* Manual NMI mask */
21 #define NMIMR_AUX_NMIM BIT(1) /* Auxiliary NMI mask */
41 #define SCBR_I2CMEN BIT(0) /* FPGA I2C master enable */
42 #define SCBR_I2CCEN BIT(1) /* CPU I2C master enable */
45 #define PWRCR_SCISEL0 BIT(0)
46 #define PWRCR_SCISEL1 BIT(1)
47 #define PWRCR_SCIEN BIT(2) /* Serial port enable */
48 #define PWRCR_PDWNACK BIT(5) /* Power down acknowledge */
49 #define PWRCR_PDWNREQ BIT(7) /* Power down request */
50 #define PWRCR_INT2 BIT(11) /* INT2 connection to power manager */
51 #define PWRCR_BUPINIT BIT(13) /* DDR backup initialize */
52 #define PWRCR_BKPRST BIT(15) /* Backup power reset */
69 #define IASELR10 0x2a0
70 #define IASELR11 0x2b0
71 #define IASELR12 0x2c0
72 #define IASELR13 0x2d0
73 #define IASELR14 0x2e0
74 #define IASELR15 0x2f0
85 #define IBSELR10 0x3a0
86 #define IBSELR11 0x3b0
87 #define IBSELR12 0x3c0
88 #define IBSELR13 0x3d0
89 #define IBSELR14 0x3e0
90 #define IBSELR15 0x3f0
101 /* arch/sh/boards/mach-sdk7786/fpga.c */
102 extern void __iomem
*sdk7786_fpga_base
;
103 extern void sdk7786_fpga_init(void);
105 #define SDK7786_FPGA_REGADDR(reg) (sdk7786_fpga_base + (reg))
108 * A convenience wrapper from register offset to internal I2C address,
109 * when the FPGA is in I2C slave mode.
111 #define SDK7786_FPGA_I2CADDR(reg) ((reg) >> 3)
113 static inline u16
fpga_read_reg(unsigned int reg
)
115 return ioread16(sdk7786_fpga_base
+ reg
);
118 static inline void fpga_write_reg(u16 val
, unsigned int reg
)
120 iowrite16(val
, sdk7786_fpga_base
+ reg
);
123 #endif /* __MACH_SDK7786_FPGA_H */