From mboxrd@z Thu Jan 1 00:00:00 1970 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 8D381C61DF4 for ; Fri, 24 Nov 2023 07:10: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: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:In-Reply-To:References: List-Owner; bh=kkK2wbpaEEcibo6NxJIzeYy3vR7c+Ih4JXsODJZjI0k=; b=4aGOzNC1yDsr3T sLgPTO4oQE8fSXihPbU4LkyTTAFO8UF5P3+LE1QIwUO9ayGPXXGoPRteVkXvBEol4C4SD6J2zGdmP tmldbWtwH3iDQPzmRR133ZqnomxLH6RT8sD+lYDNw0did69ryQAyk5cU8mfYfyQlHeKWfQSw4KLNk NnpIx5gE6GWOQhwOMzUh68ncbA/Kpd8IweuepZkINUSEKJg9S3oq6OdPCOthwf20LfktYZzpYseRS V9SFhvS7JAtLrv3Dr1H26G6TVvjy5uegsoWGMvRotsMtMRL7wOEafYaTlXDsLJDpV1GQvm4rAN6n4 Cw9+p06u7/qegCPM7IWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6QKb-006LYL-1p; Fri, 24 Nov 2023 07:10:29 +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 1r6QKY-006LXU-1D for linux-riscv@lists.infradead.org; Fri, 24 Nov 2023 07:10:27 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6cd0963c61cso886116a34.0 for ; Thu, 23 Nov 2023 23:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700809824; x=1701414624; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=O91wfSpN9ObCdaEwiURAAaoPifbKQnuX2UDqzMk/9EE=; b=M46slxbYjoMvN3tf4N1BE/H9DQ8Pz1YnC5wNfgL2JQqq9zJDZfx1axYxEVal+GCJtk Ck/IEuJcOqjnXp4QR+yYbJ4PHmeNLTCyuc52N667U+S6uNDiaWYAyWrsdebAdNgrfijw f4TPOQrbAbVbWghbrvJvACSJH2oYY2M4J0LhN60UgjLDic5DuQifos/fPQwDI/XrsYMv 5AQL8azXjR8cK5hvKdTaC/VXQnL2ydcQd2lSzZuHnBG2jngI8Zfk7t8D0Dfyu4Eq4jw6 Ivx5+pfAvs6RovJofn/xXcCOpvjUQsLd2NX6cWXxUYsAib0paY16VjXaGEwcrbt87XqF hjlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700809824; x=1701414624; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O91wfSpN9ObCdaEwiURAAaoPifbKQnuX2UDqzMk/9EE=; b=VZeBh2d1UwVYRr51lgnGuV5PcDqK74saUv1yh49B5rd/MmpDkVQNuObDf1j/mzTqv+ Rskan/CyWhbJBMFaUU4z5+HJQqMsRJy5lJYH9VRTb3T8WWe0MQvnQ98EUJmEtYiz8DFq 55w7d0DZ/0TpKt1kW44LWjKJrCsY8PMpD8BJdlUjfzUyQ2zvsD4jI7rXp35UmOIEI95e mcWtanwme2cudQiSkmD49rydsnepvE2slGWkVf0dUn+5YeH9UTXVx0yDJcO/ZH+g4mVi g/x0RXsW/pfwr/dh50SGGxlQHpEoB7s9lMp86xVosDnu2sCNtxn5ou3BPNZwUGDYnOBY yQvg== X-Gm-Message-State: AOJu0YzribwSJmYVoOCDW/3lvb7bjnIiSE4wPH01LASyi+6XWEKioyUp As2PN4IUltVNIVpnJLktN9an6g== X-Google-Smtp-Source: AGHT+IHoAk7libxxmoEnwyG+ICVQkzzI6uc6joEaMVEQl0m28dbDgLSf9VQd9ACWrQm5vBhlWCIngw== X-Received: by 2002:a05:6830:603:b0:6d7:f66d:b0ae with SMTP id w3-20020a056830060300b006d7f66db0aemr1910766oti.5.1700809824530; Thu, 23 Nov 2023 23:10:24 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:10:24 -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 0/5] RISC-V SBI debug console extension support Date: Fri, 24 Nov 2023 12:39:00 +0530 Message-Id: <20231124070905.1043092-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_231026_427694_E3925D9C X-CRM114-Status: GOOD ( 13.84 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The SBI v2.0 specification is now frozen. The SBI v2.0 specification defines SBI debug console (DBCN) extension which replaces the legacy SBI v0.1 functions sbi_console_putchar() and sbi_console_getchar(). (Refer v2.0-rc5 at https://github.com/riscv-non-isa/riscv-sbi-doc/releases) This series adds support for SBI debug console (DBCN) extension in Linux RISC-V. To try these patches with KVM RISC-V, use KVMTOOL from the riscv_zbx_zicntr_smstateen_condops_v1 branch at: https://github.com/avpatel/kvmtool.git These patches can also be found in the riscv_sbi_dbcn_v5 branch at: https://github.com/avpatel/linux.git Changes since v4: - Rebased on Linux-6.7-rc2 - Addressed Drew's comments in PATCH2 - Improved sbi_debug_console_write/read() to directly take virtual address of data so that virtual address to physical address conversion can be shared between tty/serial/earlycon-riscv-sbi.c and tty/hvc/hvc_riscv_sbi.c - Addressed Samuel's comments in PATCH3 and PATCH4 Changes since v3: - Rebased on Linux-6.7-rc1 - Dropped PATCH1 to PATCH5 of v3 series since these were merged through KVM RISC-V tree for Linux-6.7 - Used proper error code in PATCH1 - Added new PATCH2 which add common SBI debug console helper functions - Updated PATCH3 and PATCH4 to use SBI debug console helper functions Changes since v2: - Rebased on Linux-6.6-rc5 - Handled page-crossing in PATCH7 of v2 series - Addressed Drew's comment in PATCH3 of v2 series - Added new PATCH5 to make get-reg-list test aware of SBI DBCN extension Changes since v1: - Remove use of #ifdef from PATCH4 and PATCH5 of the v1 series - Improved commit description of PATCH3 in v1 series - Introduced new PATCH3 in this series to allow some SBI extensions (such as SBI DBCN) do to disabled by default so that older KVM user space work fine and newer KVM user space have to explicitly opt-in for emulating SBI DBCN. - Introduced new PATCH5 in this series which adds inline version of sbi_console_getchar() and sbi_console_putchar() for the case where CONFIG_RISCV_SBI_V01 is disabled. Anup Patel (4): RISC-V: Add stubs for sbi_console_putchar/getchar() RISC-V: Add SBI debug console helper routines tty/serial: Add RISC-V SBI debug console based earlycon RISC-V: Enable SBI based earlycon support Atish Patra (1): tty: Add SBI debug console support to HVC SBI driver arch/riscv/configs/defconfig | 1 + arch/riscv/include/asm/sbi.h | 10 ++++ arch/riscv/kernel/sbi.c | 66 +++++++++++++++++++++++++ drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 37 +++++++++++--- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 27 ++++++++-- 7 files changed, 133 insertions(+), 12 deletions(-) -- 2.34.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="AYsLJoeK" Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FED4D6E for ; Thu, 23 Nov 2023 23:10:25 -0800 (PST) Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6cd0963c61cso886117a34.0 for ; Thu, 23 Nov 2023 23:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700809824; x=1701414624; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=O91wfSpN9ObCdaEwiURAAaoPifbKQnuX2UDqzMk/9EE=; b=AYsLJoeKp/VeCaPKIAsqEeGRNi1EXuiCRdE4pVMDxJ6B/TXmQou42eJ+FTRMhNpdnd sFuKbaeEReP4bKRRo6CyvkVoKprhlpDx2zx70YKSZLMqK/pM8YdLoYy7vVPx55si3cwd +BHk+GRqfjWiA/CiWu5xVNTwzv4UofcWvYHv4DLGksU9dgA8m6ZA86W3C2kBPstgYvGq C3HDN5hJhfWEydJcE+A4lEzpyxI8bEjX2zZFta1QC9sLiRa+tfnCdcUmlV9gkqgAPn4V 36L5/VNZt4XjaErD9yP/duGhGFEOksXfIfMZHsHB0ZL+/5LP0yX+iUAuDGXBm8KY1qrI 9eNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700809824; x=1701414624; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O91wfSpN9ObCdaEwiURAAaoPifbKQnuX2UDqzMk/9EE=; b=LMAP/hYCaAyYij3fPU4pXLlmklw9NyuQFbswo2SalyrloiA57K7x6J8cjTOmciCLm+ h+EKVkvda0qcKCBbC+m2tpr+kGD2X/E/jdbzabmyfmemFBneMWzZdEgvQ8eTZsIoJ8Oy tmCOtc9eokjt++ZSyTXVlsxuHWkSyVa8fBYAQ2B1Y26nOa1hVQrWngglwtXDpi2Kq7PF z2uQgTTs1B9nZudve/TVfNyY319wIzpgwY20KKnhfhbpAVfX6xyDLzHg4VAK8JBg88b7 bDV7WW58G0axHadfLA7IytHDWuoEkEVXqY27Xd6muKsInGkZpkJ1kCNmmSL23bQy3S7G HCnA== X-Gm-Message-State: AOJu0YxZaUcMZY6FmJ444iu2YLUkTumtg7vhHLsIHKsacXAnMa6tu+U+ d/KKbg43hY7q7kT87aN00BMiBw== X-Google-Smtp-Source: AGHT+IHoAk7libxxmoEnwyG+ICVQkzzI6uc6joEaMVEQl0m28dbDgLSf9VQd9ACWrQm5vBhlWCIngw== X-Received: by 2002:a05:6830:603:b0:6d7:f66d:b0ae with SMTP id w3-20020a056830060300b006d7f66db0aemr1910766oti.5.1700809824530; Thu, 23 Nov 2023 23:10:24 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:10:24 -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 0/5] RISC-V SBI debug console extension support Date: Fri, 24 Nov 2023 12:39:00 +0530 Message-Id: <20231124070905.1043092-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The SBI v2.0 specification is now frozen. The SBI v2.0 specification defines SBI debug console (DBCN) extension which replaces the legacy SBI v0.1 functions sbi_console_putchar() and sbi_console_getchar(). (Refer v2.0-rc5 at https://github.com/riscv-non-isa/riscv-sbi-doc/releases) This series adds support for SBI debug console (DBCN) extension in Linux RISC-V. To try these patches with KVM RISC-V, use KVMTOOL from the riscv_zbx_zicntr_smstateen_condops_v1 branch at: https://github.com/avpatel/kvmtool.git These patches can also be found in the riscv_sbi_dbcn_v5 branch at: https://github.com/avpatel/linux.git Changes since v4: - Rebased on Linux-6.7-rc2 - Addressed Drew's comments in PATCH2 - Improved sbi_debug_console_write/read() to directly take virtual address of data so that virtual address to physical address conversion can be shared between tty/serial/earlycon-riscv-sbi.c and tty/hvc/hvc_riscv_sbi.c - Addressed Samuel's comments in PATCH3 and PATCH4 Changes since v3: - Rebased on Linux-6.7-rc1 - Dropped PATCH1 to PATCH5 of v3 series since these were merged through KVM RISC-V tree for Linux-6.7 - Used proper error code in PATCH1 - Added new PATCH2 which add common SBI debug console helper functions - Updated PATCH3 and PATCH4 to use SBI debug console helper functions Changes since v2: - Rebased on Linux-6.6-rc5 - Handled page-crossing in PATCH7 of v2 series - Addressed Drew's comment in PATCH3 of v2 series - Added new PATCH5 to make get-reg-list test aware of SBI DBCN extension Changes since v1: - Remove use of #ifdef from PATCH4 and PATCH5 of the v1 series - Improved commit description of PATCH3 in v1 series - Introduced new PATCH3 in this series to allow some SBI extensions (such as SBI DBCN) do to disabled by default so that older KVM user space work fine and newer KVM user space have to explicitly opt-in for emulating SBI DBCN. - Introduced new PATCH5 in this series which adds inline version of sbi_console_getchar() and sbi_console_putchar() for the case where CONFIG_RISCV_SBI_V01 is disabled. Anup Patel (4): RISC-V: Add stubs for sbi_console_putchar/getchar() RISC-V: Add SBI debug console helper routines tty/serial: Add RISC-V SBI debug console based earlycon RISC-V: Enable SBI based earlycon support Atish Patra (1): tty: Add SBI debug console support to HVC SBI driver arch/riscv/configs/defconfig | 1 + arch/riscv/include/asm/sbi.h | 10 ++++ arch/riscv/kernel/sbi.c | 66 +++++++++++++++++++++++++ drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 37 +++++++++++--- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 27 ++++++++-- 7 files changed, 133 insertions(+), 12 deletions(-) -- 2.34.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 6C72AC61DF4 for ; Fri, 24 Nov 2023 07:11:26 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=IJ8pxtCa; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Sc5kN5zG6z3vcW for ; Fri, 24 Nov 2023 18:11:24 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=IJ8pxtCa; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ventanamicro.com (client-ip=2607:f8b0:4864:20::330; helo=mail-ot1-x330.google.com; envelope-from=apatel@ventanamicro.com; receiver=lists.ozlabs.org) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Sc5jP3s4sz3cnZ for ; Fri, 24 Nov 2023 18:10:31 +1100 (AEDT) Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6ce2fc858feso870896a34.3 for ; Thu, 23 Nov 2023 23:10:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700809824; x=1701414624; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=O91wfSpN9ObCdaEwiURAAaoPifbKQnuX2UDqzMk/9EE=; b=IJ8pxtCaM2USPPXlSHCcBm42cPcRxEqBronZIMImeBgKBT/AAdliS6fcsC/+KKFoDn r6mk18sqf2qklODQYrDjIB3wRIi9b0uFIMZUBAKq9rNTczv7qrC06ksUOlZm/w9V5TDc nB7msB8zQk+a5SUSqqPDjZv1+S9zY3OohzC9Yq72/Y311+6KG9ADIwNOxTsOI8KqktRr w6Sb//+HjemosbC46JlX5Ka58mp+pX1UNk3DiryVzd3Z/v7Lxt37fSQciEocGsdp0Rrn cK4HUX5CzsVpZ/+nnbXyqsGFBEepveV6eIhBbvZtj788LpWQzyAFPGfyONSOoWNb7BGe izxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700809824; x=1701414624; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O91wfSpN9ObCdaEwiURAAaoPifbKQnuX2UDqzMk/9EE=; b=wZNN0KmosJ/ujk0LbvLyqZTOgtaUjIQRvyOjdn5E70e5Twx/D6aGJ9Brmr4MnJS4KB 28sR9OupcTgdaQiJpJyZB5vPAKakP4wMgaSA9aplKD3+Rz8PCRbQVErj1X1kWVsytV3O DDyLcqjLg4kPF7DabyXM8ceI6SXtRMUgaBG+JqEw5P6GUzg0gVHkFz4e9wKtM90jXvho i40ACVwZhUJw6hGQdD0XRUnZLKxCFsQ47Im7aLK2jY1EGniDYMRI2tuvswmJfHDvgoMG qcju9Xr3v0JuquPwKTos9a08xHNviI0Fhu67TrHD2PrOBdCfrWkaCvHGhraf1w1K6HrP jA6Q== X-Gm-Message-State: AOJu0YyvGL7LRWwvwOK+oUSKRQZ1ozYqLVGLv/fyfnLwAzZmlBNhsPCJ uh45+qIcvV0eCTN60Tf8V8GkIg== X-Google-Smtp-Source: AGHT+IHoAk7libxxmoEnwyG+ICVQkzzI6uc6joEaMVEQl0m28dbDgLSf9VQd9ACWrQm5vBhlWCIngw== X-Received: by 2002:a05:6830:603:b0:6d7:f66d:b0ae with SMTP id w3-20020a056830060300b006d7f66db0aemr1910766oti.5.1700809824530; Thu, 23 Nov 2023 23:10:24 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 23:10:24 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v5 0/5] RISC-V SBI debug console extension support Date: Fri, 24 Nov 2023 12:39:00 +0530 Message-Id: <20231124070905.1043092-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anup Patel , linux-kernel@vger.kernel.org, Conor Dooley , linux-serial@vger.kernel.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Andrew Jones Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" The SBI v2.0 specification is now frozen. The SBI v2.0 specification defines SBI debug console (DBCN) extension which replaces the legacy SBI v0.1 functions sbi_console_putchar() and sbi_console_getchar(). (Refer v2.0-rc5 at https://github.com/riscv-non-isa/riscv-sbi-doc/releases) This series adds support for SBI debug console (DBCN) extension in Linux RISC-V. To try these patches with KVM RISC-V, use KVMTOOL from the riscv_zbx_zicntr_smstateen_condops_v1 branch at: https://github.com/avpatel/kvmtool.git These patches can also be found in the riscv_sbi_dbcn_v5 branch at: https://github.com/avpatel/linux.git Changes since v4: - Rebased on Linux-6.7-rc2 - Addressed Drew's comments in PATCH2 - Improved sbi_debug_console_write/read() to directly take virtual address of data so that virtual address to physical address conversion can be shared between tty/serial/earlycon-riscv-sbi.c and tty/hvc/hvc_riscv_sbi.c - Addressed Samuel's comments in PATCH3 and PATCH4 Changes since v3: - Rebased on Linux-6.7-rc1 - Dropped PATCH1 to PATCH5 of v3 series since these were merged through KVM RISC-V tree for Linux-6.7 - Used proper error code in PATCH1 - Added new PATCH2 which add common SBI debug console helper functions - Updated PATCH3 and PATCH4 to use SBI debug console helper functions Changes since v2: - Rebased on Linux-6.6-rc5 - Handled page-crossing in PATCH7 of v2 series - Addressed Drew's comment in PATCH3 of v2 series - Added new PATCH5 to make get-reg-list test aware of SBI DBCN extension Changes since v1: - Remove use of #ifdef from PATCH4 and PATCH5 of the v1 series - Improved commit description of PATCH3 in v1 series - Introduced new PATCH3 in this series to allow some SBI extensions (such as SBI DBCN) do to disabled by default so that older KVM user space work fine and newer KVM user space have to explicitly opt-in for emulating SBI DBCN. - Introduced new PATCH5 in this series which adds inline version of sbi_console_getchar() and sbi_console_putchar() for the case where CONFIG_RISCV_SBI_V01 is disabled. Anup Patel (4): RISC-V: Add stubs for sbi_console_putchar/getchar() RISC-V: Add SBI debug console helper routines tty/serial: Add RISC-V SBI debug console based earlycon RISC-V: Enable SBI based earlycon support Atish Patra (1): tty: Add SBI debug console support to HVC SBI driver arch/riscv/configs/defconfig | 1 + arch/riscv/include/asm/sbi.h | 10 ++++ arch/riscv/kernel/sbi.c | 66 +++++++++++++++++++++++++ drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 37 +++++++++++--- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 27 ++++++++-- 7 files changed, 133 insertions(+), 12 deletions(-) -- 2.34.1