Thread (8 messages) read the whole thread 8 messages, 3 authors, 2004-07-07

Re: Getting rid of static IO mapping

From: Linh Dang <hidden>
Date: 2004-07-07 23:41:28

On 7 Jul 2004, tnt@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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help