This patch set adds support for Broadcom's ASP 2.0 Ethernet controller.
Florian Fainelli (1):
dt-bindings: net: Brcm ASP 2.0 Ethernet controller
Justin Chen (4):
dt-bindings: net: brcm,unimac-mdio: Add asp-v2.0
net: bcmasp: Add support for ASP2.0 Ethernet controller
net: phy: mdio-bcm-unimac: Add asp v2.0 support
MAINTAINERS: ASP 2.0 Ethernet driver maintainers
.../devicetree/bindings/net/brcm,asp-v2.0.yaml | 147 ++
.../devicetree/bindings/net/brcm,unimac-mdio.yaml | 1 +
MAINTAINERS | 9 +
drivers/net/ethernet/broadcom/Kconfig | 11 +
drivers/net/ethernet/broadcom/Makefile | 1 +
drivers/net/ethernet/broadcom/asp2/Makefile | 2 +
drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1351 +++++++++++++++++++
drivers/net/ethernet/broadcom/asp2/bcmasp.h | 565 ++++++++
.../net/ethernet/broadcom/asp2/bcmasp_ethtool.c | 628 +++++++++
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 1414 ++++++++++++++++++++
.../net/ethernet/broadcom/asp2/bcmasp_intf_defs.h | 187 +++
drivers/net/mdio/mdio-bcm-unimac.c | 1 +
12 files changed, 4317 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml
create mode 100644 drivers/net/ethernet/broadcom/asp2/Makefile
create mode 100644 drivers/net/ethernet/broadcom/asp2/bcmasp.c
create mode 100644 drivers/net/ethernet/broadcom/asp2/bcmasp.h
create mode 100644 drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c
create mode 100644 drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
create mode 100644 drivers/net/ethernet/broadcom/asp2/bcmasp_intf_defs.h
--
2.7.4
The ASP 2.0 Ethernet controller uses a brcm unimac.
Signed-off-by: Justin Chen <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
---
Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml b/Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml
index f4f4c37..02e1890 100644
--- a/Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml
@@ -20,6 +20,7 @@ properties:
- brcm,genet-mdio-v3
- brcm,genet-mdio-v4
- brcm,genet-mdio-v5
+ - brcm,asp-v2.0-mdio
- brcm,unimac-mdio
reg:
--
2.7.4
Signed-off-by: Justin Chen <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
---
MAINTAINERS | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 7f46153..3ba3ca8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3762,6 +3762,15 @@ F: drivers/net/mdio/mdio-bcm-unimac.c
F: include/linux/platform_data/bcmgenet.h
F: include/linux/platform_data/mdio-bcm-unimac.h
+BROADCOM ASP 2.0 ETHERNET DRIVER
+M: Justin Chen <[email protected]>
+M: Florian Fainelli <[email protected]>
+L: [email protected]
+L: [email protected]
+S: Supported
+F: Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml
+F: drivers/net/ethernet/broadcom/asp2/
+
BROADCOM IPROC ARM ARCHITECTURE
M: Ray Jui <[email protected]>
M: Scott Branden <[email protected]>
--
2.7.4
From: Florian Fainelli <[email protected]>
Add a binding document for the Broadcom ASP 2.0 Ethernet controller.
Signed-off-by: Florian Fainelli <[email protected]>
Signed-off-by: Justin Chen <[email protected]>
---
.../devicetree/bindings/net/brcm,asp-v2.0.yaml | 147 +++++++++++++++++++++
1 file changed, 147 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml
diff --git a/Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml b/Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml
new file mode 100644
index 0000000..bab31d9
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml
@@ -0,0 +1,147 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/net/brcm,asp-v2.0.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Broadcom ASP 2.0 Ethernet controller
+
+maintainers:
+ - Justin Chen <[email protected]>
+ - Florian Fainelli <[email protected]>
+
+description: Broadcom Ethernet controller first introduced with 72165
+
+properties:
+ '#address-cells':
+ const: 1
+ '#size-cells':
+ const: 1
+
+ compatible:
+ enum:
+ - brcm,bcm72165-asp-v2.0
+ - brcm,asp-v2.0
+
+ reg:
+ maxItems: 1
+ description: ASP registers
+
+ ranges: true
+
+ interrupts:
+ minItems: 1
+ maxItems: 3
+ items:
+ - description: RX/TX interrupt
+ - description: Port 0 Wake-on-LAN
+ - description: Port 1 Wake-on-LAN
+
+ clocks:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ description: Phandle to clock controller
+
+ clock-names:
+ const: sw_asp
+
+ brcm,reserved-net-filters-mask:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: bitmap of reserved network filters that the driver will not use.
+
+ mdio:
+ type: object
+ $ref: brcm,unimac-mdio.yaml#
+
+ ethernet-ports:
+ type: object
+ properties:
+ '#address-cells':
+ const: 1
+ '#size-cells':
+ const: 0
+
+ patternProperties:
+ "^port@[0-9]+$":
+ type: object
+
+ $ref: ethernet-controller.yaml#
+
+ properties:
+ reg:
+ maxItems: 1
+ description: Port number
+
+ channel:
+ maxItems: 1
+ description: ASP channel number
+
+ required:
+ - reg
+ - channel
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+ - ranges
+
+additionalProperties: false
+
+examples:
+ - |
+ asp@9c00000 {
+ compatible = "brcm,asp-v2.0";
+ reg = <0x9c00000 0x1fff14>;
+ interrupts = <0x0 0x33 0x4>;
+ ranges;
+ clocks = <&scmi 14>;
+ clock-names = "sw_asp";
+ brcm,reserved-net-filters-mask = <0xff>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ mdio@c614 {
+ compatible = "brcm,asp-v2.0-mdio";
+ reg = <0xc614 0x8>;
+ reg-names = "mdio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ phy0: ethernet-phy@1 {
+ reg = <1>;
+ };
+ };
+
+ mdio@ce14 {
+ compatible = "brcm,asp-v2.0-mdio";
+ reg = <0xce14 0x8>;
+ reg-names = "mdio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ };
+ };
+
+ ethernet-ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ channel = <8>;
+ phy-mode = "rgmii";
+ phy-handle = <&phy0>;
+ };
+
+ port@1 {
+ reg = <1>;
+ channel = <9>;
+ phy-mode = "rgmii";
+ phy-handle = <&phy1>;
+ };
+ };
+ };
--
2.7.4
Signed-off-by: Justin Chen <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
---
drivers/net/mdio/mdio-bcm-unimac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/mdio/mdio-bcm-unimac.c b/drivers/net/mdio/mdio-bcm-unimac.c
index bfc9be2..14202a1 100644
--- a/drivers/net/mdio/mdio-bcm-unimac.c
+++ b/drivers/net/mdio/mdio-bcm-unimac.c
@@ -334,6 +334,7 @@ static SIMPLE_DEV_PM_OPS(unimac_mdio_pm_ops,
unimac_mdio_suspend, unimac_mdio_resume);
static const struct of_device_id unimac_mdio_ids[] = {
+ { .compatible = "brcm,asp-v2.0-mdio", },
{ .compatible = "brcm,genet-mdio-v5", },
{ .compatible = "brcm,genet-mdio-v4", },
{ .compatible = "brcm,genet-mdio-v3", },
--
2.7.4
On Fri, Sep 24, 2021 at 02:44:46PM -0700, Justin Chen wrote:
> This patch set adds support for Broadcom's ASP 2.0 Ethernet controller.
Hi Justin
Does the hardware support L2 switching between the two ports? I'm just
wondering if later this is going to be modified into a switchdev
driver?
Andrew
On Fri, 24 Sep 2021 14:44:47 -0700, Justin Chen wrote:
> From: Florian Fainelli <[email protected]>
>
> Add a binding document for the Broadcom ASP 2.0 Ethernet controller.
>
> Signed-off-by: Florian Fainelli <[email protected]>
> Signed-off-by: Justin Chen <[email protected]>
> ---
> .../devicetree/bindings/net/brcm,asp-v2.0.yaml | 147 +++++++++++++++++++++
> 1 file changed, 147 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml
>
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
./Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml:79:10: [warning] wrong indentation: expected 10 but found 9 (indentation)
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/brcm,asp-v2.0.example.dt.yaml: asp@9c00000: 'mdio@c614', 'mdio@ce14' do not match any of the regexes: 'pinctrl-[0-9]+'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml
Documentation/devicetree/bindings/net/brcm,asp-v2.0.example.dt.yaml:0:0: /example-0/asp@9c00000/mdio@c614: failed to match any schema with compatible: ['brcm,asp-v2.0-mdio']
Documentation/devicetree/bindings/net/brcm,asp-v2.0.example.dt.yaml:0:0: /example-0/asp@9c00000/mdio@ce14: failed to match any schema with compatible: ['brcm,asp-v2.0-mdio']
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1532528
This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit.
On Fri, 24 Sep 2021 14:44:48 -0700, Justin Chen wrote:
> The ASP 2.0 Ethernet controller uses a brcm unimac.
>
> Signed-off-by: Justin Chen <[email protected]>
> Signed-off-by: Florian Fainelli <[email protected]>
> ---
> Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
Running 'make dtbs_check' with the schema in this patch gives the
following warnings. Consider if they are expected or the schema is
incorrect. These may not be new warnings.
Note that it is not yet a requirement to have 0 warnings for dtbs_check.
This will change in the future.
Full log is available here: https://patchwork.ozlabs.org/patch/1532529
mdio@e14: #address-cells:0:0: 1 was expected
arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dt.yaml
arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dt.yaml
arch/arm/boot/dts/bcm2711-rpi-400.dt.yaml
arch/arm/boot/dts/bcm2711-rpi-4-b.dt.yaml
mdio@e14: #size-cells:0:0: 0 was expected
arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dt.yaml
arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dt.yaml
arch/arm/boot/dts/bcm2711-rpi-400.dt.yaml
arch/arm/boot/dts/bcm2711-rpi-4-b.dt.yaml
Hi Andrew,
On 9/25/2021 7:25 AM, Andrew Lunn wrote:
> On Fri, Sep 24, 2021 at 02:44:46PM -0700, Justin Chen wrote:
>> This patch set adds support for Broadcom's ASP 2.0 Ethernet controller.
>
>
> Hi Justin
>
> Does the hardware support L2 switching between the two ports? I'm just
> wondering if later this is going to be modified into a switchdev
> driver?
It does not, these are just a bunch of Ethernet ports sharing a few
resources (clocks, network filters etc.).
--
Florian
On Fri, 24 Sep 2021 14:44:48 -0700, Justin Chen wrote:
> The ASP 2.0 Ethernet controller uses a brcm unimac.
>
> Signed-off-by: Justin Chen <[email protected]>
> Signed-off-by: Florian Fainelli <[email protected]>
> ---
> Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
Acked-by: Rob Herring <[email protected]>