mbox series

[v2,0/1] Add StarFive JH8100 dwmac support

Message ID 20240111025531.2875-1-chunhau.tan@starfivetech.com (mailing list archive)
Headers show
Series Add StarFive JH8100 dwmac support | expand

Message

ChunHau Tan Jan. 11, 2024, 2:55 a.m. UTC
Add StarFive JH8100 dwmac support.
JH8100 dwmac has one reset signal instead of 2 resets as in JH7110.

Changes in v2:
- Drop driver patch.
- Add missing "starfive,jh8100-dwmac" to snps,dwmac
- Add handling resets for starfive,jh8100-dwmac and provide an else condition for others.

---
Tan Chun Hau (1):
  dt-bindings: net: starfive,jh7110-dwmac: Add StarFive JH8100 support

 .../devicetree/bindings/net/snps,dwmac.yaml   |  1 +
 .../bindings/net/starfive,jh7110-dwmac.yaml   | 50 +++++++++++++------
 2 files changed, 37 insertions(+), 14 deletions(-)

Comments

Krzysztof Kozlowski Jan. 11, 2024, 8:02 a.m. UTC | #1
On 11/01/2024 03:55, Tan Chun Hau wrote:
> Add StarFive JH8100 dwmac support.
> JH8100 dwmac has one reset signal instead of 2 resets as in JH7110.
> 
> Changes in v2:
> - Drop driver patch.

? But devices are not compatible, so how can it work?

Best regards,
Krzysztof
Krzysztof Kozlowski Jan. 11, 2024, 8:03 a.m. UTC | #2
On 11/01/2024 09:02, Krzysztof Kozlowski wrote:
> On 11/01/2024 03:55, Tan Chun Hau wrote:
>> Add StarFive JH8100 dwmac support.
>> JH8100 dwmac has one reset signal instead of 2 resets as in JH7110.
>>
>> Changes in v2:
>> - Drop driver patch.
> 
> ? But devices are not compatible, so how can it work?

Wait, your select confused me... later you made them compatible.

Best regards,
Krzysztof
ChunHau Tan Jan. 11, 2024, 10 a.m. UTC | #3
> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Thursday, 11 January, 2024 4:03 PM
> To: ChunHau Tan <chunhau.tan@starfivetech.com>; David S . Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Rob Herring
> <robh+dt@kernel.org>; Emil Renner Berthing <kernel@esmil.dk>; Rob Herring
> <robh@kernel.org>; Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>;
> Conor Dooley <conor+dt@kernel.org>; Maxime Coquelin
> <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Simon Horman <horms@kernel.org>; Bartosz
> Golaszewski <bartosz.golaszewski@linaro.org>; Andrew Halaney
> <ahalaney@redhat.com>; Jisheng Zhang <jszhang@kernel.org>; Uwe
> Kleine-König <u.kleine-koenig@pengutronix.de>; Russell King
> <rmk+kernel@armlinux.org.uk>
> Cc: Leyfoon Tan <leyfoon.tan@starfivetech.com>; JeeHeng Sia
> <jeeheng.sia@starfivetech.com>; netdev@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-stm32@st-md-mailman.stormreply.com;
> linux-arm-kernel@lists.infradead.org; linux-riscv@lists.infradead.org
> Subject: Re: [PATCH v2 0/1] Add StarFive JH8100 dwmac support
> 
> On 11/01/2024 09:02, Krzysztof Kozlowski wrote:
> > On 11/01/2024 03:55, Tan Chun Hau wrote:
> >> Add StarFive JH8100 dwmac support.
> >> JH8100 dwmac has one reset signal instead of 2 resets as in JH7110.
> >>
> >> Changes in v2:
> >> - Drop driver patch.
> >
> > ? But devices are not compatible, so how can it work?
> 
> Wait, your select confused me... later you made them compatible.

Sorry for confusing, let me try to explain in detail,
For JH7110, there are two resets (stmmaceth & ahb)
For JH8100, there are only a resets (stmmaceth)
And both are using same driver code (dwmac-starfive.c), and 
in the driver code acknowledges { .compatible = "starfive,jh7110-dwmac"	} 

In v2 patch, I try to make amend the yaml file by adding "starfive,jh8100-dwmac"
and provide info regarding the differences in resets.

For loading the driver for JH8110, 
Will including "starfive,jh7110-dwmac" in device tree file,

please refer to below example of JH7110 & JH8100 device tree file:

Example of JH7110:
gmac0: ethernet@16030000 {
			compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
			resets = <&aoncrg JH7110_AONRST_GMAC0_AXI>,
				 <&aoncrg JH7110_AONRST_GMAC0_AHB>;
			reset-names = "stmmaceth", "ahb";
		};

Example of JH8100:
gmac0: ethernet@16030000 {
			compatible = "starfive,jh8100-dwmac", "starfive,jh7110-dwmac","snps,dwmac-5.20";
			resets = <&aoncrg JH8100RST_GMAC0>,
			reset-names = "stmmaceth";
		};

Please share with me if you have any suggestions, thank you.
> 
> Best regards,
> Krzysztof