Commit 5b1ab1ae authored by David S. Miller's avatar David S. Miller

Merge branch 'ravb-remove-use-of-undocumented-registers'

Simon Horman says:

====================
ravb: remove use of undocumented registers

this short series cleans up the RAVB driver a little.

The first patch corrects the spelling of the FBP field of SFO register.
This register field is unused and should have no run-time effect.

The remaining patches remove the use of undocumented registers
after some consultation with the internal Renesas BSP team.

Changes in v2:
* Corrected mangled state of first patch
* Patches 2/4 and 3/4 split out of a large patch
* Accumulated acks
* Tweaked changelog
* Claimed authorship of all patches

v1 of this series was tested on the following platforms.
No behaviour change is expected in v2.
* E3 Ebisu
* H3 Salvator-XS (ES2.0)
* M3-W Salvator-XS
* M3-N Salvator-XS
* RZ/G1C iW-RainboW-G23S
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 7250a9d2 fd8ab76a
...@@ -193,16 +193,12 @@ enum ravb_reg { ...@@ -193,16 +193,12 @@ enum ravb_reg {
GECMR = 0x05b0, GECMR = 0x05b0,
MAHR = 0x05c0, MAHR = 0x05c0,
MALR = 0x05c8, MALR = 0x05c8,
TROCR = 0x0700, /* Undocumented? */ TROCR = 0x0700, /* R-Car Gen3 only */
CDCR = 0x0708, /* Undocumented? */
LCCR = 0x0710, /* Undocumented? */
CEFCR = 0x0740, CEFCR = 0x0740,
FRECR = 0x0748, FRECR = 0x0748,
TSFRCR = 0x0750, TSFRCR = 0x0750,
TLFRCR = 0x0758, TLFRCR = 0x0758,
RFCR = 0x0760, RFCR = 0x0760,
CERCR = 0x0768, /* Undocumented? */
CEECR = 0x0770, /* Undocumented? */
MAFCR = 0x0778, MAFCR = 0x0778,
}; };
...@@ -220,7 +216,6 @@ enum CCC_BIT { ...@@ -220,7 +216,6 @@ enum CCC_BIT {
CCC_CSEL_HPB = 0x00010000, CCC_CSEL_HPB = 0x00010000,
CCC_CSEL_ETH_TX = 0x00020000, CCC_CSEL_ETH_TX = 0x00020000,
CCC_CSEL_GMII_REF = 0x00030000, CCC_CSEL_GMII_REF = 0x00030000,
CCC_BOC = 0x00100000, /* Undocumented? */
CCC_LBME = 0x01000000, CCC_LBME = 0x01000000,
}; };
...@@ -317,7 +312,7 @@ enum UFCD_BIT { ...@@ -317,7 +312,7 @@ enum UFCD_BIT {
/* SFO */ /* SFO */
enum SFO_BIT { enum SFO_BIT {
SFO_FPB = 0x0000003F, SFO_FBP = 0x0000003F,
}; };
/* RTC */ /* RTC */
......
...@@ -447,12 +447,6 @@ static int ravb_dmac_init(struct net_device *ndev) ...@@ -447,12 +447,6 @@ static int ravb_dmac_init(struct net_device *ndev)
ravb_ring_format(ndev, RAVB_BE); ravb_ring_format(ndev, RAVB_BE);
ravb_ring_format(ndev, RAVB_NC); ravb_ring_format(ndev, RAVB_NC);
#if defined(__LITTLE_ENDIAN)
ravb_modify(ndev, CCC, CCC_BOC, 0);
#else
ravb_modify(ndev, CCC, CCC_BOC, CCC_BOC);
#endif
/* Set AVB RX */ /* Set AVB RX */
ravb_write(ndev, ravb_write(ndev,
RCR_EFFS | RCR_ENCF | RCR_ETS0 | RCR_ESF | 0x18000000, RCR); RCR_EFFS | RCR_ENCF | RCR_ETS0 | RCR_ESF | 0x18000000, RCR);
...@@ -1627,17 +1621,10 @@ static struct net_device_stats *ravb_get_stats(struct net_device *ndev) ...@@ -1627,17 +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);
nstats->collisions += ravb_read(ndev, CDCR); ravb_write(ndev, 0, TROCR); /* (write clear) */
ravb_write(ndev, 0, CDCR); /* (write clear) */ }
nstats->tx_carrier_errors += ravb_read(ndev, LCCR);
ravb_write(ndev, 0, LCCR); /* (write clear) */
nstats->tx_carrier_errors += ravb_read(ndev, CERCR);
ravb_write(ndev, 0, CERCR); /* (write clear) */
nstats->tx_carrier_errors += ravb_read(ndev, CEECR);
ravb_write(ndev, 0, CEECR); /* (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