From: Alexandre P. N. <al...@om...> - 2006-02-02 14:18:42
|
Dave Hylands escreveu: >Hi Alexandre, > > > >>>Actually, if the proc_gpio module registered a simple driver, it could >>>mmap just the GPIO registers. Then root privledges wouldn't be >>>required. >>> >>> >>> >>Not quite, if you want to have a performance level close to userspace. >>In order to do uncached memory map to user space, you have to do it >>[map, not write] on physical page boundaries, and you have to map at >>least an entire page (4kb). Otherwise you do cached access, and that >>doesn't work for arm registers at all because it violates almost all of >>the requirements (in-order immediate reads/writes, size-sensitive >>reads/writes, etc). I don't have the register layout on my front right >>now but I think that it has these restrictions, so the only path left is >>mmap when performance is the goal. >> >> > >So I took a look through the pxa-255 Developer's Manual. All of the >GPIO registers are in the range: > >0x40E0_0000 thru 0x40E0_0068 > >The next highest register is 0x40F0_0000 so all of the GPIO registers >fit within a single 4k page, and that single 4k page only includes the >GPIO registers :) > > > Ah, intel is that smart. So yes, you can map a single page as you expected, that's good news for me :-) Thank you for taking the time to check, I wouldn't so soon heh! :-) I think that's one of the simplest solutions available then. You lack further individual pin access control but it's very simple to implement on the userspace point of view. Worth the shot :-) Alexandre |