LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: query regarding access of physical memory from user space
@ 2005-02-12  4:53 Akash kaul
  0 siblings, 0 replies; 2+ messages in thread
From: Akash kaul @ 2005-02-12  4:53 UTC (permalink / raw)
  To: linuxppc-embedded

Hi

Some more doubts about the same thing.

As I am aware, the MPC8260 does not have a separate
I/O address space. 
> Yes,The MPC8260 I/O address space is mapped into 
> the Processors address space itself i,e the 256 Kb
> Internal memory which can be located anywhere in the
> 4 GB adress space using the IMMR register

So,
with reference to my earlier mail, when do we need to
use ioremap() and when
do we need to use request_mem_region()? Or do we need
to use both in a
particular sequence?

> For the MPC8260 you can access the I/O region  
> directly without an need for mapping.U can access 
> it thru the IMMR base address value.And specific 
> registers can be accessed by adding the register 
> offset to this value

Also, if I just do an ioremap(), can I directly access
those remapped
addresses with inb()/outb() or writeb()/readb()? Or is
something more to be
done prior to accessing it?

> u dont have to do an ioremap



Regards

Vijay Padiyar

http://www.vijaypadiyar.eu.tf




		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

^ permalink raw reply	[flat|nested] 2+ messages in thread
* query regarding access of physical memory from user space
@ 2005-02-11 14:16 Vijay Padiyar
  0 siblings, 0 replies; 2+ messages in thread
From: Vijay Padiyar @ 2005-02-11 14:16 UTC (permalink / raw)
  To: Embedded TUX, LinuxPPC Support

Hi

I am a bit new to Linux and therefore am unable to appreciate exactly the
use of various techniques used to map physical memory to user or kernel
space. I have come across functions like ioremap(), remap_page_range(), etc.
I am still a _bit_ confused as to exactly what to use for our purpose.

I have an MPC8260 target with 128 MB SDRAM (0x00000000 - 0x07FFFFFF), 32 MB
FLASH (0xFE000000 - 0xFFFFFFFF). In between, I have some CPLDs and FPGAs
mapped at various physical addresses. I wish to access these devices from a
user program or from a device driver inserted into the kernel.

Please tell me how do I go about it?

What I have done right now is to use ioremap() to remap a section of
physical memory to kernel virtual memory and try to use it.

For example, we have a CPLD whose registers we wish to manipulate. These
registers lie in the address range 0x30000000 - 0x300000FF. I map this range
as follows:

unsigned char *cpld_mem;

cpld_mem = (unsigned char *)ioremap(0x30000000, 0x100);

Is this correct? After I do this, can I write to and read from the physical
memory locations 0x30000000-0x300000FF using writeb() and readb()? Or do I
have to use outb() and inb()?

Please do clarify my doubts. Also, what is the *highest memory address* as
well as *maximum memory size* that I can map to kernel or user space using
ioremap()?

In other words, can I map any address in the 32-bit address space to kernel
virtual space using ioremap()? Also, what chunk size of memory can I map in
one go?

Please give me some ideas regarding my doubts. I need to get finished with
the driver soon.

Regards

Vijay Padiyar

http://www.vijaypadiyar.eu.tf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-12  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-12  4:53 query regarding access of physical memory from user space Akash kaul
  -- strict thread matches above, loose matches on Subject: below --
2005-02-11 14:16 Vijay Padiyar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox