linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* How does one get physical address for iorempped window?
@ 2001-02-15 16:05 Subodh Nijsure
  2001-02-15 17:03 ` Dan Malek
  0 siblings, 1 reply; 9+ messages in thread
From: Subodh Nijsure @ 2001-02-15 16:05 UTC (permalink / raw)
  To: linuxppc-embedded


[ Perhaps not directly linux-ppc question ]

I am trying to get jffs working on my board and in trying to debug this
I need to know this.  The jffs driver requires that I map the flash address
space usinng ioremap_nocache or ioremap, when debugging I need to see exactly
which addresses its writing the CFI query commands.

My question is --

If I map memory window using ioremap_nocache() if I use virt_to_phys()
should one get back the actual physical address? If virt_to_phys is not
the correct function to use, how do I get  exact physical address?

Thanks.

/Subodh Nijsure

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: How does one get physical address for iorempped window?
@ 2001-02-15 17:58 Subodh Nijsure
  2001-02-15 18:10 ` Dan Malek
  2001-02-18 16:28 ` Matt Porter
  0 siblings, 2 replies; 9+ messages in thread
From: Subodh Nijsure @ 2001-02-15 17:58 UTC (permalink / raw)
  To: 'Dan Malek'; +Cc: linuxppc-embedded


I know the physical address I should be writing to.

For debugging I was trying to print exact physical address where
write is happening .When I used virt_to_phys() on the addresse
ioremap() I was not getting back the original physical address.
Hence the question.

Basically code I have looks like this.

unsigned long physaddr;

physmap_map.map_priv_1 = (unsigned
long)ioremap_nocache(WINDOW_ADDR,WINDOW_SIZE);
printk("Physical window (0x%08X size)starting at 0x%08X is mapped to address
0x%08X \n",
            WINDOW_SIZE,WINDOW_ADDR, physmap_map.map_priv_1);
physaddr = virt_to_phys((void *)physmap_map.map_priv_1);
printk("virtual address 0x%08X maps to physical 0x%08X \n",
                        physmap_map.map_priv_1 ,physaddr);

The output I was getting is this.

Physical window (0x00400000 size) starting at 0x28000000 is mapped to
address 0xC5012000
virtual address 0xC5012000 maps to physical 0x05012000


/Subodh Nijsure


> -----Original Message-----
> From: Dan Malek [mailto:dan@mvista.com]
> Sent: Thursday, February 15, 2001 9:03 AM
> To: Subodh Nijsure
> Cc: linuxppc-embedded@lists.linuxppc.org
> Subject: Re: How does one get physical address for iorempped window?
>
>
>
> Subodh Nijsure wrote:
>
> > If I map memory window using ioremap_nocache() if I use
> virt_to_phys()
> > should one get back the actual physical address?
>
> Ummmm....you give ioremap_nocache() a physical address to map, so
> you have to know it........Using virt_to_phys() may not give you
> the proper physical address, depending upon the platform.  I'm working
> on a solution for 2.5 that will work.  Currently, it is wrapped into
> a heavier weight virt_to_bus/phys() but that many not be the right
> place.
>
>
>
> 	-- Dan
>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: How does one get physical address for iorempped window?
@ 2001-02-19 19:15 mod+linuxppc-embedded
  2001-02-19 19:53 ` Dan Malek
  0 siblings, 1 reply; 9+ messages in thread
From: mod+linuxppc-embedded @ 2001-02-19 19:15 UTC (permalink / raw)
  To: linuxppc-embedded


>virt_to_*/*_to_virt functions _should_ have become
>something more generic, but they are just yet another macro
>name for doing the same thing.  Now, we have gone of and
>created some pci_* mapping functions, which are not at all
>useful for highly integrated processors because their
>integrated features are not PCI devices.  Yet another set
>of functions for integrated processors?  I don't think so.
>
>I think that requiring knowledge of the object attributes
>for a VM or physical space so you can call the proper
>mapping or other management functions is just a poor
>design.  If you know this information and wish to take
>performance enhancement shortcuts, that's fine, but it
>shouldn't be required.


What if you're working on a system with multiple PCI
busses (or even multiple disparate bus types) and it's
not possible to map Host memory at the same address on
all busses?  Being able to refer to something like, say,
the appropriate pci_bus* when invoking virt_to_bus()
could make it possible to accomodate those different
mappings.  I'm certainly not a fan of pointlessly
complex code, but the one-size-fits-all implementation
of virt_to_bus() seen in my 25Jan-vintage kernel sources
(it just lops off the KERNEL_OFFSET bits and adds
pci_dram_offset) won't work in situations such as those
I just described.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: How does one get physical address for iorempped window?
@ 2001-02-19 21:12 mod+linuxppc-embedded
  0 siblings, 0 replies; 9+ messages in thread
From: mod+linuxppc-embedded @ 2001-02-19 21:12 UTC (permalink / raw)
  To: linuxppc-embedded


>> ...  I'm certainly not a fan of pointlessly
>> complex code, but the one-size-fits-all implementation
>> of virt_to_bus()....
>
>That's not a one-size-fits-all implementation :-).


You're right - I should have said "procrustean"...   ;->


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2001-02-19 21:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-15 16:05 How does one get physical address for iorempped window? Subodh Nijsure
2001-02-15 17:03 ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2001-02-15 17:58 Subodh Nijsure
2001-02-15 18:10 ` Dan Malek
2001-02-18 16:28 ` Matt Porter
2001-02-19 17:59   ` Dan Malek
2001-02-19 19:15 mod+linuxppc-embedded
2001-02-19 19:53 ` Dan Malek
2001-02-19 21:12 mod+linuxppc-embedded

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