2009-03-05 05:21:14 xenomai and user-space "driver"
Thorsten Pohlmann (GERMANY)
Message: 70441
Hi!
Background: ucLinux 2008R1.5 with enabled xenomai and I/D cache on a custom BF537 board.
We need hard realtime response to irqs and dma, so we use xenomai. To avoid segmentation of the project into a bunch of kernel-modules and user-space xenomai appls, I tried to put it all together into one single user-space xenomai rt-appl which would work fine except one point:
I can map the BF's sysreg space (>0xffc00000), but if i access it (for DMA and GPIO) from the xenomai-task, i get the inevitable "illegal access to supervisor space" BUG since that space is protected by the CPLBs. It seems that, even it is a rt-task, a xenomai task keeps running in user mode.
So is there a way to leverage the rt-task to supervisor-mode or (a linuxish way) to modify the CPLBs?
A workaround would be to build a rtdm-driver which incoorporates the gpio and dma-stuff, but that would complicate the whole thing ;-) and makes the module GPL.
(I know direct access to dma and gpios is considered "bad", but our distribution is stripped down )
regards, Thorsten
TranslateQuoteReplyEditDelete
2009-03-05 12:54:52 Re: xenomai and user-space "driver"
Mike Frysinger (UNITED STATES)
Message: 70457
CPLBs should never be mucked with under Linux. dont do it.
not that it would matter here as the MMRs do not have any CPLB mappings in the first place. they are hard wired to supervisor access only. so you will need to write something that runs in supervisor mode that'll do the changes for you.
QuoteReplyEditDelete
2009-03-05 21:20:52 Re: xenomai and user-space "driver"
Sonic Zhang (CHINA)
Message: 70481
No, you can't. Please following the Linux programming model. Do device access in kernel driver only.
QuoteReplyEditDelete
2009-03-10 06:28:26 Re: xenomai and user-space "driver"
Thorsten Pohlmann (GERMANY)
Message: 70686
Hi!
You are right, I forgot that the sysregs are hardwired to supervisor mode. Meanwhile i made a rtdm-module which handles all this stuff. It was not that painful I expected :-)
regards, Thorsten