From: Kim Phillips Date: Wed, 18 Feb 2009 12:21:52 -0600 Subject: [U-Boot] [PATCH v2] Create configuration option for restricted ns16550 functions In-Reply-To: <1234901657-5699-1-git-send-email-ron_madrid@sbcglobal.net> References: <1234901657-5699-1-git-send-email-ron_madrid@sbcglobal.net> Message-ID: <20090218122152.7fbe1e25.kim.phillips@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 17 Feb 2009 12:14:17 -0800 Ron Madrid wrote: > +#ifndef CONFIG_NS16550_MIN_FUNCTIONS > void NS16550_reinit (NS16550_t com_port, int baud_divisor) > { > com_port->ier = 0x00; > @@ -53,6 +54,7 @@ void NS16550_reinit (NS16550_t com_port, int baud_divisor) > com_port->dlm = (baud_divisor >> 8) & 0xff; > com_port->lcr = LCRVAL; > } > +#endif /* CONFIG_NS16550_MIN_FUNCTIONS */ 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 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) { } #endif /* CONFIG_NS16550_MIN_FUNCTIONS */ void NS16550_putc (NS16550_t com_port, char c) @@ -79,5 +81,8 @@ int NS16550_tstc (NS16550_t com_port) return ((com_port->lsr & LSR_DR) != 0); } +#else +char NS16550_getc (NS16550_t com_port) { } +int NS16550_tstc (NS16550_t com_port) { } #endif /* CONFIG_NS16550_MIN_FUNCTIONS */ #endif (not sure if the latter _getc and _tstc functions should be individually #ifdef-wrapped) Anyway, this patch gets my ack if the fix is also get applied, because it gets rid of the current SIMPC8313 NAND bootstrap too big build failure. Thanks, Kim