From patchwork Fri Mar 6 20:19:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 447623 X-Patchwork-Delegate: sjg@chromium.org 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 563DF1401AB for ; Sun, 8 Mar 2015 03:51:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 321CDAB8EA; Sat, 7 Mar 2015 17:51:15 +0100 (CET) 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 Rrb7EjrecLnl; Sat, 7 Mar 2015 17:51:14 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E2ACB62074; Sat, 7 Mar 2015 17:50:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 73E494A04A for ; Sat, 7 Mar 2015 06:31:07 +0100 (CET) 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 khtOlA8ApOs3 for ; Sat, 7 Mar 2015 06:31:07 +0100 (CET) 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-yh0-f73.google.com (mail-yh0-f73.google.com [209.85.213.73]) by theia.denx.de (Postfix) with ESMTPS id 0BE4D4A033 for ; Sat, 7 Mar 2015 06:31:03 +0100 (CET) Received: by yhoa41 with SMTP id a41so9167233yho.0 for ; Fri, 06 Mar 2015 21:31:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FTLvNW5ZFUnm71utsPIRKK05K2bB/8ij9a73JpGSoqg=; b=jqYEr/Fo+eojsy8rlyxqduMZxPvsa1QU1ZG1ZjkSzmAj87YEG/A+u70QSR0pP1jjWk C6K/o3xTU5UojlZlfEaQNFB3336Ox36ZnBhxkvwH/53nJ+T6iUHry/NbkSHQRVoNa46r NWsswEsJilTJjR7/T5a9mlkyMADN89zeNn4t/z34Kb0lEWR9V3G5mvWaVn6jkEsBlrj9 gCkyy3U4GWiqUQAPcJolop8tsvuF2nLr269oOXgNgyBInnSsv/DPF0dbR62vRDtaNvUK WMOGYvDT8HLczGyJUsWn4ojIVNHven5i2Q9wiXXQXEmUirxH0MbhyLdMex1Rmzm6TWjh vFWg== X-Gm-Message-State: ALoCoQlSkJ31wOMO7m3PPfbAwYMhmXmsBO1ObhIT3MiX8XNhUAgfekwa1dXGmvdSVUSvpDLoBtYL X-Received: by 10.52.166.77 with SMTP id ze13mr15381304vdb.9.1425673188457; Fri, 06 Mar 2015 12:19:48 -0800 (PST) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id z16si886346yhz.5.2015.03.06.12.19.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2015 12:19:48 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id i91VMnuX.1; Fri, 06 Mar 2015 12:19:48 -0800 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 9AC0C220F19; Fri, 6 Mar 2015 13:19:47 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 6 Mar 2015 13:19:03 -0700 Message-Id: <1425673154-28383-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1425673154-28383-1-git-send-email-sjg@chromium.org> References: <1425673154-28383-1-git-send-email-sjg@chromium.org> Cc: Masahiro Yamada , Michal Simek , Tom Rini Subject: [U-Boot] [PATCH 03/14] sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Move this over to Kconfig and tidy up. Signed-off-by: Simon Glass --- configs/sandbox_defconfig | 1 + drivers/serial/Kconfig | 20 ++++++++++++++++++++ drivers/serial/serial-uclass.c | 5 +++-- include/configs/sandbox.h | 1 - include/fdtdec.h | 6 ++++++ 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index a6c3252..72740ef 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -15,3 +15,4 @@ CONFIG_CMD_CROS_EC=y CONFIG_BOOTSTAGE=y CONFIG_SANDBOX_GPIO=y CONFIG_SYS_VSNPRINTF=y +CONFIG_SANDBOX_SERIAL=y diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 2e87199..13b0582 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -85,6 +85,26 @@ config ROCKCHIP_SERIAL your board config header. The clock input is automatically set to use the oscillator (24MHz). +config SANDBOX_SERIAL + bool "Sandbox UART support" + depends on SANDBOX && DM + help + Select this to enable a seral UART for sandbox. This is required to + operate correctly, otherwise you will see no serial output from + sandbox. The emulated UART will display to the console and console + input will be fed into the UART. This allows you to interact with + U-Boot. + + The operation of the console is controlled by the -t command-line + flag. In raw mode, U-Boot sees all characters from the terminal + before they are processed, including Ctrl-C. In cooked mode, Ctrl-C + is processed by the terminal, and terminates U-Boot. Valid options + are: + + -t raw-with-sigs Raw mode, Ctrl-C will terminate U-Boot + -t raw Raw mode, Ctrl-C is processed by U-Boot + -t cooked Cooked mode, Ctrl-C terminates + config UNIPHIER_SERIAL bool "UniPhier on-chip UART support" depends on ARCH_UNIPHIER && DM_SERIAL diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 6531841..400629e 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -34,7 +34,7 @@ static void serial_find_console_or_panic(void) struct udevice *dev; int node; - if (OF_CONTROL) { + if (OF_CONTROL && gd->fdt_blob) { /* Check for a chosen console */ node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path"); if (node < 0) @@ -56,7 +56,8 @@ static void serial_find_console_or_panic(void) return; } } - } else { + } + if (!SPL_BUILD || !OF_CONTROL || !gd->fdt_blob) { /* * Try to use CONFIG_CONS_INDEX if available (it is numbered * from 1!). diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 8d96999..3b3e1f4 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -114,7 +114,6 @@ #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ 115200} -#define CONFIG_SANDBOX_SERIAL #define CONFIG_SYS_NO_FLASH diff --git a/include/fdtdec.h b/include/fdtdec.h index bec2ee9..32a857a 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -41,6 +41,12 @@ struct fdt_memory { fdt_addr_t end; }; +#ifdef CONFIG_SPL_BUILD +#define SPL_BUILD 1 +#else +#define SPL_BUILD 0 +#endif + #ifdef CONFIG_OF_CONTROL # if defined(CONFIG_SPL_BUILD) && defined(SPL_DISABLE_OF_CONTROL) # define OF_CONTROL 0