* 405EP peripheral memory access
@ 2003-10-29 14:08 Paul Miller
2003-10-29 17:32 ` Conn Clark
0 siblings, 1 reply; 3+ messages in thread
From: Paul Miller @ 2003-10-29 14:08 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I am new to Linux embedded programming. I have experience programming
microcontrollers and DSPs without an operating system, so I have some
idea what I'm doing. Anyhow, I'm trying to use the peripheral memory
bus on my 405EP CerfCube from Intrinsyc. Does anyone have an example
that I can work from?
To setup the memory's timings, I need access to the DCR register. In
the PowerPC datasheet it says to use assembly instructions mtdcr and
mfdcr. I don't know much about assembly, but I found a kernel patch
that uses these functions. So, working off this patch, I tried making
a simple program to read these registers. When I run it, Linux reports
an "Illegal instruction" and doesn't let me access the register.
Does access to this bus need to be done in "kernel mode"? If so, where
can I find more information about writing a kernel driver? Ideally,
I'd like to just open a device file and read/write to the bus.
Thanks!
-Paul
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: 405EP peripheral memory access
@ 2003-10-29 14:31 Steven Blakeslee
0 siblings, 0 replies; 3+ messages in thread
From: Steven Blakeslee @ 2003-10-29 14:31 UTC (permalink / raw)
To: 'Paul Miller', linuxppc-embedded
I would recommend you get the following books.
Embedded Linux: Hardware, Software, and Interfacing by Craig Hollabaugh
Linux Device Drivers, 2nd Edition by Alessandro Rubini, Jonathan Corbet
Building Embedded Linux Systems by Karim Yaghmour
-----Original Message-----
From: Paul Miller [mailto:pmiller9@users.sourceforge.net]
Sent: Wednesday, October 29, 2003 9:08 AM
To: linuxppc-embedded@lists.linuxppc.org
Subject: 405EP peripheral memory access
Hi,
I am new to Linux embedded programming. I have experience programming
microcontrollers and DSPs without an operating system, so I have some
idea what I'm doing. Anyhow, I'm trying to use the peripheral memory
bus on my 405EP CerfCube from Intrinsyc. Does anyone have an example
that I can work from?
To setup the memory's timings, I need access to the DCR register. In
the PowerPC datasheet it says to use assembly instructions mtdcr and
mfdcr. I don't know much about assembly, but I found a kernel patch
that uses these functions. So, working off this patch, I tried making
a simple program to read these registers. When I run it, Linux reports
an "Illegal instruction" and doesn't let me access the register.
Does access to this bus need to be done in "kernel mode"? If so, where
can I find more information about writing a kernel driver? Ideally,
I'd like to just open a device file and read/write to the bus.
Thanks!
-Paul
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: 405EP peripheral memory access
2003-10-29 14:08 405EP peripheral memory access Paul Miller
@ 2003-10-29 17:32 ` Conn Clark
0 siblings, 0 replies; 3+ messages in thread
From: Conn Clark @ 2003-10-29 17:32 UTC (permalink / raw)
To: Paul Miller; +Cc: linuxppc-embedded
Paul Miller wrote:
> Hi,
>
> I am new to Linux embedded programming. I have experience programming
> microcontrollers and DSPs without an operating system, so I have some
> idea what I'm doing. Anyhow, I'm trying to use the peripheral memory
> bus on my 405EP CerfCube from Intrinsyc. Does anyone have an example
> that I can work from?
If I remember correctly the Cerf Cube uses PPCboot/U-Boot and ships with
the source on a CD.
>
> To setup the memory's timings, I need access to the DCR register. In
> the PowerPC datasheet it says to use assembly instructions mtdcr and
> mfdcr. I don't know much about assembly, but I found a kernel patch
> that uses these functions. So, working off this patch, I tried making
> a simple program to read these registers. When I run it, Linux reports
> an "Illegal instruction" and doesn't let me access the register.
Did you make calls to the patched kernel or paste this function into
your user mode program? Some registers are priviledged and only the
kernel is allowed to touch them. If you had this function in a user
program it won't work.
>
> Does access to this bus need to be done in "kernel mode"? If so, where
> can I find more information about writing a kernel driver? Ideally,
> I'd like to just open a device file and read/write to the bus.
>
I wrote my first kernel driver based on an example found at
http://www.denx.de . Though It was for kernel version 2.2.x and the
Motorla 8xx processor, the example was quite helpful and could still be
for you. Its at the botom of the page here
http://www.denx.de/e/index1.php?head=solution-se-head&main=solution-se&subnav=solution-se-subnav&logo=logo-se&mainnav=softwarenav&bottom=bottom-se
One aproach you might take is modifying the PPCBoot source and mapping
your device to a memory address and access it using the memory map
functions in the kernel.
> Thanks!
> -Paul
>
>
Its going to be ruff in the begining, but it gets easier. Have fun.
Conn Clark
--
*****************************************************************
If you live at home long enough, your parents will move out.
(Warning they may try to sell their house out from under you.)
*****************************************************************
Conn Clark
Engineering Stooge clark@esteem.com
Electronic Systems Technology Inc. www.esteem.com
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-10-29 17:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-29 14:08 405EP peripheral memory access Paul Miller
2003-10-29 17:32 ` Conn Clark
-- strict thread matches above, loose matches on Subject: below --
2003-10-29 14:31 Steven Blakeslee
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).