[U-Boot] [PATCH v2] Create configuration option for restricted ns16550 functions

Scott Wood scottwood at freescale.com
Wed Feb 18 19:12:13 CET 2009


Kim Phillips wrote:
> So this patch gives this when CONFIG_NS16550_MIN_FUNCTIONS is set:
> 
> /home/r1aaha/git/u-boot/drivers/serial/serial.c:229: undefined reference to `NS16550_reinit'
> drivers/serial/libserial.a(serial.o): In function `_serial_tstc':
> /home/r1aaha/git/u-boot/drivers/serial/serial.c:220: undefined reference to `NS16550_tstc'
> drivers/serial/libserial.a(serial.o): In function `_serial_getc':
> /home/r1aaha/git/u-boot/drivers/serial/serial.c:214: undefined reference to `NS16550_getc'
> make: *** [u-boot] Error 1

So don't define that symbol if you're going to be using the functions 
that we're trying to trim away.

> this is my proposed fix:
> 
> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> index 1b347e9..9c0055f 100644
> --- a/drivers/serial/ns16550.c
> +++ b/drivers/serial/ns16550.c
> @@ -54,6 +54,8 @@ void NS16550_reinit (NS16550_t com_port, int baud_divisor)
>         com_port->dlm = (baud_divisor >> 8) & 0xff;
>         com_port->lcr = LCRVAL;
>  }
> +#else
> +void NS16550_reinit (NS16550_t com_port, int baud_divisor) { }

No, this adds bytes.  The whole purpose of this is to cut away bytes for 
NAND bootstraps.

-Scott


More information about the U-Boot mailing list