Re: I need some info on driver development status
Brought to you by:
aeb,
bencollins
From: Daniel K. <dan...@st...> - 2000-05-12 18:09:05
|
On Thu, 11 May 2000, Sebastien Rougeaux wrote: [That's still about getting CXD3222 chips to work with ohci1394.o] > Could you please add a debug message at the top of the irq handler, > and verify that the irq handler is called when the driver is loaded. Taking today's ohci driver from CVS, I've run a few more tests in the meantime with more debugging output enabled. In particular I've added code to the irq handler that shows the contents of the IntEvent register masked and unmasked (raw), and the current mask itself. As you proposed, I also included a loop at the beginning of the irq handler to wait for NodeID to become valid. Each cycle has a suckin' udelay(10) in it, but hey, it's only for debugging. The good news is that with those two additions I actually see several PHY packets arriving. Even better, I see PHY activity when switching on and off the camcorder attached to the Vaio. The downside is that still I couldn't figure out how to convince the CXD3222 to handle some selfIDs. As an aside, even though the driver will now properly shut down the chipset when it is removed, a rmmod-insmod cycle without any other activity will inevitably hang the whole machine to the point where Alt-SysRq-b seems to be the only working key combination. I first suspected the irq handler but a few tests proved its innocence. I've never fiddled that much with DMA stuff before and am unsure if a misconfiguration there might lock a machine. Actually I had similar symptoms with an el-cheapo network card that was very picky about the way its MMIO PCI registers were accessed and would eventually mess up the whole PCI bus. Does anyone know of subtle access restrictions regarding the OHCI/IEEE registers? > You should have something like this after `insmod ohci1394` > > ........ > ohci1394_0: resetting bus on request and attempting to become root > ieee1394: detected 1 ohci1394 adapter > ohci1394_0: IntEvent: 00020010 > ohci1394_0: IntEvent: 00020000 > ohci1394_0: IntEvent: 00020000 > ....... Is this a true sequence you see or did you just leave out the null events? In section 6.1.1 of the OHCI specs it says that the controller is supposed to prevent the driver from clearing the bus reset bit until selfIDComplete is flagged, whereas the CXD3222 seems to happily take the ack. I've modified the irq handler to mask busReset and postpone the ack until reception of selfIDComplete in this case but wasn't really successful. Below I've attached a pile of debugging output - maybe some of the OHCI wizards can have a look at it and give me some more hints on what to try next to get this beast going. I'm now off for another night on the specs. Regards, Daniel. --[snip]-- insmod ohci module, camcorder is already turned on: ieee1394: registered ohci1394 driver, initializing now ohci1394: looking for Ohci1394 cards ohci1394_0: allocated interrupt 9 ohci1394_0: The 1st byte at offset 0x404 is: 0x31 ohci1394_0: remapped memory spaces reg 0xd086a000 ohci1394_0: soft reset finished ohci1394_0: max packet size = 2048 bytes ohci1394_0: 4 iso contexts available ohci1394_0: Receive DMA ctx=0 initialized ohci1394_0: Receive DMA ctx=1 initialized ohci1394_0: AT dma ctx=0 initialized ohci1394_0: AT dma ctx=1 initialized ohci1394_0: Receive DMA ctx=2 initialized ohci1394_0: request csr_rom address: C3258000 ohci1394_0: Cancel request received ohci1394_0: resetting bus on request and attempting to become root ieee1394: detected 1 ohci1394 adapter ohci1394_0: NodeID valid in 27. cycle ohci1394_0: IntEvent: 04020000 ohci1394_0: IntEvent (raw): 04d20000, IntMask: 840300bf ohci1394_0: PhyControl: 800101FF ohci1394_0: IntEvent: 00000000 ohci1394_0: IntEvent (raw): 00d00000, IntMask: 840300bf ohci1394_0: NodeID valid in 28. cycle ohci1394_0: IntEvent: 04020000 ohci1394_0: IntEvent (raw): 04d20000, IntMask: 840300bf ohci1394_0: PhyControl: 800101FF ohci1394_0: IntEvent: 00000000 ohci1394_0: IntEvent (raw): 00d00000, IntMask: 840300bf ohci1394_0: NodeID valid in 28. cycle ohci1394_0: IntEvent: 04020000 ohci1394_0: IntEvent (raw): 04d20000, IntMask: 840300bf ohci1394_0: PhyControl: 800101FF ohci1394_0: IntEvent: 00000000 ohci1394_0: IntEvent (raw): 00d00000, IntMask: 840300bf ohci1394_0: NodeID valid in 16. cycle ohci1394_0: IntEvent: 04020000 ohci1394_0: IntEvent (raw): 04d20000, IntMask: 840300bf ohci1394_0: PhyControl: 800101FF ohci1394_0: IntEvent: 00000000 ohci1394_0: IntEvent (raw): 00d00000, IntMask: 840300bf Turn off camcorder: ohci1394_0: NodeID valid in 16. cycle ohci1394_0: IntEvent: 04020000 ohci1394_0: IntEvent (raw): 04f20000, IntMask: 840300bf ohci1394_0: PhyControl: 80030600 ohci1394_0: IntEvent: 00000000 ohci1394_0: IntEvent (raw): 00f00000, IntMask: 840300bf Turn on again: ohci1394_0: IntEvent: 04020000 ohci1394_0: IntEvent (raw): 04f20000, IntMask: 840300bf ohci1394_0: PhyControl: 80070600 ohci1394_0: IntEvent: 00000000 ohci1394_0: IntEvent (raw): 00f00000, IntMask: 840300bf ohci1394_0: NodeID valid in 16. cycle ohci1394_0: IntEvent: 04020000 ohci1394_0: IntEvent (raw): 04f20000, IntMask: 840300bf ohci1394_0: PhyControl: 80070600 ohci1394_0: IntEvent: 00000000 ohci1394_0: IntEvent (raw): 00f00000, IntMask: 840300bf ohci1394_0: NodeID valid in 16. cycle ohci1394_0: IntEvent: 04020000 ohci1394_0: IntEvent (raw): 04f20000, IntMask: 840300bf ohci1394_0: PhyControl: 80010600 ohci1394_0: IntEvent: 00000000 ohci1394_0: IntEvent (raw): 00f00000, IntMask: 840300bf kobras@polaris:~ > cat /proc/ohci1394 IEEE-1394 OHCI Driver status report: bus number: 0x3ff Node ID: 0x0 ### Host data ### node_count: 0 node_id : 00000000 irm_id : 0000FFFF busmgr_id : 0000FFFF initialized in_bus_reset attempt_root ---Iso Receive DMA--- Current buf: 0 offset: 0 ---Async Receive DMA--- Ar req current buf: 0 offset: 0 AR resp current buf: 0 offset: 0 ---Async Transmit DMA--- AT req prg: 0 sent: 0 free: 32 branchAddrPtr: 00000000 AT req queue: first: 00000000 last: 00000000 AR resp prg: 0 sent: 0 free: 32 branchAddrPtr: 00000000 AT resp queue: first: 00000000 last: 00000000 ### HC Register dump ### Version : 01010000 GUID_ROM : 00000000 ATRetries : 00000822 CSRReadData : 00000000 CSRCompData : 00000000 CSRControl : 80000000 ConfigROMhdr: 04040000 BusID : 31333934 BusOptions : f07da002 GUIDHi : 08004603 GUIDLo : 002aee04 ConfigROMmap: 03258000 PtdWrAddrLo : 00000000 PtdWrAddrHi : 00000000 VendorID : 00000000 HCControl : 004e0000 SelfIDBuffer: 02a11000 SelfIDCount : 00010000 IRMuChMaskHi: 00000000 IRMuChMaskLo: 00000000 IntEvent : 00f00000 IntMask : 840300bf IsoXmIntEvnt: 00000000 IsoXmIntMask: 00000000 IsoRcvIntEvt: 00000000 IsoRcvIntMsk: 00000001 FairnessCtrl: 00000000 LinkControl : 00300200 NodeID : 8800ffc0 PhyControl : 86000600 IsoCyclTimer: 5b3a5219 AsRqFilterHi: 80000000 AsRqFilterLo: 00000000 PhyReqFiltHi: 00000000 PhyReqFiltLo: 00000000 PhyUpperBnd : 00000000 AsRqTrCxtCtl: 00000000 AsRqTrCmdPtr: 00000000 AsRsTrCtxCtl: 00000000 AsRsTrCmdPtr: 00000000 AsRqRvCtxCtl: 00008400 AsRqRvCmdPtr: 02cefa81 AsRsRvCtxCtl: 00008400 AsRsRvCmdPtr: 02cefc81 IntEvent : 00f00000 IsoRCtxCtl00: d0008400 IsoRCmdPtr00: 02cefe81 IsoRCxtMch00: f0000000 IsoRCtxCtl01: 00000000 IsoRCmdPtr01: 00000000 IsoRCxtMch01: 00000000 IsoRCtxCtl02: 00000000 IsoRCmdPtr02: 00000000 IsoRCxtMch02: 00000000 IsoRCtxCtl03: 00000000 IsoRCmdPtr03: 00000000 IsoRCxtMch03: 00000000 ### Phy Register dump ### offset: 1 val: 0x2c -> RHB: 0IBR: 0 Gap_count: 44 offset: 2 val: 0xe3 -> SPD: 3 E : 1 Ports : 3 offset: 3 val: 0x41 -> [port 0] TPA: 1 TPB: 0 | parent disconnected offset: 4 val: 0x88 -> [port 1] TPA: 2 TPB: 0 | child disconnected offset: 5 val: 0x03 -> [port 2] TPA: 0 TPB: 0 | parent disconnected offset: 6 val: 0x00 -> ENV: backplane Reg_count: 0 |