Commit 8bc4caa0 authored by Biju Das's avatar Biju Das Committed by David S. Miller

ravb: Add internal delay hw feature to struct ravb_hw_info

R-Car Gen3 supports TX and RX clock internal delay modes, whereas R-Car
Gen2 and RZ/G2L do not support it.
Add an internal_delay hw feature bit to struct ravb_hw_info to enable this
only for R-Car Gen3.
Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarSergei Shtylyov <sergei.shtylyov@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8912ed25
...@@ -997,6 +997,9 @@ struct ravb_hw_info { ...@@ -997,6 +997,9 @@ struct ravb_hw_info {
int stats_len; int stats_len;
size_t max_rx_len; size_t max_rx_len;
unsigned aligned_tx: 1; unsigned aligned_tx: 1;
/* hardware features */
unsigned internal_delay:1; /* AVB-DMAC has internal delays */
}; };
struct ravb_private { struct ravb_private {
......
...@@ -1936,6 +1936,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info = { ...@@ -1936,6 +1936,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info = {
.chip_id = RCAR_GEN3, .chip_id = RCAR_GEN3,
.stats_len = ARRAY_SIZE(ravb_gstrings_stats), .stats_len = ARRAY_SIZE(ravb_gstrings_stats),
.max_rx_len = RX_BUF_SZ + RAVB_ALIGN - 1, .max_rx_len = RX_BUF_SZ + RAVB_ALIGN - 1,
.internal_delay = 1,
}; };
static const struct ravb_hw_info ravb_gen2_hw_info = { static const struct ravb_hw_info ravb_gen2_hw_info = {
...@@ -2175,7 +2176,7 @@ static int ravb_probe(struct platform_device *pdev) ...@@ -2175,7 +2176,7 @@ static int ravb_probe(struct platform_device *pdev)
/* Request GTI loading */ /* Request GTI loading */
ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI); ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI);
if (priv->chip_id != RCAR_GEN2) { if (info->internal_delay) {
ravb_parse_delay_mode(np, ndev); ravb_parse_delay_mode(np, ndev);
ravb_set_delay_mode(ndev); ravb_set_delay_mode(ndev);
} }
...@@ -2348,6 +2349,7 @@ static int __maybe_unused ravb_resume(struct device *dev) ...@@ -2348,6 +2349,7 @@ static int __maybe_unused ravb_resume(struct device *dev)
{ {
struct net_device *ndev = dev_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct ravb_private *priv = netdev_priv(ndev); struct ravb_private *priv = netdev_priv(ndev);
const struct ravb_hw_info *info = priv->info;
int ret = 0; int ret = 0;
/* If WoL is enabled set reset mode to rearm the WoL logic */ /* If WoL is enabled set reset mode to rearm the WoL logic */
...@@ -2370,7 +2372,7 @@ static int __maybe_unused ravb_resume(struct device *dev) ...@@ -2370,7 +2372,7 @@ static int __maybe_unused ravb_resume(struct device *dev)
/* Request GTI loading */ /* Request GTI loading */
ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI); ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI);
if (priv->chip_id != RCAR_GEN2) if (info->internal_delay)
ravb_set_delay_mode(ndev); ravb_set_delay_mode(ndev);
/* Restore descriptor base address table */ /* Restore descriptor base address table */
......
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