From patchwork Fri Jan 19 11:34:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13523697 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 D3D42C47DAF for ; Fri, 19 Jan 2024 11:35:30 +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=GPkX4e15g4Xi/3nOhlFgw5BUoKsEKj4nJu4JQms//48=; b=LZ+rDl4NZ94OwI +YGjpKnnQUrK9fgXY845kP652vt9/4+m1BJICg8cxVWD/AvTcq9oFKKt8VTP6kJxDStMf2wu9JJF1 KHrdY+gXRNGnMXDMnXbxgee+hyZjjSsE9yPDR6H7vrlU3yAZ0Dvx8SvzoUKhtY7Q6DGJFJfzDL0Pu SzbbnKfruxFvqnBPLZoCam7Yq2IHcPFmpFol8+C/BrWVfRgCEJfkjfaBuvbuWEiQChUFrU/rkW4F0 9e35YmmSVMVM6IRk2tajGjpiErhMcI4GVZvBDHTM2/lY5TduCa6VudgFeUayFzmQ8/++8HtDtT5PI ufRgYFHoyW0xIWAt0P6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9U-005Ek4-1b; Fri, 19 Jan 2024 11:35:12 +0000 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9S-005Eje-10 for linux-riscv@lists.infradead.org; Fri, 19 Jan 2024 11:35:11 +0000 Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-36197b6e875so2690415ab.0 for ; Fri, 19 Jan 2024 03:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705664107; x=1706268907; 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=k38gzzXnRwc1LG01yYkdNKX2/4JudjETsypjyCoA1oc=; b=GqTVCvW182LyTtuhUsBOqYf8IkGo7H9x/mx0+J/Z0Baqehj9UycEn2gsrJJnESt6yH TubI2yQuV9TTwhHbyTdSRwZ/fFs5ld76/iXjX7yrnPm0efflxRD1Afsq/FrvZWXAf23Q IKOJFyoPbsx/W0SnPmvPH8EPQmLZJZEJxFXknvt2XkLaRPcn0HDVPVDg/YYIdLVEqnOU BynQTgxh+GpHbIn7cujwDzjgSLz8WG4LuTaAE7qw7ghAqa+2331JrMd8QoZRZPl+0Uqb 4cnWCR0+Pl5kjNydRVaz9hQXKDvOgD1Rl8O+ZS011UEN1+YZ4PDLMpSY2M3/8LingzA6 F44Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705664107; x=1706268907; 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=k38gzzXnRwc1LG01yYkdNKX2/4JudjETsypjyCoA1oc=; b=WDrMJj0uzT2qq5dAj8A9eXvjeQjR77m9ZFBCvRGhFc/HWVWqkxhf0lPfRY95KyjSmH gYrM9j88LXwKq94fEPoJbAOIA3sbIjd8Xpku6sGI70ejyrciPAc4iy2LXY7AoRr9O5vR RnlPE/m+8eSev0LauRK7l5CjH7thlJvk6sHRDptlLfPxcJT/jEBeGZoeuix5Bfi2UIr+ 5a4zOS8TvYzTLDlnWxq/AgCrEaFlfb0YlPIimAeVf7pQzDgw/4xO+DRlOfrAWNBQp8Fj xPHWgED3/bg9CWeB2gfxaFR9J5YSpyRRxiHciWBkRZm83viiHjr0zDYIvfLMwmQ7UbTo bspA== X-Gm-Message-State: AOJu0YwyhWqAePY/GRM3zcdi8GVFDqAluK1mbE1HNPG1tlt4q4XBZ2/A Njzz1sLQBwX3gM4F4IMT4+zDvUFDAWBam/sUok3qs88FzDuJzuPXD/D1YfReQlY= X-Google-Smtp-Source: AGHT+IEFgxqp4c4BSC1SH5cF+VnXZrlQYZRwfL7NLGJ+2lwsht4p33YhmsPE8cnHExWItmf7lq/Yhg== X-Received: by 2002:a05:6e02:80a:b0:361:981f:5b32 with SMTP id u10-20020a056e02080a00b00361981f5b32mr2364278ilm.123.1705664107212; Fri, 19 Jan 2024 03:35:07 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id a5-20020a92a305000000b0036062f40c51sm5347302ili.71.2024.01.19.03.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 03:35:06 -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 v6 1/5] RISC-V: Add stubs for sbi_console_putchar/getchar() Date: Fri, 19 Jan 2024 17:04:45 +0530 Message-Id: <20240119113449.492152-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119113449.492152-1-apatel@ventanamicro.com> References: <20240119113449.492152-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240119_033510_349976_168E1703 X-CRM114-Status: UNSURE ( 9.14 ) 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 b6f898c56940..e0a8eca32ba5 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -288,8 +288,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 Jan 19 11:34:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13523696 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 63716C4725D for ; Fri, 19 Jan 2024 11:35:26 +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=JDUalMeKXJxmjzUfDJ4lrDp27r/ZsN2DK9tT/X0yW50=; b=vPAPG79fx093u2 7n27twU8V4acNvaY8LMgU4ReXPgeoP9L+PF9q3Gmt7SYZ2t/y+o94eJu4wsTbomV1lzTZjDwHNB24 v053IvLLYYJ7G1phjHK93Gzs15SwVnCUJVBBqdppIH4p2u9QUw3z37tX70BqHNNgRzeviZ9GJbRpp JNlpw4lg+/GlwQFk3pouIMnyUDkCkyoVdhB6PoUTbVITMtIXV5hCbsFPjz2PFPaC7Uwo63P5rvz2s wqH+9zXBElflRLmwSMcJXyGm7hVxL0qv17iTpSfGgaESXIQtOkneN18L93gnfwvxVxwYCeXnOf2hm HMnwiYT1JMb/CDOjxqrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9Z-005ElV-0o; Fri, 19 Jan 2024 11:35:17 +0000 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9W-005Ek9-2t for linux-riscv@lists.infradead.org; Fri, 19 Jan 2024 11:35:16 +0000 Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-3608bd50cbeso3160015ab.3 for ; Fri, 19 Jan 2024 03:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705664113; x=1706268913; 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=HakN1bFuSJrmH5vBdRWtx03jEjEl7JQWSWUtuZHUeu4=; b=jt8x/xGps7ROKELbbuvzlXDREl6r2arm7bKPp1Zl2zvD2Lv625Uc+QIWL3nbewVtSd ou80sbcszBYWu08Gp6giNapSV7hrWa/LWPydCRkxLuDw5yaGEX0cYz/PdwTBr7tn+vlN T1mDf2TEmZ8pX5VkM/pNUC2o3Tv8NOn9RciMIevBZ4l5umDmivPDs4cpSqGQQYUNhcRS 9JE9f4GIX8Lsw3YNH1ZuvloRvFvd80jNJDv5D8LD9oYpgakpLCpkyELDydGvt/ZzU6Gl S8UpgipXqTofpRcccac8jeLeBzsbJ3qgi4DmDo7mUe0cg8RKO6pxTcc6fkYN97OdklEE miMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705664113; x=1706268913; 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=HakN1bFuSJrmH5vBdRWtx03jEjEl7JQWSWUtuZHUeu4=; b=XnsL+JuDIcoUPcl41fnhlnKUYnuIWZ0L7JIDGbrpqvEzQF0+dnzFrUOciDQzmT2d6g wyca0JhpuM5goCP6zMZi+EzOVWswFxGhV7rwPrMIPR/amHMFv9xjXecEDM22dX7zfDGt QqXzq0mywwSeOXJWpb6PBz6ug1ehcyCowJOWULfhCvcKnOZdqUJTjMoYlzgzAv1z/zQ4 TJ8vwjANZvK2+NfW5h0rrEXrbO+yiX0n0UJiUy/YxMdzSiWs/CZfI1G8Ev4yJNuYC57I 4RCqBdrFyvVVWQQUG8TiE2rMpaVvQrUCMOa1xU0oFWsaVs9/6vBrlZsIffiaey49Ep+a YQUQ== X-Gm-Message-State: AOJu0YxGdLA+o5Xzilt8t96Wy1bKPOKP3z/YJQeiOu6qjKvwkF3zltHY slbt8yUhBjbR1+uIAUVDdFAghJdGGqOfElue+VI/PUcswfKs9d1DnvPqTe9rsT8= X-Google-Smtp-Source: AGHT+IGFtjL8Em7K93L47SjMB1nw+F+/vUPksVOq3vIFdZf79/+q2KL2eT42Exg7xGjUxULzusxfHA== X-Received: by 2002:a92:d643:0:b0:361:8f10:1a01 with SMTP id x3-20020a92d643000000b003618f101a01mr2827672ilp.18.1705664112618; Fri, 19 Jan 2024 03:35:12 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id a5-20020a92a305000000b0036062f40c51sm5347302ili.71.2024.01.19.03.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 03:35:12 -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 v6 2/5] RISC-V: Add SBI debug console helper routines Date: Fri, 19 Jan 2024 17:04:46 +0530 Message-Id: <20240119113449.492152-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119113449.492152-1-apatel@ventanamicro.com> References: <20240119113449.492152-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240119_033514_933033_951902EF X-CRM114-Status: GOOD ( 12.81 ) 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 e0a8eca32ba5..13594efb24bd 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -351,6 +351,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; +ssize_t sbi_debug_console_write(const u8 *bytes, size_t num_bytes); +ssize_t sbi_debug_console_read(u8 *bytes, size_t 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..b06ad29f54b5 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; + +ssize_t sbi_debug_console_write(const u8 *bytes, size_t 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; +} + +ssize_t sbi_debug_console_read(u8 *bytes, size_t 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 Jan 19 11:34:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13523698 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 26634C4725D for ; Fri, 19 Jan 2024 11:35:31 +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=r6TjdpQkaO2uMODBoihIfeKFKw5Ou1Jg4SewzByo64U=; b=0qWrxaILCg1Iv2 QUdqdtF56+pnCMhqdaGVct8oZBuh6a4wfmbUG8NnU6GiD4vaIgDfDQ5PmKWrULA4PcsTGv3KYrNmb L4IZhRNazRoELOO9qfpPjRYFeHBuyoUQ7zuosvrXW0KHRr+IwaYLDrRD7iuUA7BW3qCWwQnYBsJtS RFMiwgEPTmgioKsoIwcrd9zbWOsCsDSghO9L+Hw8FB1oTbjtklQfdWLNEN9fcSFPzcdZdKGCyES5m lD6p//h5u81eYe5akks54BYFAmnbcRs9HXkAO2B7CzpeWIowc4UdyG6nPzJfFocefoTT+m6Sx0S4N NTYenr499Q7zdXByaGiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9g-005Eob-0Y; Fri, 19 Jan 2024 11:35:24 +0000 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9d-005EmC-2Q for linux-riscv@lists.infradead.org; Fri, 19 Jan 2024 11:35:23 +0000 Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-361a741722bso2192815ab.1 for ; Fri, 19 Jan 2024 03:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705664118; x=1706268918; 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=gZs1DnoR+BqoPfBEx3sAKhKPyFXu5PFqqMfZZxzp+sc=; b=MhRuAxlXMwYdDQLFk+e62j1sFMaEHdgVe6A/yARuMT48wab+2Dzjds0rHqekojYjkH HT+aGYKxR6teXdsfv6aXljNHqYLubs+RXBq259N4iIS9/y1Ety2ltcrkQ6ST4QHQLJ9a TA75dTlAy8q2HXr5G0cvlBggmzmT3+DP38SXh3p3flVpqJHo6gwMsYaWlYzhtNkOO7KF ipMmF9popeot4PQnqZDpOjli0tPYNjVMIt7rciWMy1KiDDxirYrILLdCZrHjKMaVEmqG jlXA8o/73W/cc4iCR9FpvbaNUZkyw82rmj6aUPNNIOpa58ZBTfZcn5fEIXbUEZOj49u4 tPkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705664118; x=1706268918; 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=gZs1DnoR+BqoPfBEx3sAKhKPyFXu5PFqqMfZZxzp+sc=; b=uDHBYRLZG0ZbnT+IUAVg9PNVBjYrMaG/lSjaS6S+oT0S8ndKX+mf27QM5nLAcNy7Or rFYJQrxCJQJWGh5LGqjLFGfXWQ4ZgT2AgJFSEBTTNhL6mwRivEE8pQGJhIRslB1xBQ4N 4PTkFVJAnIpFz8twGjWLq+MG3LmVmEbRaewcawHEG+YjA2cKSumifn8t+8ojrVnDLtF5 T8HwA3Fy+D1q5XlnH7+rgbzOWkFdwse7FC4LjHXFAHOh+MftO5LK92S/LAcXQK1yDJ8C UtHe7jDlQatjt02lRRekg/T1obFZEkE6kWBtHVeAd+wQk6lNMclq127OZb4j7zjd6RG0 jGeg== X-Gm-Message-State: AOJu0YyCXecGz2GM40fxoiQckTnnJO/dXxyjgXc4C51U2vCVuOesPEvy 7dnyjdnadOp/gdOJj028+0sHXOgAZiC37xwvwnHPtbphY1/zAnNDy7hYIdRy2FQ= X-Google-Smtp-Source: AGHT+IE5xOPzOXRmI0mkKVIo636pZPAAvH16YB5jTX+cVYfv6ns2lQLatq8j8BbSiFb/JfVg9KHVDg== X-Received: by 2002:a92:bf0a:0:b0:35f:cd02:1dee with SMTP id z10-20020a92bf0a000000b0035fcd021deemr2663290ilh.3.1705664118669; Fri, 19 Jan 2024 03:35:18 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id a5-20020a92a305000000b0036062f40c51sm5347302ili.71.2024.01.19.03.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 03:35:18 -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 v6 3/5] tty/serial: Add RISC-V SBI debug console based earlycon Date: Fri, 19 Jan 2024 17:04:47 +0530 Message-Id: <20240119113449.492152-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119113449.492152-1-apatel@ventanamicro.com> References: <20240119113449.492152-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240119_033521_787028_CA9FCDC8 X-CRM114-Status: GOOD ( 13.65 ) 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 8b1f5756002f..ffcf4882b25f 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 Jan 19 11:34:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13523699 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 298E8C4725D for ; Fri, 19 Jan 2024 11:35:36 +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=PiUqKpkbZNhUH/77b3bY6LJAw9XNxvu0Ofb6oPkdInM=; b=IqTsn96BUROy+C GhsMJakFasNN9GD85KHrM1soMgnK84amv+u1zMTt3ZrPXlIq02FL9cDC+j9EXJzM8sDxEgD/qU5MV CtCQHd350b9/nDVKlDosb54ICMjzFdkG1VhUgjgCeSAPW8Sy/RrNFMqaocGAW/ejdntz8caW+WL19 XY+7OtR8X19FL8lPpiJBe4R1orhIlvtGoTtJUZkDzgbdG6XcIS72ERJxEANxpNYbYjsKLGMT+x/9L oF12/jNz4FUgEFPHqYbV/1KX5d7FyJQdyGz89KzdlzCiXW/nzD46J9eiZ0hQc8LhaQNwhqWMZqgQw FkUjNywmhJKGnZ/NI7Wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9k-005Eq5-2u; Fri, 19 Jan 2024 11:35:28 +0000 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9i-005Eot-1b for linux-riscv@lists.infradead.org; Fri, 19 Jan 2024 11:35:27 +0000 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-36091f4d8easo2129985ab.2 for ; Fri, 19 Jan 2024 03:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705664124; x=1706268924; 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=JB3Vj18FKp8kzrC7fP7ko88EXDexTWBrSVK1Kjp8q3Q=; b=iV7KoVa2LGYIJDgN3zk6KWHrsFMwPjgNA3gGHOK4HHVu5AKbqvlWPhr+WSHM2w8Fms KV7gTHtBzVotilBy+FWvJNPhwUcR033FcPmioMTWN4z5CtgouLmDl5EZr4t2hj6uk8LJ 0YQzQN04oTBtC0gov0Ol9xKJCPxTjPfZy7nge9/G2jiW/B2aK/I8Pp0R7MokqZ5tR4g2 g02bY4q4vgNDXQaE2fOY9uze+EX7UQCXLq1mRXBjP0xvqnu8LxM1Dbp9ootYcXV9F6YC zHsg6KrPBBQty0A7H/TCjw+XDkODxCZZbNPHrbDu5hvLvdN+dsrQxpNqrODlXO+t6C1s sIHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705664124; x=1706268924; 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=JB3Vj18FKp8kzrC7fP7ko88EXDexTWBrSVK1Kjp8q3Q=; b=D/bZ6PxoRrUJoy6Ary1Va8NoAgfeHGt7QdkFrxD5evdU5uKBBDTmyrko77XyBjk0/N 7hzA65zRk78CCJ5Flj9xktx6IuOR7Ct3cUzS8U3+g5fCOQRefOOMF40xQvyFvs7b8Sy8 LA4aZIHgn1tTXB47U9r2xF8R6ozANEaWOuPtmtnlp4vYtPdef/Dvr0MASf26u+iu1frf RUZkvOs9HGGh8CwaO+wcVgWPIaxFb8d5Llhi86f7SsHG9zBL0aZ6TP5+WxTfYy696Jme pBnB0FbuDqfzqTIjMq5/i5LZF5FM7eBhOC2VFWizFoTBh7LcWoyGyKpUSyzi471iOCFH Y1RQ== X-Gm-Message-State: AOJu0YxPfbpGerH/UenGfyD6kheOE0qFa/UuoKM3rqrOfAXymZbcWgMK mW65s1M36pwusVdHc6y+ERCXZgEV7AkT6poOWOEQcm2+SGcMFmN+apD0zDSEA4A= X-Google-Smtp-Source: AGHT+IGd1T1w9ctzUQVdgV1cwoeDle40sUshSYKn5r2via60aXBN96+yVuKGmlEjCGjfQyn1G3wsRg== X-Received: by 2002:a92:2908:0:b0:361:99a3:5bc4 with SMTP id l8-20020a922908000000b0036199a35bc4mr2763048ilg.12.1705664124322; Fri, 19 Jan 2024 03:35:24 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id a5-20020a92a305000000b0036062f40c51sm5347302ili.71.2024.01.19.03.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 03:35:23 -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 v6 4/5] tty: Add SBI debug console support to HVC SBI driver Date: Fri, 19 Jan 2024 17:04:48 +0530 Message-Id: <20240119113449.492152-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119113449.492152-1-apatel@ventanamicro.com> References: <20240119113449.492152-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240119_033526_535706_AEC649D7 X-CRM114-Status: GOOD ( 13.94 ) 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 a72591279f86..cede8a572594 100644 --- a/drivers/tty/hvc/hvc_riscv_sbi.c +++ b/drivers/tty/hvc/hvc_riscv_sbi.c @@ -40,21 +40,44 @@ static ssize_t hvc_sbi_tty_get(uint32_t vtermno, u8 *buf, size_t 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 ssize_t hvc_sbi_dbcn_tty_put(uint32_t vtermno, const u8 *buf, size_t 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 ssize_t hvc_sbi_dbcn_tty_get(uint32_t vtermno, u8 *buf, size_t 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 Jan 19 11:34:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13523700 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 5968CC4725D for ; Fri, 19 Jan 2024 11:35:44 +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=LGyyyYRtkfL/6W gieKEJ4JAbkKXJzY9vFxc14CcCsxXH1i868k27vhwhkm0n20OnRK+TaaV63YLsWoTp8hLk8MeUWVO RY4Yt0LgT8sxUW1tjrGt4o9/jk0Yi4nHLCscBMPvr/THvTDxw2j3XZjaF5pAgb3WgDqsot9pANjwc LTM82d5N/RdoqsQgeIo1mvQsLGkRLc8KBPs/rz+BxcdsUujmk4mvhmKuNt5nMhLc0jzwJRQNOICic 2vr8UE2wYJKNhRRypceTA0SkaE6ARr4M8Ttby580t8+woZXHYmq7vUDADPLIexFZcDHxGOnVkqalp 7atLAJhseYZJAGT2Hgvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9s-005EvA-2S; Fri, 19 Jan 2024 11:35:36 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9o-005Eqf-2V for linux-riscv@lists.infradead.org; Fri, 19 Jan 2024 11:35:35 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-3608bd50cbeso3161495ab.3 for ; Fri, 19 Jan 2024 03:35:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705664129; x=1706268929; 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=hPga+54VzT6wK2sje6ItPx3XVE3BujjyIoy8YTfdwFjgrTjXxLpljSQXdnuCUni626 ZIAOPYi2+kzFK8WtsagGYDeomsO9m3/Fbft3pU9Tfm+TeB/oOgkUupLZywirLUTurgHu umuHxn9orj4mA0Nr54aW1ooCo56r2VVOUhfmHhLAgQgYNDdSv08VGhYpro5InwRLCSoa PS+X904KHFVGvZyGdejb1STGSxKs+LyQyrN8H+oRaZJG6j5BDR7BC7ClV8m1FWJFsSkr sMrc8IIcXWsLlE8enfldPV3KvrVjW8gpmSP7cgRS+HbzcSm/pqbV2T9PohMpFSnI0KSm AbYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705664129; x=1706268929; 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=jwrtQrctdrOM0lBGqngd7guf97Ivtt7tZrEXxjp+DyT2tT9X5hvsUot/Brv7oT5U3n KkzKDqzZQpeaY1flJ/t8R2hIcJMXG6bEvL0LCG/ArOPfd20WK5ndZSW9sIlNPdzuCMuC ge4OJteHfuEq9hF6/Wf5PuTFkJFBTkpdYGjbHMR6c9x1Wn3Y9eJ68lNuaGUYdLdYNFSL id/OyG9x6Gsag24SfGTw3Qf1qGhcLs1fA3D26S3r5vX509h/9qMM3cRw1cHyHDMO6Zlg BLzYpMGK8N8N5V4nLBwX7LWFM829uaf9oY+nQ114Rv3Q1jOaGKM3a5zOi4BNatUmqX7o XnGA== X-Gm-Message-State: AOJu0YyT1D27BL7Oxwd3OtFGa5cWCoE0CwSzPDgJWCi1Pn8llxPVKzIl 4qcGndZBnIzNwbdlYSS8+84Ibf8apoJkGB7fn2i8TF0VLw2fnRs8LGtsBsYL04U= X-Google-Smtp-Source: AGHT+IGm7KnfG4/vcA0JrRBkZfX6RoyXH3aaqdl/Wta7fnqjAcw1zMCsGIqUf/hTovepwm0OqOzh9A== X-Received: by 2002:a92:7310:0:b0:360:973b:844b with SMTP id o16-20020a927310000000b00360973b844bmr2368211ilc.11.1705664129602; Fri, 19 Jan 2024 03:35:29 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id a5-20020a92a305000000b0036062f40c51sm5347302ili.71.2024.01.19.03.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 03:35:29 -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 v6 5/5] RISC-V: Enable SBI based earlycon support Date: Fri, 19 Jan 2024 17:04:49 +0530 Message-Id: <20240119113449.492152-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119113449.492152-1-apatel@ventanamicro.com> References: <20240119113449.492152-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240119_033532_810468_2D5C2C81 X-CRM114-Status: UNSURE ( 7.36 ) 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