mbox series

[v4,0/7] Add Ethernet driver for StarFive JH7110 SoC

Message ID 20230118061701.30047-1-yanhong.wang@starfivetech.com (mailing list archive)
Headers show
Series Add Ethernet driver for StarFive JH7110 SoC | expand

Message

yanhong wang Jan. 18, 2023, 6:16 a.m. UTC
This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
For more information and support, you can visit RVspace wiki[1].
	
This patchset should be applied after the patchset [2], [3], [4].
[1] https://wiki.rvspace.org/
[2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
[3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
[4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/

Changes in v4:
- Reworded the maxitems number of resets property in 'snps,dwmac.yaml'
- Removed the unused code in 'dwmac-starfive-plat.c'.
- Reworded the return statement in 'starfive_eth_plat_fix_mac_speed' function.

Previous versions:
v1 - https://patchwork.kernel.org/project/linux-riscv/cover/20221201090242.2381-1-yanhong.wang@starfivetech.com/
v2 - https://patchwork.kernel.org/project/linux-riscv/cover/20221216070632.11444-1-yanhong.wang@starfivetech.com/
v3 - https://patchwork.kernel.org/project/linux-riscv/cover/20230106030001.1952-1-yanhong.wang@starfivetech.com/

Emil Renner Berthing (2):
  dt-bindings: net: snps,dwmac: Add dwmac-5.20 version
  net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string

Yanhong Wang (5):
  dt-bindings: net: snps,dwmac: Update the maxitems number of resets and
    reset-names
  dt-bindings: net: Add support StarFive dwmac
  net: stmmac: Add glue layer for StarFive JH7110 SoCs
  riscv: dts: starfive: jh7110: Add ethernet device node
  riscv: dts: starfive: visionfive-v2: Enable gmac device tree node

 .../devicetree/bindings/net/snps,dwmac.yaml   |  14 ++-
 .../bindings/net/starfive,jh7110-dwmac.yaml   | 113 +++++++++++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-v2.dts         |  10 ++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  93 ++++++++++++++
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
 .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
 .../ethernet/stmicro/stmmac/stmmac_platform.c |   3 +-
 9 files changed, 363 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c


base-commit: 094226ad94f471a9f19e8f8e7140a09c2625abaa
prerequisite-patch-id: 8ebfffa09b478904bf7c516f76e2d824ddb60140
prerequisite-patch-id: e8dd8258a4c4062eee2cf07c4607d52baea71f3a
prerequisite-patch-id: d050d884d7b091ff30508a70f5ce5164bb3b72e5
prerequisite-patch-id: 0e41f8cfd4861fcbf6f2e6a2559ce28f0450299e
prerequisite-patch-id: 6e1652501859b85f101ff3b15ced585d43c71c1b
prerequisite-patch-id: 587628a67adad5c655e5f998bf6c4a368ec07d3c
prerequisite-patch-id: 596490c0e397df6c0249c1306fbb1d5bf00b5b83
prerequisite-patch-id: dc873317826b50364344b25ac5cd74e811403f3d
prerequisite-patch-id: a50150f41d8e874553023187e22eb24dffae8d16
prerequisite-patch-id: 735e62255c75801bdc4c0b4107850bce821ff7f5
prerequisite-patch-id: 9d2e83a2dd43e193f534283fab73e90b4f435043
prerequisite-patch-id: 7a43e0849a9afa3c6f83547fd16d9271b07619e5
prerequisite-patch-id: e7aa6fb05314bad6d94c465f3f59969871bf3d2e
prerequisite-patch-id: 6276b2a23818c65ff2ad3d65b562615690cffee9
prerequisite-patch-id: d834ece14ffb525b8c3e661e78736692f33fca9b
prerequisite-patch-id: 4c17a3ce4dae9b788795d915bf775630f5c43c53
prerequisite-patch-id: dabb913fd478e97593e45c23fee4be9fd807f851
prerequisite-patch-id: ba61df106fbe2ada21e8f22c3d2cfaf7809c84b6
prerequisite-patch-id: 287572fb64f83f5d931034f7c75674907584a087
prerequisite-patch-id: 536114f0732646095ef5302a165672b3290d4c75
prerequisite-patch-id: 258ea5f9b8bf41b6981345dcc81795f25865d38f
prerequisite-patch-id: 8b6f2c9660c0ac0ee4e73e4c21aca8e6b75e81b9
prerequisite-patch-id: e09e995700a814a763aa304ad3881a7222acf556
prerequisite-patch-id: 841cd71b556b480d6a5a5e332eeca70d6a76ec3f
prerequisite-patch-id: d074c7ffa2917a9f754d5801e3f67bc980f9de4c
prerequisite-patch-id: 5f59bc7cbbf1230e5ff4761fa7c1116d4e6e5d71
prerequisite-patch-id: d5da3475c6a3588e11a1678feb565bdd459b548e

Comments

Conor Dooley Jan. 18, 2023, 11:21 p.m. UTC | #1
Hey Yanhong!

On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
> For more information and support, you can visit RVspace wiki[1].
> 	
> This patchset should be applied after the patchset [2], [3], [4].
> [1] https://wiki.rvspace.org/
> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/

I've got those series applied, albeit locally, since they're not ready,
but I cannot get the Ethernet to work properly on my board.
I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
The fact that I am getting to the kernel in the first place means the
ethernet is working in the factory supplied U-Boot [1].

However, in Linux this ethernet port does not appear to work at all.
The other ethernet port is functional in Linux, but not in the factory
supplied U-Boot.

Is this a known issue? If it's not, I'll post the logs somewhere for
you. In case it is relevant, my board is a v1.2a.

Thanks,
Conor.

1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10
yanhong wang Feb. 3, 2023, 3:02 a.m. UTC | #2
On 2023/1/19 7:21, Conor Dooley wrote:
> Hey Yanhong!
> 
> On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
>> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
>> For more information and support, you can visit RVspace wiki[1].
>> 	
>> This patchset should be applied after the patchset [2], [3], [4].
>> [1] https://wiki.rvspace.org/
>> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
>> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
>> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/
> 
> I've got those series applied, albeit locally, since they're not ready,
> but I cannot get the Ethernet to work properly on my board.
> I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
> The fact that I am getting to the kernel in the first place means the
> ethernet is working in the factory supplied U-Boot [1].
> 
> However, in Linux this ethernet port does not appear to work at all.
> The other ethernet port is functional in Linux, but not in the factory
> supplied U-Boot.
> 
> Is this a known issue? If it's not, I'll post the logs somewhere for
> you. In case it is relevant, my board is a v1.2a.
> 
> Thanks,
> Conor.
> 
> 1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10


No, this is not a issue. 
These patches need to rely on the yt8531 phy driver of motorcomm company
and the corresponding clock delay configuration to work normally, 
and the yt8531 phy driver is being submitted. I have applied the
motorcomm patchs during my test on board v1.2b, so the ethernet cannot work without
the application of the motorcomm patchs. 

For the patchs of yt8531, see [1]

1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/

Thanks,
Yanhong.
Conor Dooley Feb. 4, 2023, 2:22 p.m. UTC | #3
On 3 February 2023 04:02:54 GMT+01:00, yanhong wang <yanhong.wang@starfivetech.com> wrote:
>
>
>On 2023/1/19 7:21, Conor Dooley wrote:
>> Hey Yanhong!
>> 
>> On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
>>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
>>> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
>>> For more information and support, you can visit RVspace wiki[1].
>>> 	
>>> This patchset should be applied after the patchset [2], [3], [4].
>>> [1] https://wiki.rvspace.org/
>>> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
>>> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
>>> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/
>> 
>> I've got those series applied, albeit locally, since they're not ready,
>> but I cannot get the Ethernet to work properly on my board.
>> I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
>> The fact that I am getting to the kernel in the first place means the
>> ethernet is working in the factory supplied U-Boot [1].
>> 
>> However, in Linux this ethernet port does not appear to work at all.
>> The other ethernet port is functional in Linux, but not in the factory
>> supplied U-Boot.
>> 
>> Is this a known issue? If it's not, I'll post the logs somewhere for
>> you. In case it is relevant, my board is a v1.2a.
>> 
>> Thanks,
>> Conor.
>> 
>> 1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10
>
>
>No, this is not a issue. 
>These patches need to rely on the yt8531 phy driver of motorcomm company
>and the corresponding clock delay configuration to work normally, 
>and the yt8531 phy driver is being submitted. I have applied the
>motorcomm patchs during my test on board v1.2b, so the ethernet cannot work without
>the application of the motorcomm patchs. 
>
>For the patchs of yt8531, see [1]
>
>1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/

Please put that info into the cover of the next round of your submission then.

Thanks,
Conor.
Andrew Lunn Feb. 4, 2023, 5:16 p.m. UTC | #4
> >For the patchs of yt8531, see [1]
> >
> >1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
> 
> Please put that info into the cover of the next round of your submission then.

These patches just got merged, so it is less of an issue now. Just
make sure you are testing with net-next.

You might need an updated DT blob, the binding for the PHY had a few
changes between the initial version to what actually got merged.

     Andrew
Conor Dooley Feb. 5, 2023, 10:11 a.m. UTC | #5
On 4 February 2023 18:16:44 GMT+01:00, Andrew Lunn <andrew@lunn.ch> wrote:
>> >For the patchs of yt8531, see [1]
>> >
>> >1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
>> 
>> Please put that info into the cover of the next round of your submission then.
>
>These patches just got merged, so it is less of an issue now. Just
>make sure you are testing with net-next.

Oh, cool. Water under the bridge so.
Sorry for the noise!

>You might need an updated DT blob, the binding for the PHY had a few
>changes between the initial version to what actually got merged.

Cool, thanks,
Conor.
yanhong wang Feb. 6, 2023, 1:05 a.m. UTC | #6
On 2023/2/4 22:22, Conor Dooley wrote:
> 
> 
> On 3 February 2023 04:02:54 GMT+01:00, yanhong wang <yanhong.wang@starfivetech.com> wrote:
>>
>>
>>On 2023/1/19 7:21, Conor Dooley wrote:
>>> Hey Yanhong!
>>> 
>>> On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
>>>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
>>>> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
>>>> For more information and support, you can visit RVspace wiki[1].
>>>> 	
>>>> This patchset should be applied after the patchset [2], [3], [4].
>>>> [1] https://wiki.rvspace.org/
>>>> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
>>>> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
>>>> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/
>>> 
>>> I've got those series applied, albeit locally, since they're not ready,
>>> but I cannot get the Ethernet to work properly on my board.
>>> I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
>>> The fact that I am getting to the kernel in the first place means the
>>> ethernet is working in the factory supplied U-Boot [1].
>>> 
>>> However, in Linux this ethernet port does not appear to work at all.
>>> The other ethernet port is functional in Linux, but not in the factory
>>> supplied U-Boot.
>>> 
>>> Is this a known issue? If it's not, I'll post the logs somewhere for
>>> you. In case it is relevant, my board is a v1.2a.
>>> 
>>> Thanks,
>>> Conor.
>>> 
>>> 1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10
>>
>>
>>No, this is not a issue. 
>>These patches need to rely on the yt8531 phy driver of motorcomm company
>>and the corresponding clock delay configuration to work normally, 
>>and the yt8531 phy driver is being submitted. I have applied the
>>motorcomm patchs during my test on board v1.2b, so the ethernet cannot work without
>>the application of the motorcomm patchs. 
>>
>>For the patchs of yt8531, see [1]
>>
>>1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
> 
> Please put that info into the cover of the next round of your submission then.
> 

I will put the info into the cover letter in the next version.

> Thanks,
> Conor.
>
yanhong wang Feb. 6, 2023, 1:15 a.m. UTC | #7
On 2023/2/5 1:16, Andrew Lunn wrote:
>> >For the patchs of yt8531, see [1]
>> >
>> >1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
>> 
>> Please put that info into the cover of the next round of your submission then.
> 
> These patches just got merged, so it is less of an issue now. Just
> make sure you are testing with net-next.
> 
> You might need an updated DT blob, the binding for the PHY had a few
> changes between the initial version to what actually got merged.
> 

I will update the DT blob about the binding for the PHY in the next version.

>      Andrew