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 B0ED9C2BB3F for ; Sat, 18 Nov 2023 03:39:51 +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=xsZ8Zzri2GMNkCBUnBDEa+AtQmZJgYmem/36XN/FP7c=; b=aRLnRKyu2WtS4j 4l7JoddgTC2qVihtlDqnmXYIOpH76a9AgC+EvII68y8WaGLd8a99jGhcalEH1uWl15r6/YCLIgHOJ +sU9zMouzkkkk3a9UrvcGGZXyHJEFbWIDWgRsVg7O68UcUFph9bjDsB9pXWCYsjyilwwnsQuGpkxG X963LVOLGwYRLgbPtLjYXz3X/ObeTuLqCBkRmDvKPvGre8pFdb/8RDcXeEB4c9EdWH4ZmsVEtsDeg 7ovgc9lRYiMhJ3q7TbHuxpMVnVgFUUNOVmKFQp4TUj8npM+sPKXxD0gvP02GDl/gZZV1p25GERelM RJJSid7VqslFTLW/pKSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4CBH-007n3i-21; Sat, 18 Nov 2023 03:39:39 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4CBD-007n1f-2F for linux-riscv@lists.infradead.org; Sat, 18 Nov 2023 03:39:37 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-27ff7fe7fbcso2208290a91.1 for ; Fri, 17 Nov 2023 19:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700278771; x=1700883571; 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=2Xk65QbdRKZdLNSQh19GKuOPbc61/SWIMytvbu8dUYc=; b=bVHCkvzbBHOFabAYPWbhwjGY2epbkiEMyEsizkPwfxHSHDopPhojvJsjn+mgIHkPRy jCi/O/nXb6buSfXQrW6Rxxp2wQuGlwvHx1eTlhBEYj22etJJzpVBEqxVGjZOHUPkkVT2 PAF8t/fjHhX6Q9outDbjQtziC/rZT4CGfZJeSaOCS402A5VZdvDTBkUu7HMwtk2NrL3D ZwvchIUNlYX5PPyEOV+5LMFoXhNN1LTdd7HV6hXCpJTei01Qr628CGLYEbxXhtX72tbl /RqJIZTguw9iCGbY315JhpwqGn+hSjeVvDLlE3Mm4Plf7ByHC/gLPuEkDwrUZcqEeINr 0u/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700278771; x=1700883571; 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=2Xk65QbdRKZdLNSQh19GKuOPbc61/SWIMytvbu8dUYc=; b=q9wzZc7uUfY+H/JAvkax93ODb9Vt087qnKKoz7uv2KxHVImNEWupP01ONn2Tb802Sk GR3fBPlmMTx+w0u//Dhj+egy1RUSJsfnRKmA3h9R5QRXGnPZJp7f2cUomd6r+kXAXl1Q tn+Uub37flUxM8IINUgkXbWu3edgVfidDT//m8dV7ibrwLbkWPgY5RNec822KMqigc+t XlWr7wGEkI/7n8oRfgewxQdYsuQIH/9EYSqY0Fy4Um6hQVRD0kqKSaAeWhj4uZ0HYf7U HioExdAULdojuR1hKlIAhLcqqxtkbxk4t/9vyvkucdIAXY+wyFV1YgwFq74GrDyjkDIy v9lA== X-Gm-Message-State: AOJu0YwrJlS38C8P2SzuqaVsBZATIrcIULZlK/trFWR3wHKjMZoP18eU lL9F02KTxhlKsv34wAWr97Q43A== X-Google-Smtp-Source: AGHT+IEdivzV5yM9VLUbAmX/fPwvXT56J4szG18kUoyADgqsU5ZolAzZbNQxZHHnYCkaszm6OKc0Yw== X-Received: by 2002:a17:90b:4a49:b0:280:4ec6:97e9 with SMTP id lb9-20020a17090b4a4900b002804ec697e9mr1593141pjb.30.1700278770582; Fri, 17 Nov 2023 19:39:30 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([171.76.80.108]) by smtp.gmail.com with ESMTPSA id cz8-20020a17090ad44800b00280fcbbe774sm2053823pjb.10.2023.11.17.19.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 19:39: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 v4 0/5] RISC-V SBI debug console extension support Date: Sat, 18 Nov 2023 09:08:54 +0530 Message-Id: <20231118033859.726692-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-20231117_193935_760717_57301309 X-CRM114-Status: GOOD ( 12.83 ) 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 KVM RISC-V and Linux RISC-V. To try these patches with KVM RISC-V, use KVMTOOL from riscv_sbi_dbcn_v1 branch at: https://github.com/avpatel/kvmtool.git These patches can also be found in the riscv_sbi_dbcn_v4 branch at: https://github.com/avpatel/linux.git 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/configs/rv32_defconfig | 1 + arch/riscv/include/asm/sbi.h | 10 +++++ arch/riscv/kernel/sbi.c | 43 ++++++++++++++++++ drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 59 ++++++++++++++++++++++--- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 24 ++++++++-- 8 files changed, 129 insertions(+), 13 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 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4057DC2BB3F for ; Sat, 18 Nov 2023 03:39:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232181AbjKRDjf (ORCPT ); Fri, 17 Nov 2023 22:39:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbjKRDje (ORCPT ); Fri, 17 Nov 2023 22:39:34 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83BF2D79 for ; Fri, 17 Nov 2023 19:39:31 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2839c113cbcso944941a91.3 for ; Fri, 17 Nov 2023 19:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700278771; x=1700883571; 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=2Xk65QbdRKZdLNSQh19GKuOPbc61/SWIMytvbu8dUYc=; b=jsiDW+/iFIlrJvhc1hGwOytoJLciIuIJz7wYjuNWDFnZ5gFquyO+WxRLDmDf5KmNJ+ eG085RVuTESbmH30O6YSw8ZW16Q7nLxcgyL9+bMp6SI3m5pWoLrHgy887fKYprXZpcrx oMEzW3lRZpTqyB728Efq+OoAtH9CWzEzyaNwvWGBFjaxWg3dZz/nsVVU0iAZfsFfI/4Y EsxySpBUlSzbfQVUjuAOCMVGxvMtyMtb10oppx2S905yksnzieWrRF17TgLpe11JBXu1 P1shtwpdQNms3HtW890uvEIPO3UYTqHZ5Lg8UU6lp2/7b8CotK6ZFshNEW8Y2O/GlU+l Rbog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700278771; x=1700883571; 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=2Xk65QbdRKZdLNSQh19GKuOPbc61/SWIMytvbu8dUYc=; b=j1pmUjnthJymv5Yf0n/xYCwuH+QjkyBEVp4KS9nUcfyYeINWWa5kA2AC4AhKbJMjqA dbEXTIzRVF5sk4MYSuTPKhGdj3V6i7aiRz54yQ1bmUHXY8mLrl+loGi66KYF+FjFAloN InaBI9YL4AnRQojg382r50DYFl2A9EMBFF0O9SogDGRpDfF9DY3E2tevWpSeLqyyC/i4 rrHHzC4QJhMwwp9bLY++PRx1VpNdQVvqdGrRKjW/cBe9WSwvnaGrEQfS8I0rjmXgmJ5w UX3r/iSb1WclcqPSb0QitLn2k1ZIw/2kRXOT9f6LJkTqWZmtF9YcfdFEUbUVy8m6QL0M Briw== X-Gm-Message-State: AOJu0Yzj3aZzEq21w00z5My7jIZLVFImIwKJpuMSO8ncnL+GpmVcpowS 2sIzOhLtNCJvTOJl3c9vvVU6yw== X-Google-Smtp-Source: AGHT+IEdivzV5yM9VLUbAmX/fPwvXT56J4szG18kUoyADgqsU5ZolAzZbNQxZHHnYCkaszm6OKc0Yw== X-Received: by 2002:a17:90b:4a49:b0:280:4ec6:97e9 with SMTP id lb9-20020a17090b4a4900b002804ec697e9mr1593141pjb.30.1700278770582; Fri, 17 Nov 2023 19:39:30 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([171.76.80.108]) by smtp.gmail.com with ESMTPSA id cz8-20020a17090ad44800b00280fcbbe774sm2053823pjb.10.2023.11.17.19.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 19:39: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 v4 0/5] RISC-V SBI debug console extension support Date: Sat, 18 Nov 2023 09:08:54 +0530 Message-Id: <20231118033859.726692-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.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 KVM RISC-V and Linux RISC-V. To try these patches with KVM RISC-V, use KVMTOOL from riscv_sbi_dbcn_v1 branch at: https://github.com/avpatel/kvmtool.git These patches can also be found in the riscv_sbi_dbcn_v4 branch at: https://github.com/avpatel/linux.git 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/configs/rv32_defconfig | 1 + arch/riscv/include/asm/sbi.h | 10 +++++ arch/riscv/kernel/sbi.c | 43 ++++++++++++++++++ drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 59 ++++++++++++++++++++++--- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 24 ++++++++-- 8 files changed, 129 insertions(+), 13 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 D7268C2BB3F for ; Sat, 18 Nov 2023 03:40:30 +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=noT+bkZz; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SXKKn1T83z3cfn for ; Sat, 18 Nov 2023 14:40:29 +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=noT+bkZz; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ventanamicro.com (client-ip=2607:f8b0:4864:20::102a; helo=mail-pj1-x102a.google.com; envelope-from=apatel@ventanamicro.com; receiver=lists.ozlabs.org) Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (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 4SXKJm5c69z30gn for ; Sat, 18 Nov 2023 14:39:34 +1100 (AEDT) Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-27ddc1b1652so2200846a91.2 for ; Fri, 17 Nov 2023 19:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1700278771; x=1700883571; 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=2Xk65QbdRKZdLNSQh19GKuOPbc61/SWIMytvbu8dUYc=; b=noT+bkZz9Uv/BqedNmezY/XMscGklvxNDs+ZvEeahGgbbWmuxA56i/gQvbWBTUeI+y IgYsHyjvfoJkwHtb/BJ86YqRH3SxJqPf+4auyXEuqxFZPmy75KIZ4CHi7Rz7I9QIB0IM 8vtWHqJgMRGq39kv6kRkmpXua3Cysc8+MsrLqtB6At2xiQ/lStTeNs5LdQ23lazdnj4O TeMNg/2LiLQ33NUYQjG/ublrXhl0Fa52o17CiKK5Py/NHyT5JZMSEQLX82Mi2N0bHo2n bOlFoHavMHd//4hN8NG674aJvlUUYeuSnP2evQQNpL9syEqsPKFfjxSId8GxqxwQh+03 /ndg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700278771; x=1700883571; 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=2Xk65QbdRKZdLNSQh19GKuOPbc61/SWIMytvbu8dUYc=; b=hoSiEgq1DmNcHB1Kk+kH2mXTGseYYOJXwYQw+UJeAnlkeuxLH+gplinrFQS4MeiuVU y+tW0qV32/s2YPAr3seLocjrSwSn2xQnmWdDzMMjiINUxgI3cla/DxjSa0YMRB3TClj+ 6SZSynlfyakG+H+3/FtaqOSKhosba7dZzSQBW/LQbfxj2JZ0RYCBqOLt3H4fBA0HKmkm +CoGkUyQNPVgL/j/1bXhmou+4vSOn6g8kD6mu7FtPWKLfl5vdpdYMy3JIXr0cp5eoERx DmuffnebJvZ8OcVRNKcxhHUm53qi66tXJxuiifna6+UxOP5DiSw+lLW1w8oK45mcRQCR 09PA== X-Gm-Message-State: AOJu0YwKBksIvBwDVw2+sH6RDMkzA/mZ2eZOv3MLZkTkMCQVVRjgYrH5 Y3zgItaoYUejJhYBck4mrgNlMw== X-Google-Smtp-Source: AGHT+IEdivzV5yM9VLUbAmX/fPwvXT56J4szG18kUoyADgqsU5ZolAzZbNQxZHHnYCkaszm6OKc0Yw== X-Received: by 2002:a17:90b:4a49:b0:280:4ec6:97e9 with SMTP id lb9-20020a17090b4a4900b002804ec697e9mr1593141pjb.30.1700278770582; Fri, 17 Nov 2023 19:39:30 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([171.76.80.108]) by smtp.gmail.com with ESMTPSA id cz8-20020a17090ad44800b00280fcbbe774sm2053823pjb.10.2023.11.17.19.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 19:39:29 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v4 0/5] RISC-V SBI debug console extension support Date: Sat, 18 Nov 2023 09:08:54 +0530 Message-Id: <20231118033859.726692-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 KVM RISC-V and Linux RISC-V. To try these patches with KVM RISC-V, use KVMTOOL from riscv_sbi_dbcn_v1 branch at: https://github.com/avpatel/kvmtool.git These patches can also be found in the riscv_sbi_dbcn_v4 branch at: https://github.com/avpatel/linux.git 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/configs/rv32_defconfig | 1 + arch/riscv/include/asm/sbi.h | 10 +++++ arch/riscv/kernel/sbi.c | 43 ++++++++++++++++++ drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 59 ++++++++++++++++++++++--- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 24 ++++++++-- 8 files changed, 129 insertions(+), 13 deletions(-) -- 2.34.1