Skip to contentSkip to conversation

riscv: dts: sifive unmatched: Name gpio lines

PATCH Superseded Vincent Pelletier 2 participants 9 messages Nov 16, 2021 – Nov 18, 2021

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/6 riscv: dts: sifive unmatched: Name gpio lines

Follow the pin descriptions given in the version 3 of the board schematics.

--
Changes since v1:
- Remove trailing "." on subject line.

---
 arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +4 -0
index 4f66919215f6..305a086e5207 100644
@@ -245,4 +245,8 @@ &pwm1 {
 
 &gpio {
 	status = "okay";
+	gpio-line-names = "J29.1", "PMICNTB", "PMICSHDN", "J8.1", "J8.3",
+		"PCIe_PWREN", "THERM", "UBRDG_RSTN", "PCIe_PERSTN",
+		"ULPI_RSTN", "J8.2", "UHUB_RSTN", "GEMGXL_RST", "J8.4",
+		"EN_VDD_SD", "SD_CD";
 };
Signature · 1 line
2.33.1
#1 lore raw

PATCH v2 2/6 riscv: dts: sifive unmatched: Expose the board ID eeprom

Mark it as read-only as it is factory-programmed with identifying information, and no executable nor configuration:
- eth MAC address
- board model (PCB version, BoM version)
- board serial number
Accidental modification would cause misidentification which could brick the board, so marking read-only seem like both a safe and non-constraining choice.

--
Changes since v1:
- Remove trailing "." on subject line.

---
 arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +10 -0
index 305a086e5207..cf8937708829 100644
@@ -58,6 +58,16 @@ temperature-sensor@4c {
 		interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
 	};
 
+	eeprom@54 {
+		compatible = "microchip,24c02", "atmel,24c02";
+		reg = <0x54>;
+		vcc-supply = <&vdd_bpro>;
+		label = "board-id";
+		pagesize = <16>;
+		read-only;
+		size = <256>;
+	};
+
 	pmic@58 {
 		compatible = "dlg,da9063";
 		reg = <0x58>;
Signature · 1 line
2.33.1
#2 lore raw

PATCH v2 3/6 riscv: dts: sifive unmatched: Expose the PMIC sub-functions

In reply to Vincent Pelletier

These sub-functions are available in the chip revision on this board, so expose them.

--
Changes since v1:
- Remove trailing "." on subject line.

---
 arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +12 -0
index cf8937708829..270360b258b7 100644
@@ -75,6 +75,18 @@ pmic@58 {
 		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
 		interrupt-controller;
 
+		onkey {
+			compatible = "dlg,da9063-onkey";
+		};
+
+		rtc {
+			compatible = "dlg,da9063-rtc";
+		};
+
+		wdt {
+			compatible = "dlg,da9063-watchdog";
+		};
+
 		regulators {
 			vdd_bcore1: bcore1 {
 				regulator-min-microvolt = <900000>;
Signature · 1 line
2.33.1
#3 lore raw

PATCH v2 4/6 riscv: dts: sifive unmatched: Expose the FU740 core supply regulator

In reply to Vincent Pelletier

Provides monitoring of core voltage and current:
tps544b20-i2c-0-1e

Adapter: i2c-ocores
vout1:       906.00 mV
temp1:        -40.0°C  (high = +125.0°C, crit = +150.0°C)
iout1:         5.06 A  (max = +20.00 A, crit max = +26.00 A)

--
Note: checkpatch.pl complains about undocumented devicetree binding, which is fixed by:
https://lore.kernel.org/linux-devicetree/[email protected]/T/#u

Changes since v1:
- Added missing "ti," prefix in compatible string.
- Remove trailing "." on subject line.
- Rename tree node.

---
 arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +5 -0
index 270360b258b7..6e7775fdae32 100644
@@ -51,6 +51,11 @@ &uart1 {
 &i2c0 {
 	status = "okay";
 
+	regulator@1e {
+		compatible = "ti,tps544b20";
+		reg = <0x1e>;
+	};
+
 	temperature-sensor@4c {
 		compatible = "ti,tmp451";
 		reg = <0x4c>;
Signature · 1 line
2.33.1
#4 lore raw

PATCH v2 5/6 riscv: dts: sifive unmatched: Fix regulator for board rev3

In reply to Vincent Pelletier

The existing values are rejected by the da9063 regulator driver, as they are unachievable with the declared chip setup (non-merged vcore and bmem are unable to provide the declared curent).

Fix voltages to match rev3 schematics, which also matches their boot-up configuration within the chip's available precision.
Declare bcore1/bcore2 and bmem/bio as merged.
Set ldo09 and ldo10 as always-on as their consumers are not declared but exist.
Drop ldo current limits as there is no current limit feature for these regulators in the DA9063. Fixes warnings like:
DA9063_LDO3: Operation of current configuration missing

--
Changes since v1:
- Remove trailing "." on subject line.

---
 .../boot/dts/sifive/hifive-unmatched-a00.dts  | 84 ++++++-------------
 1 file changed, 24 insertions(+), 60 deletions(-)
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +24 -60
index 6e7775fdae32..1abad0eec02e 100644
@@ -93,47 +93,31 @@ wdt {
 		};
 
 		regulators {
-			vdd_bcore1: bcore1 {
-				regulator-min-microvolt = <900000>;
-				regulator-max-microvolt = <900000>;
-				regulator-min-microamp = <5000000>;
-				regulator-max-microamp = <5000000>;
-				regulator-always-on;
-			};
-
-			vdd_bcore2: bcore2 {
-				regulator-min-microvolt = <900000>;
-				regulator-max-microvolt = <900000>;
-				regulator-min-microamp = <5000000>;
-				regulator-max-microamp = <5000000>;
+			vdd_bcore: bcores-merged {
+				regulator-min-microvolt = <1050000>;
+				regulator-max-microvolt = <1050000>;
+				regulator-min-microamp = <4800000>;
+				regulator-max-microamp = <4800000>;
 				regulator-always-on;
 			};
 
 			vdd_bpro: bpro {
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
-				regulator-min-microamp = <2500000>;
-				regulator-max-microamp = <2500000>;
+				regulator-min-microamp = <2400000>;
+				regulator-max-microamp = <2400000>;
 				regulator-always-on;
 			};
 
 			vdd_bperi: bperi {
-				regulator-min-microvolt = <1050000>;
-				regulator-max-microvolt = <1050000>;
+				regulator-min-microvolt = <1060000>;
+				regulator-max-microvolt = <1060000>;
 				regulator-min-microamp = <1500000>;
 				regulator-max-microamp = <1500000>;
 				regulator-always-on;
 			};
 
-			vdd_bmem: bmem {
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <1200000>;
-				regulator-min-microamp = <3000000>;
-				regulator-max-microamp = <3000000>;
-				regulator-always-on;
-			};
-
-			vdd_bio: bio {
+			vdd_bmem_bio: bmem-bio-merged {
 				regulator-min-microvolt = <1200000>;
 				regulator-max-microvolt = <1200000>;
 				regulator-min-microamp = <3000000>;
@@ -144,86 +128,66 @@ vdd_bio: bio {
 			vdd_ldo1: ldo1 {
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
-				regulator-min-microamp = <100000>;
-				regulator-max-microamp = <100000>;
 				regulator-always-on;
 			};
 
 			vdd_ldo2: ldo2 {
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
-				regulator-min-microamp = <200000>;
-				regulator-max-microamp = <200000>;
 				regulator-always-on;
 			};
 
 			vdd_ldo3: ldo3 {
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <1800000>;
-				regulator-min-microamp = <200000>;
-				regulator-max-microamp = <200000>;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
 				regulator-always-on;
 			};
 
 			vdd_ldo4: ldo4 {
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <1800000>;
-				regulator-min-microamp = <200000>;
-				regulator-max-microamp = <200000>;
+				regulator-min-microvolt = <2500000>;
+				regulator-max-microvolt = <2500000>;
 				regulator-always-on;
 			};
 
 			vdd_ldo5: ldo5 {
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <1800000>;
-				regulator-min-microamp = <100000>;
-				regulator-max-microamp = <100000>;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
 				regulator-always-on;
 			};
 
 			vdd_ldo6: ldo6 {
-				regulator-min-microvolt = <3300000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-min-microamp = <200000>;
-				regulator-max-microamp = <200000>;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
 				regulator-always-on;
 			};
 
 			vdd_ldo7: ldo7 {
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <1800000>;
-				regulator-min-microamp = <200000>;
-				regulator-max-microamp = <200000>;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
 				regulator-always-on;
 			};
 
 			vdd_ldo8: ldo8 {
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <1800000>;
-				regulator-min-microamp = <200000>;
-				regulator-max-microamp = <200000>;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
 				regulator-always-on;
 			};
 
 			vdd_ld09: ldo9 {
 				regulator-min-microvolt = <1050000>;
 				regulator-max-microvolt = <1050000>;
-				regulator-min-microamp = <200000>;
-				regulator-max-microamp = <200000>;
+				regulator-always-on;
 			};
 
 			vdd_ldo10: ldo10 {
 				regulator-min-microvolt = <1000000>;
 				regulator-max-microvolt = <1000000>;
-				regulator-min-microamp = <300000>;
-				regulator-max-microamp = <300000>;
+				regulator-always-on;
 			};
 
 			vdd_ldo11: ldo11 {
 				regulator-min-microvolt = <2500000>;
 				regulator-max-microvolt = <2500000>;
-				regulator-min-microamp = <300000>;
-				regulator-max-microamp = <300000>;
 				regulator-always-on;
 			};
 		};
Signature · 1 line
2.33.1
#5 lore raw

PATCH v2 6/6 riscv: dts: sifive unmatched: Link the tmp451 with its power supply

In reply to Vincent Pelletier

Fixes the following probe warning:
lm90 0-004c: Looking up vcc-supply from device tree
lm90 0-004c: Looking up vcc-supply property in node /soc/i2c@10030000/temperature-sensor@4c failed lm90 0-004c: supply vcc not found, using dummy regulator

--
Changes since v1:
- Remove trailing "." on subject line.
- Added a commit description.

---
 arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +1 -0
index 1abad0eec02e..1a952dec74bb 100644
@@ -59,6 +59,7 @@ regulator@1e {
 	temperature-sensor@4c {
 		compatible = "ti,tmp451";
 		reg = <0x4c>;
+		vcc-supply = <&vdd_bpro>;
 		interrupt-parent = <&gpio>;
 		interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
 	};
Signature · 1 line
2.33.1
#7 lore raw
Quoted 5 lines · Krzysztof Kozlowski
Quoted 4 lines · Vincent Pelletier

Follow the pin descriptions given in the version 3 of the board schematics.

Quoted 7 lines
Quoted 4 lines

--
Changes since v1:
- Remove trailing "." on subject line.
---

This is not a correct changelog placement - you have to use '---' just like git uses it. Just test it yourself and you will see the problem.

Indeed, thanks for catching this.

Is there a recommended way for managing these not-for-commit-message chunks automatically ?
I obviously compose them by hand so far, and put them in my local git working copy commit messages, but I would be happier if I did not have to make (bad) decisions on such mechanical detail.

On a related topic, is there a way to automate "git send-email" recipient list using get_maintainer.pl (plus some more magic lines, for example to exclude bouncing addresses) ?

While process/submitting-patches.rst describes what the result should look like, it feels to me that it (or another related file) could be more directive on what commands/workflows help to get such result, for casual contributors like myself. Have I missed such documentation ?

Regards,

Signature · 2 lines
Vincent Pelletier
GPG fingerprint 983A E8B7 3B91 1598 7A92 3845 CAC9 3691 4257 B0C1
#8 lore raw
Quoted 14 lines · Vincent Pelletier
Quoted 5 lines · Krzysztof Kozlowski
Quoted 4 lines · Vincent Pelletier

Follow the pin descriptions given in the version 3 of the board schematics.

Quoted 7 lines
Quoted 4 lines

--
Changes since v1:
- Remove trailing "." on subject line.
---

This is not a correct changelog placement - you have to use '---' just like git uses it. Just test it yourself and you will see the problem.

Quoted 7 lines

Indeed, thanks for catching this.

Is there a recommended way for managing these not-for-commit-message chunks automatically ?
I obviously compose them by hand so far, and put them in my local git working copy commit messages, but I would be happier if I did not have to make (bad) decisions on such mechanical detail.

There is an idea of git notes (wasn't really efficient) or git branch description for cover letter (--cover-from-description, didn't try yet).

Quoted 4 lines

On a related topic, is there a way to automate "git send-email" recipient list using get_maintainer.pl (plus some more magic lines, for example to exclude bouncing addresses) ?

There are few different options, so depends what do you want, e.g.:
git send-email --cc-cmd "scripts/get_maintainer.pl --no-git --no-roles --no-rolestats" --to [email protected] 0*

However above does not take care about cover-letter.

Quoted 5 lines

While process/submitting-patches.rst describes what the result should look like, it feels to me that it (or another related file) could be more directive on what commands/workflows help to get such result, for casual contributors like myself. Have I missed such documentation ?

Not sure. Anyway just look at the lists at lore.kernel.org how other people are doing it.

Best regards,
Krzysztof