* linuxppc-embedded help needed:kernel access of bad area
@ 2005-11-30 8:18 zengshuai
0 siblings, 0 replies; 2+ messages in thread
From: zengshuai @ 2005-11-30 8:18 UTC (permalink / raw)
To: ppc
i writed a led driver for PQ2FADS(a ppc board).
but i can't read/write 0x04500000 where led register addr locate in.
i tested two ways to do that.
first,
p=0x04500000;
*p=0x12;
....
second,
outb(0x12,0x04500000);
...
two ways both didn't work.they had a some wrong:kernel access of bad area.
how can i know which area is bad area or good area?
and what can i do next? thanks.
------------------------------
我现在使用Sogou.com的2G邮箱了,你也来试试吧!
http://mail.sogou.com/recommend/sogoumail_invite_reg1.jsp?from=sogouinvitation&s_EMAIL=zengshuai%40sogou.com&username=linuxppc-embedded&FullName=linuxppc-embedded&Email=linuxppc-embedded%40ozlabs.org&verify=755eff4e640bdcfc57d93cbd8b0a9cb7
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: linuxppc-embedded help needed:kernel access of bad area
@ 2005-11-30 9:33 Fillod Stephane
0 siblings, 0 replies; 2+ messages in thread
From: Fillod Stephane @ 2005-11-30 9:33 UTC (permalink / raw)
To: zengshuai, ppc
Dear zengshuai,
zengshuai@sogou.com wrote:
> i writed a led driver for PQ2FADS(a ppc board).
> but i can't read/write 0x04500000 where led register addr locate in.
> i tested two ways to do that.
> first,
> p=3D0x04500000;
> *p=3D0x12;
> ....
> second,
> outb(0x12,0x04500000);
> ...
> two ways both didn't work.they had a some wrong:kernel access of bad
area.
> how can i know which area is bad area or good area?
> and what can i do next? thanks.
Do yourself a favor, read a book about Linux device driver development,
for example one listed[1] in the excellent Denx's DLUG FAQ[2].
Getting some training on PowerPC development is a good idea too.
[1] http://www.denx.de/wiki/view/DULG/MoreInformationBooks
[2] http://www.denx.de/wiki/DULG/Manual
Peruse also your chip data-sheet, and you will see that outb() is
non-sense.
If you are accessing the led register from kernel space, you'll find
a solution using ioremap(). Otherwise, if you are accessing the led
register
from user space, this link[3] will help you, or this shorter one[4].
You can follow this thread[5] for more information.
[3]
http://www.denx.de/twiki/bin/view/PPCEmbedded/DeviceDrivers#Section_Acce
ssingPeripheralsFromUserSpace
[4] http://tinyurl.com/6c7th
[5] http://lists.linuxppc.org/linuxppc-embedded/200403/msg00059.html
Please next time, do ourselves a favor, try some searching first
(google,=20
whatever). Your question is a FAQ.
Regards,
--=20
Stephane
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-11-30 9:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-30 8:18 linuxppc-embedded help needed:kernel access of bad area zengshuai
-- strict thread matches above, loose matches on Subject: below --
2005-11-30 9:33 Fillod Stephane
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).