From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 28E99271454 for ; Fri, 4 Jul 2025 07:04:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751612661; cv=none; b=lWjz7GBu2tJp+dal8U2YGyStoqlzqFJe2/A5meOfKNg8+x04iCbdH1YXtOLwflRe/qm4IJgIx2yCMVkszKpeNFsBbLnJmEtqgRBdfleQNyWYD79PUPxvrU8xCiF6X+dly0PR9bw1v7ZcODtoMOCxxuvRd6qNloHDrrE/DvEdxKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751612661; c=relaxed/simple; bh=q2EmQLeYA4OKxgp19CQ265DwJ8OtmojXAvRLvrYct94=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HpYy9IXBygFrRVXIcDJeoB5F/4TE7j3eQSPJOe5ZXwbI5NQq9zbqodgRjPzSTafbvW7vp7koOCGz98J30Vt+RMIJhArhMkkY8xh0dS48bGBiTyU2WjX0vmS/5q2uQ688BSNZnMKBPmKt5h5isZDb7rJ7U+W4gpLvdmwc3SrJvds= 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=aL4BoyPa; arc=none smtp.client-ip=209.85.214.172 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="aL4BoyPa" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-23c8a5053c2so545345ad.1 for ; Fri, 04 Jul 2025 00:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1751612657; x=1752217457; 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=rNV4yYQMrOJDAS1UrXmWT/jHR79hA6tazWjsnWTTuMk=; b=aL4BoyPa4hlbauunorYanQx1fNfpwIxFf5M6t5sQn1ldlfxjBnXakNsUJi+suKn+OU SC4+fpH8GUS0GKcqhIJ0dznmaXipHwM8BiXH4qomDiB03jqbZZrs/ffzk/SaGWz6bPCe UPFYvLH7iNbCc1CzOoidmG9uF8VAFOltTB5wCWm/0UvqaHPW/pKqCpO0N/8x+cRa6ag0 kbLVC8iZtjBQwIdkXBdwRdXzDugrP+LBIktJzWU7YKqZifZlpHYzAc5hq1wNV/hlAVSq 42HO8/FybZyTzFXEh1lkquuW2xgsFBbyhLDKod7u9lSKrsrTKPsJ6GFskkx1R8URVhT/ jVfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751612657; x=1752217457; 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=rNV4yYQMrOJDAS1UrXmWT/jHR79hA6tazWjsnWTTuMk=; b=FPgqpCc0sShsOn1FcXzkK9quPCVVOSm2d49M+5AhK4ZUmnh5ybB9Lg2OeuaYybgDJ6 /aqqD/S6dTP/D7RTdCiZ8LnWN5HmTvNOYUbUX8c9Tal1kxRsLXJ1Rdu9yBcIBYQjr2Ad RmosVFBzUPEzm4FTik9qvyK6eWwFVnRxE7sQQFzMQGRu6LIKsV9yX/vJDb3hsc5yt2D7 dXDw2FtObGJT2u9GFv4Qrs7N3l/qg2rkbhBgp1Rih8f+Q+nf2ulTqKv6s5/NpUbMkil9 JTTsA79dJO0+Evit+0Sa/eIHfkTGEsnXk5ZcywNuT2ZhlzC/0EcZ0mT9dK6B7RQJJ9Xr 2tfg== X-Forwarded-Encrypted: i=1; AJvYcCV3zqV4obIkqDewvwiHJeJHleo51PLNyNrHILO3nEHXTZ0kYWvM5d7sxPu++Bwj7NuVpTTHNJnYAETl@vger.kernel.org X-Gm-Message-State: AOJu0Yxj6aBZxcP1VXa4bwoAh1LnYaRK3hEvUQklIV2FDlo4ljGI0icd 5W2XX+4nHBYCkXz456JfTOHTj97khsUFJQEoyeykho5ULT9/FZ0JM/JdLbCQ2ihC2UE= X-Gm-Gg: ASbGncvdnOd+lDWtF4bZnG11aGiHobleGtXc6LGsb7xoWsMW2bN3MfYCqoXMV0cqCYL djWAZ25OEdxcH0v9K7aQ8ran8obAaptb0R2YuCj94UMHo/EmIkYanfvrEVKN3G7kynQnUdqJ6GM i0lSQ1z2czcqLqOvYCMLP1fOuHcHoUqxYl0CpoqzWHcGOiF3fAwovkRkXPlSKPhumnMTb6j/JZM cCsl3Wgh6RhXpFW50rjimHbzBB04jagXDg7I/wxPfXxueSXwihXI35cNE+P/kiLP2+lZrb3FzpK xQ73yfVoy7OHMs4RTR0AY0fe1GajiQ5iLuig/Qrf6nw18Kg8Ah75ZsWkS4f+dlHKJwZEIT/6E78 43ny+APJ6WQabG0NU16bReHcNlg== X-Google-Smtp-Source: AGHT+IE6Selq5x5dbP8GjsTtUsdcC1T2xdo7xnrlnnZL2hnwCQn7lKmnlLU2hnm1nIy+2TTjIKdA+Q== X-Received: by 2002:a17:903:32c1:b0:235:e8da:8d6 with SMTP id d9443c01a7336-23c8609bfe2mr29264605ad.2.1751612657098; Fri, 04 Jul 2025 00:04:17 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.166.196]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-31aaae59a93sm1358697a91.12.2025.07.04.00.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jul 2025 00:04:16 -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?= Cc: Palmer Dabbelt , Paul Walmsley , Alexandre Ghiti , Len Brown , Sunil V L , Rahul Pathak , Leyfoon Tan , Atish Patra , Andrew Jones , Samuel Holland , Anup Patel , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH v8 00/24] Linux SBI MPXY and RPMI drivers Date: Fri, 4 Jul 2025 12:33:32 +0530 Message-ID: <20250704070356.1683992-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The SBI v3.0 (MPXY extension) [1] and RPMI v1.0 [2] specifications are frozen and finished public review at 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_v8 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 v7: - Addressed comments on PATCH3, PATCH7, PATCH10, PATCH14, and PATCH21 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 | 63 + 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 | 1017 +++++++++++++++++ include/linux/byteorder/generic.h | 16 + include/linux/mailbox/riscv-rpmi-message.h | 243 ++++ include/linux/mailbox_controller.h | 3 + include/linux/wordpart.h | 16 + 29 files changed, 2990 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