diff options
Diffstat (limited to 'drivers/staging/ipack/bridges/tpci200.h')
-rw-r--r-- | drivers/staging/ipack/bridges/tpci200.h | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/drivers/staging/ipack/bridges/tpci200.h b/drivers/staging/ipack/bridges/tpci200.h index d04510a89be..235d1fe4f48 100644 --- a/drivers/staging/ipack/bridges/tpci200.h +++ b/drivers/staging/ipack/bridges/tpci200.h @@ -17,7 +17,6 @@ #include <linux/limits.h> #include <linux/pci.h> #include <linux/spinlock.h> -#include <linux/interrupt.h> #include <linux/swab.h> #include <linux/io.h> @@ -31,18 +30,21 @@ #define TPCI200_SUBVENDOR_ID 0x1498 #define TPCI200_SUBDEVICE_ID 0x300A +#define TPCI200_CFG_MEM_BAR 0 #define TPCI200_IP_INTERFACE_BAR 2 #define TPCI200_IO_ID_INT_SPACES_BAR 3 #define TPCI200_MEM16_SPACE_BAR 4 #define TPCI200_MEM8_SPACE_BAR 5 -#define TPCI200_REVISION_REG 0x00 -#define TPCI200_CONTROL_A_REG 0x02 -#define TPCI200_CONTROL_B_REG 0x04 -#define TPCI200_CONTROL_C_REG 0x06 -#define TPCI200_CONTROL_D_REG 0x08 -#define TPCI200_RESET_REG 0x0A -#define TPCI200_STATUS_REG 0x0C +struct tpci200_regs { + __le16 revision; + /* writes to control should occur with the mutex held to protect + * read-modify-write operations */ + __le16 control[4]; + __le16 reset; + __le16 status; + u8 reserved[242]; +} __packed; #define TPCI200_IFACE_SIZE 0x100 @@ -62,6 +64,7 @@ #define TPCI200_MEM16_GAP 0x00800000 #define TPCI200_MEM16_SIZE 0x00800000 +/* control field in tpci200_regs */ #define TPCI200_INT0_EN 0x0040 #define TPCI200_INT1_EN 0x0080 #define TPCI200_INT0_EDGE 0x0010 @@ -71,11 +74,13 @@ #define TPCI200_RECOVER_EN 0x0002 #define TPCI200_CLK32 0x0001 +/* reset field in tpci200_regs */ #define TPCI200_A_RESET 0x0001 #define TPCI200_B_RESET 0x0002 #define TPCI200_C_RESET 0x0004 #define TPCI200_D_RESET 0x0008 +/* status field in tpci200_regs */ #define TPCI200_A_TIMEOUT 0x1000 #define TPCI200_B_TIMEOUT 0x2000 #define TPCI200_C_TIMEOUT 0x4000 @@ -97,6 +102,13 @@ #define TPCI200_SLOT_INT_MASK 0x00FF +/* PCI Configuration registers. The PCI bridge is a PLX Technology PCI9030. */ +#define LAS1_DESC 0x2C +#define LAS2_DESC 0x30 + +/* Bits in the LAS?_DESC registers */ +#define LAS_BIT_BIGENDIAN 24 + #define VME_IOID_SPACE "IOID" #define VME_MEM_SPACE "MEM" @@ -108,8 +120,9 @@ * */ struct slot_irq { + struct ipack_device *holder; int vector; - int (*handler)(void *); + irqreturn_t (*handler)(void *); void *arg; }; @@ -119,14 +132,15 @@ struct slot_irq { * @irq Slot IRQ infos * @io_phys IO physical base address register of the slot * @id_phys ID physical base address register of the slot + * @int_phys INT physical base address register of the slot * @mem_phys MEM physical base address register of the slot * */ struct tpci200_slot { - struct ipack_device *dev; struct slot_irq *irq; struct ipack_addr_space io_phys; struct ipack_addr_space id_phys; + struct ipack_addr_space int_phys; struct ipack_addr_space mem_phys; }; @@ -141,15 +155,16 @@ struct tpci200_slot { struct tpci200_infos { struct pci_dev *pdev; struct pci_device_id *id_table; - void __iomem *interface_regs; + struct tpci200_regs __iomem *interface_regs; void __iomem *ioidint_space; void __iomem *mem8_space; + void __iomem *cfg_regs; struct ipack_bus_device *ipack_bus; }; struct tpci200_board { - struct list_head list; unsigned int number; struct mutex mutex; + spinlock_t regs_lock; struct tpci200_slot *slots; struct tpci200_infos *info; }; |