Skip to content

Commit 10f7903

Browse files
committed
Merge branch 'mediatek-eth'
John Crispin says: ==================== net-next: mediatek: add ethernet driver This series adds support for the Mediatek ethernet core found on current ARM based SoCs. The driver works on MT2701 and MT7623 SoCs Instead of trying to upstream everything at once I decided to concentrate on the important parts required to make current generation silicon work. The V3 series only includes the code required to make dual MAC setups work and only supports the newer QDMA engine. Changes in V5 * reduce the mdio timeut to HZ * add a call to usleep_range() which schedules in the background. Changes in V4 * remove ugly _FE macro, use offsetof() instead Changes in V3 * only include code for MT2701/7623 support * drop support for PDMA and older MIPS based SoCs * drop switch support Changes in V2 * change the namespace of the functions from fe_* to mtk_* * add support for the latest generation of ARM SoCs * add dual MAC support * remove the swconfig specific bits * remove most of the magic values and replace them with defines * add verbose descriptions to the patches ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 0476189 + 0c272fc commit 10f7903

File tree

8 files changed

+2336
-0
lines changed

8 files changed

+2336
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
MediaTek Frame Engine Ethernet controller
2+
=========================================
3+
4+
The frame engine ethernet controller can be found on MediaTek SoCs. These SoCs
5+
have dual GMAC each represented by a child node..
6+
7+
* Ethernet controller node
8+
9+
Required properties:
10+
- compatible: Should be "mediatek,mt7623-eth"
11+
- reg: Address and length of the register set for the device
12+
- interrupts: Should contain the frame engines interrupt
13+
- clocks: the clock used by the core
14+
- clock-names: the names of the clock listed in the clocks property. These are
15+
"ethif", "esw", "gp2", "gp1"
16+
- power-domains: phandle to the power domain that the ethernet is part of
17+
- resets: Should contain a phandle to the ethsys reset signal
18+
- reset-names: Should contain the reset signal name "eth"
19+
- mediatek,ethsys: phandle to the syscon node that handles the port setup
20+
- mediatek,pctl: phandle to the syscon node that handles the ports slew rate
21+
and driver current
22+
23+
Optional properties:
24+
- interrupt-parent: Should be the phandle for the interrupt controller
25+
that services interrupts for this device
26+
27+
28+
* Ethernet MAC node
29+
30+
Required properties:
31+
- compatible: Should be "mediatek,eth-mac"
32+
- reg: The number of the MAC
33+
- phy-handle: see ethernet.txt file in the same directory.
34+
35+
Example:
36+
37+
eth: ethernet@1b100000 {
38+
compatible = "mediatek,mt7623-eth";
39+
reg = <0 0x1b100000 0 0x20000>;
40+
clocks = <&topckgen CLK_TOP_ETHIF_SEL>,
41+
<&ethsys CLK_ETHSYS_ESW>,
42+
<&ethsys CLK_ETHSYS_GP2>,
43+
<&ethsys CLK_ETHSYS_GP1>;
44+
clock-names = "ethif", "esw", "gp2", "gp1";
45+
interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_LOW>;
46+
power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>;
47+
resets = <&ethsys MT2701_ETHSYS_ETH_RST>;
48+
reset-names = "eth";
49+
mediatek,ethsys = <&ethsys>;
50+
mediatek,pctl = <&syscfg_pctl_a>;
51+
#address-cells = <1>;
52+
#size-cells = <0>;
53+
54+
gmac1: mac@0 {
55+
compatible = "mediatek,eth-mac";
56+
reg = <0>;
57+
phy-handle = <&phy0>;
58+
};
59+
60+
gmac2: mac@1 {
61+
compatible = "mediatek,eth-mac";
62+
reg = <1>;
63+
phy-handle = <&phy1>;
64+
};
65+
66+
mdio-bus {
67+
phy0: ethernet-phy@0 {
68+
reg = <0>;
69+
phy-mode = "rgmii";
70+
};
71+
72+
phy1: ethernet-phy@1 {
73+
reg = <1>;
74+
phy-mode = "rgmii";
75+
};
76+
};
77+
};

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7035,6 +7035,13 @@ F: include/uapi/linux/meye.h
70357035
F: include/uapi/linux/ivtv*
70367036
F: include/uapi/linux/uvcvideo.h
70377037

7038+
MEDIATEK ETHERNET DRIVER
7039+
M: Felix Fietkau <[email protected]>
7040+
M: John Crispin <[email protected]>
7041+
7042+
S: Maintained
7043+
F: drivers/net/ethernet/mediatek/
7044+
70387045
MEDIATEK MT7601U WIRELESS LAN DRIVER
70397046
M: Jakub Kicinski <[email protected]>
70407047

drivers/net/ethernet/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ config LANTIQ_ETOP
106106
Support for the MII0 inside the Lantiq SoC
107107

108108
source "drivers/net/ethernet/marvell/Kconfig"
109+
source "drivers/net/ethernet/mediatek/Kconfig"
109110
source "drivers/net/ethernet/mellanox/Kconfig"
110111
source "drivers/net/ethernet/micrel/Kconfig"
111112
source "drivers/net/ethernet/microchip/Kconfig"

drivers/net/ethernet/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ obj-$(CONFIG_JME) += jme.o
4646
obj-$(CONFIG_KORINA) += korina.o
4747
obj-$(CONFIG_LANTIQ_ETOP) += lantiq_etop.o
4848
obj-$(CONFIG_NET_VENDOR_MARVELL) += marvell/
49+
obj-$(CONFIG_NET_VENDOR_MEDIATEK) += mediatek/
4950
obj-$(CONFIG_NET_VENDOR_MELLANOX) += mellanox/
5051
obj-$(CONFIG_NET_VENDOR_MICREL) += micrel/
5152
obj-$(CONFIG_NET_VENDOR_MICROCHIP) += microchip/

drivers/net/ethernet/mediatek/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
config NET_VENDOR_MEDIATEK
2+
bool "MediaTek ethernet driver"
3+
depends on ARCH_MEDIATEK
4+
---help---
5+
If you have a Mediatek SoC with ethernet, say Y.
6+
7+
if NET_VENDOR_MEDIATEK
8+
9+
config NET_MEDIATEK_SOC
10+
tristate "MediaTek MT7623 Gigabit ethernet support"
11+
depends on NET_VENDOR_MEDIATEK && (MACH_MT7623 || MACH_MT2701)
12+
select PHYLIB
13+
---help---
14+
This driver supports the gigabit ethernet MACs in the
15+
MediaTek MT2701/MT7623 chipset family.
16+
17+
endif #NET_VENDOR_MEDIATEK
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Makefile for the Mediatek SoCs built-in ethernet macs
3+
#
4+
5+
obj-$(CONFIG_NET_MEDIATEK_SOC) += mtk_eth_soc.o

0 commit comments

Comments
 (0)