Re: serial ports on 8245

2 messages, 2 authors, 2002-02-14 · open the first message on its own page

Re: serial ports on 8245

From: Greg Allen <hidden>
Date: 2002-02-14 16:29:12

mpc10x_bridge_init() is always called before $(PLATFORM)_map_io()
No -- it's the other way around. Mapping IO is very early.

arch/ppc/kernel/head.S start_here:
-  calls machine_init() in arch/ppc/kernel/setup.c
       calls platform_init() in arch/ppc/platforms/$(PLATFORM)_setup.c
          sets ppc_md.setup_io_mappings = $(PLATFORM)_map_io
          sets ppc_md.setup_arch = $(PLATFORM)_setup_arch

-  then calls MMU_init() in arch/ppc/mm/init.c
       calls ppc_md.setup_io_mappings() (which is $(PLATFORM)_map_io)

-  then calls start_kernel() in init/main.c
       calls setup_arch() arch/ppc/kernel/setup.c
          calls ppc_md.setup_arch() (which is $(PLATFORM)_setup_arch)
             calls mpc10x_bridge_init() eventually


Also, look in arch/ppc/mm/pgtable.c:
---------------------------------------------------------------
/*
  * Set up a mapping for a block of I/O.
  * virt, phys, size must all be page-aligned.
  * This should only be called before ioremap is called.
  */
void __init io_block_mapping(unsigned long virt, unsigned long phys,
			     unsigned int size, int flags)
---------------------------------------------------------------

mpc10x_bridge_init() calls ioremap(), so all calls to
io_block_mapping() from $(PLATFORM)_map_io must be done earlier.

Thanks,
-Greg
--
  Gregory E. Allen, MSEE Engineering Scientist
  Applied Research Laboratories:
  The University of Texas at Austin

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

Re: serial ports on 8245

From: Marius Groeger <hidden>
Date: 2002-02-14 16:47:37

In linux.ppc.embedded, you wrote:
quoted
mpc10x_bridge_init() is always called before $(PLATFORM)_map_io()
No -- it's the other way around. Mapping IO is very early.
Sorry, you're right.

Regarding the serial driver initialization: the serial driver actually
provides a way to initialize the serial ports at run-time:

---------------------------------------------------------------
/*
 * This is for use by architectures that know their serial console
 * attributes only at run time. Not to be invoked after rs_init().
 */
int __init early_serial_setup(struct serial_struct *req) {...}
---------------------------------------------------------------

This could be used to register the duarts with a dynamically calculated
(ioremap()'ed) iomem_base, which probably only leaves ppc_md.progress() to
deal with.

--
Regards,
Marius.

--
Marius Groeger        SYSGO Real-Time Solutions GmbH    www.sysgo.de
Software Engineering  Embedded and Real-Time Software   www.osek.de
mgroeger @ sysgo de   Germany                           www.elinos.com

** 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