-----Original Message----- From: jhoney jhoney [mailto:jhoney_joney@xxxxxxxxxxxxxx] Sent: Thursday, October 21, 2004 11:38 AM To: Thekkedath, Gopakumar Cc: kernelnewbies@xxxxxxxxxxxx Subject: Re: RE: Problem in getting kernel vritual address >The ioremap() should be used with IO memory only not with processor >physical address. well, the ioremap and its variations are used when you want to access a >physical address but there is no mapping for it at the page tables yet. For example in case of PCI devices after we read the physical addresss where its registers are mapped from the configuration space BAR registers, we call ipremap to create mappings for them in the page tables. The return value is the virtual address which when used will translate to the required physical address. What i understood from your query was that, u want to access physical address 0xfdf00000, and that is why i suggested ioremap, you can use macros/functions like __va, or phys_to_virt only if there already 'EXISTS' mappings for those physical addresses, are you sure you have one ?. -----Original Message----- From: jhoney jhoney [mailto:jhoney_joney@xxxxxxxxxxxxxx] Sent: Thursday, October 21, 2004 11:38 AM To: Thekkedath, Gopakumar Cc: kernelnewbies@xxxxxxxxxxxx Subject: Re: RE: Problem in getting kernel vritual address Hello Gopa, The ioremap() should be used with IO memory only not with processor physical address. For your information Regards Jhoney On Thu, 21 Oct 2004 Thekkedath,Gopakumar wrote : > > > >virtual_address = __va(0xfdf00000) to get the virtual address for > >CCSRBAR , which contains fdf00000 at offset zero.(It contains it's > >address at the offset zero from the CCSRBAR). > > >If I dereference the virtual_address( *virtual_address = fdf00000) > >it should contain the same address. But when i tried this , it result in > >segmentation fault. pls give me any clue. > > I am not sure, but probably you should use ioremap(). -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/