From patchwork Mon Oct 1 17:55:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 977352 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42P9951ZcSz9s4V for ; Tue, 2 Oct 2018 04:02:17 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EEDB3C21F8E; Mon, 1 Oct 2018 17:58:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8618DC21EE3; Mon, 1 Oct 2018 17:56:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 82565C21DFD; Mon, 1 Oct 2018 17:55:53 +0000 (UTC) Received: from mail-io1-f74.google.com (mail-io1-f74.google.com [209.85.166.74]) by lists.denx.de (Postfix) with ESMTPS id 1C2C8C21F48 for ; Mon, 1 Oct 2018 17:55:50 +0000 (UTC) Received: by mail-io1-f74.google.com with SMTP id c5-v6so14349241ioa.0 for ; Mon, 01 Oct 2018 10:55:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=G8WF5Bik723+Ll2HhG3Xcz883tiE1VweYTHTZCfpOG4=; b=MHIpmD6Lzm13XWFfgiP5DQA85yH5SFLvKj1AdRv787BLXyUvxkbL/kUaM+rMjD13nl 77wRhKjvegbiykryjq2fFXqliF2/j3LhSUqifaPNXuHR8ML5wLnOBVgFHgse6wWhoAmu 1UCtjrY5vba4isNOuWT8Zw2oGsgmVi8ikp2AKM5VTDgfccfwebl9OAJFo7djvWJlINSr 4xr8CuM8n/S4ItayzLtI8Bmdknz2kwylXIRAzRMkMkurI+vEbJ/bVp/GQybR6xKJP4Qf ej85avZkCprNoZIR/74gQO8WDRLmfTnZ82zMxjdjKsFZ/8Bm6ax615J2S7NOgz35foCV 3Fhg== X-Gm-Message-State: ABuFfojwrDHyy19MATuETqGYQLVdTNibS5CL4uMechjJJsh0vwWTNm4e XZDMAQ+4wv5OulkmE4Q8dxe7zFM= X-Google-Smtp-Source: ACcGV61Ul+EHJbHpMWLeQaXCCFyyyum83GCQun8Jk9IHtlt4FHIxFrLkfl+EwYp4nyjHC1IgP1uVcFc= X-Received: by 2002:a24:2414:: with SMTP id f20-v6mr11656009ita.0.1538416549145; Mon, 01 Oct 2018 10:55:49 -0700 (PDT) Date: Mon, 1 Oct 2018 11:55:15 -0600 In-Reply-To: <20181001175520.239554-1-sjg@chromium.org> Message-Id: <20181001175520.239554-11-sjg@chromium.org> Mime-Version: 1.0 References: <20181001175520.239554-1-sjg@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini Subject: [U-Boot] [PATCH 10/15] sandbox: Add a debug UART X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add support for the debug UART so that sandbox provides build testing for this feature. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- configs/sandbox_defconfig | 2 ++ drivers/serial/Kconfig | 11 +++++++++++ drivers/serial/sandbox.c | 17 +++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 1c4a3330b4f..2ce336fc81c 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -1,5 +1,6 @@ CONFIG_SYS_TEXT_BASE=0 CONFIG_SYS_MALLOC_F_LEN=0x2000 +CONFIG_DEBUG_UART=y CONFIG_DISTRO_DEFAULTS=y CONFIG_NR_DRAM_BANKS=1 CONFIG_ANDROID_BOOT_IMAGE=y @@ -173,6 +174,7 @@ CONFIG_REMOTEPROC_SANDBOX=y CONFIG_DM_RESET=y CONFIG_SANDBOX_RESET=y CONFIG_DM_RTC=y +CONFIG_DEBUG_UART_SANDBOX=y CONFIG_SANDBOX_SERIAL=y CONFIG_SMEM=y CONFIG_SANDBOX_SMEM=y diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 5fa27254e30..83f8c94d028 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -324,6 +324,15 @@ config DEBUG_UART_MXC will need to provide parameters to make this work. The driver will be available until the real driver model serial is running. +config DEBUG_UART_SANDBOX + bool "sandbox" + depends on SANDBOX_SERIAL + help + Select this to enable the debug UART using the sandbox driver. This + provides basic serial output from the console without needing to + start up driver model. The driver will be available until the real + driver model serial is running. + config DEBUG_UART_STM32 bool "STMicroelectronics STM32" depends on STM32_SERIAL @@ -354,6 +363,7 @@ endchoice config DEBUG_UART_BASE hex "Base address of UART" depends on DEBUG_UART + default 0 if DEBUG_UART_SANDBOX help This is the base address of your UART for memory-mapped UARTs. @@ -363,6 +373,7 @@ config DEBUG_UART_BASE config DEBUG_UART_CLOCK int "UART input clock" depends on DEBUG_UART + default 0 if DEBUG_UART_SANDBOX help The UART input clock determines the speed of the internal UART circuitry. The baud rate is derived from this by dividing the input diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index 94b4fdfb171..4fbc5956b76 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -143,6 +143,23 @@ static int sandbox_serial_getc(struct udevice *dev) return result; } +#ifdef CONFIG_DEBUG_UART_SANDBOX + +#include + +static inline void _debug_uart_init(void) +{ +} + +static inline void _debug_uart_putc(int ch) +{ + os_putc(ch); +} + +DEBUG_UART_FUNCS + +#endif /* CONFIG_DEBUG_UART_SANDBOX */ + static int sandbox_serial_setconfig(struct udevice *dev, uint serial_config) { u8 parity = SERIAL_GET_PARITY(serial_config);