diff mbox series

[1/3] arm64: tegra: Add current monitors for Jetson Xavier

Message ID 20240216122805.32529-2-jonathanh@nvidia.com
State Superseded
Headers show
Series arm64: tegra: Tegra194 device-tree updates | expand

Commit Message

Jon Hunter Feb. 16, 2024, 12:28 p.m. UTC
Add the INA3221 current monitors that are present on the Jetson AGX
Xavier and Jetson Xavier NX boards.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 .../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 50 +++++++++++++++++++
 .../arm64/boot/dts/nvidia/tegra194-p3668.dtsi | 27 ++++++++++
 2 files changed, 77 insertions(+)

Comments

Krzysztof Kozlowski Feb. 16, 2024, 1:19 p.m. UTC | #1
On 16/02/2024 13:28, Jon Hunter wrote:
> Add the INA3221 current monitors that are present on the Jetson AGX
> Xavier and Jetson Xavier NX boards.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  .../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 50 +++++++++++++++++++
>  .../arm64/boot/dts/nvidia/tegra194-p3668.dtsi | 27 ++++++++++
>  2 files changed, 77 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
> index 5b59c1986e9b..7c57272af044 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
> +++ b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
> @@ -53,6 +53,56 @@ memory-controller@2c00000 {
>  			status = "okay";
>  		};
>  
> +		i2c@c240000 {
> +			status = "okay";
> +
> +			ina3221@40 {


power-sensor@

Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

Best regards,
Krzysztof
Jon Hunter Feb. 19, 2024, 12:31 p.m. UTC | #2
On 16/02/2024 13:19, Krzysztof Kozlowski wrote:
> On 16/02/2024 13:28, Jon Hunter wrote:
>> Add the INA3221 current monitors that are present on the Jetson AGX
>> Xavier and Jetson Xavier NX boards.
>>
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>> ---
>>   .../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 50 +++++++++++++++++++
>>   .../arm64/boot/dts/nvidia/tegra194-p3668.dtsi | 27 ++++++++++
>>   2 files changed, 77 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
>> index 5b59c1986e9b..7c57272af044 100644
>> --- a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
>> +++ b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
>> @@ -53,6 +53,56 @@ memory-controller@2c00000 {
>>   			status = "okay";
>>   		};
>>   
>> +		i2c@c240000 {
>> +			status = "okay";
>> +
>> +			ina3221@40 {
> 
> 
> power-sensor@
> 
> Node names should be generic. See also an explanation and list of
> examples (not exhaustive) in DT specification:
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

I will correct this.

Thanks
Jon
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
index 5b59c1986e9b..7c57272af044 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
@@ -53,6 +53,56 @@  memory-controller@2c00000 {
 			status = "okay";
 		};
 
+		i2c@c240000 {
+			status = "okay";
+
+			ina3221@40 {
+				compatible = "ti,ina3221";
+				reg = <0x40>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				input@0 {
+					reg = <0x0>;
+					label = "GPU";
+					shunt-resistor-micro-ohms = <5000>;
+				};
+				input@1 {
+					reg = <0x1>;
+					label = "CPU";
+					shunt-resistor-micro-ohms = <5000>;
+				};
+				input@2 {
+					reg = <0x2>;
+					label = "SOC";
+					shunt-resistor-micro-ohms = <5000>;
+				};
+			};
+
+			ina3221@41 {
+				compatible = "ti,ina3221";
+				reg = <0x41>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				input@0 {
+					reg = <0x0>;
+					label = "CV";
+					shunt-resistor-micro-ohms = <5000>;
+				};
+				input@1 {
+					reg = <0x1>;
+					label = "VDDRQ";
+					shunt-resistor-micro-ohms = <5000>;
+				};
+				input@2 {
+					reg = <0x2>;
+					label = "SYS5V";
+					shunt-resistor-micro-ohms = <5000>;
+				};
+			};
+		};
+
 		serial@3110000 {
 			status = "okay";
 		};
diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p3668.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p3668.dtsi
index 58f190b0f868..6f5e9d114e2a 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194-p3668.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p3668.dtsi
@@ -50,6 +50,33 @@  memory-controller@2c00000 {
 			status = "okay";
 		};
 
+		i2c@c250000 {
+			status = "okay";
+
+			ina3221@40 {
+				compatible = "ti,ina3221";
+				reg = <0x40>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				input@0 {
+					reg = <0x0>;
+					label = "VDD_IN";
+					shunt-resistor-micro-ohms = <5000>;
+				};
+				input@1 {
+					reg = <0x1>;
+					label = "VDD_CPU_GPU_CV";
+					shunt-resistor-micro-ohms = <5000>;
+				};
+				input@2 {
+					reg = <0x2>;
+					label = "VDD_SOC";
+					shunt-resistor-micro-ohms = <5000>;
+				};
+			};
+		};
+
 		serial@3100000 {
 			status = "okay";
 		};