Re: [PATCH 0/2] Experimental Amiga Zorro ESP driver

Geert Uytterhoeven
2013-08-18T09:43:00Z

On Sun, Aug 18, 2013 at 11:14 AM, Tuomas Vainikka
<tuomas.vainikka@aalto.fi> wrote:
> The original blz1230 / blz2060 drivers did PIO commands. I attached a log of
> modprobing first without interrupt messages and then with the interrupt
> messages, because, indeed, the zorro_esp_irq_pending function gets called a
> lot, and it takes forever to printk those messages. I have no idea about the

You can use WARN_RATELIMIT() instead to avoid flooding the screen
with the same values.
printk_ratelimit() is similar, but it uses a single instance of the
ratelimit state,
i.e. you cannot use it to limit two different value sets.

> correct iomappings for the registers, nor do I know about the correct sizes
> for them. I have no idea where to use physical addresses and where to use
> virtual addresses...

When the CPU accesses memory, you have to use virtual addresses.
When the DMA engine accesses memory, it has to use physical addresses.

Typically the DMA API is used to do the conversion
> What is the difference between ioremap() and ZTWO_VADDR() and which one
> should be used where?

ioremap() is the generic way to map hardware registers into the CPU's virtual
address space.

As the 16 MiB Zorro II address space is always mapped, you can use
ZTWO_VADDR() for Zorro II addresses instead. This macro converts from
physical Zorro II addresses to virtual kernel addresses.

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