From patchwork Fri Nov 24 07:09:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13467048 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49E79C61DF4 for ; Fri, 24 Nov 2023 07:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zNT3Uew8vqLSfI+na+xDLS94CsMeZ/C35pUybSyykFA=; b=0m3CJy/UOsJAvw aT08yHNF8hE6wGLZEYHr1RlHnqlZJ50465qMolW7nZP64enu12+DEdZJ0KogiXzR1BbIlYDufk+46 C41FRpLnCtmBIfHXVYQ6LqHvMr2Sv0phsmIFvLXjRPr9F47V8P0jYeTUdFwIG7TznzNKF/p2XkZgj 6w5oKZxO59dE8PDHNQ6FRuA9zxo/ptgQlDBk82PtycehQUs7U6WZlP5AxcZOCB3Pw3yZOHlKNiItM HpOGbgem2/OsRDRVcyUwFinFY3KzI42+fpOtUzeJFvS+GbhPU9DVyo6sT+d/mb8WUiwKGsLl+Zp7+ ty42d8nMm/TJ+4nFdXdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKe-006LYn-0j; Fri, 24 Nov 2023 07:10:32 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKb-006LYK-35 for linux-riscv@lists.infradead.org; Fri, 24 Nov 2023 07:10:31 +0000 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6ce2ea3a944so1010367a34.1 for ; Thu, 23 Nov 2023 23:10:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700809829; x=1701414629; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rUH3sN/jANNMbAvxiLE+FR6QScUT3piYF3Fp6n0y2EI=; b=SKwhaER7g4X8e3j+46EhlzyYAkZRaaP5d29FBNzB7a5Tk8V/8WFIKeA/5kHuWH2GTn z4S1BUxVwS07HMB48YU6isTJx/4R7WpWChqO1iDUi0+M6tWIFrtWqvAuRxWt2s8xS06X TkEWOPbrHUrmLjuxc4uvkFRcLKd6TcPxmQ46PBA0+fXmoQmXD/50cvQ3z34keg2BfadD Vm7j4wpFI0edSGA53/DAEg5ErUw/e+Bomi/80HJ9um+WaiE/TQtVqKeIeVtZWEU9Hm1T CcERwl4ermPChcv4si2vXfWv8Ti2/BVLS3JngFyg66MeU0ssyRaopLGPlPojwo+bQPXK +vJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700809829; x=1701414629; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rUH3sN/jANNMbAvxiLE+FR6QScUT3piYF3Fp6n0y2EI=; b=ftRb6a4nc+YMtx8iM6eUV7JW78v6Rbw1UL3ZewzeoqDVu1oDl88YMUvid2X/3AopBN 1VnEEJp1Pc6k+L72PtY+yragMRi2Iat5ZPe53ubdE0Se8paVKA1wLaI/eD7Fw8pmLIX2 wAZ0UFZTKJFksk9UVueMQiJ0WTT+nPwJ2L5sSLJ0wPpU60xvpUYshdzlESVxpCoW6IAh rUrI45cj0uBScvcLQm1IpXsDFY0HS6VjAv1rTBZC3pgvcn8ZrjLEQy17vMQqzbkSr0L7 uQYN6Y2ITnlfLfYnlvEQuRoKhd8r7Aumb4D0H6390Y8zMVx6DMvUBc0S++afFeLsjqb5 E5kQ== X-Gm-Message-State: AOJu0YwBHrONrzjXGYaIukjzOC2Zh5tUzee8DwCbUrzCkDZU3EhQYDTt F6QjBDY9ct5bFWqZMxKvowPBbA== X-Google-Smtp-Source: AGHT+IFcPdJe1/+ZUHL4jSznxzi4QTW1Nct7Qxw/93cKKbEqCPdbOrdVTAgRyzDakbY8JJUSxK2OJg== X-Received: by 2002:a05:6870:d8cb:b0:1e1:3ac9:bc14 with SMTP id of11-20020a056870d8cb00b001e13ac9bc14mr2262118oac.30.1700809828736; Thu, 23 Nov 2023 23:10:28 -0800 (PST) Received: from localhost.localdomain ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id e5-20020a9d7305000000b006c61c098d38sm435532otk.21.2023.11.23.23.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:10:28 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH v5 1/5] RISC-V: Add stubs for sbi_console_putchar/getchar() Date: Fri, 24 Nov 2023 12:39:01 +0530 Message-Id: <20231124070905.1043092-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231124070905.1043092-1-apatel@ventanamicro.com> References: <20231124070905.1043092-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_231029_990062_AE4C39A5 X-CRM114-Status: UNSURE ( 9.12 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The functions sbi_console_putchar() and sbi_console_getchar() are not defined when CONFIG_RISCV_SBI_V01 is disabled so let us add stub of these functions to avoid "#ifdef" on user side. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/sbi.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 0892f4421bc4..66f3933c14f6 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -271,8 +271,13 @@ struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0, unsigned long arg3, unsigned long arg4, unsigned long arg5); +#ifdef CONFIG_RISCV_SBI_V01 void sbi_console_putchar(int ch); int sbi_console_getchar(void); +#else +static inline void sbi_console_putchar(int ch) { } +static inline int sbi_console_getchar(void) { return -ENOENT; } +#endif long sbi_get_mvendorid(void); long sbi_get_marchid(void); long sbi_get_mimpid(void); From patchwork Fri Nov 24 07:09:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13467047 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32F2DC61D97 for ; Fri, 24 Nov 2023 07:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KubRPEetBC0+DUV+Tm7RpY4E5d9S3EehW74YoAiWd8A=; b=yhSZ7lX3A634gJ e9GOmjDwQ/RNCkxbrMCUDVHZWopA0gFhX0m9sODa4xQBPA+GThA2v8VXYM2m8bkobbMiRzz95gtq0 hv08/TNZECN/QPTPrdp1cP2ZQHNSGtx7Q0jpjBLuFTlfkXHXfOhTvH/SfCFybnjaR1NRh4n0FjMcv aM9A8iI8WF/EEPwc4/+mw19ISnjzHDfVvab+69Vuv5elW8Q7UZ2YUG+0W/MncnA4/7xrz+HI/Yi6v TxE7+f3ReAEcmHYtGUHUfiJQxJblgz2WRsG5fNdtjhR9hUyBkoG9H6Wewbdwoipj4BwYsqtK4viuz aAwKNpnZwQ06IDg6GcAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKi-006La6-2w; Fri, 24 Nov 2023 07:10:36 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKg-006LYv-05 for linux-riscv@lists.infradead.org; Fri, 24 Nov 2023 07:10:35 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6d7e8da5e8dso843972a34.0 for ; Thu, 23 Nov 2023 23:10:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700809833; x=1701414633; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z9VElKh7WOuKh8RiW2R0mJxQw2Lx4DpptCzfBSkBTAk=; b=esrXuF9gspDeW4hTg7qyzan5vjSA1XELKkvRniPsOL2FPy1l/Kst6nzKALj1iHbDIk +vtIAlFowuvmq7b0kDyK74j1+a4RvMRhz6g7+qTFrdd2G0HjHLdhgzQCWwIt+XJogJpd CiL9ZBuu8NF7UpwuD+l3/+3XMN5y20BLtFRKzmBXe0MCz/+zKMb6zIQ4NBfF2clbxPvG 9Xr3bhxHE7E4a4VtwaVI37BNaPS98DegBgn793KERbSuLIMnbUbNK/8BrOefARDKZEdc hrISHW6xMBRWVh+8We9k9ak3uCoV5sAo4/vAvv6WdqIU2UoABNqb36EJEtczpo8q/uPM WMqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700809833; x=1701414633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z9VElKh7WOuKh8RiW2R0mJxQw2Lx4DpptCzfBSkBTAk=; b=Jsxq3TlG4EhZAn+zZG128eQLSfECxLoBkHrQL5QfL1mxDLq4/zuxaZ8Yl8Cujzh3ey a380DJPdKzLZJ4+sGd2v8x87iWmSjufRBR0IFppenK0UOwwEYAi0F693vo+3CnJQjqB1 d1rUUfI+g66msdfXX+pEPk2KTRuWmCoAdclvsmp+PEI7cH4HYYtWkuidbuCoUS7nUd0X WXsDBRHMGiV5tDrjgL781hEITwfvuUqLofqH2RdFWavPI19GBdBVXI6RFNPZg2NNQfpp PMjzPB3NYHhmhHSmVeSJINMWZe6hya0t5AcqTLczRtv4c1WNGWE9KvQVGxIdvCCBYFS+ hsEg== X-Gm-Message-State: AOJu0YzHMZk9jF3jgBiYMTGLDwrIgp8SpBt3+UM65516B09uiSbX1K7Z OUEzeHACmLxtaxw+RfYxltrJzg== X-Google-Smtp-Source: AGHT+IEG2s4ycd1mkqU7FpTGI5rAcibI7RkN0EhH6e4T2RQdhaX7LpOD9UkrqUiowsChg6UsME1p9w== X-Received: by 2002:a05:6830:88:b0:6d3:1d04:54e with SMTP id a8-20020a056830008800b006d31d04054emr2059407oto.10.1700809832783; Thu, 23 Nov 2023 23:10:32 -0800 (PST) Received: from localhost.localdomain ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id e5-20020a9d7305000000b006c61c098d38sm435532otk.21.2023.11.23.23.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:10:32 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH v5 2/5] RISC-V: Add SBI debug console helper routines Date: Fri, 24 Nov 2023 12:39:02 +0530 Message-Id: <20231124070905.1043092-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231124070905.1043092-1-apatel@ventanamicro.com> References: <20231124070905.1043092-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_231034_101915_4ED7FEBC X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Let us provide SBI debug console helper routines which can be shared by serial/earlycon-riscv-sbi.c and hvc/hvc_riscv_sbi.c. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/sbi.h | 5 +++ arch/riscv/kernel/sbi.c | 66 ++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 66f3933c14f6..9eef25308d53 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -334,6 +334,11 @@ static inline unsigned long sbi_mk_version(unsigned long major, } int sbi_err_map_linux_errno(int err); + +extern bool sbi_debug_console_available; +int sbi_debug_console_write(const char *bytes, unsigned int num_bytes); +int sbi_debug_console_read(char *bytes, unsigned int num_bytes); + #else /* CONFIG_RISCV_SBI */ static inline int sbi_remote_fence_i(const struct cpumask *cpu_mask) { return -1; } static inline void sbi_init(void) {} diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c index 5a62ed1da453..e66e0999a800 100644 --- a/arch/riscv/kernel/sbi.c +++ b/arch/riscv/kernel/sbi.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -571,6 +572,66 @@ long sbi_get_mimpid(void) } EXPORT_SYMBOL_GPL(sbi_get_mimpid); +bool sbi_debug_console_available; + +int sbi_debug_console_write(const char *bytes, unsigned int num_bytes) +{ + phys_addr_t base_addr; + struct sbiret ret; + + if (!sbi_debug_console_available) + return -EOPNOTSUPP; + + if (is_vmalloc_addr(bytes)) + base_addr = page_to_phys(vmalloc_to_page(bytes)) + + offset_in_page(bytes); + else + base_addr = __pa(bytes); + if (PAGE_SIZE < (offset_in_page(bytes) + num_bytes)) + num_bytes = PAGE_SIZE - offset_in_page(bytes); + + if (IS_ENABLED(CONFIG_32BIT)) + ret = sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_WRITE, + num_bytes, lower_32_bits(base_addr), + upper_32_bits(base_addr), 0, 0, 0); + else + ret = sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_WRITE, + num_bytes, base_addr, 0, 0, 0, 0); + + if (ret.error == SBI_ERR_FAILURE) + return -EIO; + return ret.error ? sbi_err_map_linux_errno(ret.error) : ret.value; +} + +int sbi_debug_console_read(char *bytes, unsigned int num_bytes) +{ + phys_addr_t base_addr; + struct sbiret ret; + + if (!sbi_debug_console_available) + return -EOPNOTSUPP; + + if (is_vmalloc_addr(bytes)) + base_addr = page_to_phys(vmalloc_to_page(bytes)) + + offset_in_page(bytes); + else + base_addr = __pa(bytes); + if (PAGE_SIZE < (offset_in_page(bytes) + num_bytes)) + num_bytes = PAGE_SIZE - offset_in_page(bytes); + + if (IS_ENABLED(CONFIG_32BIT)) + ret = sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_READ, + num_bytes, lower_32_bits(base_addr), + upper_32_bits(base_addr), 0, 0, 0); + else + ret = sbi_ecall(SBI_EXT_DBCN, SBI_EXT_DBCN_CONSOLE_READ, + num_bytes, base_addr, 0, 0, 0, 0); + + if (ret.error == SBI_ERR_FAILURE) + return -EIO; + return ret.error ? sbi_err_map_linux_errno(ret.error) : ret.value; +} + void __init sbi_init(void) { int ret; @@ -612,6 +673,11 @@ void __init sbi_init(void) sbi_srst_reboot_nb.priority = 192; register_restart_handler(&sbi_srst_reboot_nb); } + if ((sbi_spec_version >= sbi_mk_version(2, 0)) && + (sbi_probe_extension(SBI_EXT_DBCN) > 0)) { + pr_info("SBI DBCN extension detected\n"); + sbi_debug_console_available = true; + } } else { __sbi_set_timer = __sbi_set_timer_v01; __sbi_send_ipi = __sbi_send_ipi_v01; From patchwork Fri Nov 24 07:09:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13467049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5BCAC636BD for ; Fri, 24 Nov 2023 07:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0Yt6nDVnR2C0ClDK1Rp4JAGxUTElrPzHv1lwKxX+yjk=; b=I//Qn5CKw1jGqv x4d9iC36nSfUiBk3DKIQzaCXQ7tEsbUhZhKGgQZlQJhBOee05R1aCGwXfg0rChZJ8lqJ7iRUSyV4M 5zoI1mRlmG12kd9uWoeLtSKZuQ8h/7GizUp8lPVwH7sejAZVJRkMWgn6xUjzrc3vwyil+7xmRFdhk /kk2Uxg0st8ToBRQ8Rr6ffffeXsL9eRR6z0SnN8M0cSVrB1PNCS0AbskAiUyN08bQaqguQKmLN/zH LqJFlKGhhaBoZjBJy9ckp82VFddxcYwMF/ibe0oQg00IiPu6tUZ1bW8dyHa52cmaxulxxcmXpvgMq tXcQ+Vd4tlY0c9xxKDlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKm-006LbP-20; Fri, 24 Nov 2023 07:10:40 +0000 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKj-006LaN-39 for linux-riscv@lists.infradead.org; Fri, 24 Nov 2023 07:10:39 +0000 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-5845a94dae1so731971eaf.0 for ; Thu, 23 Nov 2023 23:10:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700809836; x=1701414636; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AQhHGwPmQ4TCzhQ9rEz5VPF8mnM3VrFDuBPe9IkpS1Y=; b=RlRUX6vyPrZjuWhWcpJr4/XiC+bj8MbdhDkrl4jkWaPin+geuZ1U9VKq2ZEwnc6fkI BxVw/mSAEbobOyh2H+o1mWmFp9UVhPtx5VVlfSGB/wRypTC7Ll+1J1M1k0UA30jf5mh/ hre6fFormSK4kNxkdZX5RevG6r/ZRyDSPyDcrVIGdu3MooUnrT+AvjMgONv6NHUidAEY BN/gP4oRyiT+AbBxVTSU1go8jk/keojpe1MI6HccauCTCRawiSlm1BRLr/3Rmnl0mgPu iNn4za1j2kboPMjeyPnL3j7igvFdtO5zgKsKBiQ/oBf+qtoAXzKauRSzbqoS5sO1rsKM uSEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700809836; x=1701414636; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AQhHGwPmQ4TCzhQ9rEz5VPF8mnM3VrFDuBPe9IkpS1Y=; b=FuhCae7UbqaODbP0rTKRYV+lg/TSn1opzHTOirqdOXCIEN8n/nKTdyS4Uedea9GmfD gdHvb5CqAmc59gXp9TMzsRz5Tux6BsKT1oKoGETvuH+7KoA8AXvZjkjbsrkcUDLHHFHM 2WsIRTgUqU5+3hf6N2v8S/IhorJwF1d+wmMGa/zc0Avf6PbXOsOvdRSFgc6nsFe7kbP8 bySqXglkwC6U5yMR2vXQevy8r+s79DkPC5V5ZJRw6jQxHbkvj2lbnfqC1sfuoaHUKCqP kJEQR2T888uMlPhI6Q2jr22XjG1NRYRHClnd+t/899OUjo3EVfqWgSJtO00g5cD3f8Bi mYTg== X-Gm-Message-State: AOJu0YxOIXVhJXwExtFwV8DlYjofgO6cGfZRxdRVsE0GEq1HWgAM7C+M hyb5hMJfN9b+KdyV1zIURvnpwQ== X-Google-Smtp-Source: AGHT+IGvJOScqEUs5x/NC1+xkb/+ZzFxNOvJHJDnrqYvAj8EJtKq+m+RbFE9B8BNRcDqThajOtvZdA== X-Received: by 2002:a05:6870:4729:b0:1f9:d22e:6339 with SMTP id b41-20020a056870472900b001f9d22e6339mr801112oaq.23.1700809836602; Thu, 23 Nov 2023 23:10:36 -0800 (PST) Received: from localhost.localdomain ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id e5-20020a9d7305000000b006c61c098d38sm435532otk.21.2023.11.23.23.10.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:10:36 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH v5 3/5] tty/serial: Add RISC-V SBI debug console based earlycon Date: Fri, 24 Nov 2023 12:39:03 +0530 Message-Id: <20231124070905.1043092-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231124070905.1043092-1-apatel@ventanamicro.com> References: <20231124070905.1043092-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_231038_029115_FDA18311 X-CRM114-Status: GOOD ( 13.63 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org We extend the existing RISC-V SBI earlycon support to use the new RISC-V SBI debug console extension. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Acked-by: Greg Kroah-Hartman --- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 27 ++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 732c893c8d16..1f2594b8ab9d 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -87,7 +87,7 @@ config SERIAL_EARLYCON_SEMIHOST config SERIAL_EARLYCON_RISCV_SBI bool "Early console using RISC-V SBI" - depends on RISCV_SBI_V01 + depends on RISCV_SBI select SERIAL_CORE select SERIAL_CORE_CONSOLE select SERIAL_EARLYCON diff --git a/drivers/tty/serial/earlycon-riscv-sbi.c b/drivers/tty/serial/earlycon-riscv-sbi.c index 27afb0b74ea7..0162155f0c83 100644 --- a/drivers/tty/serial/earlycon-riscv-sbi.c +++ b/drivers/tty/serial/earlycon-riscv-sbi.c @@ -15,17 +15,38 @@ static void sbi_putc(struct uart_port *port, unsigned char c) sbi_console_putchar(c); } -static void sbi_console_write(struct console *con, - const char *s, unsigned n) +static void sbi_0_1_console_write(struct console *con, + const char *s, unsigned int n) { struct earlycon_device *dev = con->data; uart_console_write(&dev->port, s, n, sbi_putc); } +static void sbi_dbcn_console_write(struct console *con, + const char *s, unsigned int n) +{ + int ret; + + while (n) { + ret = sbi_debug_console_write(s, n); + if (ret < 0) + break; + + s += ret; + n -= ret; + } +} + static int __init early_sbi_setup(struct earlycon_device *device, const char *opt) { - device->con->write = sbi_console_write; + if (sbi_debug_console_available) + device->con->write = sbi_dbcn_console_write; + else if (IS_ENABLED(CONFIG_RISCV_SBI_V01)) + device->con->write = sbi_0_1_console_write; + else + return -ENODEV; + return 0; } EARLYCON_DECLARE(sbi, early_sbi_setup); From patchwork Fri Nov 24 07:09:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13467050 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DAD1AC61D97 for ; Fri, 24 Nov 2023 07:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N3LLg5xDIysCTChyMD02x/QLA5htYbXizTRo6KRMWkM=; b=M4QLcwt6WNEiNg cUkA4mFY7oiqwFrRbAq9MHeVE2/J4I23q0MW93PihWFPq+EFBEnXojLHyTJUTRtIPSiP085nW36Zm hTx3z3pJ/lHigCIEG6f4QIHw/jBjye1fNZBHnUnU0H2x0Rd1drrq/HdsKl+wbgwR0AhEkkijcwv0u uWlFQBHtGbqGxzqrGwSMm4vV4P2PzThOYrlLVgLXqQchyuK043tBbji+xCwQ0e+UkBjt9yU78zCCx GP9cdH0J88VQutUEcLD6JNT7+2BvvUaC6Z5IwfNGjFff7y2Tal7n9lxrrqpht7cUuK/U/FQDjQ/1M ybMejxpvpf2n4BNG++zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKq-006Lcy-13; Fri, 24 Nov 2023 07:10:44 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKn-006Lbo-3C for linux-riscv@lists.infradead.org; Fri, 24 Nov 2023 07:10:43 +0000 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3b84402923fso845206b6e.0 for ; Thu, 23 Nov 2023 23:10:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700809841; x=1701414641; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5e69UQ6T+Z7CNLXUZDcGOS0SOuMoPgQwIsqXvR77gEM=; b=PJHT2Use8Ngs+oNq7vklVcrMjfcnuQ95ld0mpbgv7qxPzqot1IsewohsJyxnw0Uo6W EqBibTdHI1+TF2AQ+N8mJol+fc+zKM2SWlN63GASZgU7lZFgFNwSyMBLcIUm/Q0XeJf6 VvZ0Cj2SkKcqK6pvGlxD11gvpkn5hOmVVJ0H3eAhpp4SijV0fMH1hWL6Xb3jp6t3xfO2 U58tcABZ9+51Y1equW3rxv9W9/VNNZVDhXImMNGb31NDsrQmvdCfOVdYSzH9RpstDutS H2iG8gLDjw/JVVDQALG/qfuMGudXi94ymfH92ISkBHyy9FzZ14w7Fvv00P0DIjaEDSbK WhIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700809841; x=1701414641; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5e69UQ6T+Z7CNLXUZDcGOS0SOuMoPgQwIsqXvR77gEM=; b=QG+BA3Bg1XQropt0kJ1D119fTH2BfxrobpT5wC0h5I00OAmlwFMpBuaAaHLXMGT202 iS8w+SLLeop6TMt1b5B7HR4BhtUrrwFCIdE7NLu6xkJWdtIq5+FdpLtuDBfoapkc5quq WPR07556gSnWbKtVXo/+FVjDixTcpbHxQM+WxDTzK+j+rVxsaHAonXW8Ix1iq2DO9Cnk bG7B5hSw+L/4JNu4Gjn2v6T7JjaCNuBrL10UhT+aUph88Vet4tS4s9e1P2STHoY05WOa +RRrABKc0KDVQzmXoh103+LBWKRrHrbKS2/o50N3nmocT91CiK8geZzKNeBxATd9Hmi7 JHzw== X-Gm-Message-State: AOJu0YyRLGxcOfPUS+Amb29lTVDtTT1BMCyIRBNmJstfWDBIBkj7qjBD jDmfmCKaINAMhlQDTNgSUkcXRw== X-Google-Smtp-Source: AGHT+IGpCaOs051rva99tydJYiLxp2JmCAggGxrs3iHMIIeR5K0qZKOeN66AGmBC8Za809GQ8lm4oQ== X-Received: by 2002:a05:6871:453:b0:1f4:dd99:b07 with SMTP id e19-20020a056871045300b001f4dd990b07mr2011442oag.49.1700809840700; Thu, 23 Nov 2023 23:10:40 -0800 (PST) Received: from localhost.localdomain ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id e5-20020a9d7305000000b006c61c098d38sm435532otk.21.2023.11.23.23.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:10:40 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Atish Patra , Anup Patel Subject: [PATCH v5 4/5] tty: Add SBI debug console support to HVC SBI driver Date: Fri, 24 Nov 2023 12:39:04 +0530 Message-Id: <20231124070905.1043092-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231124070905.1043092-1-apatel@ventanamicro.com> References: <20231124070905.1043092-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_231042_039901_614A6E5C X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Atish Patra RISC-V SBI specification supports advanced debug console support via SBI DBCN extension. Extend the HVC SBI driver to support it. Signed-off-by: Atish Patra Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Acked-by: Greg Kroah-Hartman --- drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 37 ++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig index 4f9264d005c0..6e05c5c7bca1 100644 --- a/drivers/tty/hvc/Kconfig +++ b/drivers/tty/hvc/Kconfig @@ -108,7 +108,7 @@ config HVC_DCC_SERIALIZE_SMP config HVC_RISCV_SBI bool "RISC-V SBI console support" - depends on RISCV_SBI_V01 + depends on RISCV_SBI select HVC_DRIVER help This enables support for console output via RISC-V SBI calls, which diff --git a/drivers/tty/hvc/hvc_riscv_sbi.c b/drivers/tty/hvc/hvc_riscv_sbi.c index 31f53fa77e4a..2f3571f17ecd 100644 --- a/drivers/tty/hvc/hvc_riscv_sbi.c +++ b/drivers/tty/hvc/hvc_riscv_sbi.c @@ -39,21 +39,44 @@ static int hvc_sbi_tty_get(uint32_t vtermno, char *buf, int count) return i; } -static const struct hv_ops hvc_sbi_ops = { +static const struct hv_ops hvc_sbi_v01_ops = { .get_chars = hvc_sbi_tty_get, .put_chars = hvc_sbi_tty_put, }; -static int __init hvc_sbi_init(void) +static int hvc_sbi_dbcn_tty_put(uint32_t vtermno, const char *buf, int count) { - return PTR_ERR_OR_ZERO(hvc_alloc(0, 0, &hvc_sbi_ops, 16)); + return sbi_debug_console_write(buf, count); } -device_initcall(hvc_sbi_init); -static int __init hvc_sbi_console_init(void) +static int hvc_sbi_dbcn_tty_get(uint32_t vtermno, char *buf, int count) { - hvc_instantiate(0, 0, &hvc_sbi_ops); + return sbi_debug_console_read(buf, count); +} + +static const struct hv_ops hvc_sbi_dbcn_ops = { + .put_chars = hvc_sbi_dbcn_tty_put, + .get_chars = hvc_sbi_dbcn_tty_get, +}; + +static int __init hvc_sbi_init(void) +{ + int err; + + if (sbi_debug_console_available) { + err = PTR_ERR_OR_ZERO(hvc_alloc(0, 0, &hvc_sbi_dbcn_ops, 256)); + if (err) + return err; + hvc_instantiate(0, 0, &hvc_sbi_dbcn_ops); + } else if (IS_ENABLED(CONFIG_RISCV_SBI_V01)) { + err = PTR_ERR_OR_ZERO(hvc_alloc(0, 0, &hvc_sbi_v01_ops, 256)); + if (err) + return err; + hvc_instantiate(0, 0, &hvc_sbi_v01_ops); + } else { + return -ENODEV; + } return 0; } -console_initcall(hvc_sbi_console_init); +device_initcall(hvc_sbi_init); From patchwork Fri Nov 24 07:09:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13467051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84DB8C61D97 for ; Fri, 24 Nov 2023 07:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UBWlWUT4ZLtBpv4XlCVfAO40y9YsyO9YKEloRGOSPQ4=; b=IRx2O0IXOBqLya UhqegLZublJ4Ee/dAFieUk4M9KMCrMvnLDzKUEZdptPwAbAoVfNNbQ3Mk/PgX4Yt8hstP95Sdtzf1 TuHtP2vu77untajgVG1ov1oVT2jM0A61CslgMc1NZvjNsfBoE/x5GFfyqr+hFpJUIAqdHoDboU0Fe 18A7NCrIwiPiMD+WW88nQejGrogn3mLck8V3zGiCspnQnr9EbS7951JaRjp7ofIjVqeRG6RF8pLsX FgtTVgVx3wbIIod2n3OgKZ7IFg6wMEgI/O8QSDXryf+NuwCsZWYeV2SDSQa+Lxg25D8pnm7RiCCz1 1rZ9Iq34iw1h5Mwco9QQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKt-006Leq-3D; Fri, 24 Nov 2023 07:10:48 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKr-006LdR-1c for linux-riscv@lists.infradead.org; Fri, 24 Nov 2023 07:10:46 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6ce322b62aeso833760a34.3 for ; Thu, 23 Nov 2023 23:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700809845; x=1701414645; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9bsP20n9g/LbbgzyTFqfc2H9X3ZVkLkHm6HS5kmWZpw=; b=mOQSAGvxXDFKvYug0fvDpBSSSajzHGFrI0QlWTb+PYmYVeJplGe4GeMH2TfIqffBlN lyuwnXFtoYtdBb5Uo4oS1pWNuc95bxmycqx4B/u1RGgQl4VsveiySl6UlFaMdBQ/elpk EAGnztPStx8KGNitkv2QjiADZkOCaTelNCnoE0uNNhz8cxiDvu2y/dKDCFVCju3gjIGI Ys+MqMBo/EdIResHRFzIHFaCpfNjXeU0vM4TDd25rfm9L3O/8Gzb8oprLhgkkMwgJqXP llx1Przo6zn6ePUuGsYw7cOivss7qt3xdVwtH0s8iTdCY723o8OHhey5RU7G1JI/veN+ MGOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700809845; x=1701414645; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9bsP20n9g/LbbgzyTFqfc2H9X3ZVkLkHm6HS5kmWZpw=; b=u+W7/lHFhl8mSUjgbRkJI9GFR6Fm5YW7P99pdlAWZpK2p2xpsw5ENS03H7oK1uWme1 Tl7/+u+XiHanja5YcBG1hmqbRAqEWt/uw5/Q9Hct28Bq6AFvA7lkS8AFAyOPsQNtgpyI 0sHaKbw0uLMS1X5wKTDxx1XAF3UZkJAWfrT5JnmbfOMJub15H3pxshN5Fq9fNYk59+lB B+2332jX4clEBx+2DC8T9tvo5pgCu+9qjOcFequxPL90Xig+NrQmiJx7FiY9nTIdNqrf WN0exW1ZVKVGSazM8LcFM0Zdxzuh0zeVo/4G/Q0xqzXIdmq2ZyC1hmlXH1Tqzqd5sO5Z DzDw== X-Gm-Message-State: AOJu0YxzGdd9cHf+NAjzgTJF3ejbcrqajgd8gwIlPXCMfgK87yofi7uE 0VrnRbjkMw0hVge5EnjxEBBVGw== X-Google-Smtp-Source: AGHT+IGGDyExhQ3zRmOy5VYh2TdS7wOyXrHh9UCot+XT8qVfR5TFj+v/PJ24bsMRy6r+bIsB3Xrfng== X-Received: by 2002:a05:6830:18f1:b0:6ce:4035:b801 with SMTP id d17-20020a05683018f100b006ce4035b801mr2096169otf.13.1700809844751; Thu, 23 Nov 2023 23:10:44 -0800 (PST) Received: from localhost.localdomain ([106.51.83.242]) by smtp.gmail.com with ESMTPSA id e5-20020a9d7305000000b006c61c098d38sm435532otk.21.2023.11.23.23.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:10:44 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Cc: Conor Dooley , Andrew Jones , linux-riscv@lists.infradead.org, linux-serial@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH v5 5/5] RISC-V: Enable SBI based earlycon support Date: Fri, 24 Nov 2023 12:39:05 +0530 Message-Id: <20231124070905.1043092-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231124070905.1043092-1-apatel@ventanamicro.com> References: <20231124070905.1043092-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_231045_536608_4402DFC3 X-CRM114-Status: UNSURE ( 7.43 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Let us enable SBI based earlycon support in defconfig for both RV32 and RV64 so that "earlycon=sbi" can be used again. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig index 905881282a7c..eaf34e871e30 100644 --- a/arch/riscv/configs/defconfig +++ b/arch/riscv/configs/defconfig @@ -149,6 +149,7 @@ CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_DW=y CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_SH_SCI=y +CONFIG_SERIAL_EARLYCON_RISCV_SBI=y CONFIG_VIRTIO_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_VIRTIO=y