Skip to content

Commit

Permalink
Merge branch 'Ingenic-SOC-mac-support'
Browse files Browse the repository at this point in the history
Zhou Yanjie says:

====================
Add Ingenic SoCs MAC support.

v2->v3:
1.Add "ingenic,mac.yaml" for Ingenic SoCs.
2.Change tx clk delay and rx clk delay from hardware value to ps.
3.return -EINVAL when a unsupported value is encountered when
  parsing the binding.
4.Simplify the code of the RGMII part of X2000 SoC according to
  Andrew Lunn’s suggestion.
5.Follow the example of "dwmac-mediatek.c" to improve the code
  that handles delays according to Andrew Lunn’s suggestion.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 14, 2021
2 parents 0a84a82 + 2bb4b98 commit ed0141d
Show file tree
Hide file tree
Showing 5 changed files with 501 additions and 0 deletions.
76 changes: 76 additions & 0 deletions Documentation/devicetree/bindings/net/ingenic,mac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/ingenic,mac.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Bindings for MAC in Ingenic SoCs

maintainers:
- 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>

description:
The Ethernet Media Access Controller in Ingenic SoCs.

properties:
compatible:
enum:
- ingenic,jz4775-mac
- ingenic,x1000-mac
- ingenic,x1600-mac
- ingenic,x1830-mac
- ingenic,x2000-mac

reg:
maxItems: 1

interrupts:
maxItems: 1

interrupt-names:
const: macirq

clocks:
maxItems: 1

clock-names:
const: stmmaceth

mode-reg:
description: An extra syscon register that control ethernet interface and timing delay

rx-clk-delay-ps:
description: RGMII receive clock delay defined in pico seconds

tx-clk-delay-ps:
description: RGMII transmit clock delay defined in pico seconds

required:
- compatible
- reg
- interrupts
- interrupt-names
- clocks
- clock-names
- mode-reg

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/x1000-cgu.h>
mac: ethernet@134b0000 {
compatible = "ingenic,x1000-mac", "snps,dwmac";
reg = <0x134b0000 0x2000>;
interrupt-parent = <&intc>;
interrupts = <55>;
interrupt-names = "macirq";
clocks = <&cgu X1000_CLK_MAC>;
clock-names = "stmmaceth";
mode-reg = <&mac_phy_ctrl>;
};
...
15 changes: 15 additions & 0 deletions Documentation/devicetree/bindings/net/snps,dwmac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ properties:
- amlogic,meson8m2-dwmac
- amlogic,meson-gxbb-dwmac
- amlogic,meson-axg-dwmac
- ingenic,jz4775-mac
- ingenic,x1000-mac
- ingenic,x1600-mac
- ingenic,x1830-mac
- ingenic,x2000-mac
- rockchip,px30-gmac
- rockchip,rk3128-gmac
- rockchip,rk3228-gmac
Expand Down Expand Up @@ -310,6 +315,11 @@ allOf:
- allwinner,sun8i-r40-emac
- allwinner,sun8i-v3s-emac
- allwinner,sun50i-a64-emac
- ingenic,jz4775-mac
- ingenic,x1000-mac
- ingenic,x1600-mac
- ingenic,x1830-mac
- ingenic,x2000-mac
- snps,dwxgmac
- snps,dwxgmac-2.10
- st,spear600-gmac
Expand Down Expand Up @@ -353,6 +363,11 @@ allOf:
- allwinner,sun8i-r40-emac
- allwinner,sun8i-v3s-emac
- allwinner,sun50i-a64-emac
- ingenic,jz4775-mac
- ingenic,x1000-mac
- ingenic,x1600-mac
- ingenic,x1830-mac
- ingenic,x2000-mac
- snps,dwmac-4.00
- snps,dwmac-4.10a
- snps,dwmac-4.20a
Expand Down
12 changes: 12 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ config DWMAC_ANARION

This selects the Anarion SoC glue layer support for the stmmac driver.

config DWMAC_INGENIC
tristate "Ingenic MAC support"
default MACH_INGENIC
depends on OF && HAS_IOMEM && (MACH_INGENIC || COMPILE_TEST)
select MFD_SYSCON
help
Support for ethernet controller on Ingenic SoCs.

This selects Ingenic SoCs glue layer support for the stmmac
device driver. This driver is used on for the Ingenic SoCs
MAC ethernet controller.

config DWMAC_IPQ806X
tristate "QCA IPQ806x DWMAC support"
default ARCH_QCOM
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ stmmac-$(CONFIG_STMMAC_SELFTESTS) += stmmac_selftests.o
# Ordering matters. Generic driver must be last.
obj-$(CONFIG_STMMAC_PLATFORM) += stmmac-platform.o
obj-$(CONFIG_DWMAC_ANARION) += dwmac-anarion.o
obj-$(CONFIG_DWMAC_INGENIC) += dwmac-ingenic.o
obj-$(CONFIG_DWMAC_IPQ806X) += dwmac-ipq806x.o
obj-$(CONFIG_DWMAC_LPC18XX) += dwmac-lpc18xx.o
obj-$(CONFIG_DWMAC_MEDIATEK) += dwmac-mediatek.o
Expand Down
Loading

0 comments on commit ed0141d

Please sign in to comment.