PPC460EX - Machine check in kernel mode - when accessing I/O in user space
Josh Boyer
jwboyer at gmail.com
Wed Sep 10 11:29:53 EST 2008
On Tue, Sep 09, 2008 at 04:34:07PM -0700, Henry Bausley wrote:
>I am trying to give user space application access to I/O. Previously I
>used 2.6.14 with RT Linux and made a kernel device driver with a mmap
>routine on a 440EP.
>
>I am converting to a PPC460Ex with 2.6.26-2 with Xenomai the same code
>results in a Machine Check in Kernel mode when I attempt to use the code
>in user space.
>
>
>The io memory is in the device tree and with ioremap and I can read and
>write to it in kernel mode with
>
>of_address_to_resource(np,0,&res)
>piom = (unsigned *) ioremap( res.start, RTL_SHIOM_SIZE);
>
>
>
>In addition I tried
>
> void *map_base, * virtAddr;
> off_t target = ((unsigned int)addr) & ~MAP_MASK;
> int fd;
>
> if ((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) {
> printf("/dev/mem could not be opened.\n");
> exit(1);
> }
>
> /* Map one page */
> map_base = mmap((void *)target, length, PROT_READ | PROT_WRITE,
> MAP_SHARED, fd, target);
You want mmap2 here. The I/O on 440EPx is above 4GiB.
josh
More information about the Linuxppc-embedded
mailing list