diff mbox

[1/3] net: stmmac: dwmac-sun8i: drop V3s compatible and add V3 one

Message ID 20180202180456.60378-2-icenowy@aosc.io (mailing list archive)
State New, archived
Headers show

Commit Message

Icenowy Zheng Feb. 2, 2018, 6:04 p.m. UTC
The V3s is just a differently packaged version of the V3 chip, which has
a MAC with the same capability with H3. The V3s just doesn't wire out
the external MII/RMII/RGMII bus. (V3 wired out it).

Drop the compatible string of V3s in the dwmac-sun8i driver, and add a
V3 compatible string, which has all capabilities.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 Documentation/devicetree/bindings/net/dwmac-sun8i.txt | 10 +++++-----
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c     | 10 ++++++----
 2 files changed, 11 insertions(+), 9 deletions(-)

Comments

Maxime Ripard Feb. 2, 2018, 10:13 p.m. UTC | #1
On Sat, Feb 03, 2018 at 02:04:54AM +0800, Icenowy Zheng wrote:
> The V3s is just a differently packaged version of the V3 chip, which has
> a MAC with the same capability with H3. The V3s just doesn't wire out
> the external MII/RMII/RGMII bus. (V3 wired out it).
> 
> Drop the compatible string of V3s in the dwmac-sun8i driver, and add a
> V3 compatible string, which has all capabilities.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>

This breaks the DT ABI, so NAK.

Maxime
Julian Calaby Feb. 3, 2018, 6 a.m. UTC | #2
Hi Icenowy,

On Sat, Feb 3, 2018 at 5:04 AM, Icenowy Zheng <icenowy@aosc.io> wrote:
> The V3s is just a differently packaged version of the V3 chip, which has
> a MAC with the same capability with H3. The V3s just doesn't wire out
> the external MII/RMII/RGMII bus. (V3 wired out it).
>
> Drop the compatible string of V3s in the dwmac-sun8i driver, and add a
> V3 compatible string, which has all capabilities.

Aren't compatible strings technically API, so don't we need to support
those that are out in the wild "forever"?

Therefore shouldn't we leave the v3s variant around for compatibility
with existing device trees?

Thanks,
Icenowy Zheng Feb. 3, 2018, 7:21 a.m. UTC | #3
于 2018年2月3日 GMT+08:00 下午2:00:33, Julian Calaby <julian.calaby@gmail.com> 写到:
>Hi Icenowy,
>
>On Sat, Feb 3, 2018 at 5:04 AM, Icenowy Zheng <icenowy@aosc.io> wrote:
>> The V3s is just a differently packaged version of the V3 chip, which
>has
>> a MAC with the same capability with H3. The V3s just doesn't wire out
>> the external MII/RMII/RGMII bus. (V3 wired out it).
>>
>> Drop the compatible string of V3s in the dwmac-sun8i driver, and add
>a
>> V3 compatible string, which has all capabilities.
>
>Aren't compatible strings technically API, so don't we need to support
>those that are out in the wild "forever"?
>
>Therefore shouldn't we leave the v3s variant around for compatibility
>with existing device trees?

You can run grep at arch/arm/boot/dts, this compatible
string is not used at all.

>
>Thanks,
Icenowy Zheng Feb. 3, 2018, 7:23 a.m. UTC | #4
于 2018年2月3日 GMT+08:00 上午6:13:01, Maxime Ripard <maxime.ripard@bootlin.com> 写到:
>On Sat, Feb 03, 2018 at 02:04:54AM +0800, Icenowy Zheng wrote:
>> The V3s is just a differently packaged version of the V3 chip, which
>has
>> a MAC with the same capability with H3. The V3s just doesn't wire out
>> the external MII/RMII/RGMII bus. (V3 wired out it).
>> 
>> Drop the compatible string of V3s in the dwmac-sun8i driver, and add
>a
>> V3 compatible string, which has all capabilities.
>> 
>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>
>This breaks the DT ABI, so NAK.

I have asked this at IRC.

The V3s compatible string is never used in any mainline
kernel, even not in any RC version.

>
>Maxime
Maxime Ripard Feb. 5, 2018, 1:39 p.m. UTC | #5
Hi,

On Sat, Feb 03, 2018 at 03:23:28PM +0800, Icenowy Zheng wrote:
> 于 2018年2月3日 GMT+08:00 上午6:13:01, Maxime Ripard <maxime.ripard@bootlin.com> 写到:
> >On Sat, Feb 03, 2018 at 02:04:54AM +0800, Icenowy Zheng wrote:
> >> The V3s is just a differently packaged version of the V3 chip, which
> >has
> >> a MAC with the same capability with H3. The V3s just doesn't wire out
> >> the external MII/RMII/RGMII bus. (V3 wired out it).
> >> 
> >> Drop the compatible string of V3s in the dwmac-sun8i driver, and add
> >a
> >> V3 compatible string, which has all capabilities.
> >> 
> >> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> >
> >This breaks the DT ABI, so NAK.
> 
> I have asked this at IRC.

One more reason why no one should ask questions like this on IRC.

> The V3s compatible string is never used in any mainline
> kernel, even not in any RC version.

$ git grep allwinner,sun8i-v3s-emac v4.15 | wc -l 
5

It is there already, and the fact that we have or don't have a DT in
tree that use it doesn't matter. One could very well have written a DT
for it and never submitted it.

Maxime
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
index 3d6d5fa0c4d5..158124e8ee71 100644
--- a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
+++ b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
@@ -7,7 +7,7 @@  Required properties:
 - compatible: must be one of the following string:
 		"allwinner,sun8i-a83t-emac"
 		"allwinner,sun8i-h3-emac"
-		"allwinner,sun8i-v3s-emac"
+		"allwinner,sun8i-v3-emac"
 		"allwinner,sun50i-a64-emac"
 - reg: address and length of the register for the device.
 - interrupts: interrupt for the device
@@ -23,7 +23,7 @@  Required properties:
 - syscon: A phandle to the syscon of the SoC with one of the following
  compatible string:
   - allwinner,sun8i-h3-system-controller
-  - allwinner,sun8i-v3s-system-controller
+  - allwinner,sun8i-v3-system-controller
   - allwinner,sun50i-a64-system-controller
   - allwinner,sun8i-a83t-system-controller
 
@@ -35,7 +35,7 @@  external PHY.
 
 Optional properties for the following compatibles:
   - "allwinner,sun8i-h3-emac",
-  - "allwinner,sun8i-v3s-emac":
+  - "allwinner,sun8i-v3-emac":
 - allwinner,leds-active-low: EPHY LEDs are active low
 
 Required child node of emac:
@@ -51,7 +51,7 @@  of the mdio node. See phy.txt for the generic PHY bindings.
 The following compatibles require that the emac node have a mdio-mux child
 node called "mdio-mux":
   - "allwinner,sun8i-h3-emac"
-  - "allwinner,sun8i-v3s-emac":
+  - "allwinner,sun8i-v3-emac":
 Required properties for the mdio-mux node:
   - compatible = "allwinner,sun8i-h3-mdio-mux"
   - mdio-parent-bus: a phandle to EMAC mdio
@@ -64,7 +64,7 @@  Required properties for the mdio-mux children node:
 The following compatibles require a PHY node representing the integrated
 PHY, under the integrated MDIO bus node if an mdio-mux node is used:
   - "allwinner,sun8i-h3-emac",
-  - "allwinner,sun8i-v3s-emac":
+  - "allwinner,sun8i-v3-emac":
 
 Additional information regarding generic multiplexer properties can be found
 at Documentation/devicetree/bindings/net/mdio-mux.txt
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index a3fa65b1ca8e..fd0519cf27b9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -84,10 +84,12 @@  static const struct emac_variant emac_variant_h3 = {
 	.support_rgmii = true
 };
 
-static const struct emac_variant emac_variant_v3s = {
+static const struct emac_variant emac_variant_v3 = {
 	.default_syscon_value = 0x38000,
 	.soc_has_internal_phy = true,
-	.support_mii = true
+	.support_mii = true,
+	.support_rmii = true,
+	.support_rgmii = true
 };
 
 static const struct emac_variant emac_variant_a83t = {
@@ -1074,8 +1076,8 @@  return ret;
 static const struct of_device_id sun8i_dwmac_match[] = {
 	{ .compatible = "allwinner,sun8i-h3-emac",
 		.data = &emac_variant_h3 },
-	{ .compatible = "allwinner,sun8i-v3s-emac",
-		.data = &emac_variant_v3s },
+	{ .compatible = "allwinner,sun8i-v3-emac",
+		.data = &emac_variant_v3 },
 	{ .compatible = "allwinner,sun8i-a83t-emac",
 		.data = &emac_variant_a83t },
 	{ .compatible = "allwinner,sun50i-a64-emac",