linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Reg. virtual address space in embedded linux
@ 2006-07-22  5:55 jagannathanjay
  2006-07-25  4:03 ` David H. Lynch Jr.
  0 siblings, 1 reply; 2+ messages in thread
From: jagannathanjay @ 2006-07-22  5:55 UTC (permalink / raw)
  To: linuxppc-embedded


[-- Attachment #1.1: Type: text/plain, Size: 958 bytes --]

 Hi all
 
 We are porting third party driver code from vxworks to Embedded linux in MPC 8260 under a evaluation platform from Embedded Planet in linux kernel space.
 
  The first step we carried out was reading the chip id and we were able to read the chip id correctly.   For reading the chip id we used the routine ChipReadMemory in the attached text and we were able to retrive the chip id successfully.   Subsequently when we write and read from Chip Specific Control Status registers ,it didn't work.   I checked the manual and the Chip Specific Control Status registers have RW access.   Any inputs on how to check if the write we made to virtual address succeeds?   Is there a way to dump the linux virtual address and examine the write we made ?
 
 Regards
 Jay
  
   
________________________________________________________________________
Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.

[-- Attachment #1.2: Type: text/html, Size: 2129 bytes --]

[-- Attachment #2: RWroutines.txt --]
[-- Type: text/plain, Size: 831 bytes --]

int ChipReadMemory(unsigned int arg_phys_addr,unsigned int *memValue)
{
  void  *virt_addr = NULL;
  unsigned int phys_addr = 0;

  phys_addr =  DEVICE_BASE_ADDRESS + arg_phys_addr;
  virt_addr = ioremap(phys_addr, 4);
  if(virt_addr == NULL)
  {
     printk("ChipReadMemory: unable to perform ioremap \n");
     return -1;
  }
  *memValue  = readl(virt_addr);
    iounmap(virt_addr);
    return 0;
}


int ChipWriteMemory(unsigned int arg_phys_addr, unsigned int arg_val)
{
  void  *virt_addr = NULL;
  unsigned int phys_addr = 0;
  phys_addr =  DEVICE_BASE_ADDRESS + arg_phys_addr;
  virt_addr = ioremap(phys_addr, 4);
  if(virt_addr == NULL)
  {
     printk("ChipWriteMemory : unable to perform ioremap \n");
     return -1;
  }
  writel(arg_val,virt_addr);
  iounmap(virt_addr);
   return 0;
}

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

end of thread, other threads:[~2006-07-25  4:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-22  5:55 Reg. virtual address space in embedded linux jagannathanjay
2006-07-25  4:03 ` David H. Lynch Jr.

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).