linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* ioremap() question
@ 2004-05-26 14:35 Oliver Korpilla
  2004-05-26 17:12 ` Eugene Surovegin
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Korpilla @ 2004-05-26 14:35 UTC (permalink / raw)
  To: linuxppc-embedded


Hello!

I start with a CPU physical address somwhere within the PCI bridge space: 0x85000000
Then I use ioremap_nocache on it to obtain a (range of) virtual address(es):
0xC302D000
And then I use virt_to_bus() to obtain an address to hand over to the PCI device:
0x0302D000


While I do see this conforms to the implementation of virt_to_bus(), I cannot
decide whether this makes sense.

Is ioremap() fixed, so it always returns the same virtual addresses for the same
given physical ones?

Or does it return "what's available" in virtual address space (so the above bus
address would be somehow bogus I guess)?

Would a function like phys_to_bus() give me the same result?

Thanks in advance,
Oliver Korpilla

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

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

* Re: ioremap() question
  2004-05-26 14:35 ioremap() question Oliver Korpilla
@ 2004-05-26 17:12 ` Eugene Surovegin
  2004-05-27  6:37   ` Oliver Korpilla
  2004-05-27  7:17   ` Oliver Korpilla
  0 siblings, 2 replies; 4+ messages in thread
From: Eugene Surovegin @ 2004-05-26 17:12 UTC (permalink / raw)
  To: Oliver Korpilla; +Cc: linuxppc-embedded


On Wed, May 26, 2004 at 04:35:19PM +0200, Oliver Korpilla wrote:
>
> Hello!
>
> I start with a CPU physical address somwhere within the PCI bridge space:
> 0x85000000
> Then I use ioremap_nocache on it to obtain a (range of) virtual address(es):
> 0xC302D000
> And then I use virt_to_bus() to obtain an address to hand over to the PCI
> device:
> 0x0302D000

You cannot use virt_to_bus() on ioremap returned addresses.

Eugene.

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

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

* Re: ioremap() question
  2004-05-26 17:12 ` Eugene Surovegin
@ 2004-05-27  6:37   ` Oliver Korpilla
  2004-05-27  7:17   ` Oliver Korpilla
  1 sibling, 0 replies; 4+ messages in thread
From: Oliver Korpilla @ 2004-05-27  6:37 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: linuxppc-embedded


Eugene Surovegin wrote:

>On Wed, May 26, 2004 at 04:35:19PM +0200, Oliver Korpilla wrote:
>
>
>You cannot use virt_to_bus() on ioremap returned addresses.
>
>
>
Thanks! Do I need something like phys_to_bus() instead?

With kind regards,
Oliver Korpilla

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

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

* Re: ioremap() question
  2004-05-26 17:12 ` Eugene Surovegin
  2004-05-27  6:37   ` Oliver Korpilla
@ 2004-05-27  7:17   ` Oliver Korpilla
  1 sibling, 0 replies; 4+ messages in thread
From: Oliver Korpilla @ 2004-05-27  7:17 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: linuxppc-embedded


Eugene Surovegin wrote:

>You cannot use virt_to_bus() on ioremap returned addresses.
>
>Eugene.
>
>
>
Hello!

Maybe I may go like this:

I know my PCI from the device bus, so:

unsigned long bus_address;
struct pci_bus *my_bus = universe_pci_dev->bus;
bus_address = pci_phys_to_bus(physical_address, my_bus->number);

Since pci_phys_to_bus() is an exported symbol, this should work in my
module, shouldn't it?

Thanks in advance,
Oliver Korpilla

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

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

end of thread, other threads:[~2004-05-27  7:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-26 14:35 ioremap() question Oliver Korpilla
2004-05-26 17:12 ` Eugene Surovegin
2004-05-27  6:37   ` Oliver Korpilla
2004-05-27  7:17   ` Oliver Korpilla

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