mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Add power monitor support on sama7d65-curiosity board
@ 2025-02-11 14:33 Mihai Sain
  2025-02-11 14:33 ` [PATCH 1/2] ARM: dts: microchip: sama7d65: Add flexcom 10 node Mihai Sain
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mihai Sain @ 2025-02-11 14:33 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, devicetree, linux-arm-kernel, linux-kernel
  Cc: Mihai Sain

This patch series adds power monitor support on Microchip SAMA7D65 Curiosity board.

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

[root@SAMA7D65 ~]$ awk -f pac1934.awk
VDD3V3   current: 146.173 mA, voltage: 3302.73 mV
VDDIODDR current: 62.1356 mA, voltage: 1353.96 mV
VDDCORE  current: 242.248 mA, voltage: 1204.36 mV
VDDCPU   current: 213.565 mA, voltage: 1303.05 mV

Mihai Sain (2):
  ARM: dts: microchip: sama7d65: Add flexcom 10 node
  ARM: dts: microchip: sama7d65_curiosity: Add power monitor support

 .../dts/microchip/at91-sama7d65_curiosity.dts | 52 +++++++++++++++++++
 arch/arm/boot/dts/microchip/sama7d65.dtsi     | 21 ++++++++
 2 files changed, 73 insertions(+)


base-commit: febbc555cf0fff895546ddb8ba2c9a523692fb55
-- 
2.48.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] ARM: dts: microchip: sama7d65: Add flexcom 10 node
  2025-02-11 14:33 [PATCH 0/2] Add power monitor support on sama7d65-curiosity board Mihai Sain
@ 2025-02-11 14:33 ` Mihai Sain
  2025-02-11 14:33 ` [PATCH 2/2] ARM: dts: microchip: sama7d65_curiosity: Add power monitor support Mihai Sain
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Mihai Sain @ 2025-02-11 14:33 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, devicetree, linux-arm-kernel, linux-kernel
  Cc: Mihai Sain

Add flexcom 10 node and its i2c-controller subnode
for usage on the SAMA7D65 Curiosity board.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 arch/arm/boot/dts/microchip/sama7d65.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/sama7d65.dtsi b/arch/arm/boot/dts/microchip/sama7d65.dtsi
index 854b30d15dcd..a38e04a86b6d 100644
--- a/arch/arm/boot/dts/microchip/sama7d65.dtsi
+++ b/arch/arm/boot/dts/microchip/sama7d65.dtsi
@@ -132,6 +132,27 @@ uart6: serial@200 {
 			};
 		};
 
+		flx10: flexcom@e2824000 {
+			compatible = "microchip,sama7d65-flexcom", "atmel,sama5d2-flexcom";
+			reg = <0xe2824000 0x200>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 44>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0xe2824000 0x800>;
+			status = "disabled";
+
+			i2c10: i2c@600 {
+				compatible = "microchip,sama7d65-i2c", "microchip,sam9x60-i2c";
+				reg = <0x600 0x200>;
+				interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				clocks = <&pmc PMC_TYPE_PERIPHERAL 44>;
+				atmel,fifo-size = <32>;
+				status = "disabled";
+			};
+		};
+
 		gic: interrupt-controller@e8c11000 {
 			compatible = "arm,cortex-a7-gic";
 			reg = <0xe8c11000 0x1000>,
-- 
2.48.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ARM: dts: microchip: sama7d65_curiosity: Add power monitor support
  2025-02-11 14:33 [PATCH 0/2] Add power monitor support on sama7d65-curiosity board Mihai Sain
  2025-02-11 14:33 ` [PATCH 1/2] ARM: dts: microchip: sama7d65: Add flexcom 10 node Mihai Sain
@ 2025-02-11 14:33 ` Mihai Sain
  2025-02-11 22:52 ` [PATCH 0/2] Add power monitor support on sama7d65-curiosity board Rob Herring (Arm)
  2025-02-17  9:15 ` Claudiu Beznea
  3 siblings, 0 replies; 5+ messages in thread
From: Mihai Sain @ 2025-02-11 14:33 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, devicetree, linux-arm-kernel, linux-kernel
  Cc: Mihai Sain

Add PAC1934 support in order to monitor the board power consumption.
Device is connected on flexcom10 in twi mode.

[root@SAMA7D65 ~]$ awk -f pac1934.awk
VDD3V3   current: 146.173 mA, voltage: 3302.73 mV
VDDIODDR current: 62.1356 mA, voltage: 1353.96 mV
VDDCORE  current: 242.248 mA, voltage: 1204.36 mV
VDDCPU   current: 213.565 mA, voltage: 1303.05 mV

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 .../dts/microchip/at91-sama7d65_curiosity.dts | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama7d65_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sama7d65_curiosity.dts
index 0f86360fb733..8d826ec4c66c 100644
--- a/arch/arm/boot/dts/microchip/at91-sama7d65_curiosity.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama7d65_curiosity.dts
@@ -43,6 +43,52 @@ &uart6 {
 	status = "okay";
 };
 
+&flx10 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
+	status = "okay";
+};
+
+&i2c10 {
+	dmas = <0>, <0>;
+	i2c-analog-filter;
+	i2c-digital-filter;
+	i2c-digital-filter-width-ns = <35>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c10_default>;
+	status = "okay";
+
+	power-monitor@10 {
+		compatible = "microchip,pac1934";
+		reg = <0x10>;
+		#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";
+		};
+	};
+};
+
 &main_xtal {
 	clock-frequency = <24000000>;
 };
@@ -75,6 +121,12 @@ pinctrl_uart6_default: uart6-default {
 			 <PIN_PD19__FLEXCOM6_IO1>;
 		bias-disable;
 	};
+
+	pinctrl_i2c10_default: i2c10-default{
+		pinmux = <PIN_PB19__FLEXCOM10_IO1>,
+			 <PIN_PB20__FLEXCOM10_IO0>;
+		bias-pull-up;
+	};
 };
 
 &sdmmc1 {
-- 
2.48.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Add power monitor support on sama7d65-curiosity board
  2025-02-11 14:33 [PATCH 0/2] Add power monitor support on sama7d65-curiosity board Mihai Sain
  2025-02-11 14:33 ` [PATCH 1/2] ARM: dts: microchip: sama7d65: Add flexcom 10 node Mihai Sain
  2025-02-11 14:33 ` [PATCH 2/2] ARM: dts: microchip: sama7d65_curiosity: Add power monitor support Mihai Sain
@ 2025-02-11 22:52 ` Rob Herring (Arm)
  2025-02-17  9:15 ` Claudiu Beznea
  3 siblings, 0 replies; 5+ messages in thread
From: Rob Herring (Arm) @ 2025-02-11 22:52 UTC (permalink / raw)
  To: Mihai Sain
  Cc: devicetree, nicolas.ferre, linux-kernel, linux-arm-kernel,
	alexandre.belloni, claudiu.beznea, krzk+dt, conor+dt


On Tue, 11 Feb 2025 16:33:00 +0200, Mihai Sain wrote:
> This patch series adds power monitor support on Microchip SAMA7D65 Curiosity board.
> 
> [root@SAMA7D65 ~]$ lsiio
> Device 001: pac1934
> Device 000: e1000000.adc
> 
> [root@SAMA7D65 ~]$ awk -f pac1934.awk
> VDD3V3   current: 146.173 mA, voltage: 3302.73 mV
> VDDIODDR current: 62.1356 mA, voltage: 1353.96 mV
> VDDCORE  current: 242.248 mA, voltage: 1204.36 mV
> VDDCPU   current: 213.565 mA, voltage: 1303.05 mV
> 
> Mihai Sain (2):
>   ARM: dts: microchip: sama7d65: Add flexcom 10 node
>   ARM: dts: microchip: sama7d65_curiosity: Add power monitor support
> 
>  .../dts/microchip/at91-sama7d65_curiosity.dts | 52 +++++++++++++++++++
>  arch/arm/boot/dts/microchip/sama7d65.dtsi     | 21 ++++++++
>  2 files changed, 73 insertions(+)
> 
> 
> base-commit: febbc555cf0fff895546ddb8ba2c9a523692fb55
> --
> 2.48.1
> 
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/microchip/' for 20250211143302.4102-1-mihai.sain@microchip.com:

arch/arm/boot/dts/microchip/at91-sama7d65_curiosity.dtb: flexcom@e2824000: compatible: 'oneOf' conditional failed, one must be fixed:
	['microchip,sama7d65-flexcom', 'atmel,sama5d2-flexcom'] is too long
	'atmel,sama5d2-flexcom' was expected
	'microchip,sam9x7-flexcom' was expected
	'microchip,sama7g5-flexcom' was expected
	from schema $id: http://devicetree.org/schemas/mfd/atmel,sama5d2-flexcom.yaml#
arch/arm/boot/dts/microchip/at91-sama7d65_curiosity.dtb: /soc/flexcom@e2824000: failed to match any schema with compatible: ['microchip,sama7d65-flexcom', 'atmel,sama5d2-flexcom']






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Add power monitor support on sama7d65-curiosity board
  2025-02-11 14:33 [PATCH 0/2] Add power monitor support on sama7d65-curiosity board Mihai Sain
                   ` (2 preceding siblings ...)
  2025-02-11 22:52 ` [PATCH 0/2] Add power monitor support on sama7d65-curiosity board Rob Herring (Arm)
@ 2025-02-17  9:15 ` Claudiu Beznea
  3 siblings, 0 replies; 5+ messages in thread
From: Claudiu Beznea @ 2025-02-17  9:15 UTC (permalink / raw)
  To: Mihai Sain, robh, krzk+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, devicetree, linux-arm-kernel, linux-kernel



On 11.02.2025 16:33, Mihai Sain wrote:
> Mihai Sain (2):
>   ARM: dts: microchip: sama7d65: Add flexcom 10 node
>   ARM: dts: microchip: sama7d65_curiosity: Add power monitor support

Applied to at91-dt (with some small adjustments, please check), thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-17  9:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-11 14:33 [PATCH 0/2] Add power monitor support on sama7d65-curiosity board Mihai Sain
2025-02-11 14:33 ` [PATCH 1/2] ARM: dts: microchip: sama7d65: Add flexcom 10 node Mihai Sain
2025-02-11 14:33 ` [PATCH 2/2] ARM: dts: microchip: sama7d65_curiosity: Add power monitor support Mihai Sain
2025-02-11 22:52 ` [PATCH 0/2] Add power monitor support on sama7d65-curiosity board Rob Herring (Arm)
2025-02-17  9:15 ` Claudiu Beznea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®