Dear Maintainers,
The initially merged device-tree for Clearfog GTR devices contained
various subtle mistakes and omissions:
- missing board-specific compatible strings
- missing pinctrl entries
- missing second sfp connector
- invalid sfp loss-of-signal gpio
- mismatch of labels between dsa ports and enclosure
Most notably this had caused functional issues with the sfp connectors.
This patch-set first converts the armada-38x dt-bindings to yaml.
New bindings are added specifically for the Clearfog GTR boards,
and for the already in-tree clearfog base and pro boards' compatible strings.
Secondly pinctrl nodes are added for all referenced gpios for independence
from bootloader defaults. U-Boot is shared between armada-388 clearfog,
and armada-385 clearfog gtr.
Further remove an invalid io from the first sfp connector description,
and add descriptions for the secondary sfp connector which is driven
by dsa switch port number 9.
Finally labels of dsa switch ports were updated to match the enclosure.
That patch is not suitable for stable.
Signed-off-by: Josua Mayer <[email protected]>
---
Changes in v3:
- armada-38x.yaml: removed '|', no need to prerserve formatting
(reported by Conor Dooley [email protected])
- update commit descriptions to clarify confusing board names and
compatible strings
(reported by Krzysztof Kozlowski <[email protected]>)
- send to all relevant lists
(reported by Krzysztof Kozlowski <[email protected]>)
- remove duplicate binding for clearfog / clearfog
- Link to v2 (patches 0-2):
https://lore.kernel.org/r/[email protected]
- Link to v2 (patches 3-8):
https://lore.kernel.org/r/[email protected]
Changes in v2:
- removed changes changes to gpio numbers because they were wrong
- added bindings documentation
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Josua Mayer (8):
dt-bindings: marvell: a38x: convert the soc compatibles description to yaml
dt-bindings: marvell: a38x: add solidrun armada 385 clearfog gtr boards
dt-bindings: marvell: a38x: add solidrun armada 388 clearfog boards
arm: dts: marvell: clearfog-gtr: add board-specific compatible strings
arm: dts: marvell: clearfog-gtr: sort pinctrl nodes alphabetically
arm: dts: marvell: clearfog-gtr: add missing pinctrl for all used gpios
arm: dts: marvell: clearfog-gtr-l8: add support for second sfp connector
arm: dts: marvell: clearfog-gtr-l8: align port numbers with enclosure
.../devicetree/bindings/arm/marvell/armada-38x.txt | 27 -------
.../bindings/arm/marvell/armada-38x.yaml | 53 ++++++++++++++
.../dts/marvell/armada-385-clearfog-gtr-l8.dts | 38 +++++++---
.../dts/marvell/armada-385-clearfog-gtr-s4.dts | 2 +
.../boot/dts/marvell/armada-385-clearfog-gtr.dtsi | 84 ++++++++++++++++------
5 files changed, 147 insertions(+), 57 deletions(-)
---
base-commit: 861deac3b092f37b2c5e6871732f3e11486f7082
change-id: 20231226-support-clearfog-gtr-l8-sfp-d87ae715a787
Sincerely,
--
Josua Mayer <[email protected]>
Convert the existing txt binding for armada-38x socs to DT schema
format.
Note that the current bindings only document the SoC (armada380,
armada385, armada388). This is undesirable, instead there should be
entries for actual boards.
For now only convert to yaml, the content can be corrected separately.
Signed-off-by: Josua Mayer <[email protected]>
---
.../devicetree/bindings/arm/marvell/armada-38x.txt | 27 ------------------
.../bindings/arm/marvell/armada-38x.yaml | 33 ++++++++++++++++++++++
2 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/Documentation/devicetree/bindings/arm/marvell/armada-38x.txt b/Documentation/devicetree/bindings/arm/marvell/armada-38x.txt
deleted file mode 100644
index 202953f1887e..000000000000
--- a/Documentation/devicetree/bindings/arm/marvell/armada-38x.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-Marvell Armada 38x Platforms Device Tree Bindings
--------------------------------------------------
-
-Boards with a SoC of the Marvell Armada 38x family shall have the
-following property:
-
-Required root node property:
-
- - compatible: must contain "marvell,armada380"
-
-In addition, boards using the Marvell Armada 385 SoC shall have the
-following property before the previous one:
-
-Required root node property:
-
-compatible: must contain "marvell,armada385"
-
-In addition, boards using the Marvell Armada 388 SoC shall have the
-following property before the previous one:
-
-Required root node property:
-
-compatible: must contain "marvell,armada388"
-
-Example:
-
-compatible = "marvell,a385-rd", "marvell,armada385", "marvell,armada380";
diff --git a/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml b/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml
new file mode 100644
index 000000000000..5af222e6db18
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/marvell/armada-38x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell Armada 38x Platforms
+
+maintainers:
+ - Gregory CLEMENT <[email protected]>
+
+properties:
+ $nodename:
+ const: '/'
+ compatible:
+ oneOf:
+
+ - description: Armada 380 SoC
+ items:
+ - const: marvell,armada380
+
+ - description: Armada 385 SoC
+ items:
+ - const: marvell,armada385
+ - const: marvell,armada380
+
+ - description: Armada 388 SoC
+ items:
+ - const: marvell,armada388
+ - const: marvell,armada385
+ - const: marvell,armada380
+
+additionalProperties: true
--
2.35.3
Add DT compatible for SolidRun Armada-385 based Clearfog GTR L8 and S4
boards.
Despite similar name these two boards are designed differently from the
armada 388 clearfog base and pro, they only share a name and general use
case.
Signed-off-by: Josua Mayer <[email protected]>
---
Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml b/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml
index 5af222e6db18..5bc69c4fe34d 100644
--- a/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml
+++ b/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml
@@ -30,4 +30,12 @@ properties:
- const: marvell,armada385
- const: marvell,armada380
+ - description: SolidRun Armada 385 based single-board computers
+ items:
+ - enum:
+ - solidrun,clearfog-gtr-l8
+ - solidrun,clearfog-gtr-s4
+ - const: marvell,armada385
+ - const: marvell,armada380
+
additionalProperties: true
--
2.35.3
Clearfog GTR L8 has an extra SFP connector on the managed switch port 9.
Add descriptions for both entities along with pinctrl.
Signed-off-by: Josua Mayer <[email protected]>
---
.../boot/dts/marvell/armada-385-clearfog-gtr-l8.dts | 20 +++++++++++++++++++-
.../boot/dts/marvell/armada-385-clearfog-gtr.dtsi | 8 +++++++-
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts
index cd5b070f1218..2df388f222ec 100644
--- a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts
+++ b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts
@@ -6,6 +6,16 @@ / {
model = "SolidRun Clearfog GTR L8";
compatible = "solidrun,clearfog-gtr-l8", "marvell,armada385",
"marvell,armada380";
+
+ /* CON25 */
+ sfp1: sfp-1 {
+ compatible = "sff,sfp";
+ pinctrl-0 = <&cf_gtr_sfp1_pins>;
+ pinctrl-names = "default";
+ i2c-bus = <&i2c0>;
+ mod-def0-gpio = <&gpio0 24 GPIO_ACTIVE_LOW>;
+ tx-disable-gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+ };
};
&mdio {
@@ -68,11 +78,19 @@ port@8 {
phy-handle = <&switch0phy7>;
};
+ port@9 {
+ reg = <9>;
+ label = "lan-sfp";
+ phy-mode = "sgmii";
+ sfp = <&sfp1>;
+ managed = "in-band-status";
+ };
+
port@10 {
reg = <10>;
phy-mode = "2500base-x";
-
ethernet = <ð1>;
+
fixed-link {
speed = <2500>;
full-duplex;
diff --git a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr.dtsi b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr.dtsi
index 39ac97edb463..f3a3cb6ac311 100644
--- a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr.dtsi
+++ b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr.dtsi
@@ -201,6 +201,12 @@ cf_gtr_sfp0_pins: sfp0-pins {
marvell,function = "gpio";
};
+ cf_gtr_sfp1_pins: sfp1-pins {
+ /* sfp modabs, txdisable */
+ marvell,pins = "mpp24", "mpp54";
+ marvell,function = "gpio";
+ };
+
cf_gtr_spi1_cs_pins: spi1-cs-pins {
marvell,pins = "mpp59";
marvell,function = "spi1";
@@ -276,7 +282,7 @@ pcie@3,0 {
};
/* CON5 */
- sfp0: sfp {
+ sfp0: sfp-0 {
compatible = "sff,sfp";
pinctrl-0 = <&cf_gtr_sfp0_pins>;
pinctrl-names = "default";
--
2.35.3
On Tue, 26 Dec 2023 19:11:33 +0100, Josua Mayer wrote:
> Add DT compatible for SolidRun Armada-385 based Clearfog GTR L8 and S4
> boards.
>
> Despite similar name these two boards are designed differently from the
> armada 388 clearfog base and pro, they only share a name and general use
> case.
>
> Signed-off-by: Josua Mayer <[email protected]>
> ---
> Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
./Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml:36:14: [warning] wrong indentation: expected 14 but found 13 (indentation)
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20231226-support-clearfog-gtr-l8-sfp-v3-2-fd1ac2d6bf2e@solid-run.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
On 26/12/2023 19:11, Josua Mayer wrote:
> Convert the existing txt binding for armada-38x socs to DT schema
> format.
...
> +---
> +$id: http://devicetree.org/schemas/arm/marvell/armada-38x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Marvell Armada 38x Platforms
> +
> +maintainers:
> + - Gregory CLEMENT <[email protected]>
> +
> +properties:
> + $nodename:
> + const: '/'
> + compatible:
> + oneOf:
> +
> + - description: Armada 380 SoC
> + items:
> + - const: marvell,armada380
> +
Thanks for the conversion. I think this is still not what we want. The
main problem is of course in the original binding, not your conversion.
Compatible armada380 above alone is not correct. This is SoC and SoC
compatible cannot be used alone, because it is not specific enough to
differentiate boards. Same applies for further lists, which I removed
from the quote, for the same reasons.
What we could do here is to fix this instead of pure conversion:
1. Add this binding file with new compatibles for existing boards and
drop the TXT file, with explanation that you actually document properly
all existing board compatibles.
2. Add compatibles to existing DTS.
3. Add your new board compatibles.
At least this is what I would do for typical cases, but as I said
before, Marvell here is in some surprising limbo state.
Best regards,
Krzysztof
On 26/12/2023 19:11, Josua Mayer wrote:
> Add DT compatible for SolidRun Armada-385 based Clearfog GTR L8 and S4
> boards.
>
> Despite similar name these two boards are designed differently from the
> armada 388 clearfog base and pro, they only share a name and general use
> case.
>
> Signed-off-by: Josua Mayer <[email protected]>
> ---
> Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml b/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml
> index 5af222e6db18..5bc69c4fe34d 100644
> --- a/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml
> +++ b/Documentation/devicetree/bindings/arm/marvell/armada-38x.yaml
> @@ -30,4 +30,12 @@ properties:
> - const: marvell,armada385
> - const: marvell,armada380
>
> + - description: SolidRun Armada 385 based single-board computers
> + items:
> + - enum:
> + - solidrun,clearfog-gtr-l8
When I pointed out in your previous versions that you do not test
patches, I did it in hope to encourage testing patches...
Standard boiler plate:
It does not look like you tested the bindings, at least after quick
look. Please run `make dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).
Maybe you need to update your dtschema and yamllint.
Best regards,
Krzysztof
Am 27.12.23 um 12:49 schrieb Krzysztof Kozlowski:
> On 26/12/2023 19:11, Josua Mayer wrote:
>> Convert the existing txt binding for armada-38x socs to DT schema
>> format.
> ...
>
>> +---
>> +$id: http://devicetree.org/schemas/arm/marvell/armada-38x.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Marvell Armada 38x Platforms
>> +
>> +maintainers:
>> + - Gregory CLEMENT <[email protected]>
>> +
>> +properties:
>> + $nodename:
>> + const: '/'
>> + compatible:
>> + oneOf:
>> +
>> + - description: Armada 380 SoC
>> + items:
>> + - const: marvell,armada380
>> +
> Thanks for the conversion. I think this is still not what we want. The
> main problem is of course in the original binding, not your conversion.
> Compatible armada380 above alone is not correct. This is SoC and SoC
> compatible cannot be used alone, because it is not specific enough to
> differentiate boards. Same applies for further lists, which I removed
> from the quote, for the same reasons.
>
> What we could do here is to fix this instead of pure conversion:
> 1. Add this binding file with new compatibles for existing boards and
> drop the TXT file, with explanation that you actually document properly
> all existing board compatibles.
So - we could add a boilerplate yaml with zero boards in conversion commit,
and then add new or existing boards through separate commits?
I feel that collecting / fixing the compatibles for all a38x based
boards might be a lot of effort.
Would it be acceptable to start with the few that I know / use myself?
In addition to those already submitted I could include
armada-388-helios4.dts.
> 2. Add compatibles to existing DTS.
For boards I do not know / using codenames - is there a template /
generic description string?
> 3. Add your new board compatibles.
>
> At least this is what I would do for typical cases, but as I said
> before, Marvell here is in some surprising limbo state.
Thank you for the constructive notes!
> Best regards,
> Krzysztof
>
On 27/12/2023 13:05, Josua Mayer wrote:
>>> + - description: Armada 380 SoC
>>> + items:
>>> + - const: marvell,armada380
>>> +
>> Thanks for the conversion. I think this is still not what we want. The
>> main problem is of course in the original binding, not your conversion.
>> Compatible armada380 above alone is not correct. This is SoC and SoC
>> compatible cannot be used alone, because it is not specific enough to
>> differentiate boards. Same applies for further lists, which I removed
>> from the quote, for the same reasons.
>>
>> What we could do here is to fix this instead of pure conversion:
>> 1. Add this binding file with new compatibles for existing boards and
>> drop the TXT file, with explanation that you actually document properly
>> all existing board compatibles.
> So - we could add a boilerplate yaml with zero boards in conversion commit,
> and then add new or existing boards through separate commits?
boilerplate YAML file is kind of useless. It's like writing new driver
with adding empty C file and Makefile entry. I understand you want to
split logical items, but there is no logical action as "empty binding file".
>
> I feel that collecting / fixing the compatibles for all a38x based
> boards might be a lot of effort.
> Would it be acceptable to start with the few that I know / use myself?
> In addition to those already submitted I could include
> armada-388-helios4.dts.
Yes, it's fine.
>
>> 2. Add compatibles to existing DTS.
> For boards I do not know / using codenames - is there a template /
> generic description string?
>> 3. Add your new board compatibles.
>>
>> At least this is what I would do for typical cases, but as I said
>> before, Marvell here is in some surprising limbo state.
>
Best regards,
Krzysztof