4 * @brief MOD-PCI ADC definitions
6 * The Janz MOD-PCI module is a PCI carrier board
7 * handling up to 2 mezzanine cards.
9 * This file provides the definitions for low-level access to
12 * Copyright (c) 2009 CERN
13 * @author Juan David Gonzalez Cobas <dcobas@cern.ch>
15 * @section license_sec License
16 * Released under the GPL v2. (and only v2, not any later version)
22 /* Vendor/Device IDs for JANZ MOD-PCI */
23 #define PCI_VENDOR_ID_JANZ 0x10b5
24 #define PCI_DEVICE_ID_JANZ_MOD_PCI_1 0x9030 /* PLX9030-based */
25 #define PCI_DEVICE_ID_JANZ_MOD_PCI_2 0x9050 /* PLX9050-based */
27 #define PCI_SUBSYSTEM_VENDOR_ID_JANZ 0x13c3
28 #define PCI_SUBSYSTEM_ID_MOD_PCI_1_0 0x0200 /* MOD-PCI revisions */
29 #define PCI_SUBSYSTEM_ID_MOD_PCI_2_0 0x0201
30 #define PCI_SUBSYSTEM_ID_MOD_PCI_2_1 0x0201
31 #define PCI_SUBSYSTEM_ID_MOD_PCI_3_0 0x0202
33 /* MOD-PCI BARs base address registers */
34 #define MOD_PCI_CONFIG_MMIO_BAR 0
35 #define MOD_PCI_CONFIG_IO_BAR 1
36 #define MOD_PCI_LITTLE_BAR 2
37 #define MOD_PCI_BIG_BAR 3
38 #define MOD_PCI_ONBOARD_REGS_BAR 4
39 #define MOD_PCI_UNUSED_BAR 5
41 #define MOD_PCI_BIG_BAR_OFFSET \
42 (sizeof(u32)*MOD_PCI_BIG_BAR)
44 #define MOD_PCI_CONFIG_MMIO_BAR_SIZE 128
45 #define MOD_PCI_CONFIG_IO_BAR_SIZE 128
46 #define MOD_PCI_LITTLE_BAR_SIZE 4096
47 #define MOD_PCI_BIG_BAR_SIZE 4096
48 #define MOD_PCI_ONBOARD_REGS_BAR_SIZE 4096
49 #define MOD_PCI_UNUSED_BAR_SIZE 0
51 /* MODULbus memory space offsets */
52 #define MOD_PCI_SLOTS 2
53 #define MOD_PCI_SLOT0_OFFSET 0x000
54 #define MOD_PCI_SLOT1_OFFSET 0x200
55 #define MOD_PCI_WIDTH 16
56 #define MOD_PCI_WINDOW_SIZE 2048
58 /* On-board registers offsets */
59 /* WARNING: all byte-only accesses */
60 #define MOD_PCI_INT_STAT 0x1 /* read access */
61 #define MOD_PCI_INT_DISABLE 0x1 /* write access */
62 #define MOD_PCI_MBUS_NUM 0x3 /* read access */
63 #define MOD_PCI_INT_ENABLE 0x3 /* write access */
64 #define MOD_PCI_RESET_ASSERT 0x5 /* write access */
65 #define MOD_PCI_RESET_DEASSERT 0x7 /* write access */
66 #define MOD_PCI_EEP 0x9 /* r/w access */
67 #define MOD_PCI_ENID 0xb /* write/access */
69 /** map of the onboard registers at BAR#4 */
71 unsigned char unused1
;
73 unsigned char int_stat
;
74 unsigned char int_disable
;
76 unsigned char unused2
;
78 unsigned char mbus_num
;
79 unsigned char int_enable
;
81 unsigned char unused3
;
82 unsigned char reset_assert
;
83 unsigned char unused4
;
84 unsigned char reset_deassert
;
85 unsigned char unused5
;
87 unsigned char unused6
;
88 unsigned char unused7
;
92 /** description of a mod-pci module */
94 int lun
; /* logical unit number */
95 int bus_number
; /* pci bus number */
96 int slot_number
; /* pci slot number */
97 void __iomem
*vaddr
; /* virtual address of MODULBUS
100 __iomem
*onboard
; /* on-board registers */
103 #endif /* _MOD_PCI_H_ */