Skip to content

Commit b9b17de

Browse files
Timur Tabidavem330
authored andcommitted
net: emac: emac gigabit ethernet controller driver
Add support for the Qualcomm Technologies, Inc. EMAC gigabit Ethernet controller. This driver supports the following features: 1) Checksum offload. 2) Interrupt coalescing support. 3) SGMII phy. 4) phylib interface for external phy Based on original work by Niranjana Vishwanathapura <[email protected]> Gilad Avidov <[email protected]> Signed-off-by: Timur Tabi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 04bed14 commit b9b17de

File tree

13 files changed

+3974
-0
lines changed

13 files changed

+3974
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
Qualcomm Technologies EMAC Gigabit Ethernet Controller
2+
3+
This network controller consists of two devices: a MAC and an SGMII
4+
internal PHY. Each device is represented by a device tree node. A phandle
5+
connects the MAC node to its corresponding internal phy node. Another
6+
phandle points to the external PHY node.
7+
8+
Required properties:
9+
10+
MAC node:
11+
- compatible : Should be "qcom,fsm9900-emac".
12+
- reg : Offset and length of the register regions for the device
13+
- interrupts : Interrupt number used by this controller
14+
- mac-address : The 6-byte MAC address. If present, it is the default
15+
MAC address.
16+
- internal-phy : phandle to the internal PHY node
17+
- phy-handle : phandle the the external PHY node
18+
19+
Internal PHY node:
20+
- compatible : Should be "qcom,fsm9900-emac-sgmii" or "qcom,qdf2432-emac-sgmii".
21+
- reg : Offset and length of the register region(s) for the device
22+
- interrupts : Interrupt number used by this controller
23+
24+
The external phy child node:
25+
- reg : The phy address
26+
27+
Example:
28+
29+
FSM9900:
30+
31+
soc {
32+
#address-cells = <1>;
33+
#size-cells = <1>;
34+
35+
emac0: ethernet@feb20000 {
36+
compatible = "qcom,fsm9900-emac";
37+
reg = <0xfeb20000 0x10000>,
38+
<0xfeb36000 0x1000>;
39+
interrupts = <76>;
40+
41+
clocks = <&gcc 0>, <&gcc 1>, <&gcc 3>, <&gcc 4>, <&gcc 5>,
42+
<&gcc 6>, <&gcc 7>;
43+
clock-names = "axi_clk", "cfg_ahb_clk", "high_speed_clk",
44+
"mdio_clk", "tx_clk", "rx_clk", "sys_clk";
45+
46+
internal-phy = <&emac_sgmii>;
47+
48+
phy-handle = <&phy0>;
49+
50+
#address-cells = <1>;
51+
#size-cells = <0>;
52+
phy0: ethernet-phy@0 {
53+
reg = <0>;
54+
};
55+
56+
pinctrl-names = "default";
57+
pinctrl-0 = <&mdio_pins_a>;
58+
};
59+
60+
emac_sgmii: ethernet@feb38000 {
61+
compatible = "qcom,fsm9900-emac-sgmii";
62+
reg = <0xfeb38000 0x1000>;
63+
interrupts = <80>;
64+
};
65+
66+
tlmm: pinctrl@fd510000 {
67+
compatible = "qcom,fsm9900-pinctrl";
68+
69+
mdio_pins_a: mdio {
70+
state {
71+
pins = "gpio123", "gpio124";
72+
function = "mdio";
73+
};
74+
};
75+
};
76+
77+
78+
QDF2432:
79+
80+
soc {
81+
#address-cells = <2>;
82+
#size-cells = <2>;
83+
84+
emac0: ethernet@38800000 {
85+
compatible = "qcom,fsm9900-emac";
86+
reg = <0x0 0x38800000 0x0 0x10000>,
87+
<0x0 0x38816000 0x0 0x1000>;
88+
interrupts = <0 256 4>;
89+
90+
clocks = <&gcc 0>, <&gcc 1>, <&gcc 3>, <&gcc 4>, <&gcc 5>,
91+
<&gcc 6>, <&gcc 7>;
92+
clock-names = "axi_clk", "cfg_ahb_clk", "high_speed_clk",
93+
"mdio_clk", "tx_clk", "rx_clk", "sys_clk";
94+
95+
internal-phy = <&emac_sgmii>;
96+
97+
phy-handle = <&phy0>;
98+
99+
#address-cells = <1>;
100+
#size-cells = <0>;
101+
phy0: ethernet-phy@4 {
102+
reg = <4>;
103+
};
104+
};
105+
106+
emac_sgmii: ethernet@410400 {
107+
compatible = "qcom,qdf2432-emac-sgmii";
108+
reg = <0x0 0x00410400 0x0 0xc00>, /* Base address */
109+
<0x0 0x00410000 0x0 0x400>; /* Per-lane digital */
110+
interrupts = <0 254 1>;
111+
};

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9696,6 +9696,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
96969696
S: Supported
96979697
F: drivers/net/wireless/ath/ath10k/
96989698

9699+
QUALCOMM EMAC GIGABIT ETHERNET DRIVER
9700+
M: Timur Tabi <[email protected]>
9701+
9702+
S: Supported
9703+
F: drivers/net/ethernet/qualcomm/emac/
9704+
96999705
QUALCOMM HEXAGON ARCHITECTURE
97009706
M: Richard Kuo <[email protected]>
97019707

drivers/net/ethernet/qualcomm/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,16 @@ config QCA7000
2424
To compile this driver as a module, choose M here. The module
2525
will be called qcaspi.
2626

27+
config QCOM_EMAC
28+
tristate "Qualcomm Technologies, Inc. EMAC Gigabit Ethernet support"
29+
select CRC32
30+
select PHYLIB
31+
---help---
32+
This driver supports the Qualcomm Technologies, Inc. Gigabit
33+
Ethernet Media Access Controller (EMAC). The controller
34+
supports IEEE 802.3-2002, half-duplex mode at 10/100 Mb/s,
35+
full-duplex mode at 10/100/1000Mb/s, Wake On LAN (WOL) for
36+
low power, Receive-Side Scaling (RSS), and IEEE 1588-2008
37+
Precision Clock Synchronization Protocol.
38+
2739
endif # NET_VENDOR_QUALCOMM

drivers/net/ethernet/qualcomm/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44

55
obj-$(CONFIG_QCA7000) += qcaspi.o
66
qcaspi-objs := qca_spi.o qca_framing.o qca_7k.o qca_debug.o
7+
8+
obj-y += emac/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Makefile for the Qualcomm Technologies, Inc. EMAC Gigabit Ethernet driver
3+
#
4+
5+
obj-$(CONFIG_QCOM_EMAC) += qcom-emac.o
6+
7+
qcom-emac-objs := emac.o emac-mac.o emac-phy.o emac-sgmii.o

0 commit comments

Comments
 (0)