diff mbox series

[RFT,v2] net: sh_eth: add support for SH7786

Message ID cbc7976d-2376-15d4-0fc1-febdf142887b@cogentembedded.com (mailing list archive)
State Under Review
Delegated to: Geert Uytterhoeven
Headers show
Series [RFT,v2] net: sh_eth: add support for SH7786 | expand

Commit Message

Sergei Shtylyov Jan. 4, 2019, 12:53 p.m. UTC
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

This commit adds the sh_eth_cpu_data structure that describes the
SH7786 variant of the IP.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

---
The patch is against DaveM's 'net-next.git' repo.
Not posting it to netdev@vger.kernel.org this time since the 'net-next' repo
is still closed.

Changes in version 2:
- added a comment before 'sh7786_data' initializer;
- added now mandatory soft_reset() method;
- changed the 'register_type' initializer to SH_ETH_REG_FAST_RCAR;
- added the 'ecsr_value' field initializer;
- renamed EESR_RTO to EESR_TRO;
- added the 'fdr_value' field initializer;
- added the 'no_xdfar'  field initializer.

 drivers/net/ethernet/renesas/sh_eth.c |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

Comments

Sergei Shtylyov Jan. 4, 2019, 1:01 p.m. UTC | #1
On 01/04/2019 03:53 PM, Sergei Shtylyov wrote:

> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> This commit adds the sh_eth_cpu_data structure that describes the
> SH7786 variant of the IP.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

MBR, Sergei
Thomas Petazzoni Jan. 8, 2019, 9:16 a.m. UTC | #2
Hello Sergei,

Thanks for your work on this topic!

On Fri, 4 Jan 2019 15:53:24 +0300, Sergei Shtylyov wrote:
> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> This commit adds the sh_eth_cpu_data structure that describes the
> SH7786 variant of the IP.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

I tried to test this patch today, and it doesn't work for the moment.
However, I've rebased my whole SH7786 patch stack on top of 4.20, and
with my original sh_eth patch, network is also not working, so I can't
say whether it's really this patch that has an issue, or some other
aspects.

(And yes, I remember to adjust the base address of the sh_eth
platform_device:

diff --git a/arch/sh/boards/board-wdc-cont4.c b/arch/sh/boards/board-wdc-cont4.c
index c72209822899..7ca1bfcc20ae 100644
--- a/arch/sh/boards/board-wdc-cont4.c
+++ b/arch/sh/boards/board-wdc-cont4.c
@@ -80,7 +80,7 @@ static int wdc_cont4_clk_init(void)
 
 static struct resource sh_eth_resources[] = {
         {
-                .start  = 0xFEE00200,
+                .start  = 0xFEE00000,
                 .end    = 0xFEE00400 - 1,
                 .flags  = IORESOURCE_MEM,
         }, {

Best regards,

Thomas
Sergei Shtylyov Jan. 10, 2019, 9:10 a.m. UTC | #3
Hello!

On 08.01.2019 12:16, Thomas Petazzoni wrote:

> On Fri, 4 Jan 2019 15:53:24 +0300, Sergei Shtylyov wrote:
>> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>>
>> This commit adds the sh_eth_cpu_data structure that describes the
>> SH7786 variant of the IP.
>>
>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> I tried to test this patch today, and it doesn't work for the moment.

    What are the symptoms?

> However, I've rebased my whole SH7786 patch stack on top of 4.20, and
> with my original sh_eth patch, network is also not working, so I can't

    Hm... same symptoms?

> say whether it's really this patch that has an issue, or some other
> aspects.
> 
> (And yes, I remember to adjust the base address of the sh_eth
> platform_device:
> 
> diff --git a/arch/sh/boards/board-wdc-cont4.c b/arch/sh/boards/board-wdc-cont4.c
> index c72209822899..7ca1bfcc20ae 100644
> --- a/arch/sh/boards/board-wdc-cont4.c
> +++ b/arch/sh/boards/board-wdc-cont4.c
> @@ -80,7 +80,7 @@ static int wdc_cont4_clk_init(void)
>   
>   static struct resource sh_eth_resources[] = {
>           {
> -                .start  = 0xFEE00200,
> +                .start  = 0xFEE00000,
>                   .end    = 0xFEE00400 - 1,
>                   .flags  = IORESOURCE_MEM,
>           }, {

    Yes, seems correct.

> Best regards,
> 
> Thomas

MBR, Sergei
diff mbox series

Patch

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
@@ -879,6 +879,36 @@  static struct sh_eth_cpu_data sh7724_dat
 	.rpadir		= 1,
 };
 
+/* SH7786 */
+static struct sh_eth_cpu_data sh7786_data = {
+	.soft_reset	= sh_eth_soft_reset,
+
+	.set_duplex	= sh_eth_set_duplex,
+
+	.register_type	= SH_ETH_REG_FAST_RCAR,
+
+	.edtrr_trns	= EDTRR_TRNS_ETHER,
+	.ecsr_value	= ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD,
+	.ecsipr_value	= ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP,
+	.eesipr_value	= EESIPR_RFCOFIP | EESIPR_ADEIP | 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_CND | EESR_DLC | EESR_CD | EESR_TRO,
+	.eesr_err_check	= EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE |
+			  EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE,
+	.fdr_value	= 0x00000f0f,
+
+	.apr		= 1,
+	.mpr		= 1,
+	.tpauser	= 1,
+	.hw_swap	= 1,
+	.no_xdfar	= 1,
+};
+
 static void sh_eth_set_rate_sh7757(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -3476,6 +3506,7 @@  static const struct platform_device_id s
 	{ "sh7757-ether", (kernel_ulong_t)&sh7757_data },
 	{ "sh7757-gether", (kernel_ulong_t)&sh7757_data_giga },
 	{ "sh7763-gether", (kernel_ulong_t)&sh7763_data },
+	{ "sh7786-ether", (kernel_ulong_t)&sh7786_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, sh_eth_id_table);