[U-Boot-Users] Runtime switch from uart0 to uart1?

Travis B. Sawyer tsawyer+u-boot at sandburst.com
Wed Sep 15 02:18:50 CEST 2004


On Thu, 2004-08-19 at 10:16, Wolfgang Denk wrote:
> In message <1092921384.24546.9.camel at pavement.sandburst.com> you wrote:
> > 
> > After having read the README and some code, I was wondering if there is
> > a way to switch, at runtime (rather than at compile time) from UART0 to
> > UART1.
> > 
> > The board is the ocotea, ppc440gx, u-boot 1.1.2, build tools from ELDK3
> 
> Not out of the box. But doc/README.serial_multi shows what we did  on
> MPC8xx  processors; this can be used as a starting point to extend it
> for 4xx as well.
> 
> Best regards,
> 
> Wolfgang Denk

Wolfgang:

Thanx.  I've been tasked out by my higher-ups to do this.  I'm planning
on adding the code directly to cpu/ppc4xx/serial.c.

However, I think this is going to add a little bit of text space even if
CONFIG_SERIAL_MULTI is not defined.

For example:

Currently we have int serial_init(void) {...}

My vision:

int serial_init_dev(unsigned long dev_base) {...}

with:
#if !defined(CONFIG_SERIAL_MULTI)
int serial_init(void)
{
	return(serial_init_dev(ACTING_UART0_BASE));
}
#else
int serial0_init(void)
{
	return(serial_init_dev(UART0_BASE));
}

int serial1_init(void)
{
	return(serial_init_dev(UART1_BASE));
}
#endif


There are several functions that will need to have this done, thus
adding 1 layer of indirection to the current code to allow for multiple
serial channels.

Do you think this is OK?  I _*KNOW_* the readme says not to add options
that will bloat the code when the option is off.

Thank you,

Travis Sawyer






More information about the U-Boot mailing list