Skip to contentSkip to conversation

Add power monitor support on Microchip boards

PATCH Applied Mihai Sain 2 participants 7 messages Sep 23, 2024 – Oct 20, 2024

Subsystems (3)
lore
Share & tools
lore

Mihai Sain

author
#0 lore raw

cover Add power monitor support on Microchip boards

This patch series adds power monitor support using PAC1934 on Microchip boards.

[root@sama7g5 ~]$ lsiio
Device 001: pac1934
Device 000: e1000000.adc

[root@sama7g5 ~]$ awk -f pac1934.awk VDD3V3 current: 161.747 mA, voltage: 3300.29 mV VDDIODDR current: 72.616 mA, voltage: 1346.68 mV VDDCORE current: 249.84 mA, voltage: 1204.59 mV VDDCPU current: 68.4628 mA, voltage: 1301.27 mV

Mihai Sain (5):
ARM: dts: microchip: sam9x60ek: Add power monitor support
ARM: dts: microchip: sama5d2_icp: Add power monitor support
ARM: dts: microchip: sama7g54_curiosity: Add power monitor support
ARM: dts: microchip: sama7g5ek: Add power monitor support
ARM: configs: at91: enable PAC1934 driver as module

 .../arm/boot/dts/microchip/at91-sam9x60ek.dts | 31 +++++++++++++++++++
 .../boot/dts/microchip/at91-sama5d2_icp.dts   | 31 +++++++++++++++++++
 .../dts/microchip/at91-sama7g54_curiosity.dts | 31 +++++++++++++++++++
 .../arm/boot/dts/microchip/at91-sama7g5ek.dts | 31 +++++++++++++++++++
 arch/arm/configs/at91_dt_defconfig            |  1 +
 arch/arm/configs/sama5_defconfig              |  1 +
 arch/arm/configs/sama7_defconfig              |  1 +
 7 files changed, 127 insertions(+)

base-commit: de5cb0dcb74c294ec527eddfe5094acfdb21ff21

Signature · 1 line
2.46.1
author
#1 lore raw

PATCH 1/5 ARM: dts: microchip: sam9x60ek: Add power monitor support

Add PAC1934 support in order to monitor the board power consumption.

---
 .../arm/boot/dts/microchip/at91-sam9x60ek.dts | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/microchip/at91-sam9x60ek.dts +31 -0
index 3b38707d736e..6cf699d9b540 100644
@@ -260,6 +260,37 @@ i2c6: i2c@600 {
 		i2c-digital-filter-width-ns = <35>;
 		status = "okay";
 
+		power-monitor@17 {
+			compatible = "microchip,pac1934";
+			reg = <0x17>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			channel@1 {
+				reg = <0x1>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDIOM";
+			};
+
+			channel@2 {
+				reg = <0x2>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDCORE";
+			};
+
+			channel@3 {
+				reg = <0x3>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3_MPU";
+			};
+
+			channel@4 {
+				reg = <0x4>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3";
+			};
+		};
+
 		gpio_exp: mcp23008@20 {
 			compatible = "microchip,mcp23008";
 			reg = <0x20>;
Signature · 1 line
2.46.1
author
#2 lore raw

PATCH 2/5 ARM: dts: microchip: sama5d2_icp: Add power monitor support

In reply to Mihai Sain

Add PAC1934 support in order to monitor the board power consumption.

---
 .../boot/dts/microchip/at91-sama5d2_icp.dts   | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts +31 -0
index 5e2bb517a480..8f617cb29d36 100644
@@ -195,6 +195,37 @@ i2c6: i2c@600 {
 		i2c-digital-filter-width-ns = <35>;
 		status = "okay";
 
+		power-monitor@10 {
+			compatible = "microchip,pac1934";
+			reg = <0x10>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			channel@1 {
+				reg = <0x1>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3_1";
+			};
+
+			channel@2 {
+				reg = <0x2>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3_2";
+			};
+
+			channel@3 {
+				reg = <0x3>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDCORE";
+			};
+
+			channel@4 {
+				reg = <0x4>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDIODDR";
+			};
+		};
+
 		mcp16502@5b {
 			compatible = "microchip,mcp16502";
 			reg = <0x5b>;
Signature · 1 line
2.46.1
author
#3 lore raw

PATCH 3/5 ARM: dts: microchip: sama7g54_curiosity: Add power monitor support

In reply to Mihai Sain

Add PAC1934 support in order to monitor the board power consumption.

---
 .../dts/microchip/at91-sama7g54_curiosity.dts | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dts +31 -0
index 645e49fdb7fe..2dec2218f32c 100644
@@ -186,6 +186,37 @@ i2c10: i2c@600 {
 		i2c-digital-filter-width-ns = <35>;
 		status = "okay";
 
+		power-monitor@1f {
+			compatible = "microchip,pac1934";
+			reg = <0x1f>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			channel@1 {
+				reg = <0x1>;
+				shunt-resistor-micro-ohms = <47000>;
+				label = "VDD3V3";
+			};
+
+			channel@2 {
+				reg = <0x2>;
+				shunt-resistor-micro-ohms = <47000>;
+				label = "VDDIODDR";
+			};
+
+			channel@3 {
+				reg = <0x3>;
+				shunt-resistor-micro-ohms = <47000>;
+				label = "VDDCORE";
+			};
+
+			channel@4 {
+				reg = <0x4>;
+				shunt-resistor-micro-ohms = <47000>;
+				label = "VDDCPU";
+			};
+		};
+
 		eeprom@51 {
 			compatible = "atmel,24c02";
 			reg = <0x51>;
Signature · 1 line
2.46.1
author
#4 lore raw

PATCH 4/5 ARM: dts: microchip: sama7g5ek: Add power monitor support

In reply to Mihai Sain

Add PAC1934 support in order to monitor the board power consumption.

---
 .../arm/boot/dts/microchip/at91-sama7g5ek.dts | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/microchip/at91-sama7g5ek.dts +31 -0
index ed75d491a246..5fd77abd4201 100644
@@ -244,6 +244,37 @@ i2c1: i2c@600 {
 		i2c-digital-filter-width-ns = <35>;
 		status = "okay";
 
+		power-monitor@10 {
+			compatible = "microchip,pac1934";
+			reg = <0x10>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			channel@1 {
+				reg = <0x1>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3";
+			};
+
+			channel@2 {
+				reg = <0x2>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDIODDR";
+			};
+
+			channel@3 {
+				reg = <0x3>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDCORE";
+			};
+
+			channel@4 {
+				reg = <0x4>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDCPU";
+			};
+		};
+
 		mcp16502@5b {
 			compatible = "microchip,mcp16502";
 			reg = <0x5b>;
Signature · 1 line
2.46.1
author
#5 lore raw

PATCH 5/5 ARM: configs: at91: enable PAC1934 driver as module

In reply to Mihai Sain

Enable PAC1934 driver and build as module.

---
 arch/arm/configs/at91_dt_defconfig | 1 +
 arch/arm/configs/sama5_defconfig   | 1 +
 arch/arm/configs/sama7_defconfig   | 1 +
 3 files changed, 3 insertions(+)
arch/arm/configs/at91_dt_defconfig +1 -0
index 2022a7fca0f9..f2596a1b2f7d 100644
@@ -201,6 +201,7 @@ CONFIG_AT_XDMAC=y
 CONFIG_IIO=y
 CONFIG_AT91_ADC=y
 CONFIG_AT91_SAMA5D2_ADC=y
+CONFIG_PAC1934=m
 CONFIG_PWM=y
 CONFIG_PWM_ATMEL=y
 CONFIG_PWM_ATMEL_HLCDC_PWM=y
arch/arm/configs/sama5_defconfig +1 -0
index 9096a99b5abd..e447329398d5 100644
@@ -212,6 +212,7 @@ CONFIG_VIDEO_HANTRO=m
 CONFIG_IIO=y
 CONFIG_AT91_ADC=y
 CONFIG_AT91_SAMA5D2_ADC=y
+CONFIG_PAC1934=m
 CONFIG_ENVELOPE_DETECTOR=m
 CONFIG_DPOT_DAC=m
 CONFIG_MCP4531=m
arch/arm/configs/sama7_defconfig +1 -0
index 7fa5d251ced2..1a2e93c8ee71 100644
@@ -193,6 +193,7 @@ CONFIG_STAGING=y
 CONFIG_IIO=y
 CONFIG_IIO_SW_TRIGGER=y
 CONFIG_AT91_SAMA5D2_ADC=y
+CONFIG_PAC1934=m
 CONFIG_PWM=y
 CONFIG_PWM_ATMEL=y
 CONFIG_MCHP_EIC=y
Signature · 1 line
2.46.1
maintainer Applied
#6 lore raw
In reply to Mihai Sain
Quoted 6 lines · Mihai Sain

Mihai Sain (5):
ARM: dts: microchip: sam9x60ek: Add power monitor support
ARM: dts: microchip: sama5d2_icp: Add power monitor support
ARM: dts: microchip: sama7g54_curiosity: Add power monitor support
ARM: dts: microchip: sama7g5ek: Add power monitor support
ARM: configs: at91: enable PAC1934 driver as module

Applied to at91-dt, thanks!