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: 764193 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E34C44EB4C for ; Fri, 19 Jan 2024 11:35:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664109; cv=none; b=FEiekBAQgjhXfkOZlY11yN6e+pNbdyAzcr74iNGTyMIduANoh4AalbqWbHn1uey9c+JzKpSzt4N450WLk90ws7n4KU2swhI9I/uIJ1LnHImjZyz1T6lCUYF9nzFCfDIRF4dJ3ZBCh0wZsRjpAagEKGYPjl7Iki3MRYXEDyxTd54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664109; c=relaxed/simple; bh=C5iRWOaVPvgyoKC+hI5XbA0WdGNDbqEUa5o2YyeO7Ao=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ud+A6NAlC9xeCjqtnffd/4j0LRFrw0Gd5yEgOcF8A1+zlyOIFV7xq01lHewF98L0OQCLOk7V0X7EjRRK7xHRxXrxCRQt+6204ciMzHpt/n0TsZKUpb81k/xYOv7LxCxt4VLND///s6KayGydeyKBYyZpsIf94JfIumj+Qi607Nk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=CZxqI0Bd; arc=none smtp.client-ip=209.85.166.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="CZxqI0Bd" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7bf2c826a5aso31756939f.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=vger.kernel.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=CZxqI0BdDTcoozSkR/a28LpSgR1gpMw5CRIoktrw+Zto+znxGyybJXV/utBlAoWCT1 00oUQIfDtL4AGaXcmUa7Npz7nEo2fXU9KxToFA1bSnRvoRhp0XUmlTqfk3u2alw6ho9G u1wzteojoyKQEQlaO+QeoftlHWXAD2Q6xAeNNXlDQlH6CG/HCHs+8AOmR/b5y+GWouoG Vat48JJ5CYA/AHtJM7M63K+QRf463r9pRwjOzUFQGamAe/+bN9P9/M2xgF5SeEYWwBwf r1ZQo+cgXsD9C8Xfmiuo8VFlbchkS6xjWyzUr/ITUbYqn1EboaumF4nkQqPgZV3wCNjF 5qMg== 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=OvdgUumxVpTAQDzMbT75VGE1LLA5leqzl+ztiW+X1jTOHt1yk9Kp51OdYT9hOQmvUE 84JHX8TlJ/KAOPMQEoht1uCFg00XN8GsgmyfGhfnEXPganUgJCoF+GBMMOEGVLLxrJCG hM0dsWNugeHGG+P5c/+NyAr4oV3Mxk2/CquBjIs7Dd0FkYdHX3sbI4RL604tZTXYbT8A SJx0OP1eL1GI1VpbE/urAhPJCN0VXQV3/WJKmg4YYnh82JxeXx/A86l2CAlozA2N7FFK De0IlPuspzMwNrc7xVSx/Q66Wpd6m642zxRU1iy6Q9ONUWqXi1u1k2Whys8bPpskJx31 lUXQ== X-Gm-Message-State: AOJu0Yz3cRb7Rbfqnwfl5atv43euxVbJSQZ4SXXnmB9SMrvGD+Evhr+j FgrFbdP9EeVrNz4ZDYYBnv3Yhghl23C31nmZ82jTenUCCW/SxowoVMwbX7r16PPGwdASos3dMMq W 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> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 765072 Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D5054F1FA for ; Fri, 19 Jan 2024 11:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664115; cv=none; b=cECFnP1uXddWwr2tN68xjt9vqoRLgrB9RvKpEZPU5r9Bgtnm6UWmGK7v+uth1cuFRRFIvh9bCm/XkucJTeyflNx5Wg3t6tHSDDo1feZrN7WNWQHgnyRIuN8GwaTdF+4olFQUzBMCc1OnXDYeEIvEgYYmYhp5nhZ9YEXHdX0ig9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664115; c=relaxed/simple; bh=bVlmxLWw388qCP8JHmo3ylKuzf2WF3OCLmtCeHD9r3w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FETY1qpxMuI0bemle8fGPaZ2+ienTzGgOfHPcO+Syj/ODKN7/R8W0lIoe1nceuGZb9SwPCDWXjbgNeQUYqtk4lYsdQ78r2KcQFrNQYrNgM74G3UVnS54ceqh5IJOnWyKFh6OEKy4MKN9IY2Znix6QEI2ZnIsZ1V2QXkleCfHBH4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=KQZxILTF; arc=none smtp.client-ip=209.85.166.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="KQZxILTF" Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-36082f3cb05so2795225ab.0 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=1705664112; x=1706268912; darn=vger.kernel.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=KQZxILTF612OomhefVTDW7powU5mbyItKRK1SH75WUGsBwkUoiEQVDiSc2Dwbi3m+Y /dN/2tKpHR8dm1HkfTPpv1Unwe3XuX8OsAj9Ik4h+tu0b8OHhCBP8Ouede02QV9d4mrp 2vvyjeCjzQzpxJ1zxjznDpgYn61y1LayxbGMs+N/H2aUQDbg17b4T7ez3dDMvpnxykuf qg83qqe4+hE/2hrd1SBl6Wa2F6WY/bWfBfvZ7zndyYxQvSvb56S4HVx96vsrADLa5xfb rKPQfjpTlgve9ZV+U6ylsb7Cu9n5Hy/HR9lyFvGPbKHOg6xPl4GSjtUQPTBTMQNZbyR1 l9bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705664112; x=1706268912; 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=qNSNN4Q4p6R+oFy5RzEJj5Z9c0jFV9XxW+CqU3+x0fqiFLZ8sQ4wNJ8RunR1lhAYLA JTsyqMoIciC7m1tjJkQKT+GXupEBhSR3vDp2h0vH1BWg+Ma0lcXjOda6qDmYTPQdSUXu KNA/cRqTYrjAvO+ajwbmJVM9Y5Zttih0rRoTtMTkROR1EcK0WGUPuagsqvkFYwBmz1FI dz9NFMgR/QRkXfyWtHmocSuXmi89ns3r/RHaFKdznFEvF1VWBaUMdp6zhOphWo234Baj 5x5iIdvxr7jWGp2Qmgh70xZuqlpnj73cxKgO8IxYMvNHtfesGtuvHzNqYVUPBeukN+gF 0s+Q== X-Gm-Message-State: AOJu0YygQ2jGTihXwwS6dkNDw7GEzHtX3RCPIfKU5cnE3oaFGqWPJKer efh0O9kVHC1FO/agHqi4JOPFfZD/JNlGO5BPywlW+/8OR1bn/tnzFyVR2mhxYyg= 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> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 764192 Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86C0E4F1FB for ; Fri, 19 Jan 2024 11:35:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664120; cv=none; b=iMUvo70sd72XGphvGJEFZFCabMYyajLSUN9HE75BPfh6UdiK+hK7MyZdZrmY3CNxb9/10pqNzLPCHU1WohG+Lo8yx8lM3K3TgaqqT/M3WBT80tO7tyWCG4+ndQwSDm99xNyKiC+mIQqtTH3ZElNliNamqY3lgP+p0l2grdzzrqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664120; c=relaxed/simple; bh=YBF7A0OJZRzNwOkRz3/ZyND9coOZT6tf8Q+wR8kkdLc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OkNvSDAEp2gxJkNrNnhWQgISiFgttE1DUxrP/Dhpn2Xgfc74tnOcPjjIbENr0lob3aKl4bsfLA53t/sC+t+F7G5m5di5hFkpKSGPRIxYy67TWUwvT8Cv552nium5/ribtUEFacFRB7hXeI8N1r45ruZAka0qvhQRlDMh9qCiqKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=nwf1jBRG; arc=none smtp.client-ip=209.85.166.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="nwf1jBRG" Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-361a1f8c675so2203295ab.2 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=vger.kernel.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=nwf1jBRGcLxyVjLNZ0IrGdI3em3/Dn7Js87UHyqW9OCdgPGYgP325vv0k1keKAAGLz 8iiSt+3t8A5OiGI84ajlVkhGcyzsvKeeWFqqjLOagRI/HSH5QMeW3jyQycr+HDwxuEr8 AT5HMRKxvwqUY0pTD/pvGt8y38WYthAcZpwI1yg6tz3L03b5AMsoLUHjX8aZhwZlvwaL GaTK8N+2emFK8rT3+4P0pf3U/7g3qdKYQY2NlXbjJcGGMdRWb47TJg2CcZMts2yc+OBZ UokWhkwgDAlos8MzLdeRNkjnTD3vtOfvyOCf1SnXmg1IPNo0W64ut+a4aFvK8dMxwiLr Px5g== 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=aI1U64wNW1z4lj6CNww3kjF8c3okSXI0hi9DRGWEutMM0OnCpA6gHDok+9gs9GhhNi f9VxPI65Z5P3IpDn33o5rxyEzk0Iw3caR6OTjI+zxFMqrJDNqDa5EJTkk+7L3vqjmHFt QAYPOmL3rapKPlVFDAQuMzLWDgc1V98zeZQTrD9n8rg0rg/EWn+f0MSLh5CQ44y8jgJs 6wiXlTUXO1JEmg5Fnkdk/Pi/92O0wuwHYBIRvjp14wFzHTMEX520wqyMBp0okCNZJuuK K9DRJDJD2plSHnRW8I/HNRww7vX9UnSaup4k4ldzcqIK1wXmpVJG9fex5n3+BQ648uw5 sgpg== X-Gm-Message-State: AOJu0Yx0tbpP17RqHoo1Pc1lRc5ntU3RiLBFd3Mf7Hp4+Tw2mvZ/QkWW aZ/bXFhomte1GnWzJxneX/86qVm87MNUjM1NsLxGS49Jk2QSLzHvP+Wy+ENrmHRQvpleNdtAjkQ D 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> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 765071 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 379CC4F5FF for ; Fri, 19 Jan 2024 11:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664126; cv=none; b=hWtRGvSyFDCf+cOP+HQ6Imc5N9EZ8jnx667YrVonAl/OQP/7puUo5wBSWpLaoxxh59pJoT64OMlr/JblCd7pXi1xkM6jHjQ5u4BWYJS9vlHepMtUj7tHn1NpcRQSvzqKsZv5HLBj0J8G/NTK+hvGGHA0rBjAIsbQTSJv2TDS+bQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664126; c=relaxed/simple; bh=biGuQPZKz9nJLpyogO7APhYUhiA6YmM02cSM8cnfGYw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nwDqBwLtFQZHO95diPe8YjM/V8lNoFubJ/23jiW7d56hH5RZ1lQxYfIcoscVAL7HvQNE6/CXBOBLpsKCZrobVO+zBcAmCWxgVb4hs1ELOZrGs3Jj7Z4pTILJhIIZDCsTfWOtuUYdnWug8xeOL9we4QkRBkF4mJ+YjyC6lnRPonU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=aCxx5Jw2; arc=none smtp.client-ip=209.85.166.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="aCxx5Jw2" Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3608bd50cbeso3161075ab.3 for ; Fri, 19 Jan 2024 03:35:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705664124; x=1706268924; darn=vger.kernel.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=aCxx5Jw2ZsPnT9/JWPztaq1jvm+ltsjOZXTZOA+2aNOefrgPd0Y2rOQN2DLDedONfS xT3k6BNLJ2aoGd13Yaf8wvr938DZXXxE6lkq1um5983mSWY7kxzB+tgXWhgK7heFvvTH rbxkVPw8xc/Gf+xDPVOrPZcUHKtwi8DApbmlzfyg9Z3qnRDOz0dVDqd/PAlkY57J1ZZU 2wQdkrPfvcP2TUDAIVvoSI37k7UI9yhC1RMVm+zgiAc6v+Hs10IBucdK4TApbsxLzwq5 /YzUJVa6vA4c58SqnbqY2GAHI9z2eSizUKcMvy9GLyvClOc5X3obdP1uEwaF5/VEa7JH ++LQ== 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=hUCt5RuqsDkvwpVKM9904Gr1/JvHT6454ZoXmxCfBRgHDlLjqfQk8iEvOs1Wmynm0B XJxZvXgghvrGuq6ekD8FhheEIXk1hwnBt2QuApm581hjJ/ObI8at2ijRA0b1tkmUI+an aKll3OnOTmnyQ3WytVErR7DGGmRIp0pFLPr2ZcNQoxDleHQqL9xiLE1QxUdt/LA2Ge9W W4FldP8tdXKU9t9KWGQrWROgGADbzOdv5IR62/EZjdOm9UhNXV8wVQK3jiBQ+eYXXQmH qPTLL5PvZlRecQMnGyWEyuOw36l3JGZJvPtgCXIvsRGYPdicWRDGTJEp9pkOnNnbbz8s G83g== X-Gm-Message-State: AOJu0Yzxq2llr0mnQnSZUBftGSoKLbu2TiBLg5dLCFtlY1cq1CZT50dF A6kmu+UuZo26G8zR6H8Bj6rehkRdOXGqI24KZMhPgwGm2LoI96Omr2n9UG/oaqA= 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> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 764191 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AD584F88D for ; Fri, 19 Jan 2024 11:35:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664131; cv=none; b=mJJyAeo9E+XYonPdWNTxS3IeLeC3Tsjb31P4zyQjqVOQnD1oTI/7xS8UdbVYEZJSnD2vsOKc/cdYQeZZ+IK8G9WeSU+hYcz/efQk2Z4JTaWgOKpWrQdEXZgfOVQ/j2UPj6Ft8ZCJNLLO8DzEV6SzE4lLR43a1S8lwMCmHZjtT6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664131; c=relaxed/simple; bh=fqqDjN66329pa4niMWl6MkhJrFW850wjJ+KnOw48Ihc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dQRTiT8H3f/cAk0Ml4OFt986C+UOnkl13R/v+IDJrPdvPd6RFGTtzPUOCEMqrkY9cqFfy6fscfsUIcj4hHP0V2Eedzrsksdr47oXAEfEcLKtWGwIskKPVQjZZ5gSS3RbyY5jPSsegT8yWXV4GB+CyHCkIPW/s/aJKwJpMrKEnmA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=mbi9StrE; arc=none smtp.client-ip=209.85.166.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="mbi9StrE" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-36091f4d8easo2130295ab.2 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=vger.kernel.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=mbi9StrENwn6XzzWy1BiKRt2MrZXI0FQNYiBXiqntu4B3GBqLg2ACdEkuni/HKDOh7 xeHFb3EQ4WlP3gnlHxkvuLUeAnOPm7oBkcm2mR89JAIeBONVVYYMPaOT1s5m/dIVWmIO pguQv9lZ8KL+hld87j1xwIhhVTu1H6fBpSwC5CqNVHNT4qPb4gbFbihbHt30CbSeU1/K HAhwSrunwR1C6rvad4H0JDq93r6wWQpJ+Bl6Ms0U7xYYR5s2DDyV3FZ54ejnHy26fyuC d+eaaLcjyrkCIMaGGyiuHge4Fc6Vx61+LiM2GzvOnasu+Bt2JbhG3G63Z4dP0jSHW/Gf 1Xkg== 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=VFWWKCbTk9fq5QIm2pSFXyTjuxouIz68AePvOELGub0udX3mPiEE1WnRo/BOezp5id RahjO8VQ8NmdQXpfcTmcK2K7XjkSBBR6OTb5HVOxmfiWdcct8R4PW26WUnmju+n78PHc IiR5HDmgpWTG1JAJsSP7go34Bgv/qab9/qj8pbv5zfHvOlorvO1cQuRPQmAzcW4g+S3U n5gnKscJf4zn9Q9BpZd+Ca/S73Qz5UIWLl0H9fQPPpn6hxBI/x/y2rybjwWKU+ZLd3SY dLAyMGpoUMFaNh1CMZqEjK+cdAZviuu5FetMsjGmMSAS4ePK6spMxmXMjfU7W8FkdIyn Rj4w== X-Gm-Message-State: AOJu0YzPC46kY4HqFazHoGt+afNfxZhJmWzwj0sJYmy/awh4PTlQIdZI VK6udL6aGSP2WnEU9cpAMvonDkffUo3WoYLJyqjs7nemYOJdxCLMrcqDQh9a/AE= 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> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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