Getting rid of static IO mapping

Linh Dang linhd at nortelnetworks.com
Thu Jul 8 09:41:28 EST 2004


On 7 Jul 2004, tnt at 246tnt.com wrote:

>
> Hi
>
> I'll try to re-explain my problem more clearly. Maybe some one will
> see a solution.
>
> I'm trying to avoid any static io mapping. So no use of
> setup_io_mapping. I also setup a handler for ppc_md.progress to have
> early debug.
> This progress function makes use of the UART, so at every call the
> uart must be mapped and I have to know where.

I'm NOT sure what are you trying to avoid. a typical setup_io_mapping
function is:


static void __init
my_card_map_io(void)
{
    io_block_mapping(MY_IO_VIRT_ADDR_1, MY_IO_PHYS_ADDR_1,
                     MY_IO_1_SIZE, PAGE_XXX);

    io_block_mapping(MY_IO_VIRT_ADDR_2, MY_IO_PHYS_ADDR_2,
                     MY_IO_2_SIZE, PAGE_XXX);

    ...
}


1. you HAVE TO provide the virt address and the phys
   address. io_block_mapping will not do it for you.


2. io_block_mapping will try to use available bats. if none avail, it
   will use pages. So you're NOT hardcoding the BAT values.


3. By CONVENTION, in your platform_init(), you should use bat3 to map
   the io space needed for your uart. Also by convention, you should
   reuse that same addresses in your setup_io_mapping(). So your UART
   is located at the SAME address BEFORE (via BAT3) and AFTER (using
   whatever io_block_mapping can use) the call to load_up_mmu().


I think you should probably explain what are you trying to achieve
before we can give you better suggestions.


--
Linh Dang

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





More information about the Linuxppc-embedded mailing list