From: sudheer <urwithsudheer@gmail.com>
To: Steven Kaiser <skaiser.uci@gmail.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: MPC5200b kernel module memory mapping
Date: Thu, 21 Sep 2006 14:17:37 +0530 [thread overview]
Message-ID: <451251A9.9080504@gmail.com> (raw)
In-Reply-To: <000001c6dd12$417d7a50$6e4ec880@volt>
Hi Stevenson Kaiser,
Steven Kaiser wrote:
> #define MPC5xxx_MM_IPBI (MPC5xxx_MBAR + 0x0054)
>
> void *ioaddr = NULL;
>
>
> // map our physical address into kernal virtual address space
> // do I need this call?
> ioaddr = ioremap(MALab_MM_START,MALab_MM_SIZE);
>
>
Try typecasting. ioaddr = (u16 *)ioremap (start, size );
Regards
Sudheer
> return 0;
> }
>
> Later (in a ioctrl routine), I will try and write something to the first
> location in my address range. I tried these three ways:
>
> *(volatile u16 *)MALab_MM_START = 0x5555;
> outw(0x5555,MALab_MM_START);
> outw(0x5555,ioaddr);
>
> Any and all of the these calls crash the kernel so horrendously I have to
> reboot. Sometimes I have to delete and mknod a new /dev entry.
>
> I have tried the io memory map technique instead of the above io port map
> technique, using request_mem_region(), with the same crashing results upon
> any writew() call or direct variants. I tried things without the ioremap()
> call-- I get a segmentation fault in these cases.
>
> The request_region() or request_mem_region() seems to work ok. I can cat
> /proc/iomem or /proc/ioports and see my range in there. I am pretty sure I
> am setting up the LocalBus chip select registers ok.
>
> Yet obviously I am doing something profoundly stupid. Is my error obvious?
> Can someone enlighten me in my darkness?
>
> Steven Kaiser
> Chemistry Electronics Facility
> University of California, Irvine
> 2347 Natural Sciences 2
> Irvine, CA 92697-2025
> (949)824-7520
>
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
next prev parent reply other threads:[~2006-09-21 8:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-21 0:09 MPC5200b kernel module memory mapping Steven Kaiser
2006-09-21 8:47 ` sudheer [this message]
2006-09-21 18:10 ` Markus Klotzbücher
2006-09-23 20:46 ` Steven Kaiser
2006-09-23 20:55 ` Steven Kaiser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=451251A9.9080504@gmail.com \
--to=urwithsudheer@gmail.com \
--cc=linuxppc-embedded@ozlabs.org \
--cc=skaiser.uci@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).