1
2
3 #define FDOMAIN_REGION_SIZE 0x10
4 #define FDOMAIN_BIOS_SIZE 0x2000
5
6 enum {
7 in_arbitration = 0x02,
8 in_selection = 0x04,
9 in_other = 0x08,
10 disconnect = 0x10,
11 aborted = 0x20,
12 sent_ident = 0x40,
13 };
14
15
16 #define REG_SCSI_DATA 0
17 #define REG_BSTAT 1
18 #define BSTAT_BSY BIT(0)
19 #define BSTAT_MSG BIT(1)
20 #define BSTAT_IO BIT(2)
21 #define BSTAT_CMD BIT(3)
22 #define BSTAT_REQ BIT(4)
23 #define BSTAT_SEL BIT(5)
24 #define BSTAT_ACK BIT(6)
25 #define BSTAT_ATN BIT(7)
26 #define REG_BCTL 1
27 #define BCTL_RST BIT(0)
28 #define BCTL_SEL BIT(1)
29 #define BCTL_BSY BIT(2)
30 #define BCTL_ATN BIT(3)
31 #define BCTL_IO BIT(4)
32 #define BCTL_CMD BIT(5)
33 #define BCTL_MSG BIT(6)
34 #define BCTL_BUSEN BIT(7)
35 #define REG_ASTAT 2
36 #define ASTAT_IRQ BIT(0)
37 #define ASTAT_ARB BIT(1)
38 #define ASTAT_PARERR BIT(2)
39 #define ASTAT_RST BIT(3)
40 #define ASTAT_FIFODIR BIT(4)
41 #define ASTAT_FIFOEN BIT(5)
42 #define ASTAT_PAREN BIT(6)
43 #define ASTAT_BUSEN BIT(7)
44 #define REG_ICTL 2
45 #define ICTL_FIFO_MASK 0x0f
46 #define ICTL_FIFO BIT(4)
47 #define ICTL_ARB BIT(5)
48 #define ICTL_SEL BIT(6)
49 #define ICTL_REQ BIT(7)
50 #define REG_FSTAT 3
51 #define FSTAT_ONOTEMPTY BIT(0)
52 #define FSTAT_INOTEMPTY BIT(1)
53 #define FSTAT_NOTEMPTY BIT(2)
54 #define FSTAT_NOTFULL BIT(3)
55 #define REG_MCTL 3
56 #define MCTL_ACK_MASK 0x0f
57 #define MCTL_ACTDEASS BIT(4)
58 #define MCTL_TARGET BIT(5)
59 #define MCTL_FASTSYNC BIT(6)
60 #define MCTL_SYNC BIT(7)
61 #define REG_INTCOND 4
62 #define IRQ_FIFO BIT(1)
63 #define IRQ_REQ BIT(2)
64 #define IRQ_SEL BIT(3)
65 #define IRQ_ARB BIT(4)
66 #define IRQ_RST BIT(5)
67 #define IRQ_FORCED BIT(6)
68 #define IRQ_TIMEOUT BIT(7)
69 #define REG_ACTL 4
70 #define ACTL_RESET BIT(0)
71 #define ACTL_FIRQ BIT(1)
72 #define ACTL_ARB BIT(2)
73 #define ACTL_PAREN BIT(3)
74 #define ACTL_IRQEN BIT(4)
75 #define ACTL_CLRFIRQ BIT(5)
76 #define ACTL_FIFOWR BIT(6)
77 #define ACTL_FIFOEN BIT(7)
78 #define REG_ID_LSB 5
79 #define REG_ACTL2 5
80 #define ACTL2_RAMOVRLY BIT(0)
81 #define ACTL2_SLEEP BIT(7)
82 #define REG_ID_MSB 6
83 #define REG_LOOPBACK 7
84 #define REG_SCSI_DATA_NOACK 8
85 #define REG_ASTAT3 9
86 #define ASTAT3_ACTDEASS BIT(0)
87 #define ASTAT3_RAMOVRLY BIT(1)
88 #define ASTAT3_TARGERR BIT(2)
89 #define ASTAT3_IRQEN BIT(3)
90 #define ASTAT3_IRQMASK 0xf0
91 #define REG_CFG1 10
92 #define CFG1_BUS BIT(0)
93 #define CFG1_IRQ_MASK 0x0e
94 #define CFG1_IO_MASK 0x30
95 #define CFG1_BIOS_MASK 0xc0
96 #define REG_CFG2 11
97 #define CFG2_ROMDIS BIT(0)
98 #define CFG2_RAMDIS BIT(1)
99 #define CFG2_IRQEDGE BIT(2)
100 #define CFG2_NOWS BIT(3)
101 #define CFG2_32BIT BIT(7)
102 #define REG_FIFO 12
103 #define REG_FIFO_COUNT 14
104
105 #ifdef CONFIG_PM_SLEEP
106 static const struct dev_pm_ops fdomain_pm_ops;
107 #define FDOMAIN_PM_OPS (&fdomain_pm_ops)
108 #else
109 #define FDOMAIN_PM_OPS NULL
110 #endif
111
112 struct Scsi_Host *fdomain_create(int base, int irq, int this_id,
113 struct device *dev);
114 int fdomain_destroy(struct Scsi_Host *sh);