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 5BCCBC47DAF for ; Fri, 19 Jan 2024 11:35:23 +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=87aS/2Cze/0Wf8uPFjkP1p77njiocKS/Y577RTMBvkI=; b=Wzk0ElelqWEDLl cXVxGT8j3CcoUXRpEuTzqFdZi8p6HgkXyqBEDSopOdsi0MO+bYxPvE5NX0cYttbh7WvUFpZQIBgzT /1USqOhW7fLvrVHct1+W8eQMte+gnI6BCsEhrbVXus2USdhr/gRi7+Ip6S4G/qnIOVnERheJOFl1v 3vHZ6J8U2GXd85VQV6bqpLmOKRXZOpKYpJLAX3wiSmRTFiz3TVT6jALf7o/VImDBpd44P+ZhTto1R 9ySmNQaY0c0Cc0fb1oTh/FwInMFuf5B2/XAa8SbVBHlY7Qy87yi8AY1geCqQ+AJBL2CKw4c6tTJp7 7o4eMxSQtKoGV9jZBcJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9Q-005Eji-2c; Fri, 19 Jan 2024 11:35:08 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQn9N-005EjH-1A for linux-riscv@lists.infradead.org; Fri, 19 Jan 2024 11:35:06 +0000 Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-36197b6e875so2689985ab.0 for ; Fri, 19 Jan 2024 03:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705664102; x=1706268902; 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=xp7UR5FVgwMPuq2WVimakycKIljY+vuuiyqjnbxZrlU=; b=EI/saUr0ECsW4nBUvmTOmRvDBbpv45Pw1noYUWlhmjRDBTxRNbfzS9qkFWhYzCaEE8 6Ti86llYodQR4h/jJ4DzCf/ZFT3rcIJ+LGcZqNFtUMwM3zcXGrXi8/DES6ugrJEk8pj8 0aO/nhetO+yZ0exlyrSTVTh89TqsVHfGv54NeOQu+px1wGL4+RFz929/zBc8QIVR4mUg kWVeV6dKZsB9i2mc380ZHQlTn5ePq+Y8ncMFCz26N76u1eQzIRP0qnOIbDd4JJBLwejt Abyys/OZ9rja+GfvKzlugLCVph20/EV9uyt7SKIsnbuUxK8iD/cDb43Ajjh6DJzZe0g1 chgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705664102; x=1706268902; 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=xp7UR5FVgwMPuq2WVimakycKIljY+vuuiyqjnbxZrlU=; b=kFYzYO8EY5S0fB75WzXyRRO7uQK6NTkUtm4rsN2J+qyTMl8XwppNCEtZJDK3KN+gOk ED3qeGEA9QstzVHe0CshPFWtpIiYcP6gAshtEmObYSPzvz6x2T06ySySVWTt0cKWTfkH x8EVS+TSRJXElgxECJxd3eM+tgEZIPbfzuRTyqyIbW5n751/tr0CRH0JTy5fJzHUNpXx bdzN/2QOq/O6j0gVbr3J8v7Ype/0YqguhV+ir7iKbIICr/dZTkhoIrfLpxXbMaHT3cZD zu8VPkFyEzfOhn2Xa2wKswxAE2gzRUFPy8kE9CbQ3OEcBtsNGCRI8snFEEf0oaZR1+C7 iNCw== X-Gm-Message-State: AOJu0Yz5qPvMT4kkhUq/Ydwj/E9ezARZ1MPW3pKDj1M4SSWs+4GglxWx koPrSS/hqRZ+JCzCe++xnMQHLmmlKqKU4qpY5OdTwc8ruY1RYv8MKiD8zFdu4Y4= X-Google-Smtp-Source: AGHT+IHhZC2U/hjG0mise1koTMiVKhIOk+6bnofKSdYFddaeNjsDxTHYd5Kh49hCXzNRa8H1IDwPPQ== X-Received: by 2002:a92:2907:0:b0:361:9315:5356 with SMTP id l7-20020a922907000000b0036193155356mr2449028ilg.10.1705664101928; Fri, 19 Jan 2024 03:35:01 -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.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 03:35:01 -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 0/5] RISC-V SBI debug console extension support Date: Fri, 19 Jan 2024 17:04:44 +0530 Message-Id: <20240119113449.492152-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-20240119_033505_430357_46397E64 X-CRM114-Status: GOOD ( 13.93 ) 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_v6 branch at: https://github.com/avpatel/linux.git Changes since v5: - Rebased on commit 9d1694dc91ce7b80bc96d6d8eaf1a1eca668d847 ("Merge tag 'for-6.8/block-2024-01-18' of git://git.kernel.dk/linux") - Added Acked-by from GregKH in PATCH3 and PATCH4 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 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 052D74D135 for ; Fri, 19 Jan 2024 11:35:02 +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=1705664104; cv=none; b=Ji3EeLHaGzTUn3EWDV0wO6O+6j/ECHa/1Q9E04OlcMh9KKwMaYgMZTqqSRogtX1dALglNYTS6jK2zoY3sj5VaNwlhPSVAcgF3A9+UtpA9KViP50wVpyCtdfZUqgJvMXGNRwQMAofZFbIAcXGHh9s0U076hzutFNcluzPhf7Usnc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705664104; c=relaxed/simple; bh=uyL8bNC7ma/3HaOi4wx55XD8BQt4u5BR2EwRAhg1g2M=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=jC6mZIhwd6t+xLjeG5ImFgMz6MHveODHirwwVN45MyKXtGhrunnejo/qJ71vYUVJu86JoVrbSS9vj4ZN3KpiDkTC3nclaIWDBteqIf6x5jA5DGLyhAJBfDDaXR7IC7NYvKyNk2Ea5okBSyngd5rdiYNRSIoHsjsvK8ofLoZUw4A= 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=jefq628Z; 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="jefq628Z" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7bc332d3a8cso32981239f.2 for ; Fri, 19 Jan 2024 03:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705664102; x=1706268902; 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=xp7UR5FVgwMPuq2WVimakycKIljY+vuuiyqjnbxZrlU=; b=jefq628ZKAHumFIqOyGHdQOU2q5aXnfyXP77e2CdPALfa+aNYuSztzCOGIcOTG9fro DUaLGze/nKQmnvR7jUk4vKY3OsqeKb4XW8tvInFiAofslqGwGSPxVuAYVnr2/i0/GNWf lpy2XAIg2omVWuZx+/gJBzRGNKcqnDnzhkNLpmB3fnMfHym7IWFS95v/v6sJBh7q9JGW MHxpo+wWdS5hkuT/G6hw4KnxLIS25FsvvtPo79UxXq8oJz/FDed3liIxZHV2/Wkz6WC2 kAWZ9MW12iQ3T4awn4BolmvH2Rmu/EP+f3VOIpmdc4+VBLiBzaRp5magEonmcXlJ0QdD pSSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705664102; x=1706268902; 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=xp7UR5FVgwMPuq2WVimakycKIljY+vuuiyqjnbxZrlU=; b=d/sRthvQCwboUA5Yi1O0Jnl+JH+dXnQz2E4qAgH4sOyb8fYf6cTURwcNlrkUKNO1A/ aHUepprE7gCYu4XmT4ql/Ny6D6iR1HNP/+w7KLxn53zt8UdM9IKuk59Lnm2oUS/Et6UF zoHyJ/wAPQSo+gCZHmt9f6R+qZ61p72hWwfCvX4g3uKjJKhBTkz5ABzYN/+iR1b3qNBK /Qu/FWZuEi1X1xuy+2u9Ad0LCTpTDhJ8cscJ7yjH+odUdiTcmbSYVphM2LgrL5JdGAA4 O+xTK9OYPRmhdxv7YX9TFH0wF/ELE6orgxGFLvJuVjf880fUVkQnYeiA4TTxYHincyDS KG0w== X-Gm-Message-State: AOJu0YzjJfePX/Udltfvh5YnhCUpLl986kAAF5SkrLaGmEnhHWcy5AEd iJN7v9+B1lKx3zdvURULzRqtuh0rsZU3rYw9QZz/2r/97GTvtGXEOjNEHU+wSn0= X-Google-Smtp-Source: AGHT+IHhZC2U/hjG0mise1koTMiVKhIOk+6bnofKSdYFddaeNjsDxTHYd5Kh49hCXzNRa8H1IDwPPQ== X-Received: by 2002:a92:2907:0:b0:361:9315:5356 with SMTP id l7-20020a922907000000b0036193155356mr2449028ilg.10.1705664101928; Fri, 19 Jan 2024 03:35:01 -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.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 03:35:01 -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 0/5] RISC-V SBI debug console extension support Date: Fri, 19 Jan 2024 17:04:44 +0530 Message-Id: <20240119113449.492152-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_v6 branch at: https://github.com/avpatel/linux.git Changes since v5: - Rebased on commit 9d1694dc91ce7b80bc96d6d8eaf1a1eca668d847 ("Merge tag 'for-6.8/block-2024-01-18' of git://git.kernel.dk/linux") - Added Acked-by from GregKH in PATCH3 and PATCH4 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 48A14C47DAF for ; Fri, 19 Jan 2024 11:36:03 +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=hcmaDlys; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4TGcxs4KgDz2xTP for ; Fri, 19 Jan 2024 22:36:01 +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=hcmaDlys; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ventanamicro.com (client-ip=2607:f8b0:4864:20::d29; helo=mail-io1-xd29.google.com; envelope-from=apatel@ventanamicro.com; receiver=lists.ozlabs.org) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 4TGcwt6pv2z2xdh for ; Fri, 19 Jan 2024 22:35:08 +1100 (AEDT) Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7ba903342c2so23771739f.3 for ; Fri, 19 Jan 2024 03:35:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705664102; x=1706268902; 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=xp7UR5FVgwMPuq2WVimakycKIljY+vuuiyqjnbxZrlU=; b=hcmaDlys1tqCIWS05QqzU3LvKGX9XSeDrKnQE/wvulRGqV+mPPR02CC85kVOkx/p63 unL8WVKQlTDKM/EumO13XlFuyPv824y0mtEhfJ7Is4yHHLWUGt37uhulyDTkpNTYMAvd pPpP3BT0C/VsCVE2GiZ5jAIZael5mLpcx6dGMIUmoznxcukBi8av7tNTkXtvKaARkjWp 48md0aEMe/NaFBW9Jh/gz6D0J0xy5Q7EsW6NagGUbKW0EtO/Awt3vr+NM2y0RcjynuEa uYg0CuOFirxFhzoWB+N2vuerh+LV8vH8KHXY+nXPksto2QTDj8XJhzbimvJWssvVre8z BZ+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705664102; x=1706268902; 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=xp7UR5FVgwMPuq2WVimakycKIljY+vuuiyqjnbxZrlU=; b=kLtL0LHiDknsUYnusNuIwTpGI3LC+t8ZIMghY90v49XKNXfDlCZkTH921JzOPWIqT7 QHfhzdIljb3T7JRCmSh1KGI7oNaDWrtpG1rRXG3a9gmhRxjksVVaKBfTHFiTbt1cDCKR V5uLnXM9dnvz695IV45zCmpCya2vyCtctTdVkGsiHnfI3HYnymoRHybaVh1RYG50bPxT ZmWpU41rmD8vnUAwezHt2s4fXqJHCJ8PMuzR0BFcN7wCviaAo9ULP0OXEvf4Xn4ceTCc CfyeRkUbo3ZFbfBTDnmCvOYmtUKvinhZfxWnbbGJTxRb0TxykXk1jyXBA73XeLCUkreE hejg== X-Gm-Message-State: AOJu0YxHTrAwbtmtQMNUsWyXYBchueUI3jhinLLkrliqiTufMm7Tn6/z LhvgriHeSDAmO+W5EvsA69U2bYqGV/qtVDqlIgjYBr45wBZvTQSUTCfytcLsP3o= X-Google-Smtp-Source: AGHT+IHhZC2U/hjG0mise1koTMiVKhIOk+6bnofKSdYFddaeNjsDxTHYd5Kh49hCXzNRa8H1IDwPPQ== X-Received: by 2002:a92:2907:0:b0:361:9315:5356 with SMTP id l7-20020a922907000000b0036193155356mr2449028ilg.10.1705664101928; Fri, 19 Jan 2024 03:35:01 -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.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 03:35:01 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v6 0/5] RISC-V SBI debug console extension support Date: Fri, 19 Jan 2024 17:04:44 +0530 Message-Id: <20240119113449.492152-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_v6 branch at: https://github.com/avpatel/linux.git Changes since v5: - Rebased on commit 9d1694dc91ce7b80bc96d6d8eaf1a1eca668d847 ("Merge tag 'for-6.8/block-2024-01-18' of git://git.kernel.dk/linux") - Added Acked-by from GregKH in PATCH3 and PATCH4 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