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 45800CA0EE4 for ; Mon, 18 Aug 2025 04:10:15 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=wGBLBhDg9ysCkUgmQ/uYgxjmBZ7ZEGqoi/a7fy9XYb8=; b=B4kXVaMhagT8b1 o1z8x9FHVIOkRwWL4VbhEtv18BWnTNGjW7YLosi0hmyuZjNyiBli1aKxZbCle3vAMhlpN+iwIyvSa /+mhAknLNpwq7/93DMgiG99nPfgdlwAQGeeY178PRpnuJrK+HSo01Vo6JGYrG8ETIGPrpyaz6ylhv jgB0uF3o5B9A977tO9B8iPUOmUPfwA6ZzEP6EXMVwnzSGp0/OXEG5UTGm2Zd73Ft4+8Vrbdlol7aK X+OT3xanrmfRNF2xO4a90ha/miU/i5SlIaWPJAVfEPrigBivr5hj4EiEhuLCe//R9JwQe0Vc4Uqg6 Z6ZU5tEns//iFHn3YhOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1unrCC-00000006Qkm-1CwA; Mon, 18 Aug 2025 04:10:08 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1unrCA-00000006QkB-1C4n for linux-riscv@lists.infradead.org; Mon, 18 Aug 2025 04:10:07 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-32372c05b79so283075a91.0 for ; Sun, 17 Aug 2025 21:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1755490205; x=1756095005; 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=iKYOLGunQqKMdXF6qm/SZHKTrDdQ8k/yLLtlmUN6IDM=; b=PjkVhsb8xjkpV4Y5MYUIiZzGsud0ErT0p4PqAmh8oj2ekomVjkgZdg38BWQ6ppZlkx 1w2jKRiMz91h2Y8CPjcZ0AA8dv4SazLHNLg8Sj4/RGiO8RmNTQOu7ke99lfOEBcY6zS5 oqQ2rtOJAlbzOJdPv5E2H2+xYT878HNZQL2i8m32dqc7n5BidyT2BEMzhVjj6Rag7Ecm b8fgMm8pEZvE69Gf0pIP3sUAj0tc1MgOsCOmdOpPY6hpwf0DWb3vky+sNdRapf185vlQ lYfwGMRu2HJwfgVbrpkrnQWjaKlIOCzhnqFwOC5Qdcj3KhuOz8Y91jcnx3kUPFIU1stG 73qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755490205; x=1756095005; 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=iKYOLGunQqKMdXF6qm/SZHKTrDdQ8k/yLLtlmUN6IDM=; b=CXQtoxtdmgLmtIOEICJvKJGbbLNEZDV8hRq+vd+33pmXijAqkLOx9zzuRVs+esTYZX 1LK+5AjHQDVAwhR9AMR3Em57HESogveQG33ctcBpxpOaB8eRu5pDMyJkcVmWqFIO25xT lzzlyOl1AAJsQdgKVLX3xPY1aU/d2DFBoQqP8gjVSGR343WX64yUrRrmtU59ebV7U7qN XS0xLosZFinVx4Zwtej7c8t/UkP/XT+1eSvpQymZxuIhEdFJ0Uv1LMnW5dW7oQ8SS8aa 1bAiTRbtVfYeZrgGxtwNxMIULHCAkF3TK41ibvvplH2/8ocgeLrProkDiavWDe6y3QGq CI1Q== X-Forwarded-Encrypted: i=1; AJvYcCUc/QPdJUjIOMT3LN/Jkq6cBt/b+7rRSMkzfKZPA7iBVtzr11b0PJH+HviIXp+F8O6Ch1LOpJ9D47QZkg==@lists.infradead.org X-Gm-Message-State: AOJu0YxxCLKAXH14BrIhA6ksy8Jt4+pkxggTs6/asv6T5VOL8fyR8OeV HvbsHkZgMiosdPCAJgdKmZZh9AW0pE4odLMfYAdo3aSxT7ZFfHkZvml6LB9/DiyE9L0= X-Gm-Gg: ASbGnctBGbbKxr5GuHSYlOvHzNUuvb/Gfw979LIMwryps0JdA+8k7wxlsc9UHvSICRv arZGKUAUSqxOxov0r1lyffAdtYxT9TxcGtb8f3NaeOtU15DEjEmF3VlFTPeTPsmg/CG0LioJxS8 l8hiEdRu7eJ8KrKT12YLQlmYWR40ot0B/AprStFuzYdGvktXXsnKSOgOqFwviTqksKzK5L1GpsD dyJw9Ra/cf4mebl11E2/ZzDs7R9WpWqXSwXb0racObMrC7MS8gxjoOCHAeV/pfbSnQQEAS9Yfib 0jzuIxUoBNO59DfOkGwqDOzpzPnhWgQOefoh2fo6jF2/l606YC2QZD9T3uCAidjoSm1OEUwFpj8 EjV0p92QPatjRROx7A8aFB1RdH2kMC+NyCpzhBkOlmmRZuHQQB8o/jA== X-Google-Smtp-Source: AGHT+IGdmiB7+Cb5/hqIGlVOwluhJy7QNe0bpoiDKTDYPYAg4O4TLUdcaJ5Rvz0B2g2NDnT1eIGDqA== X-Received: by 2002:a17:90b:390f:b0:321:2407:3cef with SMTP id 98e67ed59e1d1-32342107d3emr12083892a91.32.1755490205226; Sun, 17 Aug 2025 21:10:05 -0700 (PDT) Received: from localhost.localdomain ([122.171.17.53]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-32343c70356sm6560972a91.25.2025.08.17.21.09.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Aug 2025 21:10:04 -0700 (PDT) From: Anup Patel To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jassi Brar , Thomas Gleixner , "Rafael J . Wysocki" , Mika Westerberg , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Subject: [PATCH v10 00/24] Linux SBI MPXY and RPMI drivers Date: Mon, 18 Aug 2025 09:38:56 +0530 Message-ID: <20250818040920.272664-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250817_211006_331079_1C1E968A X-CRM114-Status: GOOD ( 20.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: , Cc: Anup Patel , devicetree@vger.kernel.org, Andrew Jones , Alexandre Ghiti , Atish Patra , Leyfoon Tan , Anup Patel , linux-kernel@vger.kernel.org, Samuel Holland , linux-acpi@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , linux-riscv@lists.infradead.org, Len Brown , linux-clk@vger.kernel.org, Rahul Pathak 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 v3.0 (MPXY extension) [1] and RPMI v1.0 [2] specifications are ratified by the RISC-V International. Currently, most of the RPMI and MPXY drivers are in OpenSBI whereas Linux only has SBI MPXY mailbox controller driver, RPMI clock driver and RPMI system MSI driver This series also includes ACPI support for SBI MPXY mailbox controller and RPMI system MSI drivers. These patches can be found in the riscv_sbi_mpxy_mailbox_v10 branch at: https://github.com/avpatel/linux.git To test these patches, boot Linux on "virt,rpmi=on,aia=aplic-imsic" machine with OpenSBI and QEMU from the dev-upstream branch at: https://github.com/ventanamicro/opensbi.git https://github.com/ventanamicro/qemu.git [1] https://github.com/riscv-non-isa/riscv-sbi-doc/releases [2] https://github.com/riscv-non-isa/riscv-rpmi/releases Changes since v9: - Rebased on Linux-6.17-rc2 - Dropped make_u32_from_two_u16() and make_u64_from_two_u32() macros and their use from PATCH3, PATCH4, and PATCH10 as-per comments from Linus Torvalds (Refer, https://lkml.org/lkml/2025/8/9/76). Changes since v8: - Added Jassi's Acked-by in mailbox related patches - Renamed "clock-controller" DT node to "clock-service" DT node in PATCH8 as suggested by Stephen Boyd Changes since v7: - Addressed enum related nits in PATCH3 (Refer, https://lore.kernel.org/all/CAK9=C2VxhC6soxHtmacedbeCU=rFi84Br1RvN2uPcBKoLhRaJw@mail.gmail.com/) - Addressed comments in PATCH7 as follows: - Added minmax.h to includes - Removed "rc" variable from mpxy_mbox_send_rpmi_data() - Removed alignment and other checks from mpxy_mbox_peek_rpmi_data() - Created separate function to restrict scope of channel_ids used in mpxy_mbox_probe() (Refer, https://lore.kernel.org/all/CAK9=C2Ume2CmBYHYob7HSJHu=ZdfdWM+4JYPgFJ9Hir5Oi8cOg@mail.gmail.com/) - Improved comments for struct rpmi_clk_rates in PATCH10 (Refer, https://lore.kernel.org/all/CAK9=C2VfvsbFTjecQm0OSsssXbff7wC4fqWf3CTmnpWSiaLcBw@mail.gmail.com/) - Improved refactoring of acpi_fwnode_get_reference_args() in PATCH14 (Refer, https://lore.kernel.org/all/20250702051345.1460497-15-apatel@ventanamicro.com/) - Improve nargs_count parsing in acpi_fwnode_get_reference_args() for PATCH15 (Refer, https://lore.kernel.org/all/20250702051345.1460497-16-apatel@ventanamicro.com/) - Added more comments describing why need to explicitly set device MSI domain in PATCH21 (Refer, https://lore.kernel.org/all/aGaUmpw1pVWNAmpb@smile.fi.intel.com/) Changes since v6: - Rebased the series on Linux-6.16-rc4 - Added Stephen's Reviewed-by in appropriate patches - Addressed Andy's comments on PATCH5, PATCH6, PATCH9, and PATCH14 - New PATCH6 in this series which is factored-out from PATCH7 Changes since v5: - Rebased the series on Linux-6.16-rc2 - Added Conor's Reviewed-by in all DT binding patches - Addressed Andy's comments on PATCH5 - Addressed Tglx's comments on PATCH12 and PATCH21 Changes since v4: - Rebased the series on Linux-6.16-rc1 - Dropped PATCH1 since a similar change is already merged https://lore.kernel.org/linux-riscv/20250523101932.1594077-4-cleger@rivosinc.com/ - Addressed Andy's comments on PATCH4, PATCH5, PATCH6, PATCH7, PATCH13, and PATCH17 - Addressed Atish's comments on PATCH11 and PATCH12 - Addressed Conor's comments on PATCH9 Changes since v3: - Rebased the series on Linux-6.15-rc7 - Updated PATCH2 DT bindings as-per Rob's suggestion - Improved request_threaded_irq() usage in PATCH7 - Updated PATCH10 clk-rpmi driver as-per commments from Andy - Updated PATCH13 irq-riscv-rpmi-sysmsi driver as-per comments from Andy and Tglx - Addressed ACPI related comments in PATCH14, PATCH15, PATCH18, PATCH20 and PATCH21 Changes since v2: - Dropped the "RFC" tag from series since the SBI v3.0 and RPMI v1.0 specifications are now frozen - Rebased the series on Linux-6.15-rc5 - Split PATCH8 of v2 into two patches adding separate DT bindings for "riscv,rpmi-mpxy-clock" and "riscv,rpmi-clock" - Split PATCH10 of v2 into two patches adding separate DT bindings for "riscv,rpmi-mpxy-system-msi" and "riscv,rpmi-system-msi" - Addressed comments from TGLX on PATCH11 of v2 adding irqchip driver for RPMI system MSI - Addressed ACPI related comments in PATCH15 and PATCH16 of v2 - New PATCH17 and PATCH18 in this series Changes since v1: - Addressed DT bindings related comments in PATCH2, PATCH3, and PATCH7 of v1 series - Addressed comments in PATCH6 and PATCH8 of v1 series - New PATCH6 in v2 series to allow fwnode based mailbox channel request - New PATCH10 and PATCH11 to add RPMI system MSI based interrupt controller driver - New PATCH12 to PATCH16 which adds ACPI support in SBI MPXY mailbox driver and RPMI system MSI driver - New PATCH17 to enable required kconfig option to allow graceful shutdown on QEMU virt machine Anup Patel (14): dt-bindings: mailbox: Add bindings for RPMI shared memory transport dt-bindings: mailbox: Add bindings for RISC-V SBI MPXY extension RISC-V: Add defines for the SBI message proxy extension mailbox: Add common header for RPMI messages sent via mailbox mailbox: Allow controller specific mapping using fwnode byteorder: Add memcpy_to_le32() and memcpy_from_le32() mailbox: Add RISC-V SBI message proxy (MPXY) based mailbox driver dt-bindings: clock: Add RPMI clock service message proxy bindings dt-bindings: clock: Add RPMI clock service controller bindings dt-bindings: Add RPMI system MSI message proxy bindings dt-bindings: Add RPMI system MSI interrupt controller bindings irqchip: Add driver for the RPMI system MSI service group RISC-V: Enable GPIO keyboard and event device in RV64 defconfig MAINTAINERS: Add entry for RISC-V RPMI and MPXY drivers Rahul Pathak (1): clk: Add clock driver for the RISC-V RPMI clock service group Sunil V L (9): ACPI: property: Refactor acpi_fwnode_get_reference_args() to support nargs_prop ACPI: Add support for nargs_prop in acpi_fwnode_get_reference_args() ACPI: scan: Update honor list for RPMI System MSI ACPI: RISC-V: Create interrupt controller list in sorted order ACPI: RISC-V: Add support to update gsi range ACPI: RISC-V: Add RPMI System MSI to GSI mapping irqchip/irq-riscv-imsic-early: Export imsic_acpi_get_fwnode() mailbox/riscv-sbi-mpxy: Add ACPI support irqchip/riscv-rpmi-sysmsi: Add ACPI support .../bindings/clock/riscv,rpmi-clock.yaml | 64 ++ .../bindings/clock/riscv,rpmi-mpxy-clock.yaml | 64 ++ .../riscv,rpmi-mpxy-system-msi.yaml | 67 ++ .../riscv,rpmi-system-msi.yaml | 74 ++ .../mailbox/riscv,rpmi-shmem-mbox.yaml | 124 ++ .../bindings/mailbox/riscv,sbi-mpxy-mbox.yaml | 51 + MAINTAINERS | 15 + arch/riscv/configs/defconfig | 2 + arch/riscv/include/asm/irq.h | 6 + arch/riscv/include/asm/sbi.h | 62 + drivers/acpi/property.c | 128 ++- drivers/acpi/riscv/irq.c | 75 +- drivers/acpi/scan.c | 2 + drivers/base/property.c | 2 +- drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + drivers/clk/clk-rpmi.c | 616 ++++++++++ drivers/irqchip/Kconfig | 7 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-riscv-imsic-early.c | 2 + drivers/irqchip/irq-riscv-rpmi-sysmsi.c | 328 ++++++ drivers/mailbox/Kconfig | 11 + drivers/mailbox/Makefile | 2 + drivers/mailbox/mailbox.c | 65 +- drivers/mailbox/riscv-sbi-mpxy-mbox.c | 1019 +++++++++++++++++ include/linux/byteorder/generic.h | 16 + include/linux/mailbox/riscv-rpmi-message.h | 243 ++++ include/linux/mailbox_controller.h | 3 + 28 files changed, 2975 insertions(+), 83 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/riscv,rpmi-clock.yaml create mode 100644 Documentation/devicetree/bindings/clock/riscv,rpmi-mpxy-clock.yaml create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,rpmi-mpxy-system-msi.yaml create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,rpmi-system-msi.yaml create mode 100644 Documentation/devicetree/bindings/mailbox/riscv,rpmi-shmem-mbox.yaml create mode 100644 Documentation/devicetree/bindings/mailbox/riscv,sbi-mpxy-mbox.yaml create mode 100644 drivers/clk/clk-rpmi.c create mode 100644 drivers/irqchip/irq-riscv-rpmi-sysmsi.c create mode 100644 drivers/mailbox/riscv-sbi-mpxy-mbox.c create mode 100644 include/linux/mailbox/riscv-rpmi-message.h -- 2.43.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv