2008-10-21 18:45:32 PPI read "hanging" (BF54x)
Isaac Leung (CANADA)
Message: 64003
We are using a BF54x device on our custom board, so we modified the existing PPI driver to work with the BF54x series. For our particular purpose, it uses the EPPI1 port.
We're at the point where we have verified that WRITING to the PPI works as we want it to. Now we want to read back from the port. The problem is that when we try that, the program "hangs". It's not frozen, it's just idle, waiting for some sort of trigger or data.
It's been tracked down to one line in our driver in the "ppi_read" function. This line is just:
wait_event_interruptible(*(pdev->rx_avail), pdev->done);
For some reason, it never triggers so it waits there forever. Hopefully it's just a usage/configuration problem?
For reading, we have it configured the same way as for writing (which is verified to work), with the following exceptions:
- Port direction is changed, of course.
- Frame sync mode is set to "1", not "2". For write, we use GP2 mode to take advantage of other Frame Sync features, such as DEN on FS3.
- FIELD_SELECT is set to "1" for internal trigger (we have tried external as well, with some signal on the FSx pins, but doesn't work either)
- Number of dimensions set to 1 instead of 2 for writ
Does the read have a minimum length for it to work? We found for a write, it had to do write of at least 64 items.
Can anyone suggest where I might start looking/debugging to determine the cause of this stall? I assume with internal sync and fs, it should just "go" when I ask for a read, I don't have to supply any other external trigger or stimulus, do I? (PPI_CLK?)
Thanks,
Isaac
QuoteReplyEditDelete
2008-10-22 02:17:43 Re: PPI read "hanging" (BF54x)
Mike Frysinger (UNITED STATES)
Message: 64015
look at the interrupt handler as that is what will wake things up. if the interrupt isnt firing (you can check /proc/interrupts), then you need to check the PPI configuration / status and put a logic analyzer on the pins to make sure they're toggling correctly.
QuoteReplyEditDelete
2008-10-22 12:51:08 Re: PPI read "hanging" (BF54x)
Isaac Leung (CANADA)
Message: 64052
We believe the interrupt is not firing. The question is why is the interrupt not firing. (If I'm not mistaken, same interrupt handling function that is used for the rest of the driver, and write works).
There's nothing to check on the pins. We know a WRITE works, the pins toggle correctly, but for a READ, what are the relevant control signals if we have configured it to trigger internally using internally supplied clock? None of the pins (at least to my understanding) should be an output when in READ mode. And for READ setup in such a manner, I should not have to provide any stimulus, correct? (Aside from data on the read pins, of course).