2022-04-21 05:49:18

by Changming Huang

[permalink] [raw]
Subject: [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301

Add DT Binding doc for semtech sx1301

Signed-off-by: Changming Huang <[email protected]>
---
changes in v3:
- add the dt-bindings

.../bindings/spi/semtech,sx1301.yaml | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 Documentation/devicetree/bindings/spi/semtech,sx1301.yaml

diff --git a/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
new file mode 100644
index 000000000000..f65fb5809218
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/semtech,sx1301.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Semtech sx1301 devicetree bindings
+
+allOf:
+ - $ref: "spi-controller.yaml"
+
+maintainers:
+ - Changming Huang <[email protected]>
+
+properties:
+ compatible:
+ const: semtech,sx1301
+
+ reg:
+ maxItems: 1
+
+ spi-max-frequency: true
+
+ fsl,spi-cs-sck-delay: true
+
+ fsl,spi-sck-cs-delay: true
+
+required:
+ - compatible
+ - reg
+ - spi-max-frequency
+
+additionalProperties: false
+
+examples:
+ - |
+ mikrobus@0 {
+ compatible = "semtech,sx1301";
+ reg = <0>;
+ spi-max-frequency = <2000000>;
+ fsl,spi-cs-sck-delay = <1000000>;
+ fsl,spi-sck-cs-delay = <50>;
+ };
+
+...
--
2.25.1


2022-04-22 17:42:02

by Changming Huang

[permalink] [raw]
Subject: [PATCH 2/2 v3] arm64: dts: fsl-ls1028a: add dspi2 support

Enable MikroBUS SPI port.

Signed-off-by: Changming Huang <[email protected]>
---
changes in v3:
- add the dt-bindings

arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
index 68c31cb8eead..6d0508d5abd0 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
@@ -117,6 +117,19 @@ &duart1 {
status = "okay";
};

+&dspi2 {
+ bus-num = <2>;
+ status = "okay";
+
+ mikrobus@0 {
+ compatible = "semtech,sx1301";
+ reg = <0>;
+ spi-max-frequency = <2000000>;
+ fsl,spi-cs-sck-delay = <1000000>;
+ fsl,spi-sck-cs-delay = <50>;
+ };
+};
+
&enetc_mdio_pf3 {
sgmii_phy0: ethernet-phy@2 {
reg = <0x2>;
--
2.25.1

2022-04-22 19:24:50

by Michael Walle

[permalink] [raw]
Subject: Re: [PATCH 1/2 v3] dt-bindings: dspi: added for semtech sx1301

> Add DT Binding doc for semtech sx1301

Please be a bit more elaborate. The sx1301 seems to be an
SPI device, some kind of WAN device.

>
> Signed-off-by: Changming Huang <[email protected]>
> ---
> changes in v3:
> - add the dt-bindings
>
> .../bindings/spi/semtech,sx1301.yaml | 45 +++++++++++++++++++
> 1 file changed, 45 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
>
> diff --git a/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> new file mode 100644
> index 000000000000..f65fb5809218
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/semtech,sx1301.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/semtech,sx1301.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Semtech sx1301 devicetree bindings
> +
> +allOf:
> + - $ref: "spi-controller.yaml"

.. then why does it inherit the spi controllers properties?

Also *some* kind of information what the sx1301 is would be nice.

Anyway, I was about to comment on your patch 2. But maybe I'll
just leave it here. On the RDB there is a mikrobus connector, with
this, you are going to say "hey there is always a sx1301" module
there. What happens if it not there? What if you put another module
in that socket?

Maybe Krzystof knows better. But it really looks like you want to
have device tree overlays here instead of hardcoding exactly one
use case.

-michael

> +
> +maintainers:
> + - Changming Huang <[email protected]>
> +
> +properties:
> + compatible:
> + const: semtech,sx1301
> +
> + reg:
> + maxItems: 1
> +
> + spi-max-frequency: true
> +
> + fsl,spi-cs-sck-delay: true
> +
> + fsl,spi-sck-cs-delay: true
> +
> +required:
> + - compatible
> + - reg
> + - spi-max-frequency
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + mikrobus@0 {
> + compatible = "semtech,sx1301";
> + reg = <0>;
> + spi-max-frequency = <2000000>;
> + fsl,spi-cs-sck-delay = <1000000>;
> + fsl,spi-sck-cs-delay = <50>;
> + };
> +
> +...
> --
> 2.25.1
>
>