2021-11-16 23:57:49

by Vincent Pelletier

[permalink] [raw]
Subject: [PATCH v2 1/6] riscv: dts: sifive unmatched: Name gpio lines

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

Signed-off-by: Vincent Pelletier <[email protected]>

--
Changes since v1:
- Remove trailing "." on subject line.
---
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
index 4f66919215f6..305a086e5207 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
@@ -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";
};
--
2.33.1



2021-11-16 23:57:52

by Vincent Pelletier

[permalink] [raw]
Subject: [PATCH v2 3/6] riscv: dts: sifive unmatched: Expose the PMIC sub-functions

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

Signed-off-by: Vincent Pelletier <[email protected]>

--
Changes since v1:
- Remove trailing "." on subject line.
---
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
index cf8937708829..270360b258b7 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
@@ -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>;
--
2.33.1


2021-11-16 23:57:53

by Vincent Pelletier

[permalink] [raw]
Subject: [PATCH v2 5/6] riscv: dts: sifive unmatched: Fix regulator for board rev3

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

Signed-off-by: Vincent Pelletier <[email protected]>

--
Changes since v1:
- Remove trailing "." on subject line.
---
.../boot/dts/sifive/hifive-unmatched-a00.dts | 84 ++++++-------------
1 file changed, 24 insertions(+), 60 deletions(-)

diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
index 6e7775fdae32..1abad0eec02e 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
@@ -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;
};
};
--
2.33.1


2021-11-16 23:57:54

by Vincent Pelletier

[permalink] [raw]
Subject: [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.

Signed-off-by: Vincent Pelletier <[email protected]>

--
Changes since v1:
- Remove trailing "." on subject line.
---
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
index 305a086e5207..cf8937708829 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
@@ -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>;
--
2.33.1


2021-11-16 23:57:57

by Vincent Pelletier

[permalink] [raw]
Subject: [PATCH v2 4/6] riscv: dts: sifive unmatched: Expose the FU740 core supply regulator

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)

Signed-off-by: Vincent Pelletier <[email protected]>

--
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(+)

diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
index 270360b258b7..6e7775fdae32 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
@@ -51,6 +51,11 @@ &uart1 {
&i2c0 {
status = "okay";

+ regulator@1e {
+ compatible = "ti,tps544b20";
+ reg = <0x1e>;
+ };
+
temperature-sensor@4c {
compatible = "ti,tmp451";
reg = <0x4c>;
--
2.33.1


2021-11-16 23:58:00

by Vincent Pelletier

[permalink] [raw]
Subject: [PATCH v2 6/6] riscv: dts: sifive unmatched: Link the tmp451 with its power supply

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

Signed-off-by: Vincent Pelletier <[email protected]>

--
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(+)

diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
index 1abad0eec02e..1a952dec74bb 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
@@ -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>;
};
--
2.33.1


2021-11-17 09:29:05

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/6] riscv: dts: sifive unmatched: Name gpio lines

On 17/11/2021 00:57, Vincent Pelletier wrote:
> Follow the pin descriptions given in the version 3 of the board schematics.
>
> Signed-off-by: Vincent Pelletier <[email protected]>
>
> --
> 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.

Best regards,
Krzysztof

2021-11-18 00:34:24

by Vincent Pelletier

[permalink] [raw]
Subject: Re: [PATCH v2 1/6] riscv: dts: sifive unmatched: Name gpio lines

On Wed, 17 Nov 2021 10:28:59 +0100, Krzysztof Kozlowski <[email protected]> wrote:
> On 17/11/2021 00:57, Vincent Pelletier wrote:
> > Follow the pin descriptions given in the version 3 of the board schematics.
> >
> > Signed-off-by: Vincent Pelletier <[email protected]>
> >
> > --
> > 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,
--
Vincent Pelletier
GPG fingerprint 983A E8B7 3B91 1598 7A92 3845 CAC9 3691 4257 B0C1

2021-11-18 13:45:19

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/6] riscv: dts: sifive unmatched: Name gpio lines

On 18/11/2021 01:34, Vincent Pelletier wrote:
> On Wed, 17 Nov 2021 10:28:59 +0100, Krzysztof Kozlowski <[email protected]> wrote:
>> On 17/11/2021 00:57, Vincent Pelletier wrote:
>>> Follow the pin descriptions given in the version 3 of the board schematics.
>>>
>>> Signed-off-by: Vincent Pelletier <[email protected]>
>>>
>>> --
>>> 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.

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).

>
> 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.

>
> 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