* [PATCH v2 0/3] Add Renesas R8A77980 GEther support @ 2018-05-18 18:28 Sergei Shtylyov 2018-05-18 18:30 ` [PATCH v2 1/1] sh_eth: add RGMII support Sergei Shtylyov ` (3 more replies) 0 siblings, 4 replies; 8+ messages in thread From: Sergei Shtylyov @ 2018-05-18 18:28 UTC (permalink / raw) To: netdev, devicetree, David S. Miller, Rob Herring Cc: Mark Rutland, linux-renesas-soc Hello! Here's a set of 3 patches against DaveM's 'net-next.git' repo. They (gradually) add R8A77980 GEther support to the 'sh_eth' driver, starting with couple new register bits/values introduced with this chip, and ending with adding a new 'struct sh_eth_cpu_data' instance connected to the new DT "compatible" prop value... [1/1] sh_eth: add RGMII support [2/3] sh_eth: add EDMR.NBST support [3/3] sh_eth: add R8A77980 support MBR, Sergei ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/1] sh_eth: add RGMII support 2018-05-18 18:28 [PATCH v2 0/3] Add Renesas R8A77980 GEther support Sergei Shtylyov @ 2018-05-18 18:30 ` Sergei Shtylyov 2018-05-18 19:12 ` Andrew Lunn 2018-05-18 18:31 ` [PATCH v2 2/3] sh_eth: add EDMR.NBST support Sergei Shtylyov ` (2 subsequent siblings) 3 siblings, 1 reply; 8+ messages in thread From: Sergei Shtylyov @ 2018-05-18 18:30 UTC (permalink / raw) To: netdev, David S. Miller; +Cc: linux-renesas-soc The R-Car V3H (AKA R8A77980) GEther controller adds support for the RGMII PHY interface mode as a new value for the RMII_MII register. Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> --- Changes in version 2: - included PHY_INTERFACE_MODE_RGMII_{|RX|TX}ID in the RGMII *case*. drivers/net/ethernet/renesas/sh_eth.c | 3 +++ 1 file changed, 3 insertions(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -466,6 +466,9 @@ static void sh_eth_select_mii(struct net u32 value; switch (mdp->phy_interface) { + case PHY_INTERFACE_MODE_RGMII ... PHY_INTERFACE_MODE_RGMII_TXID: + value = 0x3; + break; case PHY_INTERFACE_MODE_GMII: value = 0x2; break; ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/1] sh_eth: add RGMII support 2018-05-18 18:30 ` [PATCH v2 1/1] sh_eth: add RGMII support Sergei Shtylyov @ 2018-05-18 19:12 ` Andrew Lunn 0 siblings, 0 replies; 8+ messages in thread From: Andrew Lunn @ 2018-05-18 19:12 UTC (permalink / raw) To: Sergei Shtylyov; +Cc: netdev, David S. Miller, linux-renesas-soc On Fri, May 18, 2018 at 09:30:18PM +0300, Sergei Shtylyov wrote: > The R-Car V3H (AKA R8A77980) GEther controller adds support for the RGMII > PHY interface mode as a new value for the RMII_MII register. > > Based on the original (and large) patch by Vladimir Barinov. > > Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> > > --- > Changes in version 2: > - included PHY_INTERFACE_MODE_RGMII_{|RX|TX}ID in the RGMII *case*. > > drivers/net/ethernet/renesas/sh_eth.c | 3 +++ > 1 file changed, 3 insertions(+) > > Index: net-next/drivers/net/ethernet/renesas/sh_eth.c > =================================================================== > --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c > +++ net-next/drivers/net/ethernet/renesas/sh_eth.c > @@ -466,6 +466,9 @@ static void sh_eth_select_mii(struct net > u32 value; > > switch (mdp->phy_interface) { > + case PHY_INTERFACE_MODE_RGMII ... PHY_INTERFACE_MODE_RGMII_TXID: > + value = 0x3; > + break; Ah, your don't see that form used very often. I just checked, clang/llvm should also support it. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] sh_eth: add EDMR.NBST support 2018-05-18 18:28 [PATCH v2 0/3] Add Renesas R8A77980 GEther support Sergei Shtylyov 2018-05-18 18:30 ` [PATCH v2 1/1] sh_eth: add RGMII support Sergei Shtylyov @ 2018-05-18 18:31 ` Sergei Shtylyov 2018-05-18 18:32 ` [PATCH v2 3/3] sh_eth: add R8A77980 support Sergei Shtylyov 2018-05-20 3:25 ` [PATCH v2 0/3] Add Renesas R8A77980 GEther support David Miller 3 siblings, 0 replies; 8+ messages in thread From: Sergei Shtylyov @ 2018-05-18 18:31 UTC (permalink / raw) To: netdev, devicetree, David S. Miller, Rob Herring Cc: Mark Rutland, linux-renesas-soc The R-Car V3H (AKA R8A77980) GEther controller adds the DMA burst mode bit (NBST) in EDMR and the manual tells to always set it before doing any DMA. Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> --- Changes in version 2: - added Simon's tag. drivers/net/ethernet/renesas/sh_eth.c | 4 ++++ drivers/net/ethernet/renesas/sh_eth.h | 2 ++ 2 files changed, 6 insertions(+) Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1434,6 +1434,10 @@ static int sh_eth_dev_init(struct net_de sh_eth_write(ndev, mdp->cd->trscer_err_mask, TRSCER); + /* DMA transfer burst mode */ + if (mdp->cd->nbst) + sh_eth_modify(ndev, EDMR, EDMR_NBST, EDMR_NBST); + if (mdp->cd->bculr) sh_eth_write(ndev, 0x800, BCULR); /* Burst sycle set */ Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -184,6 +184,7 @@ enum GECMR_BIT { /* EDMR */ enum DMAC_M_BIT { + EDMR_NBST = 0x80, EDMR_EL = 0x40, /* Litte endian */ EDMR_DL1 = 0x20, EDMR_DL0 = 0x10, EDMR_SRST_GETHER = 0x03, @@ -505,6 +506,7 @@ struct sh_eth_cpu_data { unsigned bculr:1; /* EtherC have BCULR */ unsigned tsu:1; /* EtherC have TSU */ unsigned hw_swap:1; /* E-DMAC have DE bit in EDMR */ + unsigned nbst:1; /* E-DMAC has NBST bit in EDMR */ unsigned rpadir:1; /* E-DMAC have RPADIR */ unsigned no_trimd:1; /* E-DMAC DO NOT have TRIMD */ unsigned no_ade:1; /* E-DMAC DO NOT have ADE bit in EESR */ ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] sh_eth: add R8A77980 support 2018-05-18 18:28 [PATCH v2 0/3] Add Renesas R8A77980 GEther support Sergei Shtylyov 2018-05-18 18:30 ` [PATCH v2 1/1] sh_eth: add RGMII support Sergei Shtylyov 2018-05-18 18:31 ` [PATCH v2 2/3] sh_eth: add EDMR.NBST support Sergei Shtylyov @ 2018-05-18 18:32 ` Sergei Shtylyov 2018-12-30 17:24 ` Sergei Shtylyov 2018-05-20 3:25 ` [PATCH v2 0/3] Add Renesas R8A77980 GEther support David Miller 3 siblings, 1 reply; 8+ messages in thread From: Sergei Shtylyov @ 2018-05-18 18:32 UTC (permalink / raw) To: netdev, devicetree, David S. Miller, Rob Herring Cc: Mark Rutland, linux-renesas-soc Finally, add support for the DT probing of the R-Car V3H (AKA R8A77980) -- it's the only R-Car gen3 SoC having the GEther controller -- others have only EtherAVB... Based on the original (and large) patch by Vladimir Barinov. Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> --- Changes in version 2: - added Simon's tag. Documentation/devicetree/bindings/net/sh_eth.txt | 1 drivers/net/ethernet/renesas/sh_eth.c | 44 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) Index: net-next/Documentation/devicetree/bindings/net/sh_eth.txt =================================================================== --- net-next.orig/Documentation/devicetree/bindings/net/sh_eth.txt +++ net-next/Documentation/devicetree/bindings/net/sh_eth.txt @@ -14,6 +14,7 @@ Required properties: "renesas,ether-r8a7791" if the device is a part of R8A7791 SoC. "renesas,ether-r8a7793" if the device is a part of R8A7793 SoC. "renesas,ether-r8a7794" if the device is a part of R8A7794 SoC. + "renesas,gether-r8a77980" if the device is a part of R8A77980 SoC. "renesas,ether-r7s72100" if the device is a part of R7S72100 SoC. "renesas,rcar-gen1-ether" for a generic R-Car Gen1 device. "renesas,rcar-gen2-ether" for a generic R-Car Gen2 or RZ/G1 Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -753,6 +753,49 @@ static struct sh_eth_cpu_data rcar_gen2_ .rmiimode = 1, .magic = 1, }; + +/* R8A77980 */ +static struct sh_eth_cpu_data r8a77980_data = { + .soft_reset = sh_eth_soft_reset_gether, + + .set_duplex = sh_eth_set_duplex, + .set_rate = sh_eth_set_rate_gether, + + .register_type = SH_ETH_REG_GIGABIT, + + .edtrr_trns = EDTRR_TRNS_GETHER, + .ecsr_value = ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD | ECSR_MPD, + .ecsipr_value = ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP | + ECSIPR_MPDIP, + .eesipr_value = EESIPR_RFCOFIP | EESIPR_ECIIP | + EESIPR_FTCIP | EESIPR_TDEIP | EESIPR_TFUFIP | + EESIPR_FRIP | EESIPR_RDEIP | EESIPR_RFOFIP | + EESIPR_RMAFIP | EESIPR_RRFIP | + EESIPR_RTLFIP | EESIPR_RTSFIP | + EESIPR_PREIP | EESIPR_CERFIP, + + .tx_check = EESR_FTC | EESR_CD | EESR_RTO, + .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | + EESR_RFE | EESR_RDE | EESR_RFRMER | + EESR_TFE | EESR_TDE | EESR_ECI, + .fdr_value = 0x0000070f, + + .apr = 1, + .mpr = 1, + .tpauser = 1, + .bculr = 1, + .hw_swap = 1, + .nbst = 1, + .rpadir = 1, + .rpadir_value = 2 << 16, + .no_trimd = 1, + .no_ade = 1, + .xdfar_rw = 1, + .hw_checksum = 1, + .select_mii = 1, + .magic = 1, + .cexcr = 1, +}; #endif /* CONFIG_OF */ static void sh_eth_set_rate_sh7724(struct net_device *ndev) @@ -3134,6 +3177,7 @@ static const struct of_device_id sh_eth_ { .compatible = "renesas,ether-r8a7791", .data = &rcar_gen2_data }, { .compatible = "renesas,ether-r8a7793", .data = &rcar_gen2_data }, { .compatible = "renesas,ether-r8a7794", .data = &rcar_gen2_data }, + { .compatible = "renesas,gether-r8a77980", .data = &r8a77980_data }, { .compatible = "renesas,ether-r7s72100", .data = &r7s72100_data }, { .compatible = "renesas,rcar-gen1-ether", .data = &rcar_gen1_data }, { .compatible = "renesas,rcar-gen2-ether", .data = &rcar_gen2_data }, ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/3] sh_eth: add R8A77980 support 2018-05-18 18:32 ` [PATCH v2 3/3] sh_eth: add R8A77980 support Sergei Shtylyov @ 2018-12-30 17:24 ` Sergei Shtylyov 2018-12-30 20:15 ` Sergei Shtylyov 0 siblings, 1 reply; 8+ messages in thread From: Sergei Shtylyov @ 2018-12-30 17:24 UTC (permalink / raw) To: netdev, devicetree, David S. Miller, Rob Herring Cc: Mark Rutland, linux-renesas-soc On 05/18/2018 09:32 PM, Sergei Shtylyov wrote: > Finally, add support for the DT probing of the R-Car V3H (AKA R8A77980) -- > it's the only R-Car gen3 SoC having the GEther controller -- others have > only EtherAVB... > > Based on the original (and large) patch by Vladimir Barinov. > > Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> > Reviewed-by: Simon Horman <horms+renesas@verge.net.au> > [...] > Index: net-next/drivers/net/ethernet/renesas/sh_eth.c > =================================================================== > --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c > +++ net-next/drivers/net/ethernet/renesas/sh_eth.c > @@ -753,6 +753,49 @@ static struct sh_eth_cpu_data rcar_gen2_ > .rmiimode = 1, > .magic = 1, > }; > + > +/* R8A77980 */ > +static struct sh_eth_cpu_data r8a77980_data = { > + .soft_reset = sh_eth_soft_reset_gether, > + > + .set_duplex = sh_eth_set_duplex, > + .set_rate = sh_eth_set_rate_gether, > + > + .register_type = SH_ETH_REG_GIGABIT, > + > + .edtrr_trns = EDTRR_TRNS_GETHER, > + .ecsr_value = ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD | ECSR_MPD, > + .ecsipr_value = ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP | > + ECSIPR_MPDIP, > + .eesipr_value = EESIPR_RFCOFIP | EESIPR_ECIIP | > + EESIPR_FTCIP | EESIPR_TDEIP | EESIPR_TFUFIP | > + EESIPR_FRIP | EESIPR_RDEIP | EESIPR_RFOFIP | > + EESIPR_RMAFIP | EESIPR_RRFIP | > + EESIPR_RTLFIP | EESIPR_RTSFIP | > + EESIPR_PREIP | EESIPR_CERFIP, > + > + .tx_check = EESR_FTC | EESR_CD | EESR_RTO, > + .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | > + EESR_RFE | EESR_RDE | EESR_RFRMER | > + EESR_TFE | EESR_TDE | EESR_ECI, > + .fdr_value = 0x0000070f, > + > + .apr = 1, > + .mpr = 1, > + .tpauser = 1, > + .bculr = 1, > + .hw_swap = 1, > + .nbst = 1, > + .rpadir = 1, > + .rpadir_value = 2 << 16, > + .no_trimd = 1, > + .no_ade = 1, > + .xdfar_rw = 1, > + .hw_checksum = 1, Ugh, the "intelligent" checksum is not actually supported, just a simplistic checksum (from byte 14). I'll send a fix. > + .select_mii = 1, > + .magic = 1, > + .cexcr = 1, > +}; > #endif /* CONFIG_OF */ > > static void sh_eth_set_rate_sh7724(struct net_device *ndev) [...] MBR, Sergei ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/3] sh_eth: add R8A77980 support 2018-12-30 17:24 ` Sergei Shtylyov @ 2018-12-30 20:15 ` Sergei Shtylyov 0 siblings, 0 replies; 8+ messages in thread From: Sergei Shtylyov @ 2018-12-30 20:15 UTC (permalink / raw) To: netdev, devicetree, David S. Miller, Rob Herring Cc: Mark Rutland, linux-renesas-soc On 12/30/2018 08:24 PM, Sergei Shtylyov wrote: >> Finally, add support for the DT probing of the R-Car V3H (AKA R8A77980) -- >> it's the only R-Car gen3 SoC having the GEther controller -- others have >> only EtherAVB... >> >> Based on the original (and large) patch by Vladimir Barinov. >> >> Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> >> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> >> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> >> > [...] >> Index: net-next/drivers/net/ethernet/renesas/sh_eth.c >> =================================================================== >> --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c >> +++ net-next/drivers/net/ethernet/renesas/sh_eth.c >> @@ -753,6 +753,49 @@ static struct sh_eth_cpu_data rcar_gen2_ >> .rmiimode = 1, >> .magic = 1, >> }; >> + >> +/* R8A77980 */ >> +static struct sh_eth_cpu_data r8a77980_data = { >> + .soft_reset = sh_eth_soft_reset_gether, >> + >> + .set_duplex = sh_eth_set_duplex, >> + .set_rate = sh_eth_set_rate_gether, >> + >> + .register_type = SH_ETH_REG_GIGABIT, >> + >> + .edtrr_trns = EDTRR_TRNS_GETHER, >> + .ecsr_value = ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD | ECSR_MPD, >> + .ecsipr_value = ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP | >> + ECSIPR_MPDIP, >> + .eesipr_value = EESIPR_RFCOFIP | EESIPR_ECIIP | >> + EESIPR_FTCIP | EESIPR_TDEIP | EESIPR_TFUFIP | >> + EESIPR_FRIP | EESIPR_RDEIP | EESIPR_RFOFIP | >> + EESIPR_RMAFIP | EESIPR_RRFIP | >> + EESIPR_RTLFIP | EESIPR_RTSFIP | >> + EESIPR_PREIP | EESIPR_CERFIP, >> + >> + .tx_check = EESR_FTC | EESR_CD | EESR_RTO, >> + .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | >> + EESR_RFE | EESR_RDE | EESR_RFRMER | >> + EESR_TFE | EESR_TDE | EESR_ECI, >> + .fdr_value = 0x0000070f, >> + >> + .apr = 1, >> + .mpr = 1, >> + .tpauser = 1, >> + .bculr = 1, >> + .hw_swap = 1, >> + .nbst = 1, >> + .rpadir = 1, >> + .rpadir_value = 2 << 16, >> + .no_trimd = 1, >> + .no_ade = 1, >> + .xdfar_rw = 1, >> + .hw_checksum = 1, > > Ugh, the "intelligent" checksum is not actually supported, just a simplistic > checksum (from byte 14). I'll send a fix. Surprisingly, testing has shown that the manual is wrong and thus "intelligent" checksumming is implemented. When I remove that flag, DHCP doesn't work. >> + .select_mii = 1, >> + .magic = 1, >> + .cexcr = 1, >> +}; >> #endif /* CONFIG_OF */ >> >> static void sh_eth_set_rate_sh7724(struct net_device *ndev) > [...] MBR, Sergei ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/3] Add Renesas R8A77980 GEther support 2018-05-18 18:28 [PATCH v2 0/3] Add Renesas R8A77980 GEther support Sergei Shtylyov ` (2 preceding siblings ...) 2018-05-18 18:32 ` [PATCH v2 3/3] sh_eth: add R8A77980 support Sergei Shtylyov @ 2018-05-20 3:25 ` David Miller 3 siblings, 0 replies; 8+ messages in thread From: David Miller @ 2018-05-20 3:25 UTC (permalink / raw) To: sergei.shtylyov Cc: netdev, devicetree, robh+dt, mark.rutland, linux-renesas-soc From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Date: Fri, 18 May 2018 21:28:29 +0300 > Here's a set of 3 patches against DaveM's 'net-next.git' repo. They (gradually) > add R8A77980 GEther support to the 'sh_eth' driver, starting with couple new > register bits/values introduced with this chip, and ending with adding a new > 'struct sh_eth_cpu_data' instance connected to the new DT "compatible" prop > value... Series applied, thanks. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-12-30 20:15 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-05-18 18:28 [PATCH v2 0/3] Add Renesas R8A77980 GEther support Sergei Shtylyov 2018-05-18 18:30 ` [PATCH v2 1/1] sh_eth: add RGMII support Sergei Shtylyov 2018-05-18 19:12 ` Andrew Lunn 2018-05-18 18:31 ` [PATCH v2 2/3] sh_eth: add EDMR.NBST support Sergei Shtylyov 2018-05-18 18:32 ` [PATCH v2 3/3] sh_eth: add R8A77980 support Sergei Shtylyov 2018-12-30 17:24 ` Sergei Shtylyov 2018-12-30 20:15 ` Sergei Shtylyov 2018-05-20 3:25 ` [PATCH v2 0/3] Add Renesas R8A77980 GEther support David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).