All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh_eth: Fix access to TRSCER register
@ 2015-01-07  5:35 ` Nobuhiro Iwamatsu
  0 siblings, 0 replies; 6+ messages in thread
From: Nobuhiro Iwamatsu @ 2015-01-07  5:35 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, linux-sh, Nobuhiro Iwamatsu

TRSCER register is configured differently by SoCs. TRSCER of R-Car is
RINT8 bit only valid, other bits are reserved bits.
This removes access to TRSCER register reserve bit.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
 drivers/net/ethernet/renesas/sh_eth.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index c29ba80..59ee457 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1294,7 +1294,11 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
 	/* Frame recv control (enable multiple-packets per rx irq) */
 	sh_eth_write(ndev, RMCR_RNC, RMCR);
 
-	sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2, TRSCER);
+	if (mdp->cd->register_type = SH_ETH_REG_FAST_RCAR)
+		sh_eth_write(ndev, DESC_I_RINT8, TRSCER);
+	else
+		sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2,
+			     TRSCER);
 
 	if (mdp->cd->bculr)
 		sh_eth_write(ndev, 0x800, BCULR);	/* Burst sycle set */
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] sh_eth: Fix access to TRSCER register
@ 2015-01-07  5:35 ` Nobuhiro Iwamatsu
  0 siblings, 0 replies; 6+ messages in thread
From: Nobuhiro Iwamatsu @ 2015-01-07  5:35 UTC (permalink / raw)
  To: netdev; +Cc: yoshihiro.shimoda.uh, linux-sh, Nobuhiro Iwamatsu

TRSCER register is configured differently by SoCs. TRSCER of R-Car is
RINT8 bit only valid, other bits are reserved bits.
This removes access to TRSCER register reserve bit.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
 drivers/net/ethernet/renesas/sh_eth.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index c29ba80..59ee457 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1294,7 +1294,11 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
 	/* Frame recv control (enable multiple-packets per rx irq) */
 	sh_eth_write(ndev, RMCR_RNC, RMCR);
 
-	sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2, TRSCER);
+	if (mdp->cd->register_type == SH_ETH_REG_FAST_RCAR)
+		sh_eth_write(ndev, DESC_I_RINT8, TRSCER);
+	else
+		sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2,
+			     TRSCER);
 
 	if (mdp->cd->bculr)
 		sh_eth_write(ndev, 0x800, BCULR);	/* Burst sycle set */
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] sh_eth: Fix access to TRSCER register
  2015-01-07  5:35 ` Nobuhiro Iwamatsu
@ 2015-01-07  8:42   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2015-01-07  8:42 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu
  Cc: netdev@vger.kernel.org, Yoshihiro Shimoda, Linux-sh list

Hi Iwamatsu-san,

On Wed, Jan 7, 2015 at 6:35 AM, Nobuhiro Iwamatsu
<nobuhiro.iwamatsu.yj@renesas.com> wrote:
> TRSCER register is configured differently by SoCs. TRSCER of R-Car is
> RINT8 bit only valid, other bits are reserved bits.
> This removes access to TRSCER register reserve bit.
>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> ---
>  drivers/net/ethernet/renesas/sh_eth.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index c29ba80..59ee457 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -1294,7 +1294,11 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
>         /* Frame recv control (enable multiple-packets per rx irq) */
>         sh_eth_write(ndev, RMCR_RNC, RMCR);
>
> -       sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2, TRSCER);
> +       if (mdp->cd->register_type = SH_ETH_REG_FAST_RCAR)

This catches both the R-Car Gen1 and R-Car Gen2 cases.
According to the datasheets, r8a7778/9 do have the other bits?
Only R-Car Gen2 doesn't have them.

> +               sh_eth_write(ndev, DESC_I_RINT8, TRSCER);
> +       else
> +               sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2,
> +                            TRSCER);

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sh_eth: Fix access to TRSCER register
@ 2015-01-07  8:42   ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2015-01-07  8:42 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu
  Cc: netdev@vger.kernel.org, Yoshihiro Shimoda, Linux-sh list

Hi Iwamatsu-san,

On Wed, Jan 7, 2015 at 6:35 AM, Nobuhiro Iwamatsu
<nobuhiro.iwamatsu.yj@renesas.com> wrote:
> TRSCER register is configured differently by SoCs. TRSCER of R-Car is
> RINT8 bit only valid, other bits are reserved bits.
> This removes access to TRSCER register reserve bit.
>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
> ---
>  drivers/net/ethernet/renesas/sh_eth.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index c29ba80..59ee457 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -1294,7 +1294,11 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
>         /* Frame recv control (enable multiple-packets per rx irq) */
>         sh_eth_write(ndev, RMCR_RNC, RMCR);
>
> -       sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2, TRSCER);
> +       if (mdp->cd->register_type == SH_ETH_REG_FAST_RCAR)

This catches both the R-Car Gen1 and R-Car Gen2 cases.
According to the datasheets, r8a7778/9 do have the other bits?
Only R-Car Gen2 doesn't have them.

> +               sh_eth_write(ndev, DESC_I_RINT8, TRSCER);
> +       else
> +               sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2,
> +                            TRSCER);

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sh_eth: Fix access to TRSCER register
  2015-01-07  8:42   ` Geert Uytterhoeven
@ 2015-01-07 23:49     ` Nobuhiro Iwamatsu
  -1 siblings, 0 replies; 6+ messages in thread
From: Nobuhiro Iwamatsu @ 2015-01-07 23:49 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: netdev@vger.kernel.org, Yoshihiro Shimoda, Linux-sh list

Hi,

Thanks for youre review.

(2015/01/07 17:42), Geert Uytterhoeven wrote:
> Hi Iwamatsu-san,
>
> On Wed, Jan 7, 2015 at 6:35 AM, Nobuhiro Iwamatsu
> <nobuhiro.iwamatsu.yj@renesas.com>  wrote:
>> TRSCER register is configured differently by SoCs. TRSCER of R-Car is
>> RINT8 bit only valid, other bits are reserved bits.
>> This removes access to TRSCER register reserve bit.
>>
>> Signed-off-by: Nobuhiro Iwamatsu<nobuhiro.iwamatsu.yj@renesas.com>
>> ---
>>   drivers/net/ethernet/renesas/sh_eth.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
>> index c29ba80..59ee457 100644
>> --- a/drivers/net/ethernet/renesas/sh_eth.c
>> +++ b/drivers/net/ethernet/renesas/sh_eth.c
>> @@ -1294,7 +1294,11 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
>>          /* Frame recv control (enable multiple-packets per rx irq) */
>>          sh_eth_write(ndev, RMCR_RNC, RMCR);
>>
>> -       sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2, TRSCER);
>> +       if (mdp->cd->register_type = SH_ETH_REG_FAST_RCAR)
>
> This catches both the R-Car Gen1 and R-Car Gen2 cases.
> According to the datasheets, r8a7778/9 do have the other bits?
> Only R-Car Gen2 doesn't have them.

I see. I checked mistake.
I will resend about this patch.

>
>> +               sh_eth_write(ndev, DESC_I_RINT8, TRSCER);
>> +       else
>> +               sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2,
>> +                            TRSCER);
>
> Gr{oetje,eeting}s,
>
>                          Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds

Best regards,
   Nobuhiro

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sh_eth: Fix access to TRSCER register
@ 2015-01-07 23:49     ` Nobuhiro Iwamatsu
  0 siblings, 0 replies; 6+ messages in thread
From: Nobuhiro Iwamatsu @ 2015-01-07 23:49 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: netdev@vger.kernel.org, Yoshihiro Shimoda, Linux-sh list

Hi,

Thanks for youre review.

(2015/01/07 17:42), Geert Uytterhoeven wrote:
> Hi Iwamatsu-san,
>
> On Wed, Jan 7, 2015 at 6:35 AM, Nobuhiro Iwamatsu
> <nobuhiro.iwamatsu.yj@renesas.com>  wrote:
>> TRSCER register is configured differently by SoCs. TRSCER of R-Car is
>> RINT8 bit only valid, other bits are reserved bits.
>> This removes access to TRSCER register reserve bit.
>>
>> Signed-off-by: Nobuhiro Iwamatsu<nobuhiro.iwamatsu.yj@renesas.com>
>> ---
>>   drivers/net/ethernet/renesas/sh_eth.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
>> index c29ba80..59ee457 100644
>> --- a/drivers/net/ethernet/renesas/sh_eth.c
>> +++ b/drivers/net/ethernet/renesas/sh_eth.c
>> @@ -1294,7 +1294,11 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
>>          /* Frame recv control (enable multiple-packets per rx irq) */
>>          sh_eth_write(ndev, RMCR_RNC, RMCR);
>>
>> -       sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2, TRSCER);
>> +       if (mdp->cd->register_type == SH_ETH_REG_FAST_RCAR)
>
> This catches both the R-Car Gen1 and R-Car Gen2 cases.
> According to the datasheets, r8a7778/9 do have the other bits?
> Only R-Car Gen2 doesn't have them.

I see. I checked mistake.
I will resend about this patch.

>
>> +               sh_eth_write(ndev, DESC_I_RINT8, TRSCER);
>> +       else
>> +               sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2,
>> +                            TRSCER);
>
> Gr{oetje,eeting}s,
>
>                          Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds

Best regards,
   Nobuhiro

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-07 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-07  5:35 [PATCH] sh_eth: Fix access to TRSCER register Nobuhiro Iwamatsu
2015-01-07  5:35 ` Nobuhiro Iwamatsu
2015-01-07  8:42 ` Geert Uytterhoeven
2015-01-07  8:42   ` Geert Uytterhoeven
2015-01-07 23:49   ` Nobuhiro Iwamatsu
2015-01-07 23:49     ` Nobuhiro Iwamatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.