Re: [PATCH 0/13] Atari EtherNAT/EtherNEC/NetUSBee support

Geert Uytterhoeven
2013-05-02T20:12:46Z

On Wed, May 1, 2013 at 12:10 AM, Michael Schmitz
<schmitz@mail.biophys.uni-duesseldorf.de> wrote:
> Another question: Is there a way to find out which physical address maps to
> a given ioremapped one?
>
> If I let the USB driver print the physical address, the ioremapped address,
> and the result of __pa() on the ioremapped one, I get:
>
> ISP116X probe: data 80000012 virt. 21098012 pa 21098012 , addr 80000016
> virt. 21096016 pa 21096016
>
> for the EtherNAT instance, and
>
> ISP116X probe: data 00000340 virt. 2109e340 pa 2109e340 , addr 00000360
> virt. 2109c360 pa 2109c360
>
> for the NetUSBee instance. In both cases ioremapped and __pa() are equal.
>
> I had hoped to get the physical address back from __pa() in the first
> instance, and check for _pa(reg) > 0x8000000 to differentiate between the
> two instances. Not so simple, apparently.

__pa() (and virt_to_phys()) only work for system RAM, where the mapping is
just the addition of an offset.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds