mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-27 05:32:27 +00:00
daf799cca8
Pull MIPS updates from Ralf Baechle: - More work on DT support for various platforms - Various fixes that were to late to make it straight into 3.9 - Improved platform support, in particular the Netlogic XLR and BCM63xx, and the SEAD3 and Malta eval boards. - Support for several Ralink SOC families. - Complete support for the microMIPS ASE which basically reencodes the existing MIPS32/MIPS64 ISA to use non-constant size instructions. - Some fallout from LTO work which remove old cruft and will generally make the MIPS kernel easier to maintain and resistant to compiler optimization, even in absence of LTO. - KVM support. While MIPS has announced hardware virtualization extensions this KVM extension uses trap and emulate mode for virtualization of MIPS32. More KVM work to add support for VZ hardware virtualizaiton extensions and MIPS64 will probably already be merged for 3.11. Most of this has been sitting in -next for a long time. All defconfigs have been build or run time tested except three for which fixes are being sent by other maintainers. Semantic conflict with kvm updates done as per Ralf * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (118 commits) MIPS: Add new GIC clockevent driver. MIPS: Formatting clean-ups for clocksources. MIPS: Refactor GIC clocksource code. MIPS: Move 'gic_frequency' to common location. MIPS: Move 'gic_present' to common location. MIPS: MIPS16e: Add unaligned access support. MIPS: MIPS16e: Support handling of delay slots. MIPS: MIPS16e: Add instruction formats. MIPS: microMIPS: Optimise 'strnlen' core library function. MIPS: microMIPS: Optimise 'strlen' core library function. MIPS: microMIPS: Optimise 'strncpy' core library function. MIPS: microMIPS: Optimise 'memset' core library function. MIPS: microMIPS: Add configuration option for microMIPS kernel. MIPS: microMIPS: Disable LL/SC and fix linker bug. MIPS: microMIPS: Add vdso support. MIPS: microMIPS: Add unaligned access support. MIPS: microMIPS: Support handling of delay slots. MIPS: microMIPS: Add support for exception handling. MIPS: microMIPS: Floating point support. MIPS: microMIPS: Fix macro naming in micro-assembler. ...
86 lines
2.2 KiB
C
86 lines
2.2 KiB
C
#ifndef BCM63XX_DEV_SPI_H
|
|
#define BCM63XX_DEV_SPI_H
|
|
|
|
#include <linux/types.h>
|
|
#include <bcm63xx_io.h>
|
|
#include <bcm63xx_regs.h>
|
|
|
|
int __init bcm63xx_spi_register(void);
|
|
|
|
struct bcm63xx_spi_pdata {
|
|
unsigned int fifo_size;
|
|
unsigned int msg_type_shift;
|
|
unsigned int msg_ctl_width;
|
|
int bus_num;
|
|
int num_chipselect;
|
|
};
|
|
|
|
enum bcm63xx_regs_spi {
|
|
SPI_CMD,
|
|
SPI_INT_STATUS,
|
|
SPI_INT_MASK_ST,
|
|
SPI_INT_MASK,
|
|
SPI_ST,
|
|
SPI_CLK_CFG,
|
|
SPI_FILL_BYTE,
|
|
SPI_MSG_TAIL,
|
|
SPI_RX_TAIL,
|
|
SPI_MSG_CTL,
|
|
SPI_MSG_DATA,
|
|
SPI_RX_DATA,
|
|
};
|
|
|
|
#define __GEN_SPI_RSET_BASE(__cpu, __rset) \
|
|
case SPI_## __rset: \
|
|
return SPI_## __cpu ##_## __rset;
|
|
|
|
#define __GEN_SPI_RSET(__cpu) \
|
|
switch (reg) { \
|
|
__GEN_SPI_RSET_BASE(__cpu, CMD) \
|
|
__GEN_SPI_RSET_BASE(__cpu, INT_STATUS) \
|
|
__GEN_SPI_RSET_BASE(__cpu, INT_MASK_ST) \
|
|
__GEN_SPI_RSET_BASE(__cpu, INT_MASK) \
|
|
__GEN_SPI_RSET_BASE(__cpu, ST) \
|
|
__GEN_SPI_RSET_BASE(__cpu, CLK_CFG) \
|
|
__GEN_SPI_RSET_BASE(__cpu, FILL_BYTE) \
|
|
__GEN_SPI_RSET_BASE(__cpu, MSG_TAIL) \
|
|
__GEN_SPI_RSET_BASE(__cpu, RX_TAIL) \
|
|
__GEN_SPI_RSET_BASE(__cpu, MSG_CTL) \
|
|
__GEN_SPI_RSET_BASE(__cpu, MSG_DATA) \
|
|
__GEN_SPI_RSET_BASE(__cpu, RX_DATA) \
|
|
}
|
|
|
|
#define __GEN_SPI_REGS_TABLE(__cpu) \
|
|
[SPI_CMD] = SPI_## __cpu ##_CMD, \
|
|
[SPI_INT_STATUS] = SPI_## __cpu ##_INT_STATUS, \
|
|
[SPI_INT_MASK_ST] = SPI_## __cpu ##_INT_MASK_ST, \
|
|
[SPI_INT_MASK] = SPI_## __cpu ##_INT_MASK, \
|
|
[SPI_ST] = SPI_## __cpu ##_ST, \
|
|
[SPI_CLK_CFG] = SPI_## __cpu ##_CLK_CFG, \
|
|
[SPI_FILL_BYTE] = SPI_## __cpu ##_FILL_BYTE, \
|
|
[SPI_MSG_TAIL] = SPI_## __cpu ##_MSG_TAIL, \
|
|
[SPI_RX_TAIL] = SPI_## __cpu ##_RX_TAIL, \
|
|
[SPI_MSG_CTL] = SPI_## __cpu ##_MSG_CTL, \
|
|
[SPI_MSG_DATA] = SPI_## __cpu ##_MSG_DATA, \
|
|
[SPI_RX_DATA] = SPI_## __cpu ##_RX_DATA,
|
|
|
|
static inline unsigned long bcm63xx_spireg(enum bcm63xx_regs_spi reg)
|
|
{
|
|
#ifdef BCMCPU_RUNTIME_DETECT
|
|
extern const unsigned long *bcm63xx_regs_spi;
|
|
|
|
return bcm63xx_regs_spi[reg];
|
|
#else
|
|
#if defined(CONFIG_BCM63XX_CPU_6338) || defined(CONFIG_BCM63XX_CPU_6348)
|
|
__GEN_SPI_RSET(6348)
|
|
#endif
|
|
#if defined(CONFIG_BCM63XX_CPU_6358) || defined(CONFIG_BCM63XX_CPU_6362) || \
|
|
defined(CONFIG_BCM63XX_CPU_6368)
|
|
__GEN_SPI_RSET(6358)
|
|
#endif
|
|
#endif
|
|
return 0;
|
|
}
|
|
|
|
#endif /* BCM63XX_DEV_SPI_H */
|