-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'net-stmmac-add-support-for-rzn1-gmac-devices'
Romain Gantois says: ==================== net: stmmac: Add support for RZN1 GMAC devices This is version seven of my series that adds support for a Gigabit Ethernet controller featured in the Renesas r9a06g032 SoC, of the RZ/N1 family. This GMAC device is based on a Synopsys IP and is compatible with the stmmac driver. My former colleague Clément Léger originally sent a series for this driver, but an issue in bringing up the PCS clock had blocked the upstreaming process. This issue has since been resolved by the following series: https://lore.kernel.org/all/[email protected]/ This series consists of a devicetree binding describing the RZN1 GMAC controller IP, a node for the GMAC1 device in the r9a06g032 SoC device tree, and the GMAC driver itself which is a glue layer in stmmac. There are also two patches by Russell that improve pcs initialization handling in stmmac. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
- Loading branch information
Showing
10 changed files
with
272 additions
and
77 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) | ||
%YAML 1.2 | ||
--- | ||
$id: http://devicetree.org/schemas/net/renesas,rzn1-gmac.yaml# | ||
$schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
||
title: Renesas GMAC | ||
|
||
maintainers: | ||
- Romain Gantois <[email protected]> | ||
|
||
select: | ||
properties: | ||
compatible: | ||
contains: | ||
enum: | ||
- renesas,r9a06g032-gmac | ||
- renesas,rzn1-gmac | ||
required: | ||
- compatible | ||
|
||
allOf: | ||
- $ref: snps,dwmac.yaml# | ||
|
||
properties: | ||
compatible: | ||
items: | ||
- enum: | ||
- renesas,r9a06g032-gmac | ||
- const: renesas,rzn1-gmac | ||
- const: snps,dwmac | ||
|
||
pcs-handle: | ||
description: | ||
phandle pointing to a PCS sub-node compatible with | ||
renesas,rzn1-miic.yaml# | ||
|
||
required: | ||
- compatible | ||
|
||
unevaluatedProperties: false | ||
|
||
examples: | ||
- | | ||
#include <dt-bindings/clock/r9a06g032-sysctrl.h> | ||
#include <dt-bindings/interrupt-controller/arm-gic.h> | ||
ethernet@44000000 { | ||
compatible = "renesas,r9a06g032-gmac", "renesas,rzn1-gmac", "snps,dwmac"; | ||
reg = <0x44000000 0x2000>; | ||
interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>, | ||
<GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>, | ||
<GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; | ||
interrupt-names = "macirq", "eth_wake_irq", "eth_lpi"; | ||
clock-names = "stmmaceth"; | ||
clocks = <&sysctrl R9A06G032_HCLK_GMAC0>; | ||
power-domains = <&sysctrl>; | ||
snps,multicast-filter-bins = <256>; | ||
snps,perfect-filter-entries = <128>; | ||
tx-fifo-depth = <2048>; | ||
rx-fifo-depth = <4096>; | ||
pcs-handle = <&mii_conv1>; | ||
phy-mode = "mii"; | ||
}; | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18874,6 +18874,12 @@ F: include/dt-bindings/net/pcs-rzn1-miic.h | |
F: include/linux/pcs-rzn1-miic.h | ||
F: net/dsa/tag_rzn1_a5psw.c | ||
|
||
RENESAS RZ/N1 DWMAC GLUE LAYER | ||
M: Romain Gantois <[email protected]> | ||
S: Maintained | ||
F: Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml | ||
F: drivers/net/ethernet/stmicro/stmmac/dwmac-rzn1.c | ||
|
||
RENESAS RZ/N1 RTC CONTROLLER DRIVER | ||
M: Miquel Raynal <[email protected]> | ||
L: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
/* | ||
* Copyright (C) 2024 Schneider-Electric | ||
* | ||
* Clément Léger <[email protected]> | ||
*/ | ||
|
||
#include <linux/of.h> | ||
#include <linux/pcs-rzn1-miic.h> | ||
#include <linux/phylink.h> | ||
#include <linux/platform_device.h> | ||
|
||
#include "stmmac_platform.h" | ||
#include "stmmac.h" | ||
|
||
static int rzn1_dwmac_pcs_init(struct stmmac_priv *priv) | ||
{ | ||
struct device_node *np = priv->device->of_node; | ||
struct device_node *pcs_node; | ||
struct phylink_pcs *pcs; | ||
|
||
pcs_node = of_parse_phandle(np, "pcs-handle", 0); | ||
|
||
if (pcs_node) { | ||
pcs = miic_create(priv->device, pcs_node); | ||
of_node_put(pcs_node); | ||
if (IS_ERR(pcs)) | ||
return PTR_ERR(pcs); | ||
|
||
priv->hw->phylink_pcs = pcs; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
static void rzn1_dwmac_pcs_exit(struct stmmac_priv *priv) | ||
{ | ||
if (priv->hw->phylink_pcs) | ||
miic_destroy(priv->hw->phylink_pcs); | ||
} | ||
|
||
static int rzn1_dwmac_probe(struct platform_device *pdev) | ||
{ | ||
struct plat_stmmacenet_data *plat_dat; | ||
struct stmmac_resources stmmac_res; | ||
struct device *dev = &pdev->dev; | ||
int ret; | ||
|
||
ret = stmmac_get_platform_resources(pdev, &stmmac_res); | ||
if (ret) | ||
return ret; | ||
|
||
plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac); | ||
if (IS_ERR(plat_dat)) | ||
return PTR_ERR(plat_dat); | ||
|
||
plat_dat->bsp_priv = plat_dat; | ||
plat_dat->pcs_init = rzn1_dwmac_pcs_init; | ||
plat_dat->pcs_exit = rzn1_dwmac_pcs_exit; | ||
|
||
ret = stmmac_dvr_probe(dev, plat_dat, &stmmac_res); | ||
if (ret) | ||
return ret; | ||
|
||
return 0; | ||
} | ||
|
||
static const struct of_device_id rzn1_dwmac_match[] = { | ||
{ .compatible = "renesas,rzn1-gmac" }, | ||
{ } | ||
}; | ||
MODULE_DEVICE_TABLE(of, rzn1_dwmac_match); | ||
|
||
static struct platform_driver rzn1_dwmac_driver = { | ||
.probe = rzn1_dwmac_probe, | ||
.remove_new = stmmac_pltfr_remove, | ||
.driver = { | ||
.name = "rzn1-dwmac", | ||
.of_match_table = rzn1_dwmac_match, | ||
}, | ||
}; | ||
module_platform_driver(rzn1_dwmac_driver); | ||
|
||
MODULE_AUTHOR("Clément Léger <[email protected]>"); | ||
MODULE_DESCRIPTION("Renesas RZN1 DWMAC specific glue layer"); | ||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.