From patchwork Fri Nov 24 07:09:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1868037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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 Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Sc5jq4QDnz1yRy for ; Fri, 24 Nov 2023 18:10:53 +1100 (AEDT) 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 4Sc5jn2BFqz3dTH for ; Fri, 24 Nov 2023 18:10:53 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org 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 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+incoming=patchwork.ozlabs.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(-)