Re: Memory Mapped Access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jhoney,

> And Also how to conver the kernel virtual address to the
> physical address as the DMA hardware sees only the physical addresses.

You can use ioremap to get a virtual address that you can use to write to. 

unsigned long value = 0;
unsigned char *buff = NULL;

Say mem_addr contains memory/IO base address-0 from config space,
extract only base address removing lower bits and then do:

buff = ioremap (mem_addr, 0x40)
value = readl (buff)

On Mon, 22 Nov 2004 11:03:00 -0600, Curran, Dominic <dcurran@xxxxxx> wrote:
>  
> To read/write to IO memory (PCI registers) use the readl()/writel() family. 

Before that shouldn't one remap to get a virtual address as shown above?

Regards,

K Shakthi

----------------------------------------------------------------------------------
K Shakthi
Specsoft (Hexaware Technologies), ASIC Design Center 
http://www.geocities.com/shakthimaan
----------------------------------------------------------------------------------

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux