Skip to content

Commit dc0f314

Browse files
committed
Merge branch 'add-the-dwmac-driver-support-for-t-head-th1520-soc'
Drew Fustini says: ==================== Add the dwmac driver support for T-HEAD TH1520 SoC This series adds support for dwmac gigabit ethernet in the T-Head TH1520 RISC-V SoC used on boards like BeagleV Ahead and the LicheePi 4A. The gigabit ethernet on these boards does need pinctrl support to mux the necessary pads. The pinctrl-th1520 driver, pinctrl binding, and related dts patches are in linux-next. However, they are not yet in net-next/main. Therefore, I am dropping the dts patch for v5 as it will not build on net-next/main due to the lack of the padctrl0_apsys pin controller node in next-next/main version th1520.dtsi. It does exist in linux-next [1] and the two patches in this series allow the ethernet ports to work correctly on the LPi4A and Ahead when applied to linux-next. The dwmac-thead driver in this series does not need the pinctrl-th1520 driver to build. Nor does the thead,th1520-gmac.yaml binding need the pinctrl binding to pass the schema check. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/riscv/boot/dts/thead/th1520.dtsi ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 83cb4b4 + 33a1a01 commit dc0f314

File tree

6 files changed

+397
-0
lines changed

6 files changed

+397
-0
lines changed

Documentation/devicetree/bindings/net/snps,dwmac.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ properties:
101101
- snps,dwxgmac-2.10
102102
- starfive,jh7100-dwmac
103103
- starfive,jh7110-dwmac
104+
- thead,th1520-gmac
104105

105106
reg:
106107
minItems: 1
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/net/thead,th1520-gmac.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: T-HEAD TH1520 GMAC Ethernet controller
8+
9+
maintainers:
10+
- Drew Fustini <[email protected]>
11+
12+
description: |
13+
The TH1520 GMAC is described in the TH1520 Peripheral Interface User Manual
14+
https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/tree/main/docs
15+
16+
Features include
17+
- Compliant with IEEE802.3 Specification
18+
- IEEE 1588-2008 standard for precision networked clock synchronization
19+
- Supports 10/100/1000Mbps data transfer rate
20+
- Supports RGMII/MII interface
21+
- Preamble and start of frame data (SFD) insertion in Transmit path
22+
- Preamble and SFD deletion in the Receive path
23+
- Automatic CRC and pad generation options for receive frames
24+
- MDIO master interface for PHY device configuration and management
25+
26+
The GMAC Registers consists of two parts
27+
- APB registers are used to configure clock frequency/clock enable/clock
28+
direction/PHY interface type.
29+
- AHB registers are use to configure GMAC core (DesignWare Core part).
30+
GMAC core register consists of DMA registers and GMAC registers.
31+
32+
select:
33+
properties:
34+
compatible:
35+
contains:
36+
enum:
37+
- thead,th1520-gmac
38+
required:
39+
- compatible
40+
41+
allOf:
42+
- $ref: snps,dwmac.yaml#
43+
44+
properties:
45+
compatible:
46+
items:
47+
- enum:
48+
- thead,th1520-gmac
49+
- const: snps,dwmac-3.70a
50+
51+
reg:
52+
items:
53+
- description: DesignWare GMAC IP core registers
54+
- description: GMAC APB registers
55+
56+
reg-names:
57+
items:
58+
- const: dwmac
59+
- const: apb
60+
61+
clocks:
62+
items:
63+
- description: GMAC main clock
64+
- description: Peripheral registers interface clock
65+
66+
clock-names:
67+
items:
68+
- const: stmmaceth
69+
- const: pclk
70+
71+
interrupts:
72+
items:
73+
- description: Combined signal for various interrupt events
74+
75+
interrupt-names:
76+
items:
77+
- const: macirq
78+
79+
required:
80+
- clocks
81+
- clock-names
82+
83+
unevaluatedProperties: false
84+
85+
examples:
86+
- |
87+
gmac0: ethernet@e7070000 {
88+
compatible = "thead,th1520-gmac", "snps,dwmac-3.70a";
89+
reg = <0xe7070000 0x2000>, <0xec003000 0x1000>;
90+
reg-names = "dwmac", "apb";
91+
clocks = <&clk 1>, <&clk 2>;
92+
clock-names = "stmmaceth", "pclk";
93+
interrupts = <66>;
94+
interrupt-names = "macirq";
95+
phy-mode = "rgmii-id";
96+
snps,fixed-burst;
97+
snps,axi-config = <&stmmac_axi_setup>;
98+
snps,pbl = <32>;
99+
phy-handle = <&phy0>;
100+
101+
mdio {
102+
#address-cells = <1>;
103+
#size-cells = <0>;
104+
compatible = "snps,dwmac-mdio";
105+
106+
phy0: ethernet-phy@0 {
107+
reg = <0>;
108+
};
109+
};
110+
};

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19845,8 +19845,10 @@ L: [email protected]
1984519845
S: Maintained
1984619846
T: git https://github.com/pdp7/linux.git
1984719847
F: Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml
19848+
F: Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
1984819849
F: arch/riscv/boot/dts/thead/
1984919850
F: drivers/clk/thead/clk-th1520-ap.c
19851+
F: drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c
1985019852
F: include/dt-bindings/clock/thead,th1520-clk-ap.h
1985119853

1985219854
RNBD BLOCK DRIVERS

drivers/net/ethernet/stmicro/stmmac/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,16 @@ config DWMAC_SUN8I
228228
stmmac device driver. This driver is used for H3/A83T/A64
229229
EMAC ethernet controller.
230230

231+
config DWMAC_THEAD
232+
tristate "T-HEAD dwmac support"
233+
depends on OF && (ARCH_THEAD || COMPILE_TEST)
234+
help
235+
Support for ethernet controllers on T-HEAD RISC-V SoCs
236+
237+
This selects the T-HEAD platform specific glue layer support for
238+
the stmmac device driver. This driver is used for T-HEAD TH1520
239+
ethernet controller.
240+
231241
config DWMAC_IMX8
232242
tristate "NXP IMX8 DWMAC support"
233243
default ARCH_MXC

drivers/net/ethernet/stmicro/stmmac/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o
2828
obj-$(CONFIG_DWMAC_STM32) += dwmac-stm32.o
2929
obj-$(CONFIG_DWMAC_SUNXI) += dwmac-sunxi.o
3030
obj-$(CONFIG_DWMAC_SUN8I) += dwmac-sun8i.o
31+
obj-$(CONFIG_DWMAC_THEAD) += dwmac-thead.o
3132
obj-$(CONFIG_DWMAC_DWC_QOS_ETH) += dwmac-dwc-qos-eth.o
3233
obj-$(CONFIG_DWMAC_INTEL_PLAT) += dwmac-intel-plat.o
3334
obj-$(CONFIG_DWMAC_LOONGSON1) += dwmac-loongson1.o

0 commit comments

Comments
 (0)