Skip to contentSkip to conversation

ARM: dts: rmobile: Add IIC3 node on Gen2 R8A7792 V2H

PATCH New Marek Vasut 1 participant 3 messages Mar 21, 2020 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ARM: dts: rmobile: Add IIC3 node on Gen2 R8A7792 V2H

Add IIC3 node from mainline Linux DT. This will be further updated in subsequent DT sync, however adding this node for now is sufficient and minimal change.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/dts/r8a7792.dtsi | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/dts/r8a7792.dtsi +17 -0
index 8e9eb4b704..6fd80e3541 100644
@@ -444,6 +444,23 @@
 			status = "disabled";
 		};
 
+		iic3: i2c at e60b0000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "renesas,iic-r8a7792",
+				     "renesas,rcar-gen2-iic",
+				     "renesas,rmobile-iic";
+			reg = <0 0xe60b0000 0 0x425>;
+			interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 926>;
+			dmas = <&dmac0 0x77>, <&dmac0 0x78>,
+			       <&dmac1 0x77>, <&dmac1 0x78>;
+			dma-names = "tx", "rx", "tx", "rx";
+			power-domains = <&sysc R8A7792_PD_ALWAYS_ON>;
+			resets = <&cpg 926>;
+			status = "disabled";
+		};
+
 		dmac0: dma-controller at e6700000 {
 			compatible = "renesas,dmac-r8a7792",
 				     "renesas,rcar-dmac";
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/3 ARM: dts: rmobile: Enable IIC3 on V2H Blanche

Enable IIC3 to permit access to the PMIC.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/dts/r8a7792-blanche-u-boot.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/r8a7792-blanche-u-boot.dts +4 -0
index 3555663d64..30b27040f5 100644
@@ -8,6 +8,10 @@
 #include "r8a7792-blanche.dts"
 #include "r8a7792-u-boot.dtsi"
 
+&iic3 {
+	status = "okay";
+};
+
 &scif0 {
 	u-boot,dm-pre-reloc;
 };
Signature · 1 line
2.25.1
#2 lore raw

PATCH 3/3 ARM: rmobile: Implement PMIC reset on V2H Blanche

In reply to Marek Vasut

Add code to reset the board through PMIC, by writing the required PMIC registers in the CPU reset handler.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 board/renesas/blanche/blanche.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
board/renesas/blanche/blanche.c +19 -0
index 7232370d6f..0807967d6e 100644
@@ -355,4 +355,23 @@ int dram_init_banksize(void)
 
 void reset_cpu(ulong addr)
 {
+	struct udevice *dev;
+	const u8 pmic_bus = 6;
+	const u8 pmic_addr = 0x58;
+	u8 data;
+	int ret;
+
+	ret = i2c_get_chip_for_busnum(pmic_bus, pmic_addr, 1, &dev);
+	if (ret)
+		hang();
+
+	ret = dm_i2c_read(dev, 0x13, &data, 1);
+	if (ret)
+		hang();
+
+	data |= BIT(1);
+
+	ret = dm_i2c_write(dev, 0x13, &data, 1);
+	if (ret)
+		hang();
 }
Signature · 1 line
2.25.1