Add NVIDIA VRS PSEQ support
Subsystems (4)
v3 cover Add NVIDIA VRS PSEQ support
This patch series adds support for NVIDIA's Voltage Regulator Specification (VRS) Power Sequencer (PSEQ) controller. This controller includes a PSEQ hardware block, that manages power sequencing and voltage regulation for various components in the system. This controller also provides 32kHz RTC support with backup battery for system timing.
The series includes:
- Device tree bindings for the VRS PSEQ controller
- MFD driver to handle the core functionality
- RTC driver for the PSEQ's real-time clock functionality
- Device tree nodes for Tegra234 platforms
- Configuration updates to enable the driver
- driver entry in MAINTAINERS
Changes in v3:
- fixed device tree node name to generic "pmic@3c"
- fixed indentation in dt-bindings
- added rate limiting to interrupt clearing debug logs
- removed unnecessary braces in if blocks
- changed dependency from I2C=y to I2C in mfd Kconfig
- fixed return value in RTC driver function calls
- fixed sizeof(*variable) inside rtc driver devm_kzalloc
- switch to devm_device_init_wakeup() for automatic cleanup
Changes in v2:
- fixed, copyrights, definitions and dtb node in dt-bindings
- removed unnecessary logs from MFD and RTC driver
- fixed RTC allocation and registration APIs
- removed unnecessary functions in RTC driver
- used rtc_lock/unlock in RTC irq handler
- added alias to assign VRS RTC as RTC0
- added driver entry in MAINTAINERS
- few other miinor changes done in driver
Shubhi Garg (6):
dt-bindings: mfd: add NVIDIA VRS PSEQ
arm64: tegra: Add device-tree node for NVVRS PSEQ
mfd: nvvrs: add NVVRS PSEQ MFD driver
rtc: nvvrs: add NVIDIA VRS PSEQ RTC device driver
arm64: defconfig: enable NVIDIA VRS PSEQ
MAINTAINERS: Add NVIDIA VRS PSEQ driver entry
.../bindings/mfd/nvidia,vrs-pseq.yaml | 60 +++ MAINTAINERS | 9 + .../arm64/boot/dts/nvidia/tegra234-p3701.dtsi | 11 + .../arm64/boot/dts/nvidia/tegra234-p3767.dtsi | 15 + arch/arm64/configs/defconfig | 2 + drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/nvidia-vrs-pseq.c | 267 ++++++++++ drivers/rtc/Kconfig | 10 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-nvidia-vrs-pseq.c | 457 ++++++++++++++++++ include/linux/mfd/nvidia-vrs-pseq.h | 127 +++++ 12 files changed, 972 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/nvidia,vrs-pseq.yaml create mode 100644 drivers/mfd/nvidia-vrs-pseq.c create mode 100644 drivers/rtc/rtc-nvidia-vrs-pseq.c create mode 100644 include/linux/mfd/nvidia-vrs-pseq.h
Signature · 1 line
2.43.0
PATCH v3 1/6 dt-bindings: mfd: add NVIDIA VRS PSEQ
Add support for NVIDIA VRS (Voltage Regulator Specification) power sequencer device. NVIDIA VRS PSEQ provides 32kHz RTC support with backup battery for system timing. It controls ON/OFF and suspend/resume power sequencing of system power rails on below NVIDIA platforms:
- NVIDIA Jetson AGX Orin Developer Kit
- NVIDIA IGX Orin Development Kit
- NVIDIA Jetson Orin NX Developer Kit
- NVIDIA Jetson Orin Nano Developer Kit
---
v3:
- fixed device tree node name to generic "pmic@3c"
- fixed indentation
v2:
- fixed copyrights
- updated description with RTC information
- added status node in dtb node example
.../bindings/mfd/nvidia,vrs-pseq.yaml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/nvidia,vrs-pseq.yaml
Documentation/devicetree/bindings/mfd/nvidia,vrs-pseq.yaml new file +60 -0
@@ -0,0 +1,60 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/nvidia,vrs-pseq.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Voltage Regulator Specification Power Sequencer + +maintainers: + - Shubhi Garg <[email protected]> + +description: + NVIDIA Voltage Regulator Specification Power Sequencer device controls + ON/OFF and suspend/resume power sequencing of system power rails for NVIDIA + SoCs. It provides 32kHz RTC clock support with backup battery for system + timing. The device also acts as an interrupt controller for managing + interrupts from the VRS power sequencer. + +properties: + compatible: + const: nvidia,vrs-pseq + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + description: + The first cell is the IRQ number, the second cell is the trigger type. + +required: + - compatible + - reg + - interrupts + - interrupt-controller + - '#interrupt-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@3c { + compatible = "nvidia,vrs-pseq"; + reg = <0x3c>; + interrupt-parent = <&pmc>; + interrupts = <24 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <2>; + }; + };
Signature · 1 line
2.43.0
PATCH v3 2/6 arm64: tegra: Add device-tree node for NVVRS PSEQ
In reply to Shubhi GargAdd NVIDIA VRS Power Sequencer device tree node for Tegra234 P3701 and P3767 platforms. Assign VRS RTC as primary RTC (rtc0).
---
v3:
- fixed device tree node name to generic "pmic@3c"
v2:
- added alias to assign VRS RTC to rtc0
- removed status node from VRS DTB node
arch/arm64/boot/dts/nvidia/tegra234-p3701.dtsi | 11 +++++++++++ arch/arm64/boot/dts/nvidia/tegra234-p3767.dtsi | 15 +++++++++++++++ 2 files changed, 26 insertions(+)
arch/arm64/boot/dts/nvidia/tegra234-p3701.dtsi +11 -0
@@ -8,6 +8,7 @@ / { aliases { mmc0 = "/bus@0/mmc@3460000"; mmc1 = "/bus@0/mmc@3400000"; + rtc0 = "/bpmp/i2c/vrs@3c"; }; bus@0 {
@@ -170,6 +171,16 @@ bpmp { i2c { status = "okay"; + pmic@3c { + compatible = "nvidia,vrs-pseq"; + reg = <0x3c>; + interrupt-parent = <&pmc>; + /* VRS Wake ID is 24 */ + interrupts = <24 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <2>; + }; + thermal-sensor@4c { compatible = "ti,tmp451"; status = "okay";
arch/arm64/boot/dts/nvidia/tegra234-p3767.dtsi +15 -0
@@ -7,6 +7,7 @@ / { aliases { mmc0 = "/bus@0/mmc@3400000"; + rtc0 = "/bpmp/i2c/vrs@3c"; }; bus@0 {
@@ -121,6 +122,20 @@ pmc@c360000 { }; }; + bpmp { + i2c { + pmic@3c { + compatible = "nvidia,vrs-pseq"; + reg = <0x3c>; + interrupt-parent = <&pmc>; + /* VRS Wake ID is 24 */ + interrupts = <24 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; + }; + vdd_5v0_sys: regulator-vdd-5v0-sys { compatible = "regulator-fixed"; regulator-name = "VDD_5V0_SYS";
Signature · 1 line
2.43.0
Jon Hunter
maintainerRe: [PATCH v3 2/6] arm64: tegra: Add device-tree node for NVVRS PSEQ
Quoted 22 lines · Shubhi Garg
Add NVIDIA VRS Power Sequencer device tree node for Tegra234 P3701 and P3767 platforms. Assign VRS RTC as primary RTC (rtc0).
Signed-off-by Shubhi Garg <[email protected]>---
v3:
- fixed device tree node name to generic "pmic@3c"v2:
- added alias to assign VRS RTC to rtc0
- removed status node from VRS DTB nodearch/arm64/boot/dts/nvidia/tegra234-p3701.dtsi | 11 +++++++++++ arch/arm64/boot/dts/nvidia/tegra234-p3767.dtsi | 15 +++++++++++++++ 2 files changed, 26 insertions(+)arch/arm64/boot/dts/nvidia/tegra234-p3701.dtsi +0
-0
arch/arm64/boot/dts/nvidia/tegra234-p3701.dtsi / { · line 11
Quoted 4 lines
arch/arm64/boot/dts/nvidia/tegra234-p3701.dtsi +1
-0@@ -8,6 +8,7 @@ / { aliases { mmc0 = "/bus@0/mmc@3460000"; mmc1 = "/bus@0/mmc@3400000"; + rtc0 = "/bpmp/i2c/vrs@3c";
The above should be ...
rtc0 = "/bpmp/i2c/pmic@3c";
Quoted 25 lines
arch/arm64/boot/dts/nvidia/tegra234-p3701.dtsi +10
-0}; bus@0 {@@ -170,6 +171,16 @@ bpmp { i2c { status = "okay"; + pmic@3c { + compatible = "nvidia,vrs-pseq"; + reg = <0x3c>; + interrupt-parent = <&pmc>; + /* VRS Wake ID is 24 */ + interrupts = <24 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <2>; + }; + thermal-sensor@4c { compatible = "ti,tmp451"; status = "okay";arch/arm64/boot/dts/nvidia/tegra234-p3767.dtsi +0
-0
arch/arm64/boot/dts/nvidia/tegra234-p3767.dtsi / { · line 10
Quoted 4 lines
arch/arm64/boot/dts/nvidia/tegra234-p3767.dtsi +1
-0@@ -7,6 +7,7 @@ / { aliases { mmc0 = "/bus@0/mmc@3400000"; + rtc0 = "/bpmp/i2c/vrs@3c";
Same here.
Thanks!
Jon
Signature · 1 line
nvpublic
PATCH v3 3/6 mfd: nvvrs: add NVVRS PSEQ MFD driver
In reply to Shubhi GargAdd support for NVIDIA VRS (Voltage Regulator Specification) power sequencer device driver. NVIDIA VRS PSEQ provides 32kHz RTC support with backup battery for system timing. It controls ON/OFF and suspend/resume power sequencing of system power rails on below NVIDIA platforms:
- NVIDIA Jetson AGX Orin Developer Kit
- NVIDIA IGX Orin Development Kit
- NVIDIA Jetson Orin NX Developer Kit
- NVIDIA Jetson Orin Nano Developer Kit
---
v3:
- added rate limiting to interrupt clearing debug logs
- removed unnecessary braces in if blocks
- changed dependency from I2C=y to I2C in mfd Kconfig
v2:
- removed unnecessary error logs
- changed dev_info to dev_dbg
- changed dev_err to dev_err_probe
- fixed "of_match_table" assignment
drivers/mfd/Kconfig | 12 ++ drivers/mfd/Makefile | 1 + drivers/mfd/nvidia-vrs-pseq.c | 267 ++++++++++++++++++++++++++++ include/linux/mfd/nvidia-vrs-pseq.h | 127 +++++++++++++ 4 files changed, 407 insertions(+) create mode 100644 drivers/mfd/nvidia-vrs-pseq.c create mode 100644 include/linux/mfd/nvidia-vrs-pseq.h
drivers/mfd/Kconfig +12 -0
@@ -1437,6 +1437,18 @@ config MFD_SC27XX_PMIC This driver provides common support for accessing the SC27xx PMICs, and it also adds the irq_chip parts for handling the PMIC chip events. +config MFD_NVVRS_PSEQ + tristate "NVIDIA Voltage Regulator Specification Power Sequencer" + depends on I2C + select MFD_CORE + select REGMAP_I2C + select REGMAP_IRQ + help + Say Y here to add support for NVIDIA Voltage Regulator Specification + Power Sequencer. NVVRS_PSEQ supports ON/OFF, suspend/resume sequence of + system power rails. It provides 32kHz RTC clock support with backup + battery for system timing. + config RZ_MTU3 tristate "Renesas RZ/G2L MTU3a core driver" depends on (ARCH_RZG2L && OF) || COMPILE_TEST
drivers/mfd/Makefile +1 -0
@@ -183,6 +183,7 @@ obj-$(CONFIG_MFD_MT6360) += mt6360-core.o obj-$(CONFIG_MFD_MT6370) += mt6370.o mt6397-objs := mt6397-core.o mt6397-irq.o mt6358-irq.o obj-$(CONFIG_MFD_MT6397) += mt6397.o +obj-$(CONFIG_MFD_NVVRS_PSEQ) += nvidia-vrs-pseq.o obj-$(CONFIG_RZ_MTU3) += rz-mtu3.o obj-$(CONFIG_ABX500_CORE) += abx500-core.o
drivers/mfd/nvidia-vrs-pseq.c new file +267 -0
267 lines not on this page · raw message
include/linux/mfd/nvidia-vrs-pseq.h new file +127 -0
127 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v3 4/6 rtc: nvvrs: add NVIDIA VRS PSEQ RTC device driver
In reply to Shubhi GargAdd support for NVIDIA VRS (Voltage Regulator Specification) Power Sequencer RTC device driver. This RTC can be used to get/set system time, retain system time across boot, wake system from suspend and shutdown state.
---
v3:
- fixed return value in RTC read_time and read_alarm functions
- fixed sizeof(*variable) inside rtc driver devm_kzalloc
- switch to devm_device_init_wakeup() for automatic cleanup
v2:
- removed regmap struct since it is not required
- removed rtc_map definition to directly use register definition
- removed unnecessary dev_err logs
- fixed dev_err logs to dev_dbg
- used rtc_lock/unlock in irq handler
- changed RTC allocation and register APIs as per latest kernel
- removed nvvrs_rtc_remove function since it's not required
drivers/rtc/Kconfig | 10 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-nvidia-vrs-pseq.c | 457 ++++++++++++++++++++++++++++++ 3 files changed, 468 insertions(+) create mode 100644 drivers/rtc/rtc-nvidia-vrs-pseq.c
drivers/rtc/Kconfig +10 -0
@@ -406,6 +406,16 @@ config RTC_DRV_MAX77686 This driver can also be built as a module. If so, the module will be called rtc-max77686. +config RTC_DRV_NVVRS_PSEQ + tristate "NVIDIA VRS Power Sequencer RTC device" + depends on MFD_NVVRS_PSEQ + help + If you say yes here you will get support for the battery backed RTC device + of NVIDIA VRS Power Sequencer. The RTC is connected via I2C interface and + supports alarm functionality. + This driver can also be built as a module. If so, the module will be called + rtc-nvidia-vrs-pseq. + config RTC_DRV_NCT3018Y tristate "Nuvoton NCT3018Y" depends on OF
drivers/rtc/Makefile +1 -0
@@ -120,6 +120,7 @@ obj-$(CONFIG_RTC_DRV_MXC_V2) += rtc-mxc_v2.o obj-$(CONFIG_RTC_DRV_GAMECUBE) += rtc-gamecube.o obj-$(CONFIG_RTC_DRV_NCT3018Y) += rtc-nct3018y.o obj-$(CONFIG_RTC_DRV_NTXEC) += rtc-ntxec.o +obj-$(CONFIG_RTC_DRV_NVVRS_PSEQ)+= rtc-nvidia-vrs-pseq.o obj-$(CONFIG_RTC_DRV_OMAP) += rtc-omap.o obj-$(CONFIG_RTC_DRV_OPAL) += rtc-opal.o obj-$(CONFIG_RTC_DRV_OPTEE) += rtc-optee.o
drivers/rtc/rtc-nvidia-vrs-pseq.c new file +457 -0
457 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v3 5/6 arm64: defconfig: enable NVIDIA VRS PSEQ
In reply to Shubhi GargEnable NVIDIA VRS (Voltage Regulator Specification) power sequencer device modules. NVIDIA VRS PSEQ provides 32kHz RTC support with backup battery for system timing. It controls ON/OFF and suspend/resume power sequencing of system power rails on below NVIDIA platforms:
- NVIDIA Jetson AGX Orin Developer Kit
- NVIDIA IGX Orin Development Kit
- NVIDIA Jetson Orin NX Developer Kit
- NVIDIA Jetson Orin Nano Developer Kit
---
v3:
- no changes
v2:
- moved VRS RTC config to correct place
arch/arm64/configs/defconfig | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/configs/defconfig +2 -0
@@ -787,6 +787,7 @@ CONFIG_MFD_ROHM_BD718XX=y CONFIG_MFD_STM32_LPTIMER=m CONFIG_MFD_WCD934X=m CONFIG_MFD_KHADAS_MCU=m +CONFIG_MFD_NVVRS_PSEQ=m CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_AXP20X=y CONFIG_REGULATOR_BD718XX=y
@@ -1267,6 +1268,7 @@ CONFIG_RTC_DRV_MT6397=m CONFIG_RTC_DRV_XGENE=y CONFIG_RTC_DRV_TI_K3=m CONFIG_RTC_DRV_RENESAS_RTCA3=m +CONFIG_RTC_DRV_NVVRS_PSEQ=m CONFIG_DMADEVICES=y CONFIG_DMA_BCM2835=y CONFIG_DMA_SUN6I=m
Signature · 1 line
2.43.0
PATCH v3 6/6 MAINTAINERS: Add NVIDIA VRS PSEQ driver entry
In reply to Shubhi GargAdd NVIDIA VRS (Voltage Regulator Specification) power sequencer driver entry in MAINTAINERS.
---
v3:
- fixed indentation
v2:
- this is a new patch in V2
MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
@@ -17789,6 +17789,15 @@ S: Maintained F: drivers/video/fbdev/nvidia/ F: drivers/video/fbdev/riva/ +NVIDIA VRS POWER SEQUENCER +M: Shubhi Garg <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/mfd/nvidia,vrs-pseq.yaml +F: drivers/mfd/nvidia-vrs-pseq.c +F: drivers/rtc/rtc-nvidia-vrs-pseq.c +F: include/linux/mfd/nvidia-vrs-pseq.h + NVIDIA WMI EC BACKLIGHT DRIVER M: Daniel Dadap <[email protected]> L: [email protected]
Signature · 1 line
2.43.0