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
31static void inline hcWriteWord (unsigned long base, unsigned int value,
32 unsigned int offset)
33{
34 out_le16 ((volatile u16*)(base + 2), offset | 0x80);
35 out_le16 ((volatile u16*)base, value);
36}
37
38
39
40
41
42
43
44
45
46static void inline hcWriteDWord (unsigned long base, unsigned long value,
47 unsigned int offset)
48{
49 out_le16 ((volatile u16*)(base + 2), offset | 0x80);
50 out_le16 ((volatile u16*)base, value);
51 out_le16 ((volatile u16*)base, value >> 16);
52}
53
54
55
56
57
58
59
60
61
62static unsigned int inline hcReadWord (unsigned long base, unsigned int offset)
63{
64 out_le16 ((volatile u16*)(base + 2), offset);
65 return (in_le16 ((volatile u16*)base));
66}
67
68
69
70
71
72
73
74
75
76static unsigned long inline hcReadDWord (unsigned long base, unsigned int offset)
77{
78 unsigned long val, val16;
79
80 out_le16 ((volatile u16*)(base + 2), offset);
81 val = in_le16((volatile u16*)base);
82 val16 = in_le16((volatile u16*)base);
83 return (val | (val16 << 16));
84}
85
86
87#define HcRevision 0x00
88#define HcControl 0x01
89#define HcCommandStatus 0x02
90#define HcInterruptStatus 0x03
91#define HcInterruptEnable 0x04
92#define HcInterruptDisable 0x05
93#define HcFmInterval 0x0D
94#define HcFmRemaining 0x0E
95#define HcFmNumber 0x0F
96#define HcLSThreshold 0x11
97#define HcRhDescriptorA 0x12
98#define HcRhDescriptorB 0x13
99#define HcRhStatus 0x14
100#define HcRhPortStatus1 0x15
101#define HcRhPortStatus2 0x16
102
103#define HcHardwareConfiguration 0x20
104#define HcDMAConfiguration 0x21
105#define HcTransferCounter 0x22
106#define HcuPInterrupt 0x24
107#define HcuPInterruptEnable 0x25
108#define HcChipID 0x27
109#define HcScratch 0x28
110#define HcSoftwareReset 0x29
111#define HcITLBufferLength 0x2A
112#define HcATLBufferLength 0x2B
113#define HcBufferStatus 0x2C
114#define HcReadBackITL0Length 0x2D
115#define HcReadBackITL1Length 0x2E
116#define HcITLBufferPort 0x40
117#define HcATLBufferPort 0x41
118