From patchwork Tue Dec 4 13:55:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 10711809 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B92C14E2 for ; Tue, 4 Dec 2018 14:11:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A3CF2B72C for ; Tue, 4 Dec 2018 14:11:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E85E2B998; Tue, 4 Dec 2018 14:11:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D50B42B72C for ; Tue, 4 Dec 2018 14:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Y1bwNyFWWGQtSoVbo3fFUwcIpgipprX0Ot0qjpoBgdc=; b=NV1vqUuv1WxnPNlJ9JyMsKuuzb TavOxoEl6Be8WXk+tnnej5HMu1OaiY3WPknOjjMXrbW5P70uWjfdFGAHwLtGvbBH3FbNi/Y/qdhvr oMqY9TKbBTKmObgCvAZxNbMiF3xnR5/SiQ4VKx6JL5ZcagPCKRZQiDs/UKit/5GsdekfLriiZ4ItV I+kqWxSb9YyijOLqqxlfS2/Z2h3FXld/XHWL4qfXyOxZ0aNfeUeVwTixQmFTk9HgOxlHJVLrxI3sF +6ht4tE7Q3WGAJqb0mf94e5w0gPaXteOPu2OaT3cfNs3F4GgJNWKYQ9t5XNO1qfOPlOJ6iGzCF+Lt 8DGiGUWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUBPo-00071o-ER; Tue, 04 Dec 2018 14:11:08 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUBPl-0006ys-MA for linux-riscv@lists.infradead.org; Tue, 04 Dec 2018 14:11:07 +0000 Received: by mail-pl1-x643.google.com with SMTP id gn14so8350153plb.10 for ; Tue, 04 Dec 2018 06:10:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BTPdu0Dl5dI9f0RvwZ4b3FQV4mVlXTL1ZWm0hIO3Dcg=; b=joVYPGyfS51dy2YuZIbN92mHTKVXiz11syOtUFtSzZNvPzULvzC/elLQ2QeqDxFeNa ces1AMrzpGS3kukOEVdgUjdCO05TiDmOQT53uKDD8EVDx9LJ0BaFi7oS2wFge0dp5qXt ZyZxRslRHXio/przej1AHS1Y/GxS5QNpzXkfJ7vaFbc9jbdS+0Nm8yA+fJn7jmod9yvn 7c3T9KLAIingr1zzA5osaqvaCgtf7YV8Gqv8OxbHOd8av23iYyEp0+NQYWc+2qNYFf6G AdCqccFC3JtH1BAMbx/Nz/cpWR6qBZK71DtjgEb3JhtrGJ95x56mTZt5ib+KP9FqbTEr fJkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BTPdu0Dl5dI9f0RvwZ4b3FQV4mVlXTL1ZWm0hIO3Dcg=; b=Qj8oT9DfrCNTD/NBZN7veF0uRO1V4q1SYzaqR9bG3zRAcnaNOjyfOqQsx0PvJKbldO ANK5l1ZMLKBn0TuygmGGCPgbQjX5FihFKIVZsWxVfCPvIJ5+gYqrxvnWv4vzLBtuVNNH wfgTiY6uBh+qEzofXzySA+2qG72bDzLLxOGgLlRjYvdPb3arKmNuTS/mhiDIz+K8ijZo Hm8YPm5zBDaFGt5qWDaEGWfFKI7G5ouQgcZeE2JlWGdndT+hysPjNMsIl2NCSc1ctE2K dYBU0PhtzHU8LZf1mJydEirYYP9CGN+ceP7/TzUVSrUpJn5YGEUzBTUkpISH02R+m1xb lp6w== X-Gm-Message-State: AA+aEWYF8stfpGBEr1uTLLgLMUxgeAUoQsOHH0jz56NPOJsKejf6As9n a+QNANUKVvBnPINzahEly3lfmg== X-Google-Smtp-Source: AFSGD/VmR50lnvpHU80Xag/uZ2hvS+h9ZbY6ijbVgs6o5BV0WQTIdzab5I/fpvMnhrFib84FA8tvkw== X-Received: by 2002:a17:902:1102:: with SMTP id d2mr15988999pla.138.1543932654889; Tue, 04 Dec 2018 06:10:54 -0800 (PST) Received: from anup-ubuntu64.qualcomm.com ([49.207.53.58]) by smtp.googlemail.com with ESMTPSA id k129sm31298884pgk.29.2018.12.04.06.10.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 06:10:54 -0800 (PST) From: Anup Patel To: Greg Kroah-Hartman , Jiri Slaby , Palmer Dabbelt , Albert Ou Subject: [PATCH 1/3] tty/serial: Add RISC-V SBI earlycon support Date: Tue, 4 Dec 2018 19:25:05 +0530 Message-Id: <20181204135507.3706-2-anup@brainfault.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181204135507.3706-1-anup@brainfault.org> References: <20181204135507.3706-1-anup@brainfault.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181204_061105_728569_CE036669 X-CRM114-Status: GOOD ( 15.43 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Anup Patel , linux-kernel@vger.kernel.org, Christoph Hellwig , Atish Patra , linux-serial@vger.kernel.org, linux-riscv@lists.infradead.org MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In RISC-V, the M-mode runtime firmware provide SBI calls for debug prints. This patch adds earlycon support using RISC-V SBI console calls. To enable it, just pass "earlycon=sbi" in kernel parameters. Signed-off-by: Anup Patel Acked-by: Greg Kroah-Hartman Reviewed-by: Palmer Dabbelt --- drivers/tty/serial/Kconfig | 12 +++++++++++ drivers/tty/serial/Makefile | 1 + drivers/tty/serial/earlycon-riscv-sbi.c | 28 +++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 drivers/tty/serial/earlycon-riscv-sbi.c diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 32886c304641..287bb41ac814 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -85,6 +85,18 @@ config SERIAL_EARLYCON_ARM_SEMIHOST with "earlycon=smh" on the kernel command line. The console is enabled when early_param is processed. +config SERIAL_EARLYCON_RISCV_SBI + bool "Early console using RISC-V SBI" + depends on RISCV + select SERIAL_CORE + select SERIAL_CORE_CONSOLE + select SERIAL_EARLYCON + help + Support for early debug console using RISC-V SBI. This enables + the console before standard serial driver is probed. This is enabled + with "earlycon=sbi" on the kernel command line. The console is + enabled when early_param is processed. + config SERIAL_SB1250_DUART tristate "BCM1xxx on-chip DUART serial support" depends on SIBYTE_SB1xxx_SOC=y diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile index daac675612df..3ce26ce08616 100644 --- a/drivers/tty/serial/Makefile +++ b/drivers/tty/serial/Makefile @@ -7,6 +7,7 @@ obj-$(CONFIG_SERIAL_CORE) += serial_core.o obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.o +obj-$(CONFIG_SERIAL_EARLYCON_RISCV_SBI) += earlycon-riscv-sbi.o # These Sparc drivers have to appear before others such as 8250 # which share ttySx minor node space. Otherwise console device diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c new file mode 100644 index 000000000000..e1a551aae336 --- /dev/null +++ b/drivers/tty/serial/earlycon-riscv-sbi.c @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * RISC-V SBI based earlycon + * + * Copyright (C) 2018 Anup Patel + */ +#include +#include +#include +#include +#include + +static void sbi_console_write(struct console *con, + const char *s, unsigned int n) +{ + int i; + + for (i = 0; i < n; ++i) + sbi_console_putchar(s[i]); +} + +static int __init early_sbi_setup(struct earlycon_device *device, + const char *opt) +{ + device->con->write = sbi_console_write; + return 0; +} +EARLYCON_DECLARE(sbi, early_sbi_setup); From patchwork Tue Dec 4 13:55:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 10711811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6259B14E2 for ; Tue, 4 Dec 2018 14:11:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 524852B72C for ; Tue, 4 Dec 2018 14:11:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4327A2B998; Tue, 4 Dec 2018 14:11:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F313D2B72C for ; Tue, 4 Dec 2018 14:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=fyVBnfIJUai+zcIwJU1R8SqVljDi/0vfEFrfeRe+j3k=; b=jWWHgcdfJ2M2c/lrKP67dQVvYl xO/ofi2ak+JtpVw1OEdp/YQQmcSzusS+9qNt9ccB+jrTAUbTv4tBy1iIIYtGqJSovZlCipi0T2nvE L0nCWAYEu3IZiA6TZyiTE95psKnLgMy3DitmVBtS0keiXSKo1J74JSE5BJENod40loZ5SiFsBCPnd huYYmbhlRbLUKkaT/6H2Eaidi3S/V1N9e89j3/px5tEFTjcNcs3OuGUdDpZWzYRAq41NelgsC9X6j PKzxq/XxdLiGMa3ludobbczsJ3p3J+N0UpAvJoa/dPB5eWkCFAqMrAZxGQ02vUw6dyjvO0n+1Xi8g YBDZmsHw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUBQE-00075q-Ut; Tue, 04 Dec 2018 14:11:34 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUBQC-00074G-CG for linux-riscv@lists.infradead.org; Tue, 04 Dec 2018 14:11:33 +0000 Received: by mail-pg1-x541.google.com with SMTP id w6so7420768pgl.6 for ; Tue, 04 Dec 2018 06:11:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rquojr46N0DT8TNw1OqodG4b4JFdn/DRt/UImRH2pNs=; b=gopouSypkCUDiKsYoLEe34rSJgyCu3D13Whb2hsHrWlUMo9FK1M9GD0JjmxxQlAu06 DC/fyyVT+JQZ8LwBpjwQL7BTT2sY35HrAqonl03n2Qz5l+aPJOE4S9bRm+FvX4fp0tcw ngrWx3s2pdaqyY0NmevKTqf8meVtOV7bYjQ5JfvRnB5dHPlTbzKZ+6XkH4KbrUXQvGs1 Q7Dgwkxma55agw3W2UAgAYcG1ftTDeSX8rCEcudNsyEat86SEXKfg59g/NTe4JgQH6Ox sWAn1adcanyWHyjvCK0q2eLi9f4EgIlZw8iKMglVt8MzJHhQHWHhcMPJlO8gXz5GVkEf 6BKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rquojr46N0DT8TNw1OqodG4b4JFdn/DRt/UImRH2pNs=; b=SJ/+2eOURk1uOtXhzV9z/lc/RCrmXayakBh+5Fwk1ndwUA/0rr+N/l0HeApytSYinO VaTSjZAQOc1rc//ls9TtEZwmFh32+043/ODHsUf3RpZ1svjq6sRepvtOPoLUZz2Rdnnp t4q+ekFLLPeUM0KLdXtbjZ86uviPHWw0z8HSfr/BTxkBqjAHitNMe8C0CZYTr++hjMFq N0Xuasxks3l9KpUND8gvNgttp6b1sGCsRN6Bn9Rv3eZeUwI4x3zMjSynBpKI4UbrdFxn ejU0ogKmtVaOvFSSHs64E6QElXzozR8QuJ7J2+kuEZ8Puo7Kob1SehxmSN+ohQjhsHuZ N85A== X-Gm-Message-State: AA+aEWbCGKUK9OQGyednmsG0TBE5K7AreooQ0W6twQ/+Vi5sriy8sw1B rEqIcLsPM1Z5gp4ZpOrmO19CRw== X-Google-Smtp-Source: AFSGD/U2ACi+EMyJKkM+0b6OcU8NBpdc3iaZaawwGFLQGWmj3usKTeCb5cqTPEnNsYR7r4P0oDOtoA== X-Received: by 2002:a62:644:: with SMTP id 65mr20270358pfg.161.1543932681416; Tue, 04 Dec 2018 06:11:21 -0800 (PST) Received: from anup-ubuntu64.qualcomm.com ([49.207.53.58]) by smtp.googlemail.com with ESMTPSA id k129sm31298884pgk.29.2018.12.04.06.11.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 06:11:20 -0800 (PST) From: Anup Patel To: Greg Kroah-Hartman , Jiri Slaby , Palmer Dabbelt , Albert Ou Subject: [PATCH 2/3] RISC-V: defconfig: Enable RISC-V SBI earlycon support Date: Tue, 4 Dec 2018 19:25:06 +0530 Message-Id: <20181204135507.3706-3-anup@brainfault.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181204135507.3706-1-anup@brainfault.org> References: <20181204135507.3706-1-anup@brainfault.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181204_061132_418034_CFE1A185 X-CRM114-Status: GOOD ( 10.56 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Anup Patel , linux-kernel@vger.kernel.org, Christoph Hellwig , Atish Patra , linux-serial@vger.kernel.org, linux-riscv@lists.infradead.org MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch enables RISC-V SBI earlycon support in default defconfig so that we can use "earlycon=sbi" in kernel parameters for early debug prints. Signed-off-by: Anup Patel Reviewed-by: Palmer Dabbelt --- arch/riscv/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig index ef4f15df9adf..f399659d3b8d 100644 --- a/arch/riscv/configs/defconfig +++ b/arch/riscv/configs/defconfig @@ -46,6 +46,7 @@ CONFIG_INPUT_MOUSEDEV=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_EARLYCON_RISCV_SBI=y CONFIG_HVC_RISCV_SBI=y # CONFIG_PTP_1588_CLOCK is not set CONFIG_DRM=y From patchwork Tue Dec 4 13:55:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 10711813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C205616B1 for ; Tue, 4 Dec 2018 14:11:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2F822B72C for ; Tue, 4 Dec 2018 14:11:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A69DB2B98C; Tue, 4 Dec 2018 14:11:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 57A8E2B9A4 for ; Tue, 4 Dec 2018 14:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ox7AzoJpa1JHWHJdsKeyYPsoVZivd8oLAscW5Yu+5c0=; b=lDrkq8//4hskcmKA+UHO3dje7O aB3fkcaUZ+gLIcrz+gDbPijjQVqHHyJpQ62B+8sRtLvuT2/8hax++s0Qk2mZwjsmfk30EMlDA4dJr ZqFu5soFoWOfTqLuvZ9gNvNKDA4DkuN+x3dHek+Bg/yLLAABx25eRyhCxddmOsxUD8ndp91V/Ibze hhU6RlUG06PlcR93+bdlCuXCbFeYxJP8YdsICK8Oiq5vC4Pm5PCNwzBlr59UCJGiGbMnE0RB4XSgv n86xpACP3mM4hab1pHNBVwbXV76wAhzb5La1emjBgfA6wwqmH0WAWkrbYRMnCm3av5a0UXVEK49HU TKLe7Fqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUBQF-00076B-Ch; Tue, 04 Dec 2018 14:11:35 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUBQC-00074j-CH for linux-riscv@lists.infradead.org; Tue, 04 Dec 2018 14:11:33 +0000 Received: by mail-pg1-x541.google.com with SMTP id n2so7435052pgm.3 for ; Tue, 04 Dec 2018 06:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JjE3m3KhoW/fupLlyitIScJqRKLQdmncQOfWLq2YHj4=; b=ayXCV5tXDBvefnE96niiHdR1lxYBaQDf/OrEr6JpIHqyUIcgHz5rwM5VBe5W+Q30aw pNA5lzvZNDJnqOyz/XFSRdDbmsr4rfCajEGmZNNfUB54sUfcd3+HqGvFlmazQLbDcSKx GgWKvD7lrGXYCFsFPeJFtaF8nGrbSG9pes/pGxJjRisFIBDZNp6QxJfJVoP/d+KsvYJA QTPbfCRrnadMdcOgaZnlNWWJtB0bbbF6mzUuh0E1V9XuZIAJtrrEkeiiHdbwnjSzpn4/ cRtYiHgzNdZFjt0lHdFyWuGcC8FVw7Ilr3vwewmCp4RhaJbw/GXlPlzthQDkdomd+7VF l5Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JjE3m3KhoW/fupLlyitIScJqRKLQdmncQOfWLq2YHj4=; b=jiTBbSUZXVHxGuNjtXfJCEep/gMdJYzp4Kxcx65PDKvtzC3EUpHGhYJ21rqPyD4RQu k29Wlz5Y3JZbMGd1qrvqst4yQLwE2zSRWEWFT+OCF01qIFM6H4iqNxPcbTbaHRdz2xx9 VMaCBmm6mhPzT8r7d6hR4xBnDGaWlbigWtxzv0y0kJ1RJaXT6s3GYA++JqbTWFjlsZNO AY8LQkFg2/zWyevDX5z7F2q/ZTT8HBqF403BwLgzSJ4ZGjWjZ3ODhxOp1wBhjTXtYHk/ zKdgyHhejk4jfeQI3xF3Ef5ZJp6MUZwfml+rfpHNBfSgNQQ0wOUt3poS8uJuH79UtXje WkJA== X-Gm-Message-State: AA+aEWbvxYPog0TWJ4HhdFeoFyDUtLVjMkVRQFe/r3RGScKw6HCvMxuG J3Tbn+ZuXxfaz/qAoSsROpZ83A== X-Google-Smtp-Source: AFSGD/WFzf2OlR+iBlm92g06JcgbMovmeH6PyBxCULu5iF8ycg+wb//PssBQCzrDSC4V7y7QtGsM4g== X-Received: by 2002:a63:4706:: with SMTP id u6mr15986664pga.95.1543932687281; Tue, 04 Dec 2018 06:11:27 -0800 (PST) Received: from anup-ubuntu64.qualcomm.com ([49.207.53.58]) by smtp.googlemail.com with ESMTPSA id k129sm31298884pgk.29.2018.12.04.06.11.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 06:11:26 -0800 (PST) From: Anup Patel To: Greg Kroah-Hartman , Jiri Slaby , Palmer Dabbelt , Albert Ou Subject: [PATCH 3/3] RISC-V: Remove EARLY_PRINTK support Date: Tue, 4 Dec 2018 19:25:07 +0530 Message-Id: <20181204135507.3706-4-anup@brainfault.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181204135507.3706-1-anup@brainfault.org> References: <20181204135507.3706-1-anup@brainfault.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181204_061132_417863_A5D1AC60 X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Anup Patel , linux-kernel@vger.kernel.org, Christoph Hellwig , Atish Patra , linux-serial@vger.kernel.org, linux-riscv@lists.infradead.org MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The EARLY_PRINTK using SBI console calls is not required any more because we now have RISC-V SBI support in generic earlycon framework. Signed-off-by: Anup Patel Reviewed-by: Palmer Dabbelt --- arch/riscv/Kconfig.debug | 2 -- arch/riscv/kernel/setup.c | 28 ---------------------------- 2 files changed, 30 deletions(-) diff --git a/arch/riscv/Kconfig.debug b/arch/riscv/Kconfig.debug index c5a72f17c469..e69de29bb2d1 100644 --- a/arch/riscv/Kconfig.debug +++ b/arch/riscv/Kconfig.debug @@ -1,2 +0,0 @@ -config EARLY_PRINTK - def_bool y diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 2c290e6aaa6e..fc8006a042eb 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -35,31 +35,9 @@ #include #include #include -#include #include #include -#ifdef CONFIG_EARLY_PRINTK -static void sbi_console_write(struct console *co, const char *buf, - unsigned int n) -{ - int i; - - for (i = 0; i < n; ++i) { - if (buf[i] == '\n') - sbi_console_putchar('\r'); - sbi_console_putchar(buf[i]); - } -} - -struct console riscv_sbi_early_console_dev __initdata = { - .name = "early", - .write = sbi_console_write, - .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME, - .index = -1 -}; -#endif - #ifdef CONFIG_DUMMY_CONSOLE struct screen_info screen_info = { .orig_video_lines = 30, @@ -219,12 +197,6 @@ static void __init setup_bootmem(void) void __init setup_arch(char **cmdline_p) { -#if defined(CONFIG_EARLY_PRINTK) - if (likely(early_console == NULL)) { - early_console = &riscv_sbi_early_console_dev; - register_console(early_console); - } -#endif *cmdline_p = boot_command_line; parse_early_param();