mbox series

[v1,0/5] Add Ethernet driver for StarFive JH7110 SoC

Message ID 20230317010536.17860-1-yanhong.wang@starfivetech.com
Headers show
Series Add Ethernet driver for StarFive JH7110 SoC | expand

Message

Yanhong Wang March 17, 2023, 1:05 a.m. UTC
This series adds ethernet support for the StarFive JH7110 RISC-V SoC.
The series includes PHY and MAC drivers. The PHY model is
YT8531 (from Motorcomm Inc), and the MAC version is dwmac-5.20
(from Synopsys DesignWare). 

The implementation of the phy driver is ported from linux, but it
has been adjusted for the u-boot framework.

The PHY and MAC driver has been tested on the StarFive VisionFive 2 1.2A
and 1.3B boards and works normally.

For more information and support,you can visit RVspace wiki[1].
	
This patchset should be applied after the patchset [2].
[1] https://wiki.rvspace.org/
[2] https://patchwork.ozlabs.org/project/uboot/cover/20230316025332.3297-1-yanhong.wang@starfivetech.com/


Yanhong Wang (5):
  net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy
  net: dwc_eth_qos: Add StarFive ethernet driver glue layer
  riscv: dts: jh7110: Add ethernet device tree nodes
  riscv: dts: starfive: Add phy clock delay configuration for StarFive
    VisionFive2 board
  configs: starfive: Enable ethernet configuration for StarFive
    VisionFive 2

 .../jh7110-starfive-visionfive-2-v1.2a.dts    |  13 +
 .../jh7110-starfive-visionfive-2-v1.3b.dts    |  27 ++
 .../dts/jh7110-starfive-visionfive-2.dtsi     |  34 ++
 arch/riscv/dts/jh7110.dtsi                    |  69 +++
 configs/starfive_visionfive2_defconfig        |  13 +
 drivers/net/Kconfig                           |   7 +
 drivers/net/Makefile                          |   1 +
 drivers/net/dwc_eth_qos.c                     |   6 +
 drivers/net/dwc_eth_qos.h                     |   2 +
 drivers/net/dwc_eth_qos_starfive.c            | 306 +++++++++++++
 drivers/net/phy/Kconfig                       |   6 +
 drivers/net/phy/Makefile                      |   1 +
 drivers/net/phy/motorcomm.c                   | 409 ++++++++++++++++++
 drivers/net/phy/phy.c                         |   4 +-
 include/phy.h                                 |   1 +
 15 files changed, 898 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/dwc_eth_qos_starfive.c
 create mode 100644 drivers/net/phy/motorcomm.c


base-commit: 3ad7642443aee9369726844ffcfe5b9ae68c259e

Comments

Torsten Duwe March 24, 2023, 12:53 p.m. UTC | #1
On Fri, 17 Mar 2023 09:05:31 +0800
Yanhong Wang <yanhong.wang@starfivetech.com> wrote:

> This series adds ethernet support for the StarFive JH7110 RISC-V SoC.
> The series includes PHY and MAC drivers. The PHY model is
> YT8531 (from Motorcomm Inc), and the MAC version is dwmac-5.20
> (from Synopsys DesignWare). 
> 
> The implementation of the phy driver is ported from linux, but it
> has been adjusted for the u-boot framework.
> 
> The PHY and MAC driver has been tested on the StarFive VisionFive 2 1.2A
> and 1.3B boards and works normally.

At least a smoke test here succeeded as well, I'm seeing replies to DHCP.
However:

| Model: StarFive VisionFive 2 v1.3B
[...]
| Net:   
| Warning: ethernet@16040000 (eth1) using random MAC address - e2:b9:39:bd:92:24
| 
| Warning: ethernet@16030000 (eth0) using random MAC address - 22:da:dc:e6:2c:17
| eth0: ethernet@16030000, eth1: ethernet@16040000
[...]

What's missing to read the correct MACs from the EEPROM?

	Torsten
Yanhong Wang March 27, 2023, 2:22 a.m. UTC | #2
On 2023/3/24 20:53, Torsten Duwe wrote:
> On Fri, 17 Mar 2023 09:05:31 +0800
> Yanhong Wang <yanhong.wang@starfivetech.com> wrote:
> 
>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC.
>> The series includes PHY and MAC drivers. The PHY model is
>> YT8531 (from Motorcomm Inc), and the MAC version is dwmac-5.20
>> (from Synopsys DesignWare). 
>> 
>> The implementation of the phy driver is ported from linux, but it
>> has been adjusted for the u-boot framework.
>> 
>> The PHY and MAC driver has been tested on the StarFive VisionFive 2 1.2A
>> and 1.3B boards and works normally.
> 
> At least a smoke test here succeeded as well, I'm seeing replies to DHCP.
> However:
> 
> | Model: StarFive VisionFive 2 v1.3B
> [...]
> | Net:   
> | Warning: ethernet@16040000 (eth1) using random MAC address - e2:b9:39:bd:92:24
> | 
> | Warning: ethernet@16030000 (eth0) using random MAC address - 22:da:dc:e6:2c:17
> | eth0: ethernet@16030000, eth1: ethernet@16040000
> [...]
> 
> What's missing to read the correct MACs from the EEPROM?
> 

The minimum system of u-boot supporting JH7110 does not contain EEPROM and cannot 
read the MAC address from EEPROM, so enable the CONFIG_NET_RANDOM_ETHADDR, EEPROM 
will be supported in the future, and the MAC address will be read from EEPROM.


> 	Torsten
> 
>
Torsten Duwe March 27, 2023, 8:09 a.m. UTC | #3
On Mon, 27 Mar 2023 10:22:37 +0800
yanhong wang <yanhong.wang@starfivetech.com> wrote:

> On 2023/3/24 20:53, Torsten Duwe wrote:

> > What's missing to read the correct MACs from the EEPROM?
> 
> The minimum system of u-boot supporting JH7110 does not contain EEPROM
[...]

Thanks for the info!

	Torsten