Commit 57ea8506 authored by David S. Miller's avatar David S. Miller

Merge branch 'ti-am65x-cpts-follow-up-dt-bindings-update'

Grygorii Strashko says:

====================
net: ethernet: ti: am65x-cpts: follow up dt bindings update

This series is follow update for  TI A65x/J721E Common platform time sync (CPTS)
driver [1] to implement  DT bindings review comments from
Rob Herring <robh@kernel.org> [2].
 - "reg" and "compatible" properties are made required for CPTS DT nodes which
   also required to change K3 CPSW driver to use of_platform_device_create()
   instead of of_platform_populate() for proper CPTS and MDIO initialization
 - minor DT bindings format changes
 - K3 CPTS example added to K3 MCU CPSW bindings

[1] https://lwn.net/Articles/819313/
[2] https://lwn.net/ml/linux-kernel/20200505040419.GA8509@bogus/
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a8c9baf2 ef2d1363
...@@ -144,7 +144,7 @@ patternProperties: ...@@ -144,7 +144,7 @@ patternProperties:
description: description:
CPSW MDIO bus. CPSW MDIO bus.
"^cpts$": "^cpts@[0-9a-f]+":
type: object type: object
allOf: allOf:
- $ref: "ti,k3-am654-cpts.yaml#" - $ref: "ti,k3-am654-cpts.yaml#"
...@@ -171,6 +171,8 @@ examples: ...@@ -171,6 +171,8 @@ examples:
#include <dt-bindings/pinctrl/k3.h> #include <dt-bindings/pinctrl/k3.h>
#include <dt-bindings/soc/ti,sci_pm_domain.h> #include <dt-bindings/soc/ti,sci_pm_domain.h>
#include <dt-bindings/net/ti-dp83867.h> #include <dt-bindings/net/ti-dp83867.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
mcu_cpsw: ethernet@46000000 { mcu_cpsw: ethernet@46000000 {
compatible = "ti,am654-cpsw-nuss"; compatible = "ti,am654-cpsw-nuss";
...@@ -229,4 +231,15 @@ examples: ...@@ -229,4 +231,15 @@ examples:
ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>; ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
}; };
}; };
cpts@3d000 {
compatible = "ti,am65-cpts";
reg = <0x0 0x3d000 0x0 0x400>;
clocks = <&k3_clks 18 2>;
clock-names = "cpts";
interrupts-extended = <&gic500 GIC_SPI 858 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "cpts";
ti,cpts-ext-ts-inputs = <4>;
ti,cpts-periodic-outputs = <2>;
};
}; };
...@@ -42,7 +42,7 @@ description: |+ ...@@ -42,7 +42,7 @@ description: |+
properties: properties:
$nodename: $nodename:
pattern: "^cpts(@.*|-[0-9a-f])*$" pattern: "^cpts@[0-9a-f]+$"
compatible: compatible:
oneOf: oneOf:
...@@ -52,7 +52,7 @@ properties: ...@@ -52,7 +52,7 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
description: description:
The physical base address and size of CPTS IO range The physical base address and size of CPTS IO range
reg-names: reg-names:
items: items:
...@@ -65,27 +65,27 @@ properties: ...@@ -65,27 +65,27 @@ properties:
items: items:
- const: cpts - const: cpts
interrupts-extended: interrupts:
items: items:
- description: CPTS events interrupt - description: CPTS events interrupt
interrupt-names: interrupt-names:
items: items:
- const: "cpts" - const: cpts
ti,cpts-ext-ts-inputs: ti,cpts-ext-ts-inputs:
allOf: allOf:
- $ref: /schemas/types.yaml#/definitions/uint32 - $ref: /schemas/types.yaml#/definitions/uint32
maximum: 8 maximum: 8
description: description:
Number of hardware timestamp push inputs (HWx_TS_PUSH) Number of hardware timestamp push inputs (HWx_TS_PUSH)
ti,cpts-periodic-outputs: ti,cpts-periodic-outputs:
allOf: allOf:
- $ref: /schemas/types.yaml#/definitions/uint32 - $ref: /schemas/types.yaml#/definitions/uint32
maximum: 8 maximum: 8
description: description:
Number of timestamp Generator function outputs (TS_GENFx) Number of timestamp Generator function outputs (TS_GENFx)
refclk-mux: refclk-mux:
type: object type: object
...@@ -107,9 +107,11 @@ properties: ...@@ -107,9 +107,11 @@ properties:
- clocks - clocks
required: required:
- compatible
- reg
- clocks - clocks
- clock-names - clock-names
- interrupts-extended - interrupts
- interrupt-names - interrupt-names
additionalProperties: false additionalProperties: false
...@@ -140,13 +142,4 @@ examples: ...@@ -140,13 +142,4 @@ examples:
assigned-clock-parents = <&k3_clks 118 11>; assigned-clock-parents = <&k3_clks 118 11>;
}; };
}; };
- |
cpts {
clocks = <&k3_clks 18 2>;
clock-names = "cpts";
interrupts-extended = <&gic500 GIC_SPI 858 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "cpts";
ti,cpts-ext-ts-inputs = <4>;
ti,cpts-periodic-outputs = <2>;
};
...@@ -248,7 +248,9 @@ davinci_mdio: mdio@f00 { ...@@ -248,7 +248,9 @@ davinci_mdio: mdio@f00 {
bus_freq = <1000000>; bus_freq = <1000000>;
}; };
cpts { cpts@3d000 {
compatible = "ti,am65-cpts";
reg = <0x0 0x3d000 0x0 0x400>;
clocks = <&mcu_cpsw_cpts_mux>; clocks = <&mcu_cpsw_cpts_mux>;
clock-names = "cpts"; clock-names = "cpts";
interrupts-extended = <&gic500 GIC_SPI 570 IRQ_TYPE_LEVEL_HIGH>; interrupts-extended = <&gic500 GIC_SPI 570 IRQ_TYPE_LEVEL_HIGH>;
......
...@@ -339,7 +339,9 @@ davinci_mdio: mdio@f00 { ...@@ -339,7 +339,9 @@ davinci_mdio: mdio@f00 {
bus_freq = <1000000>; bus_freq = <1000000>;
}; };
cpts { cpts@3d000 {
compatible = "ti,am65-cpts";
reg = <0x0 0x3d000 0x0 0x400>;
clocks = <&k3_clks 18 2>; clocks = <&k3_clks 18 2>;
clock-names = "cpts"; clock-names = "cpts";
interrupts-extended = <&gic500 GIC_SPI 858 IRQ_TYPE_LEVEL_HIGH>; interrupts-extended = <&gic500 GIC_SPI 858 IRQ_TYPE_LEVEL_HIGH>;
......
...@@ -2031,10 +2031,21 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev) ...@@ -2031,10 +2031,21 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev)
return ret; return ret;
} }
ret = of_platform_populate(dev->of_node, NULL, NULL, dev); node = of_get_child_by_name(dev->of_node, "mdio");
/* We do not want to force this, as in some cases may not have child */ if (!node) {
if (ret) dev_warn(dev, "MDIO node not found\n");
dev_warn(dev, "populating child nodes err:%d\n", ret); } else if (of_device_is_available(node)) {
struct platform_device *mdio_pdev;
mdio_pdev = of_platform_device_create(node, NULL, dev);
if (!mdio_pdev) {
ret = -ENODEV;
goto err_pm_clear;
}
common->mdio_dev = &mdio_pdev->dev;
}
of_node_put(node);
am65_cpsw_nuss_get_ver(common); am65_cpsw_nuss_get_ver(common);
...@@ -2090,7 +2101,8 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev) ...@@ -2090,7 +2101,8 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev)
return 0; return 0;
err_of_clear: err_of_clear:
of_platform_depopulate(dev); of_platform_device_destroy(common->mdio_dev, NULL);
err_pm_clear:
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
pm_runtime_disable(dev); pm_runtime_disable(dev);
return ret; return ret;
...@@ -2115,7 +2127,7 @@ static int am65_cpsw_nuss_remove(struct platform_device *pdev) ...@@ -2115,7 +2127,7 @@ static int am65_cpsw_nuss_remove(struct platform_device *pdev)
*/ */
am65_cpsw_nuss_cleanup_ndev(common); am65_cpsw_nuss_cleanup_ndev(common);
of_platform_depopulate(dev); of_platform_device_destroy(common->mdio_dev, NULL);
pm_runtime_put_sync(&pdev->dev); pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/platform_device.h>
struct am65_cpts; struct am65_cpts;
...@@ -76,6 +77,7 @@ struct am65_cpsw_pdata { ...@@ -76,6 +77,7 @@ struct am65_cpsw_pdata {
struct am65_cpsw_common { struct am65_cpsw_common {
struct device *dev; struct device *dev;
struct device *mdio_dev;
const struct am65_cpsw_pdata *pdata; const struct am65_cpsw_pdata *pdata;
void __iomem *ss_base; void __iomem *ss_base;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment