* PPC kernel hangs
@ 2004-10-12 21:24 Rupesh S
2004-10-12 21:36 ` Eugene Surovegin
0 siblings, 1 reply; 8+ messages in thread
From: Rupesh S @ 2004-10-12 21:24 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
To perform a Memory Mapped access of a device, I setup the OR and BR
registers in the bootloader (u-boot). I am able to read and write to
the device being in the u-boot prompt. However, when I try to access
the device after the Linux kernel boots up (say, in a driver), it
gives me a exception message as follows.
#################################################################
enabl0004, DSISR: 00000063
TASK = c3ef4000[18] 'insmod' Last syscall: 128
last math 00000000 last altivec 00000000
GPR00: C60B0338 C3EF5E50 C3EF4000 60000004 00001032 00000001 C018009E C60B0000
GPR08: C60B0BB8 C60B085C C60B0BBC C60B0000 C0180000 10056374 00000000 00000000
3
TASK = c3ef4000[18] 'insmod' Last syscall: 128
last math 00000000 last altivec 00000000
GPR00: C60B0338 C3EF5E50 C3EF4000 60000004 00001032 00000001 C018009E C60B0000
GPR08: C60B0BB8 C60B085C C60B0BBC C60B0000 C0180000 10056374 00000000 00000000
GPR16: 00000000 00000000 00000000 00000000 00009032 C3EF5E98 10064EBC C3E2C000
GPR24: C02EEA80 00000008 C60B2000 00000060 FFFFFFEA 00000000 C60B0000 C60B0000
Call backtrace:
00000000 C60B0338 C0014DE4 C000447C 10050000 1000B27C 1000C344
10003CBC 100038C8 0FE70E88 00000000
#################################################################
My platform is MPC880 Processor.
Do I need to setup something more in the kernel?
--
Rupesh S
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PPC kernel hangs
2004-10-12 21:24 PPC kernel hangs Rupesh S
@ 2004-10-12 21:36 ` Eugene Surovegin
2004-10-12 23:03 ` Jon Masters
0 siblings, 1 reply; 8+ messages in thread
From: Eugene Surovegin @ 2004-10-12 21:36 UTC (permalink / raw)
To: Rupesh S; +Cc: linuxppc-embedded
On Tue, Oct 12, 2004 at 02:24:50PM -0700, Rupesh S wrote:
> Hi,
>
> To perform a Memory Mapped access of a device, I setup the OR and BR
> registers in the bootloader (u-boot). I am able to read and write to
> the device being in the u-boot prompt. However, when I try to access
> the device after the Linux kernel boots up (say, in a driver), it
> gives me a exception message as follows.
> #################################################################
> enabl0004, DSISR: 00000063
> TASK = c3ef4000[18] 'insmod' Last syscall: 128
> last math 00000000 last altivec 00000000
> GPR00: C60B0338 C3EF5E50 C3EF4000 60000004 00001032 00000001 C018009E C60B0000
> GPR08: C60B0BB8 C60B085C C60B0BBC C60B0000 C0180000 10056374 00000000 00000000
> 3
> TASK = c3ef4000[18] 'insmod' Last syscall: 128
> last math 00000000 last altivec 00000000
> GPR00: C60B0338 C3EF5E50 C3EF4000 60000004 00001032 00000001 C018009E C60B0000
> GPR08: C60B0BB8 C60B085C C60B0BBC C60B0000 C0180000 10056374 00000000 00000000
> GPR16: 00000000 00000000 00000000 00000000 00009032 C3EF5E98 10064EBC C3E2C000
> GPR24: C02EEA80 00000008 C60B2000 00000060 FFFFFFEA 00000000 C60B0000 C60B0000
> Call backtrace:
> 00000000 C60B0338 C0014DE4 C000447C 10050000 1000B27C 1000C344
> 10003CBC 100038C8 0FE70E88 00000000
> #################################################################
>
> My platform is MPC880 Processor.
>
> Do I need to setup something more in the kernel?
Did you use ioremap to get valid kernel virtual address for your
device registers? You generally cannot just use physical address to
access device from the device driver.
--
Eugene
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PPC kernel hangs
2004-10-12 21:36 ` Eugene Surovegin
@ 2004-10-12 23:03 ` Jon Masters
2004-10-12 23:05 ` Jon Masters
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jon Masters @ 2004-10-12 23:03 UTC (permalink / raw)
To: Rupesh S, linuxppc-embedded
On Tue, 12 Oct 2004 14:36:34 -0700, Eugene Surovegin <ebs@ebshome.net> wrote:
> Did you use ioremap to get valid kernel virtual address for your
> device registers? You generally cannot just use physical address to
> access device from the device driver.
Possibly also use io_block_mapping on ppc to map a block of IO memory
before ioremapping.
Jon.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PPC kernel hangs
2004-10-12 23:03 ` Jon Masters
@ 2004-10-12 23:05 ` Jon Masters
2004-10-12 23:34 ` Eugene Surovegin
2004-10-14 16:44 ` Rupesh S
2 siblings, 0 replies; 8+ messages in thread
From: Jon Masters @ 2004-10-12 23:05 UTC (permalink / raw)
To: Rupesh S, linuxppc-embedded
On Wed, 13 Oct 2004 00:03:21 +0100, Jon Masters <jonmasters@gmail.com> wrote:
> Possibly also use io_block_mapping on ppc to map a block of IO memory
> before ioremapping.
Actually, in this case that's a bad idea. Ignore that.
Jon.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PPC kernel hangs
2004-10-12 23:03 ` Jon Masters
2004-10-12 23:05 ` Jon Masters
@ 2004-10-12 23:34 ` Eugene Surovegin
2004-10-13 18:00 ` Jon Masters
2004-10-14 16:44 ` Rupesh S
2 siblings, 1 reply; 8+ messages in thread
From: Eugene Surovegin @ 2004-10-12 23:34 UTC (permalink / raw)
To: jonathan; +Cc: linuxppc-embedded
On Wed, Oct 13, 2004 at 12:03:21AM +0100, Jon Masters wrote:
> On Tue, 12 Oct 2004 14:36:34 -0700, Eugene Surovegin <ebs@ebshome.net> wrote:
>
> > Did you use ioremap to get valid kernel virtual address for your
> > device registers? You generally cannot just use physical address to
> > access device from the device driver.
>
> Possibly also use io_block_mapping on ppc to map a block of IO memory
> before ioremapping.
Yes, this is possible but considered obsoleted and not-recommended way
of accessing device registers.
--
Eugene
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PPC kernel hangs
2004-10-12 23:34 ` Eugene Surovegin
@ 2004-10-13 18:00 ` Jon Masters
0 siblings, 0 replies; 8+ messages in thread
From: Jon Masters @ 2004-10-13 18:00 UTC (permalink / raw)
To: jonathan, Rupesh S, linuxppc-embedded
On Tue, Oct 12, 2004 at 04:34:32PM -0700, Eugene Surovegin wrote:
> On Wed, Oct 13, 2004 at 12:03:21AM +0100, Jon Masters wrote:
> > On Tue, 12 Oct 2004 14:36:34 -0700, Eugene Surovegin <ebs@ebshome.net> wrote:
> >
> > > Did you use ioremap to get valid kernel virtual address for your
> > > device registers? You generally cannot just use physical address to
> > > access device from the device driver.
> >
> > Possibly also use io_block_mapping on ppc to map a block of IO memory
> > before ioremapping.
>
> Yes, this is possible but considered obsoleted and not-recommended way
> of accessing device registers.
I realised that after I said it, old habbit.
Jon.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PPC kernel hangs
2004-10-12 23:03 ` Jon Masters
2004-10-12 23:05 ` Jon Masters
2004-10-12 23:34 ` Eugene Surovegin
@ 2004-10-14 16:44 ` Rupesh S
2004-10-14 21:23 ` Jon Masters
2 siblings, 1 reply; 8+ messages in thread
From: Rupesh S @ 2004-10-14 16:44 UTC (permalink / raw)
To: jonathan; +Cc: linuxppc-embedded
Thanks for the informations.
I used "ioremap" and it works !!
However, when I checked out some documentaions on this regard, I
happened to notice that for "cache disabled acees in some arch", we
would probably need to use "ioremap_nocache". My requirement is for a
cache disabled access. Also, I read that in some processor arch, the
"nocache" and the normmal version is all the same. How is it in PPC ?
I could also read that it is encouraged to use "readl", "writel" to
access the memory rather than the normal pointer dereferencing.
However, in my driver, the normal pointer dereferencing works, but the
"readl" and "writel" doesn't work. Here is the code snippet for the
write operation. Any clues ?
################################################################
volatile __u32* __fpga;
__fpga = (__u32*) ioremap_nocache(0x60000000, (4*1024));
/* writel(data, ((__u32)__fpga + 0x0C)); */ /* This does not work */
*(volatile __u32*)((__u32)__fpga + 0x0C) = data; /* This works */
#############################################################
On Wed, 13 Oct 2004 00:03:21 +0100, Jon Masters <jonmasters@gmail.com> wrote:
> On Tue, 12 Oct 2004 14:36:34 -0700, Eugene Surovegin <ebs@ebshome.net> wrote:
>
> > Did you use ioremap to get valid kernel virtual address for your
> > device registers? You generally cannot just use physical address to
> > access device from the device driver.
>
> Possibly also use io_block_mapping on ppc to map a block of IO memory
> before ioremapping.
>
> Jon.
>
--
Rupesh S
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PPC kernel hangs
2004-10-14 16:44 ` Rupesh S
@ 2004-10-14 21:23 ` Jon Masters
0 siblings, 0 replies; 8+ messages in thread
From: Jon Masters @ 2004-10-14 21:23 UTC (permalink / raw)
To: Rupesh S; +Cc: jonathan, linuxppc-embedded
On Thu, Oct 14, 2004 at 09:44:30AM -0700, Rupesh S wrote:
> ################################################################
> volatile __u32* __fpga;
>
> __fpga = (__u32*) ioremap_nocache(0x60000000, (4*1024));
>
> /* writel(data, ((__u32)__fpga + 0x0C)); */ /* This does not work */
>
> *(volatile __u32*)((__u32)__fpga + 0x0C) = data; /* This works */
> #############################################################
Hi Rupesh,
Notice that you're casting as a pointer in one case, and in the other you're not.
Jon.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-10-14 21:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-12 21:24 PPC kernel hangs Rupesh S
2004-10-12 21:36 ` Eugene Surovegin
2004-10-12 23:03 ` Jon Masters
2004-10-12 23:05 ` Jon Masters
2004-10-12 23:34 ` Eugene Surovegin
2004-10-13 18:00 ` Jon Masters
2004-10-14 16:44 ` Rupesh S
2004-10-14 21:23 ` Jon Masters
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).