1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #ifndef _DEV_PCI_PCIIDE_NATSEMI_REG_H_
31 #define _DEV_PCI_PCIIDE_NATSEMI_REG_H_
32
33
34
35
36
37
38
39 #define NATSEMI_CTRL1 0x40
40 #define NATSEMI_CTRL1_SWRST 0x04
41 #define NATSEMI_CTRL1_IDEPWR 0x08
42 #define NATSEMI_CTRL1_CH1INTMAP 0x10
43 #define NATSEMI_CTRL1_CH2INTMAP 0x20
44 #define NATSEMI_CTRL1_INTAMASK 0x40
45 #define NATSEMI_CTRL1_IDWR 0x80
46
47 #define NATSEMI_CTRL2 0x41
48 #define NATSEMI_CTRL2_CH1MASK 0x01
49 #define NATSEMI_CTRL2_CH2MASK 0x02
50 #define NATSEMI_CTRL2_BARDIS 0x04
51 #define NATSEMI_CTRL2_WATCHDOG 0x08
52 #define NATSEMI_CTRL2_BUF1BYP 0x10
53 #define NATSEMI_CTRL2_BUF2BYP 0x20
54 #define NATSEMI_CTRL2_IDE1MAP 0x40
55 #define NATSEMI_CTRL2_IDE2MAP 0x80
56
57 #define NATSEMI_CHMASK(chn) (NATSEMI_CTRL2_CH1MASK << (chn))
58
59 #define NATSEMI_CTRL3 0x42
60 #define NATSEMI_CTRL3_CH1PREDIS 0x01
61 #define NATSEMI_CTRL3_CH2PREDIS 0x02
62 #define NATSEMI_CTRL3_RSTIDLE 0x04
63 #define NATSEMI_CTRL3_C1D1DMARQ 0x10
64 #define NATSEMI_CTRL3_C1D2DMARQ 0x20
65 #define NATSEMI_CTRL3_C2D1DMARQ 0x40
66 #define NATSEMI_CTRL3_C2D2DMARQ 0x80
67
68 #define NATSEMI_WBS 0x43
69 #define NATSEMI_WBS_WB1NMPTY 0x01
70 #define NATSEMI_WBS_WB2NMPTY 0x02
71
72 #define NATSEMI_C1D1DRT 0x44
73 #define NATSEMI_C1D1DWT 0x45
74 #define NATSEMI_C1D2DRT 0x48
75 #define NATSEMI_C1D2DWT 0x49
76 #define NATSEMI_C2D1DRT 0x4c
77 #define NATSEMI_C2D1DWT 0x4d
78 #define NATSEMI_C2D2DRT 0x50
79 #define NATSEMI_C2D2DWT 0x51
80
81 #define NATSEMI_CCBT 0x54
82
83 #define NATSEMI_SECT 0x55
84 #define NATSEMI_SECT_C1UNUSED 0x0f
85 #define NATSEMI_SECT_C1_512 0x0e
86 #define NATSEMI_SECT_C1_1024 0x0c
87 #define NATSEMI_SECT_C1_2048 0x08
88 #define NATSEMI_SECT_C1_4096 0x00
89 #define NATSEMI_SECT_C2UNUSED 0xf0
90 #define NATSEMI_SECT_C2_512 0xe0
91 #define NATSEMI_SECT_C2_1024 0xc0
92 #define NATSEMI_SECT_C2_2048 0x80
93 #define NATSEMI_SECT_C2_4096 0x00
94
95 #define NATSEMI_RTREG(c,d) (0x44 + (c * 8) + (d * 4) + 0)
96 #define NATSEMI_WTREG(c,d) (0x44 + (c * 8) + (d * 4) + 1)
97
98
99 static u_int8_t natsemi_pio_pulse[] = { 7, 12, 13, 14, 14 };
100 static u_int8_t natsemi_dma_pulse[] = { 7, 10, 10 };
101
102 static u_int8_t natsemi_pio_recover[] = { 6, 8, 11, 13, 15 };
103 static u_int8_t natsemi_dma_recover[] = { 6, 8, 9 };
104
105
106
107
108
109
110 #define SCx200_TIM_PIO(chan, drive) (0x40 + 16 * (chan) + 8 * (drive))
111 #define SCx200_TIM_DMA(chan, drive) (0x44 + 16 * (chan) + 8 * (drive))
112
113 #define SCx200_PIOFORMAT_SHIFT 31
114
115
116 const static u_int32_t scx200_pio33[2][5] = {
117
118 { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 },
119
120 { 0x9172d132, 0x21717121, 0x00803020, 0x20102010, 0x00100010 }};
121 const static u_int32_t scx200_pio66[2][5] = {
122
123 { 0x0000f8e4, 0x000153f3, 0x000213f1, 0x00034231, 0x00041131 },
124
125 { 0xf8e4f8e4, 0x53f3f353, 0x13f18141, 0x42314231, 0x11311131 }};
126
127
128 const static u_int32_t scx200_dma33[] = { 0x00077771, 0x00012121, 0x00002020 };
129 const static u_int32_t scx200_dma66[] = { 0x000ffff3, 0x00035352, 0x00015151 };
130
131
132 const static u_int32_t scx200_udma33[] = { 0x00921250, 0x00911140, 0x00911030 };
133 const static u_int32_t scx200_udma66[] = { 0x009436a1, 0x00933481, 0x00923261 };
134
135 #endif