Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/riscv,rpmi-device-power.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: RISC-V RPMI device power service group based power domain controller

maintainers:
- Joshua Yeong <joshua.yeong@starfivetech.com>

description: |
The RISC-V Platform Management Interface (RPMI) [1] defines a
messaging protocol which is modular and extensible. The supervisor
software can send/receive RPMI messages via SBI MPXY extension [2]
or some dedicated supervisor-mode RPMI transport.

The RPMI specification [1] defines device power service group for
accessing and controlling the power state of platform devices managed
by a platform microcontroller. The supervisor software can access RPMI
device power service group via SBI MPXY channel or some dedicated
supervisor-mode RPMI transport.

===========================================
References
===========================================

[1] RISC-V Platform Management Interface (RPMI) v1.0 (or higher)
https://github.com/riscv-non-isa/riscv-rpmi/releases

[2] RISC-V Supervisor Binary Interface (SBI) v3.0 (or higher)
https://github.com/riscv-non-isa/riscv-sbi-doc/releases

properties:
compatible:
description:
Intended for use by the supervisor software.
const: riscv,rpmi-device-power

mboxes:
maxItems: 1
description:
Mailbox channel of the underlying RPMI transport or SBI message proxy channel.

"#power-domain-cells":
const: 1
description:
Platform specific DOMAIN_ID as defined by the RISC-V Platform Management
Interface (RPMI) specification.

required:
- compatible
- mboxes
- "#power-domain-cells"

additionalProperties: false

examples:
- |
power-controller {
compatible = "riscv,rpmi-device-power";
mboxes = <&mpxy_mbox 0x1002 0x0>;
#power-domain-cells = <1>;
};
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/riscv,rpmi-mpxy-device-power.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: RISC-V RPMI device power service group based message proxy

maintainers:
- Joshua Yeong <joshua.yeong@starfivetech.com>

description: |
The RISC-V Platform Management Interface (RPMI) [1] defines a
messaging protocol which is modular and extensible. The supervisor
software can send/receive RPMI messages via SBI MPXY extension [2]
or some dedicated supervisor-mode RPMI transport.

The RPMI specification [1] defines device power service group for
accessing and controlling the power state of platform devices managed
by a platform microcontroller. The SBI implementation (machine mode
firmware or hypervisor) can implement an SBI MPXY channel to allow RPMI
device power service group access to the supervisor software.

===========================================
References
===========================================

[1] RISC-V Platform Management Interface (RPMI) v1.0 (or higher)
https://github.com/riscv-non-isa/riscv-rpmi/releases

[2] RISC-V Supervisor Binary Interface (SBI) v3.0 (or higher)
https://github.com/riscv-non-isa/riscv-sbi-doc/releases

properties:
compatible:
description:
Intended for use by the SBI implementation.
const: riscv,rpmi-mpxy-device-power

mboxes:
maxItems: 1
description:
Mailbox channel of the underlying RPMI transport.

riscv,sbi-mpxy-channel-id:
$ref: /schemas/types.yaml#/definitions/uint32
description:
The SBI MPXY channel id to be used for providing RPMI access to
the supervisor software.

required:
- compatible
- mboxes
- riscv,sbi-mpxy-channel-id

additionalProperties: false

examples:
- |
device-power-service {
compatible = "riscv,rpmi-mpxy-device-power";
mboxes = <&rpmi_shmem_mbox 0x9>;
riscv,sbi-mpxy-channel-id = <0x1002>;
};
...
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -23587,6 +23587,14 @@ F: drivers/irqchip/irq-riscv-rpmi-sysmsi.c
F: drivers/mailbox/riscv-sbi-mpxy-mbox.c
F: include/linux/mailbox/riscv-rpmi-message.h

RISC-V RPMI DEVICE POWER DRIVER
M: Joshua Yeong <joshua.yeong@starfivetech.com>
L: linux-riscv@lists.infradead.org
S: Maintained
F: Documentation/devicetree/bindings/power/riscv,rpmi-device-power.yaml
F: Documentation/devicetree/bindings/power/riscv,rpmi-mpxy-device-power.yaml
F: drivers/pmdomain/riscv/

RISC-V SPACEMIT SoC Support
M: Yixun Lan <dlan@kernel.org>
L: linux-riscv@lists.infradead.org
Expand Down
1 change: 1 addition & 0 deletions drivers/pmdomain/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ source "drivers/pmdomain/marvell/Kconfig"
source "drivers/pmdomain/mediatek/Kconfig"
source "drivers/pmdomain/qcom/Kconfig"
source "drivers/pmdomain/renesas/Kconfig"
source "drivers/pmdomain/riscv/Kconfig"
source "drivers/pmdomain/rockchip/Kconfig"
source "drivers/pmdomain/samsung/Kconfig"
source "drivers/pmdomain/st/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/pmdomain/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ obj-y += marvell/
obj-y += mediatek/
obj-y += qcom/
obj-y += renesas/
obj-y += riscv/
obj-y += rockchip/
obj-y += samsung/
obj-y += st/
Expand Down
15 changes: 15 additions & 0 deletions drivers/pmdomain/riscv/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: GPL-2.0-only

config RISCV_RPMI_DEVICE_POWER
bool "RISC-V RPMI Based Device Power driver"
depends on RISCV || COMPILE_TEST
depends on MAILBOX
depends on PM
default RISCV
select PM_GENERIC_DOMAINS
help
Support for device power domains based on the device power service
group defined by the RISC-V platform management interface (RPMI)
specification. The power domains advertised by the platform
microcontroller are registered as generic power domains, so that
devices can reference them through the "power-domains" property.
3 changes: 3 additions & 0 deletions drivers/pmdomain/riscv/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only

obj-$(CONFIG_RISCV_RPMI_DEVICE_POWER) += riscv-rpmi-device-power.o
Loading
Loading