2020-04-29 20:50:11

by Priit Laes

[permalink] [raw]
Subject: [PATCH v2 0/6] ARM: sunxi: Convert A20/A31 GMAC driver to use CCU

This serie converts Allwinner A20 and A31 GMAC driver to CCU
while still retaining compatibility with existing devicetrees.

This patchset touches 3 areas:
- sun7i and sun6i CCUs now set up regmap to allow dwmac-sunxi driver
to properly access the GMAC clock register.
- dwmac-sunxi can now handle syscon-based clock register to handle
clock itself.
- sun7i and sun6i devicetrees are converted to use the new syscon-based
access.

Changes since v1:
* Use CLK_OF_DECLARE_DRIVER to make it possible to probe again and set up
regmap using platform device probe.
* Clarify the meaning of "legacy" in dwmac-sunxi driver.
* Make sure we don't mess with the RX/TX delay settings when updating
clock registers.
* Update devicetree bindings
* Add sun6i-A31 support. (not tested due to lack of hardware)

Priit Laes (6):
clk: sunxi-ng: a20: Register regmap for sun7i CCU
clk: sunxi-ng: a31: Register regmap for sun6i CCU
net: stmmac: dwmac-sunxi: Implement syscon-based clock handling
dt-bindings: net: sun7i-gmac: Add syscon support
ARM: dts: sun7i: Use syscon-based implementation for gmac
ARM: dts: sun6i: Use syscon-based implementation for gmac

.../net/allwinner,sun7i-a20-gmac.yaml | 15 +-
arch/arm/boot/dts/sun6i-a31.dtsi | 35 +----
arch/arm/boot/dts/sun7i-a20.dtsi | 36 +----
drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 60 +++++++-
drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 60 +++++++-
.../net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 130 ++++++++++++++++--
6 files changed, 258 insertions(+), 78 deletions(-)

--
2.26.2


2020-04-29 20:52:06

by Priit Laes

[permalink] [raw]
Subject: [PATCH v2 4/6] dt-bindings: net: sun7i-gmac: Add syscon support

Now that driver supports syscon-based regmap access, document also the
devicetree binding.

Signed-off-by: Priit Laes <[email protected]>
---
.../bindings/net/allwinner,sun7i-a20-gmac.yaml | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
index 703d0d886884..c41d7c598c19 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
@@ -29,17 +29,26 @@ properties:
clocks:
items:
- description: GMAC main clock
+
+ # Deprecated
- description: TX clock

clock-names:
items:
- const: stmmaceth
+
+ # Deprecated
- const: allwinner_gmac_tx

phy-supply:
description:
PHY regulator

+ syscon:
+ $ref: /schemas/types.yaml#definitions/phandle
+ description:
+ Phandle to the device containing the GMAC clock register
+
required:
- compatible
- reg
@@ -48,6 +57,7 @@ required:
- clocks
- clock-names
- phy-mode
+ - syscon

unevaluatedProperties: false

@@ -55,11 +65,12 @@ examples:
- |
gmac: ethernet@1c50000 {
compatible = "allwinner,sun7i-a20-gmac";
+ syscon = <&syscon>;
reg = <0x01c50000 0x10000>;
interrupts = <0 85 1>;
interrupt-names = "macirq";
- clocks = <&ahb_gates 49>, <&gmac_tx>;
- clock-names = "stmmaceth", "allwinner_gmac_tx";
+ clocks = <&ahb_gates 49>;
+ clock-names = "stmmaceth";
phy-mode = "mii";
};

--
2.26.2