ISA memory space on != ia32

From: Geert Uytterhoeven (geert@linux-m68k.org)
Date: Sat May 06 2000 - 08:58:03 EST


On PC, ISA memory space is located in the first 16 MB of the physical address
space, and shared with RAM. On most other machines (ARM, MIPS, PPC), ISA memory
space is located somewhere else in PCI memory space.

Nowadays we have macros to access ISA memory space (isa_*() in <asm/io.h>),
which is fine since this abstracts the behavior from the low-level
implementation.

However, there are still some problems left:

 1. How to allocate ISA memory space?

    Some drivers do

        request_mem_region(0xA0000, 65535, ...)

    to mark ISA memory space busy, but this is not guaranteed to work on non-PC
    platforms because the VGA memory is not necessarily located at address
    0xA0000 is (PCI) memory space. I think this justifies the addition of

        request_isa_region(start,n,name)
        release_isa_region(start,n)

    and possibly

        check_isa_region(start,n,name)

    to manage ISA memory space. On most architectures these can be simple
    #defines.

 2. How to map ISA memory space?

    On some architectures, ISA memory space is not mapped by default (Alpha
    and ia64, from reading <asm/vga.h>).
    
    Vgacon maps the VGA memory in ISA memory space using the macro
    VGA_MAP_MEM(). This macro also works around the same ISA memory space base
    address problem that is abstracted by isa_*() as well. At first it's a bit
    surprising that vgacon doesn't use isa_{read,write}w(). But the reason
    behind this is that vgacon wants to share the VGA text buffer with the
    virtual console shadow screen system (for performance reasons) through
    scr_{read,write}w(). Changing vgacon to use the isa_*() functions instead
    would make the VGA text support much more complex.

    So we may need more general functions for mapping (parts of) ISA memory
    space:

        isa_ioremap(offset, size)
        isa_iounmap(addr)

    Alternatively we have to make sure ISA memory space is always mapped on
    architectures that support it. After all it's only 16 MB.

What do you think?

BTW, IMHO `__ISA_IO_base' is a bad choice for a variable holding the base
address of ISA _memory_ space (see include/asm-i386/io.h).

Gr{oetje,eeting}s,

                                                Geert

--
Geert Uytterhoeven -- Linux/{m68k~Amiga,PPC~CHRP} -- 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

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:19 EST