Lines Matching defs:ohci
32 #include "ohci.h"
36 struct ohci {
40 static inline void reg_write(const struct ohci *ohci, int offset, u32 data)
42 writel(data, ohci->registers + offset);
45 static inline u32 reg_read(const struct ohci *ohci, int offset)
47 return readl(ohci->registers + offset);
53 static inline u8 __init get_phy_reg(struct ohci *ohci, u8 addr)
58 reg_write(ohci, OHCI1394_PhyControl, (addr << 8) | 0x00008000);
61 if (reg_read(ohci, OHCI1394_PhyControl) & 0x80000000)
65 r = reg_read(ohci, OHCI1394_PhyControl);
71 static inline void __init set_phy_reg(struct ohci *ohci, u8 addr, u8 data)
75 reg_write(ohci, OHCI1394_PhyControl, (addr << 8) | data | 0x00004000);
78 if (!(reg_read(ohci, OHCI1394_PhyControl) & 0x00004000))
85 static inline void __init init_ohci1394_soft_reset(struct ohci *ohci)
89 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset);
92 if (!(reg_read(ohci, OHCI1394_HCControlSet)
104 static inline void __init init_ohci1394_initialize(struct ohci *ohci)
110 bus_options = reg_read(ohci, OHCI1394_BusOptions);
114 reg_write(ohci, OHCI1394_BusOptions, bus_options);
117 reg_write(ohci, OHCI1394_NodeID, 0x0000ffc0);
120 reg_write(ohci, OHCI1394_HCControlSet,
124 reg_write(ohci, OHCI1394_LinkControlClear, 0xffffffff);
127 reg_write(ohci, OHCI1394_LinkControlSet,
131 reg_write(ohci, OHCI1394_LinkControlClear, 0x00000400);
134 reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, 0xffffffff);
135 reg_write(ohci, OHCI1394_IsoRecvIntEventClear, 0xffffffff);
136 reg_write(ohci, OHCI1394_IsoXmitIntMaskClear, 0xffffffff);
137 reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 0xffffffff);
140 reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000);
143 reg_write(ohci, OHCI1394_ATRetries,
149 reg_write(ohci, OHCI1394_HCControlClear,
153 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_linkEnable);
156 num_ports = get_phy_reg(ohci, 2) & 0xf;
160 set_phy_reg(ohci, 7, i);
161 status = get_phy_reg(ohci, 8);
164 set_phy_reg(ohci, 8, status & ~1);
177 static inline void __init init_ohci1394_wait_for_busresets(struct ohci *ohci)
183 events = reg_read(ohci, OHCI1394_IntEventSet);
185 reg_write(ohci, OHCI1394_IntEventClear,
195 static inline void __init init_ohci1394_enable_physical_dma(struct ohci *ohci)
197 reg_write(ohci, OHCI1394_PhyReqFilterHiSet, 0xffffffff);
198 reg_write(ohci, OHCI1394_PhyReqFilterLoSet, 0xffffffff);
199 reg_write(ohci, OHCI1394_PhyUpperBound, 0xffff0000);
206 static inline void __init init_ohci1394_reset_and_init_dma(struct ohci *ohci)
209 init_ohci1394_soft_reset(ohci);
212 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_LPS);
215 reg_write(ohci, OHCI1394_IntEventClear, 0xffffffff);
216 reg_write(ohci, OHCI1394_IntMaskClear, 0xffffffff);
220 init_ohci1394_initialize(ohci);
225 init_ohci1394_wait_for_busresets(ohci);
228 init_ohci1394_enable_physical_dma(ohci);
238 struct ohci ohci;
248 ohci.registers = (void __iomem *)fix_to_virt(FIX_OHCI1394_BASE);
250 init_ohci1394_reset_and_init_dma(&ohci);