3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 * hcWriteWord - write a 16 bit value into the USB controller
26 * @base: base address to access the chip registers
27 * @value: 16 bit value to write into register @offset
28 * @offset: register to write the @value into
31 static void inline hcWriteWord (unsigned long base, unsigned int value,
34 out_le16 ((volatile u16*)(base + 2), offset | 0x80);
35 out_le16 ((volatile u16*)base, value);
39 * hcWriteDWord - write a 32 bit value into the USB controller
40 * @base: base address to access the chip registers
41 * @value: 32 bit value to write into register @offset
42 * @offset: register to write the @value into
46 static void inline hcWriteDWord (unsigned long base, unsigned long value,
49 out_le16 ((volatile u16*)(base + 2), offset | 0x80);
50 out_le16 ((volatile u16*)base, value);
51 out_le16 ((volatile u16*)base, value >> 16);
55 * hcReadWord - read a 16 bit value from the USB controller
56 * @base: base address to access the chip registers
57 * @offset: register to read from
59 * Returns the readed register value
62 static unsigned int inline hcReadWord (unsigned long base, unsigned int offset)
64 out_le16 ((volatile u16*)(base + 2), offset);
65 return (in_le16 ((volatile u16*)base));
69 * hcReadDWord - read a 32 bit value from the USB controller
70 * @base: base address to access the chip registers
71 * @offset: register to read from
73 * Returns the readed register value
76 static unsigned long inline hcReadDWord (unsigned long base, unsigned int offset)
78 unsigned long val, val16;
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));
86 /* control and status registers isp1161 */
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
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