Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
       [not found]                 ` <amg64lxjjetkzo5bpi7icmsfgmt5e7jmu2z2h3duqy2jcloj7s@nma2hjk4so5b>
@ 2024-10-23 12:42                   ` Andrew Lunn
  2024-10-23 22:36                     ` Inochi Amaoto
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2024-10-23 12:42 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Giuseppe Cavallaro, Yixun Lan, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv

> Yes, this is what I have done at the beginning. At first I only
> set up the phy setting and not set the config in the syscon. 
> But I got a weird thing: the phy lookback test is timeout. 
> Although the datasheet told it just adds a internal delay for 
> the phy, I suspect sophgo does something more to set this delay.

You need to understand what is going on here. Just because it works
does not mean it is correct.

	Andrew


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
       [not found]     ` <yt2idyivivcxctosec3lwkjbmr4tmctbs4viefxsuqlsvihdeh@alya6g27625l>
@ 2024-10-23 20:49       ` Conor Dooley
  2024-10-23 22:38         ` Inochi Amaoto
  0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2024-10-23 20:49 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Giuseppe Cavallaro, Yixun Lan, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv

[-- Attachment #1: Type: text/plain, Size: 2981 bytes --]

On Wed, Oct 23, 2024 at 08:31:24AM +0800, Inochi Amaoto wrote:
> On Tue, Oct 22, 2024 at 06:28:06PM +0100, Conor Dooley wrote:
> > On Mon, Oct 21, 2024 at 06:36:15PM +0800, Inochi Amaoto wrote:
> > > The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> > > with some extra clock.
> > > 
> > > Add necessary compatible string for this device.
> > > 
> > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > > ---
> > >  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
> > >  .../bindings/net/sophgo,sg2044-dwmac.yaml     | 145 ++++++++++++++++++
> > >  2 files changed, 146 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > 
> > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > index 3c4007cb65f8..69f6bb36970b 100644
> > > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > @@ -99,6 +99,7 @@ properties:
> > >          - snps,dwmac-5.30a
> > >          - snps,dwxgmac
> > >          - snps,dwxgmac-2.10
> > > +        - sophgo,sg2044-dwmac
> > >          - starfive,jh7100-dwmac
> > >          - starfive,jh7110-dwmac
> > >  
> > > diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > new file mode 100644
> > > index 000000000000..93c41550b0b6
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > @@ -0,0 +1,145 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/net/sophgo,sg2044-dwmac.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: StarFive JH7110 DWMAC glue layer
> > > +
> > > +maintainers:
> > > +  - Inochi Amaoto <inochiama@gmail.com>
> > > +
> > > +select:
> > > +  properties:
> > > +    compatible:
> > > +      contains:
> > > +        enum:
> > > +          - sophgo,sg2044-dwmac
> > > +  required:
> > > +    - compatible
> > > +
> > > +properties:
> > > +  compatible:
> > > +    items:
> > > +      - const: sophgo,sg2044-dwmac
> > > +      - const: snps,dwmac-5.30a
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  clocks:
> > > +    items:
> > > +      - description: GMAC main clock
> > > +      - description: PTP clock
> > > +      - description: TX clock
> > > +
> > > +  clock-names:
> > > +    items:
> > > +      - const: stmmaceth
> > > +      - const: ptp_ref
> > > +      - const: tx
> > > +
> > > +  sophgo,syscon:
> > 
> > How many dwmac instances does the sg2044 have?
> > 
> 
> Only one, there is another 100G dwxgmac instance, but it does not
> use this syscon.

That dwxgmac is a different device, with a different compatible etc?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
  2024-10-23 12:42                   ` [PATCH 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Andrew Lunn
@ 2024-10-23 22:36                     ` Inochi Amaoto
  2024-10-23 23:56                       ` Andrew Lunn
  0 siblings, 1 reply; 11+ messages in thread
From: Inochi Amaoto @ 2024-10-23 22:36 UTC (permalink / raw)
  To: Andrew Lunn, Inochi Amaoto
  Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Giuseppe Cavallaro, Yixun Lan, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv

On Wed, Oct 23, 2024 at 02:42:16PM +0200, Andrew Lunn wrote:
> > Yes, this is what I have done at the beginning. At first I only
> > set up the phy setting and not set the config in the syscon. 
> > But I got a weird thing: the phy lookback test is timeout. 
> > Although the datasheet told it just adds a internal delay for 
> > the phy, I suspect sophgo does something more to set this delay.
> 
> You need to understand what is going on here. Just because it works
> does not mean it is correct.
> 

It seems like there is a missing info in the SG2044 doc: setting the
syscon internal delay bit is not enabling the internal mac delay, but
disable it. Now everything seems like normal: the mac adds no delay,
and the phy adds its delay. 

The sophgo have already confirmed this is a firmware issue that does 
not set up the mac delay correctly and will fix this in the firmware,
so the kernal can always have not mac delay. Since this will be fixed
in the firmware and this interface is not exposed to the kernel, I will
remove the code setting the syscon bit.

Thanks for your effort on this.

Regards,
Inochi


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
  2024-10-23 20:49       ` [PATCH 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac Conor Dooley
@ 2024-10-23 22:38         ` Inochi Amaoto
  2024-10-24 17:04           ` Conor Dooley
  0 siblings, 1 reply; 11+ messages in thread
From: Inochi Amaoto @ 2024-10-23 22:38 UTC (permalink / raw)
  To: Conor Dooley, Inochi Amaoto
  Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Giuseppe Cavallaro, Yixun Lan, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv

On Wed, Oct 23, 2024 at 09:49:34PM +0100, Conor Dooley wrote:
> On Wed, Oct 23, 2024 at 08:31:24AM +0800, Inochi Amaoto wrote:
> > On Tue, Oct 22, 2024 at 06:28:06PM +0100, Conor Dooley wrote:
> > > On Mon, Oct 21, 2024 at 06:36:15PM +0800, Inochi Amaoto wrote:
> > > > The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> > > > with some extra clock.
> > > > 
> > > > Add necessary compatible string for this device.
> > > > 
> > > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > > > ---
> > > >  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
> > > >  .../bindings/net/sophgo,sg2044-dwmac.yaml     | 145 ++++++++++++++++++
> > > >  2 files changed, 146 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > index 3c4007cb65f8..69f6bb36970b 100644
> > > > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > @@ -99,6 +99,7 @@ properties:
> > > >          - snps,dwmac-5.30a
> > > >          - snps,dwxgmac
> > > >          - snps,dwxgmac-2.10
> > > > +        - sophgo,sg2044-dwmac
> > > >          - starfive,jh7100-dwmac
> > > >          - starfive,jh7110-dwmac
> > > >  
> > > > diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > > new file mode 100644
> > > > index 000000000000..93c41550b0b6
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > > @@ -0,0 +1,145 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/net/sophgo,sg2044-dwmac.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: StarFive JH7110 DWMAC glue layer
> > > > +
> > > > +maintainers:
> > > > +  - Inochi Amaoto <inochiama@gmail.com>
> > > > +
> > > > +select:
> > > > +  properties:
> > > > +    compatible:
> > > > +      contains:
> > > > +        enum:
> > > > +          - sophgo,sg2044-dwmac
> > > > +  required:
> > > > +    - compatible
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    items:
> > > > +      - const: sophgo,sg2044-dwmac
> > > > +      - const: snps,dwmac-5.30a
> > > > +
> > > > +  reg:
> > > > +    maxItems: 1
> > > > +
> > > > +  clocks:
> > > > +    items:
> > > > +      - description: GMAC main clock
> > > > +      - description: PTP clock
> > > > +      - description: TX clock
> > > > +
> > > > +  clock-names:
> > > > +    items:
> > > > +      - const: stmmaceth
> > > > +      - const: ptp_ref
> > > > +      - const: tx
> > > > +
> > > > +  sophgo,syscon:
> > > 
> > > How many dwmac instances does the sg2044 have?
> > > 
> > 
> > Only one, there is another 100G dwxgmac instance, but it does not
> > use this syscon.
> 
> That dwxgmac is a different device, with a different compatible etc?

Yes, it needs a different compatiable, and maybe a new binding is needed
since the 100G and 1G IP are different.

Regards,
Inochi


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
       [not found] ` <20241021103617.653386-3-inochiama@gmail.com>
       [not found]   ` <20241022-crisply-brute-45f98632ef78@spud>
@ 2024-10-23 23:41   ` Emil Renner Berthing
  2024-10-24  5:08     ` Inochi Amaoto
  1 sibling, 1 reply; 11+ messages in thread
From: Emil Renner Berthing @ 2024-10-23 23:41 UTC (permalink / raw)
  To: Inochi Amaoto, Chen Wang, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Inochi Amaoto,
	Alexandre Torgue, Jose Abreu, Maxime Coquelin, Richard Cochran,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Giuseppe Cavallaro
  Cc: Yixun Lan, netdev, devicetree, linux-kernel, linux-stm32,
	linux-arm-kernel, linux-riscv

Inochi Amaoto wrote:
> The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> with some extra clock.
>
> Add necessary compatible string for this device.
>
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
>  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
>  .../bindings/net/sophgo,sg2044-dwmac.yaml     | 145 ++++++++++++++++++
>  2 files changed, 146 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
>
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index 3c4007cb65f8..69f6bb36970b 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -99,6 +99,7 @@ properties:
>          - snps,dwmac-5.30a
>          - snps,dwxgmac
>          - snps,dwxgmac-2.10
> +        - sophgo,sg2044-dwmac
>          - starfive,jh7100-dwmac
>          - starfive,jh7110-dwmac
>
> diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> new file mode 100644
> index 000000000000..93c41550b0b6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> @@ -0,0 +1,145 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/sophgo,sg2044-dwmac.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: StarFive JH7110 DWMAC glue layer

I think you forgot to change this when you copied the binding.

/Emil

> +
> +maintainers:
> +  - Inochi Amaoto <inochiama@gmail.com>
> +
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - sophgo,sg2044-dwmac
> +  required:
> +    - compatible
> +
> +properties:
> +  compatible:
> +    items:
> +      - const: sophgo,sg2044-dwmac
> +      - const: snps,dwmac-5.30a
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: GMAC main clock
> +      - description: PTP clock
> +      - description: TX clock
> +
> +  clock-names:
> +    items:
> +      - const: stmmaceth
> +      - const: ptp_ref
> +      - const: tx
> +
> +  sophgo,syscon:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    items:
> +      - items:
> +          - description: phandle to syscon that configures phy
> +          - description: offset of phy mode register
> +          - description: length of the phy mode register
> +    description:
> +      A phandle to syscon with two arguments that configure phy mode.
> +      The argument one is the offset of phy mode register, the
> +      argument two is the length of phy mode register.
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - clock-names
> +  - interrupts
> +  - interrupt-names
> +  - resets
> +  - reset-names
> +
> +allOf:
> +  - $ref: snps,dwmac.yaml#
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: sophgo,sg2044-dwmac
> +    then:
> +      properties:
> +        interrupts:
> +          minItems: 1
> +          maxItems: 1
> +
> +        interrupt-names:
> +          minItems: 1
> +          maxItems: 1
> +
> +        resets:
> +          maxItems: 1
> +
> +        reset-names:
> +          const: stmmaceth
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    ethernet@30006000 {
> +      compatible = "sophgo,sg2044-dwmac", "snps,dwmac-5.30a";
> +      reg = <0x30006000 0x4000>;
> +      clocks = <&clk 151>, <&clk 152>, <&clk 154>;
> +      clock-names = "stmmaceth", "ptp_ref", "tx";
> +      interrupt-parent = <&intc>;
> +      interrupts = <296 IRQ_TYPE_LEVEL_HIGH>;
> +      interrupt-names = "macirq";
> +      resets = <&rst 30>;
> +      reset-names = "stmmaceth";
> +      snps,multicast-filter-bins = <0>;
> +      snps,perfect-filter-entries = <1>;
> +      snps,aal;
> +      snps,tso;
> +      snps,txpbl = <32>;
> +      snps,rxpbl = <32>;
> +      snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
> +      snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
> +      snps,axi-config = <&gmac0_stmmac_axi_setup>;
> +      status = "disabled";
> +
> +      gmac0_mtl_rx_setup: rx-queues-config {
> +        snps,rx-queues-to-use = <8>;
> +        snps,rx-sched-wsp;
> +        queue0 {};
> +        queue1 {};
> +        queue2 {};
> +        queue3 {};
> +        queue4 {};
> +        queue5 {};
> +        queue6 {};
> +        queue7 {};
> +      };
> +
> +      gmac0_mtl_tx_setup: tx-queues-config {
> +        snps,tx-queues-to-use = <8>;
> +        queue0 {};
> +        queue1 {};
> +        queue2 {};
> +        queue3 {};
> +        queue4 {};
> +        queue5 {};
> +        queue6 {};
> +        queue7 {};
> +      };
> +
> +      gmac0_stmmac_axi_setup: stmmac-axi-config {
> +        snps,blen = <16 8 4 0 0 0 0>;
> +        snps,wr_osr_lmt = <1>;
> +        snps,rd_osr_lmt = <2>;
> +      };
> +    };
> --
> 2.47.0
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
  2024-10-23 22:36                     ` Inochi Amaoto
@ 2024-10-23 23:56                       ` Andrew Lunn
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2024-10-23 23:56 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Giuseppe Cavallaro, Yixun Lan, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv

On Thu, Oct 24, 2024 at 06:36:06AM +0800, Inochi Amaoto wrote:
> On Wed, Oct 23, 2024 at 02:42:16PM +0200, Andrew Lunn wrote:
> > > Yes, this is what I have done at the beginning. At first I only
> > > set up the phy setting and not set the config in the syscon. 
> > > But I got a weird thing: the phy lookback test is timeout. 
> > > Although the datasheet told it just adds a internal delay for 
> > > the phy, I suspect sophgo does something more to set this delay.
> > 
> > You need to understand what is going on here. Just because it works
> > does not mean it is correct.
> > 
> 
> It seems like there is a missing info in the SG2044 doc: setting the
> syscon internal delay bit is not enabling the internal mac delay, but
> disable it. Now everything seems like normal: the mac adds no delay,
> and the phy adds its delay. 

That makes a lot more sense.

Thanks for digging into the details.

	Andrew


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
  2024-10-23 23:41   ` Emil Renner Berthing
@ 2024-10-24  5:08     ` Inochi Amaoto
  0 siblings, 0 replies; 11+ messages in thread
From: Inochi Amaoto @ 2024-10-24  5:08 UTC (permalink / raw)
  To: Emil Renner Berthing, Inochi Amaoto, Chen Wang, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Inochi Amaoto,
	Alexandre Torgue, Jose Abreu, Maxime Coquelin, Richard Cochran,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Giuseppe Cavallaro
  Cc: Yixun Lan, netdev, devicetree, linux-kernel, linux-stm32,
	linux-arm-kernel, linux-riscv

On Wed, Oct 23, 2024 at 07:41:28PM -0400, Emil Renner Berthing wrote:
> Inochi Amaoto wrote:
> > The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> > with some extra clock.
> >
> > Add necessary compatible string for this device.
> >
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> >  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
> >  .../bindings/net/sophgo,sg2044-dwmac.yaml     | 145 ++++++++++++++++++
> >  2 files changed, 146 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > index 3c4007cb65f8..69f6bb36970b 100644
> > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > @@ -99,6 +99,7 @@ properties:
> >          - snps,dwmac-5.30a
> >          - snps,dwxgmac
> >          - snps,dwxgmac-2.10
> > +        - sophgo,sg2044-dwmac
> >          - starfive,jh7100-dwmac
> >          - starfive,jh7110-dwmac
> >
> > diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > new file mode 100644
> > index 000000000000..93c41550b0b6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > @@ -0,0 +1,145 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/net/sophgo,sg2044-dwmac.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: StarFive JH7110 DWMAC glue layer
> 
> I think you forgot to change this when you copied the binding.
> 
> /Emil
> 

Thanks, I will fix it.

Regards,
Inochi


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
       [not found] ` <20241021103617.653386-5-inochiama@gmail.com>
       [not found]   ` <227daa87-1924-4b0b-80db-77507fc20f19@lunn.ch>
@ 2024-10-24 15:37   ` Uwe Kleine-König
  2024-10-25  1:39     ` Inochi Amaoto
  1 sibling, 1 reply; 11+ messages in thread
From: Uwe Kleine-König @ 2024-10-24 15:37 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Giuseppe Cavallaro, Yixun Lan, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]

Hello,

On Mon, Oct 21, 2024 at 06:36:17PM +0800, Inochi Amaoto wrote:
> +static struct platform_driver sophgo_dwmac_driver = {
> +	.probe  = sophgo_dwmac_probe,
> +	.remove_new = stmmac_pltfr_remove,
> +	.driver = {
> +		.name = "sophgo-dwmac",
> +		.pm = &stmmac_pltfr_pm_ops,
> +		.of_match_table = sophgo_dwmac_match,
> +	},
> +};

After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers. Please just drop "_new".

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
  2024-10-23 22:38         ` Inochi Amaoto
@ 2024-10-24 17:04           ` Conor Dooley
  2024-10-24 22:27             ` Inochi Amaoto
  0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2024-10-24 17:04 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Giuseppe Cavallaro, Yixun Lan, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv

[-- Attachment #1: Type: text/plain, Size: 3741 bytes --]

On Thu, Oct 24, 2024 at 06:38:29AM +0800, Inochi Amaoto wrote:
> On Wed, Oct 23, 2024 at 09:49:34PM +0100, Conor Dooley wrote:
> > On Wed, Oct 23, 2024 at 08:31:24AM +0800, Inochi Amaoto wrote:
> > > On Tue, Oct 22, 2024 at 06:28:06PM +0100, Conor Dooley wrote:
> > > > On Mon, Oct 21, 2024 at 06:36:15PM +0800, Inochi Amaoto wrote:
> > > > > The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> > > > > with some extra clock.
> > > > > 
> > > > > Add necessary compatible string for this device.
> > > > > 
> > > > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > > > > ---
> > > > >  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
> > > > >  .../bindings/net/sophgo,sg2044-dwmac.yaml     | 145 ++++++++++++++++++
> > > > >  2 files changed, 146 insertions(+)
> > > > >  create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > > > 
> > > > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > > index 3c4007cb65f8..69f6bb36970b 100644
> > > > > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > > @@ -99,6 +99,7 @@ properties:
> > > > >          - snps,dwmac-5.30a
> > > > >          - snps,dwxgmac
> > > > >          - snps,dwxgmac-2.10
> > > > > +        - sophgo,sg2044-dwmac
> > > > >          - starfive,jh7100-dwmac
> > > > >          - starfive,jh7110-dwmac
> > > > >  
> > > > > diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > > > new file mode 100644
> > > > > index 000000000000..93c41550b0b6
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > > > @@ -0,0 +1,145 @@
> > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > > +%YAML 1.2
> > > > > +---
> > > > > +$id: http://devicetree.org/schemas/net/sophgo,sg2044-dwmac.yaml#
> > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > +
> > > > > +title: StarFive JH7110 DWMAC glue layer
> > > > > +
> > > > > +maintainers:
> > > > > +  - Inochi Amaoto <inochiama@gmail.com>
> > > > > +
> > > > > +select:
> > > > > +  properties:
> > > > > +    compatible:
> > > > > +      contains:
> > > > > +        enum:
> > > > > +          - sophgo,sg2044-dwmac
> > > > > +  required:
> > > > > +    - compatible
> > > > > +
> > > > > +properties:
> > > > > +  compatible:
> > > > > +    items:
> > > > > +      - const: sophgo,sg2044-dwmac
> > > > > +      - const: snps,dwmac-5.30a
> > > > > +
> > > > > +  reg:
> > > > > +    maxItems: 1
> > > > > +
> > > > > +  clocks:
> > > > > +    items:
> > > > > +      - description: GMAC main clock
> > > > > +      - description: PTP clock
> > > > > +      - description: TX clock
> > > > > +
> > > > > +  clock-names:
> > > > > +    items:
> > > > > +      - const: stmmaceth
> > > > > +      - const: ptp_ref
> > > > > +      - const: tx
> > > > > +
> > > > > +  sophgo,syscon:
> > > > 
> > > > How many dwmac instances does the sg2044 have?
> > > > 
> > > 
> > > Only one, there is another 100G dwxgmac instance, but it does not
> > > use this syscon.
> > 
> > That dwxgmac is a different device, with a different compatible etc?
> 
> Yes, it needs a different compatiable, and maybe a new binding is needed
> since the 100G and 1G IP are different.

In that case, you don't /need/ a syscon property at all, much less one
with offsets. You can just look up the syscon by compatible and hard
code the offset in the driver.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac
  2024-10-24 17:04           ` Conor Dooley
@ 2024-10-24 22:27             ` Inochi Amaoto
  0 siblings, 0 replies; 11+ messages in thread
From: Inochi Amaoto @ 2024-10-24 22:27 UTC (permalink / raw)
  To: Conor Dooley, Inochi Amaoto
  Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Giuseppe Cavallaro, Yixun Lan, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv

On Thu, Oct 24, 2024 at 06:04:31PM +0100, Conor Dooley wrote:
> On Thu, Oct 24, 2024 at 06:38:29AM +0800, Inochi Amaoto wrote:
> > On Wed, Oct 23, 2024 at 09:49:34PM +0100, Conor Dooley wrote:
> > > On Wed, Oct 23, 2024 at 08:31:24AM +0800, Inochi Amaoto wrote:
> > > > On Tue, Oct 22, 2024 at 06:28:06PM +0100, Conor Dooley wrote:
> > > > > On Mon, Oct 21, 2024 at 06:36:15PM +0800, Inochi Amaoto wrote:
> > > > > > The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC
> > > > > > with some extra clock.
> > > > > > 
> > > > > > Add necessary compatible string for this device.
> > > > > > 
> > > > > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > > > > > ---
> > > > > >  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
> > > > > >  .../bindings/net/sophgo,sg2044-dwmac.yaml     | 145 ++++++++++++++++++
> > > > > >  2 files changed, 146 insertions(+)
> > > > > >  create mode 100644 Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > > > > 
> > > > > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > > > index 3c4007cb65f8..69f6bb36970b 100644
> > > > > > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > > > @@ -99,6 +99,7 @@ properties:
> > > > > >          - snps,dwmac-5.30a
> > > > > >          - snps,dwxgmac
> > > > > >          - snps,dwxgmac-2.10
> > > > > > +        - sophgo,sg2044-dwmac
> > > > > >          - starfive,jh7100-dwmac
> > > > > >          - starfive,jh7110-dwmac
> > > > > >  
> > > > > > diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > > > > new file mode 100644
> > > > > > index 000000000000..93c41550b0b6
> > > > > > --- /dev/null
> > > > > > +++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
> > > > > > @@ -0,0 +1,145 @@
> > > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > > > +%YAML 1.2
> > > > > > +---
> > > > > > +$id: http://devicetree.org/schemas/net/sophgo,sg2044-dwmac.yaml#
> > > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > > > +
> > > > > > +title: StarFive JH7110 DWMAC glue layer
> > > > > > +
> > > > > > +maintainers:
> > > > > > +  - Inochi Amaoto <inochiama@gmail.com>
> > > > > > +
> > > > > > +select:
> > > > > > +  properties:
> > > > > > +    compatible:
> > > > > > +      contains:
> > > > > > +        enum:
> > > > > > +          - sophgo,sg2044-dwmac
> > > > > > +  required:
> > > > > > +    - compatible
> > > > > > +
> > > > > > +properties:
> > > > > > +  compatible:
> > > > > > +    items:
> > > > > > +      - const: sophgo,sg2044-dwmac
> > > > > > +      - const: snps,dwmac-5.30a
> > > > > > +
> > > > > > +  reg:
> > > > > > +    maxItems: 1
> > > > > > +
> > > > > > +  clocks:
> > > > > > +    items:
> > > > > > +      - description: GMAC main clock
> > > > > > +      - description: PTP clock
> > > > > > +      - description: TX clock
> > > > > > +
> > > > > > +  clock-names:
> > > > > > +    items:
> > > > > > +      - const: stmmaceth
> > > > > > +      - const: ptp_ref
> > > > > > +      - const: tx
> > > > > > +
> > > > > > +  sophgo,syscon:
> > > > > 
> > > > > How many dwmac instances does the sg2044 have?
> > > > > 
> > > > 
> > > > Only one, there is another 100G dwxgmac instance, but it does not
> > > > use this syscon.
> > > 
> > > That dwxgmac is a different device, with a different compatible etc?
> > 
> > Yes, it needs a different compatiable, and maybe a new binding is needed
> > since the 100G and 1G IP are different.
> 
> In that case, you don't /need/ a syscon property at all, much less one
> with offsets. You can just look up the syscon by compatible and hard
> code the offset in the driver.

Good, look up the syscon is a good idea. Thanks for this suggestion.

Regards,
Inochi


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC
  2024-10-24 15:37   ` Uwe Kleine-König
@ 2024-10-25  1:39     ` Inochi Amaoto
  0 siblings, 0 replies; 11+ messages in thread
From: Inochi Amaoto @ 2024-10-25  1:39 UTC (permalink / raw)
  To: Uwe Kleine-König, Inochi Amaoto
  Cc: Chen Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Richard Cochran, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Giuseppe Cavallaro, Yixun Lan, netdev, devicetree,
	linux-kernel, linux-stm32, linux-arm-kernel, linux-riscv

On Thu, Oct 24, 2024 at 05:37:03PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> On Mon, Oct 21, 2024 at 06:36:17PM +0800, Inochi Amaoto wrote:
> > +static struct platform_driver sophgo_dwmac_driver = {
> > +	.probe  = sophgo_dwmac_probe,
> > +	.remove_new = stmmac_pltfr_remove,
> > +	.driver = {
> > +		.name = "sophgo-dwmac",
> > +		.pm = &stmmac_pltfr_pm_ops,
> > +		.of_match_table = sophgo_dwmac_match,
> > +	},
> > +};
> 
> After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
> return void") .remove() is (again) the right callback to implement for
> platform drivers. Please just drop "_new".
> 
> Best regards
> Uwe


Thanks, I will fix it.

Regards,
Inochi


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-10-25  1:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20241021103617.653386-1-inochiama@gmail.com>
     [not found] ` <20241021103617.653386-3-inochiama@gmail.com>
     [not found]   ` <20241022-crisply-brute-45f98632ef78@spud>
     [not found]     ` <yt2idyivivcxctosec3lwkjbmr4tmctbs4viefxsuqlsvihdeh@alya6g27625l>
2024-10-23 20:49       ` [PATCH 2/4] dt-bindings: net: Add support for Sophgo SG2044 dwmac Conor Dooley
2024-10-23 22:38         ` Inochi Amaoto
2024-10-24 17:04           ` Conor Dooley
2024-10-24 22:27             ` Inochi Amaoto
2024-10-23 23:41   ` Emil Renner Berthing
2024-10-24  5:08     ` Inochi Amaoto
     [not found] ` <20241021103617.653386-5-inochiama@gmail.com>
     [not found]   ` <227daa87-1924-4b0b-80db-77507fc20f19@lunn.ch>
     [not found]     ` <gwtiuotmwj2x3d5rhfrploj7o763yjye4jj7vniomv77s7crqx@5jwrpwrlwn4s>
     [not found]       ` <65720a16-d165-4379-a01f-54340fb907df@lunn.ch>
     [not found]         ` <424erlm55tuorjvs2xgmanzpximvey22ufhzf3fli7trpimxih@st4yz53hpzzr>
     [not found]           ` <66f35d1b-fd26-429b-bbf9-d03ed0c1edaf@lunn.ch>
     [not found]             ` <zum7n3656qonk4sdfu76owfs4jk2mkjrzayd57uuoqeb6iiris@635pw3mqymqd>
     [not found]               ` <d691a687-c0e2-48a9-bf76-d0a086aa7870@lunn.ch>
     [not found]                 ` <amg64lxjjetkzo5bpi7icmsfgmt5e7jmu2z2h3duqy2jcloj7s@nma2hjk4so5b>
2024-10-23 12:42                   ` [PATCH 4/4] net: stmmac: Add glue layer for Sophgo SG2044 SoC Andrew Lunn
2024-10-23 22:36                     ` Inochi Amaoto
2024-10-23 23:56                       ` Andrew Lunn
2024-10-24 15:37   ` Uwe Kleine-König
2024-10-25  1:39     ` Inochi Amaoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox