Lines Matching refs:ohci

45 #include "ohci.h"
49 struct ohci {
53 static inline void reg_write(const struct ohci *ohci, int offset, u32 data)
55 writel(data, ohci->registers + offset);
58 static inline u32 reg_read(const struct ohci *ohci, int offset)
60 return readl(ohci->registers + offset);
66 static inline u8 __init get_phy_reg(struct ohci *ohci, u8 addr)
71 reg_write(ohci, OHCI1394_PhyControl, (addr << 8) | 0x00008000);
74 if (reg_read(ohci, OHCI1394_PhyControl) & 0x80000000)
78 r = reg_read(ohci, OHCI1394_PhyControl);
84 static inline void __init set_phy_reg(struct ohci *ohci, u8 addr, u8 data)
88 reg_write(ohci, OHCI1394_PhyControl, (addr << 8) | data | 0x00004000);
91 if (!(reg_read(ohci, OHCI1394_PhyControl) & 0x00004000))
98 static inline void __init init_ohci1394_soft_reset(struct ohci *ohci)
102 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset);
105 if (!(reg_read(ohci, OHCI1394_HCControlSet)
117 static inline void __init init_ohci1394_initialize(struct ohci *ohci)
123 bus_options = reg_read(ohci, OHCI1394_BusOptions);
127 reg_write(ohci, OHCI1394_BusOptions, bus_options);
130 reg_write(ohci, OHCI1394_NodeID, 0x0000ffc0);
133 reg_write(ohci, OHCI1394_HCControlSet,
137 reg_write(ohci, OHCI1394_LinkControlClear, 0xffffffff);
140 reg_write(ohci, OHCI1394_LinkControlSet,
144 reg_write(ohci, OHCI1394_LinkControlClear, 0x00000400);
147 reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, 0xffffffff);
148 reg_write(ohci, OHCI1394_IsoRecvIntEventClear, 0xffffffff);
149 reg_write(ohci, OHCI1394_IsoXmitIntMaskClear, 0xffffffff);
150 reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 0xffffffff);
153 reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000);
156 reg_write(ohci, OHCI1394_ATRetries,
162 reg_write(ohci, OHCI1394_HCControlClear,
166 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_linkEnable);
169 num_ports = get_phy_reg(ohci, 2) & 0xf;
173 set_phy_reg(ohci, 7, i);
174 status = get_phy_reg(ohci, 8);
177 set_phy_reg(ohci, 8, status & ~1);
190 static inline void __init init_ohci1394_wait_for_busresets(struct ohci *ohci)
196 events = reg_read(ohci, OHCI1394_IntEventSet);
198 reg_write(ohci, OHCI1394_IntEventClear,
208 static inline void __init init_ohci1394_enable_physical_dma(struct ohci *ohci)
210 reg_write(ohci, OHCI1394_PhyReqFilterHiSet, 0xffffffff);
211 reg_write(ohci, OHCI1394_PhyReqFilterLoSet, 0xffffffff);
212 reg_write(ohci, OHCI1394_PhyUpperBound, 0xffff0000);
219 static inline void __init init_ohci1394_reset_and_init_dma(struct ohci *ohci)
222 init_ohci1394_soft_reset(ohci);
225 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_LPS);
228 reg_write(ohci, OHCI1394_IntEventClear, 0xffffffff);
229 reg_write(ohci, OHCI1394_IntMaskClear, 0xffffffff);
233 init_ohci1394_initialize(ohci);
238 init_ohci1394_wait_for_busresets(ohci);
241 init_ohci1394_enable_physical_dma(ohci);
251 struct ohci ohci;
261 ohci.registers = (void __iomem *)fix_to_virt(FIX_OHCI1394_BASE);
263 init_ohci1394_reset_and_init_dma(&ohci);