Hi!
I've made a bit of progress and now the MUSB client driver is kinda working, but
in a very hackish way.
The first thing I did was to disable caching and buffering in L4.. And it was a fiasco.
The good news is that reading IO memory via the DS attached pointer
and via the mmio Register class seems to bring identical results.
Turned out, the wrong data came from musb_read_fifo function.
This function calls __raw_readl, __raw_readb, __raw_readw functions. I think I have implemented
them correctly given that unaligned access works fine in genode. I would appreciate if someone
takes a look at them.
Turns out, there's a single FIFO register and when you read from it or write to it, the controller immediately
feeds it with the new data. So, maybe multiple unaligned access caused it to fail.
What I did was to comment out musb_{write,read}_fifo code and manually read the data. First I decided
to read by 4-byte words, but that failed. To my surprise, reading by single bytes did the trick and the driver
is now receiving the correct data and the host recognizes the device, albeit at the third attempt.
I'm attaching the dmesg from my destkop to see how the device behaves from the point I reboot
the pandaboard to the point the musb client driver is recognized.
I'm out of the ideas as to what's going on here. Does anyone have any suggestions?
And, btw, I've found a small bug in dde_linux. In the file
dde_linux/src/drivers/usb/arm/platform/lx_emul.h
the definition SZ_4K = 0x00001000a, seems clearly wrong to me. That 'a' at the end is probably
a bad typo. When I figure out the musb issues, I'll submit a pull request for this if no one else does that before.
--
Regards, Alexander