From patchwork Sat Sep 29 00:30:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 187922 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CB6902C00B6 for ; Sat, 29 Sep 2012 10:33:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 315EF2813E; Sat, 29 Sep 2012 02:33:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ATeyrUGQhWms; Sat, 29 Sep 2012 02:33:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D26A92816A; Sat, 29 Sep 2012 02:32:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 96FCC28114 for ; Sat, 29 Sep 2012 02:31:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YsKpVMn1zuNU for ; Sat, 29 Sep 2012 02:31:42 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTPS id 1C1D528102 for ; Sat, 29 Sep 2012 02:31:37 +0200 (CEST) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3XT9fw2c2Vz4KK7W; Sat, 29 Sep 2012 02:31:36 +0200 (CEST) X-Auth-Info: RpgYjB5ytdAtJYxVaPI3tbfe871rKkHs/qXgGqnpp0g= Received: from mashiro.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3XT9fw1CJczbbrS; Sat, 29 Sep 2012 02:31:36 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Sat, 29 Sep 2012 02:30:21 +0200 Message-Id: <1348878687-14194-5-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348878687-14194-1-git-send-email-marex@denx.de> References: <1347837696-3192-1-git-send-email-marex@denx.de> <1348878687-14194-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Tom Rini Subject: [U-Boot] [PATCH 04/70] serial: pxa: Implement default_serial_console in serial_pxa.c X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Implement weak default_serial_console() function in serial_pxa driver, which gets available in case CONFIG_SERIAL_MULTI is enabled. This will get helpful in subsequent patches, which will encapsulate PXA's struct serial_device instances in serial_pxa driver. Signed-off-by: Marek Vasut Cc: Marek Vasut Cc: Tom Rini --- drivers/serial/serial_pxa.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/serial/serial_pxa.c b/drivers/serial/serial_pxa.c index 97e3f36..ad2d77e 100644 --- a/drivers/serial/serial_pxa.c +++ b/drivers/serial/serial_pxa.c @@ -36,6 +36,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -298,4 +299,19 @@ void pxa_puts_dev(unsigned int uart_index, const char *s) #ifndef CONFIG_SERIAL_MULTI pxa_uart(serial, UART) +#else +__weak struct serial_device *default_serial_console(void) +{ +#if CONFIG_CONS_INDEX == 1 + return &serial_hwuart_device; +#elif CONFIG_CONS_INDEX == 2 + return &serial_stuart_device; +#elif CONFIG_CONS_INDEX == 3 + return &serial_ffuart_device; +#elif CONFIG_CONS_INDEX == 4 + return &serial_btuart_device; +#else +#error "Bad CONFIG_CONS_INDEX." +#endif +} #endif