Commit fd8ab76a authored by Simon Horman's avatar Simon Horman Committed by David S. Miller

ravb: TROCR register is only present on R-Car Gen3

Only use the TROCR register on R-Car Gen3 as it is not present on other
SoCs.

Offsets used for the undocumented registers are considered reserved and
should not be written to. After some internal investigation with Renesas it
remains unclear why this driver accesses these fields on R-Car Gen2 but
regardless of what the historical reasons are the current code is
considered incorrect.
Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Reviewed-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d957a7e
...@@ -193,7 +193,7 @@ enum ravb_reg { ...@@ -193,7 +193,7 @@ enum ravb_reg {
GECMR = 0x05b0, GECMR = 0x05b0,
MAHR = 0x05c0, MAHR = 0x05c0,
MALR = 0x05c8, MALR = 0x05c8,
TROCR = 0x0700, /* Undocumented? */ TROCR = 0x0700, /* R-Car Gen3 only */
CEFCR = 0x0740, CEFCR = 0x0740,
FRECR = 0x0748, FRECR = 0x0748,
TSFRCR = 0x0750, TSFRCR = 0x0750,
......
...@@ -1621,8 +1621,10 @@ static struct net_device_stats *ravb_get_stats(struct net_device *ndev) ...@@ -1621,8 +1621,10 @@ static struct net_device_stats *ravb_get_stats(struct net_device *ndev)
stats0 = &priv->stats[RAVB_BE]; stats0 = &priv->stats[RAVB_BE];
stats1 = &priv->stats[RAVB_NC]; stats1 = &priv->stats[RAVB_NC];
nstats->tx_dropped += ravb_read(ndev, TROCR); if (priv->chip_id == RCAR_GEN3) {
ravb_write(ndev, 0, TROCR); /* (write clear) */ nstats->tx_dropped += ravb_read(ndev, TROCR);
ravb_write(ndev, 0, TROCR); /* (write clear) */
}
nstats->rx_packets = stats0->rx_packets + stats1->rx_packets; nstats->rx_packets = stats0->rx_packets + stats1->rx_packets;
nstats->tx_packets = stats0->tx_packets + stats1->tx_packets; nstats->tx_packets = stats0->tx_packets + stats1->tx_packets;
......
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