1 #ifndef BCM63XX_DEV_SPI_H
2 #define BCM63XX_DEV_SPI_H
4 #include <linux/types.h>
5 #include <bcm63xx_io.h>
6 #include <bcm63xx_regs.h>
8 int __init
bcm63xx_spi_register(void);
10 struct bcm63xx_spi_pdata
{
11 unsigned int fifo_size
;
12 unsigned int msg_type_shift
;
13 unsigned int msg_ctl_width
;
18 enum bcm63xx_regs_spi
{
33 #define __GEN_SPI_RSET_BASE(__cpu, __rset) \
35 return SPI_## __cpu ##_## __rset;
37 #define __GEN_SPI_RSET(__cpu) \
39 __GEN_SPI_RSET_BASE(__cpu, CMD) \
40 __GEN_SPI_RSET_BASE(__cpu, INT_STATUS) \
41 __GEN_SPI_RSET_BASE(__cpu, INT_MASK_ST) \
42 __GEN_SPI_RSET_BASE(__cpu, INT_MASK) \
43 __GEN_SPI_RSET_BASE(__cpu, ST) \
44 __GEN_SPI_RSET_BASE(__cpu, CLK_CFG) \
45 __GEN_SPI_RSET_BASE(__cpu, FILL_BYTE) \
46 __GEN_SPI_RSET_BASE(__cpu, MSG_TAIL) \
47 __GEN_SPI_RSET_BASE(__cpu, RX_TAIL) \
48 __GEN_SPI_RSET_BASE(__cpu, MSG_CTL) \
49 __GEN_SPI_RSET_BASE(__cpu, MSG_DATA) \
50 __GEN_SPI_RSET_BASE(__cpu, RX_DATA) \
53 #define __GEN_SPI_REGS_TABLE(__cpu) \
54 [SPI_CMD] = SPI_## __cpu ##_CMD, \
55 [SPI_INT_STATUS] = SPI_## __cpu ##_INT_STATUS, \
56 [SPI_INT_MASK_ST] = SPI_## __cpu ##_INT_MASK_ST, \
57 [SPI_INT_MASK] = SPI_## __cpu ##_INT_MASK, \
58 [SPI_ST] = SPI_## __cpu ##_ST, \
59 [SPI_CLK_CFG] = SPI_## __cpu ##_CLK_CFG, \
60 [SPI_FILL_BYTE] = SPI_## __cpu ##_FILL_BYTE, \
61 [SPI_MSG_TAIL] = SPI_## __cpu ##_MSG_TAIL, \
62 [SPI_RX_TAIL] = SPI_## __cpu ##_RX_TAIL, \
63 [SPI_MSG_CTL] = SPI_## __cpu ##_MSG_CTL, \
64 [SPI_MSG_DATA] = SPI_## __cpu ##_MSG_DATA, \
65 [SPI_RX_DATA] = SPI_## __cpu ##_RX_DATA,
67 static inline unsigned long bcm63xx_spireg(enum bcm63xx_regs_spi reg
)
69 #ifdef BCMCPU_RUNTIME_DETECT
70 extern const unsigned long *bcm63xx_regs_spi
;
72 return bcm63xx_regs_spi
[reg
];
74 #if defined(CONFIG_BCM63XX_CPU_6338) || defined(CONFIG_BCM63XX_CPU_6348)
77 #if defined(CONFIG_BCM63XX_CPU_6358) || defined(CONFIG_BCM63XX_CPU_6362) || \
78 defined(CONFIG_BCM63XX_CPU_6368)
85 #endif /* BCM63XX_DEV_SPI_H */