Getting rid of static IO mapping

Sylvain Munaut tnt at 246tnt.com
Wed Jul 7 08:33:43 EST 2004


Sylvain Munaut wrote:

 > In the current situation, I use the physical address and there is a
 >  1:1 mapping. The mapping is first done by directly manipulating
 > {D,I}BAT2, then by setup_io_mappings.

Actually, looking at the code in arch/ppc/mm/init.c

        /* Map in all of RAM starting at KERNELBASE */
        if (ppc_md.progress)
                ppc_md.progress("MMU:mapin", 0x301);
        mapin_ram();

#ifdef CONFIG_HIGHMEM
        ioremap_base = PKMAP_BASE;
#else
        ioremap_base = 0xfe000000UL;    /* for now, could be 0xfffff000 */
#endif /* CONFIG_HIGHMEM */
        ioremap_bot = ioremap_base;

        /* Map in I/O resources */
        if (ppc_md.progress)
                ppc_md.progress("MMU:setio", 0x302);
        if (ppc_md.setup_io_mappings)
                ppc_md.setup_io_mappings();


I wonder how it works. At the mapin_ram(), my BAT are overwritten,
then the "MMU:setio" progress is called, but at this point, my BAT is
no longer active and my setup_io_mappings is not yet called. Shouldn't
that crash ? During these two calls, the uart zone shouldn't be mapped.


Sylvain Munaut


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





More information about the Linuxppc-embedded mailing list