diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2018-02-24 14:41:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-26 13:59:15 -0500 |
commit | a94cf2a614f8bc5b2b33c708626ce695bf71e424 (patch) | |
tree | 1e07cceb60713990556ffe4a3575916fac71df03 | |
parent | 4869a1476df5ef2d09fa52acc9cfcc21b47194c5 (diff) |
sh_eth: fix TSU init on SH7734/R8A7740
It appears that the single port Ether controllers having TSU (like SH7734/
R8A7740) need the same kind of treating in sh_eth_tsu_init() as R7S72100
currently has -- they also don't have the TSU registers related e.g. to
passing the frames between ports. Add the 'sh_eth_cpu_data::dual_port'
flag and use it as a new criterion for taking a "short path" in the TSU
init sequence in order to avoid writing to the non-existent registers...
Fixes: f0e81fecd4f8 ("net: sh_eth: Add support SH7734")
Fixes: 73a0d907301e ("net: sh_eth: add support R8A7740")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 4502ff7bc19f..d3e1bc05ca9c 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -752,6 +752,7 @@ static struct sh_eth_cpu_data sh7757_data = { | |||
752 | .rpadir = 1, | 752 | .rpadir = 1, |
753 | .rpadir_value = 2 << 16, | 753 | .rpadir_value = 2 << 16, |
754 | .rtrate = 1, | 754 | .rtrate = 1, |
755 | .dual_port = 1, | ||
755 | }; | 756 | }; |
756 | 757 | ||
757 | #define SH_GIGA_ETH_BASE 0xfee00000UL | 758 | #define SH_GIGA_ETH_BASE 0xfee00000UL |
@@ -830,6 +831,7 @@ static struct sh_eth_cpu_data sh7757_data_giga = { | |||
830 | .no_trimd = 1, | 831 | .no_trimd = 1, |
831 | .no_ade = 1, | 832 | .no_ade = 1, |
832 | .tsu = 1, | 833 | .tsu = 1, |
834 | .dual_port = 1, | ||
833 | }; | 835 | }; |
834 | 836 | ||
835 | /* SH7734 */ | 837 | /* SH7734 */ |
@@ -900,6 +902,7 @@ static struct sh_eth_cpu_data sh7763_data = { | |||
900 | .tsu = 1, | 902 | .tsu = 1, |
901 | .irq_flags = IRQF_SHARED, | 903 | .irq_flags = IRQF_SHARED, |
902 | .magic = 1, | 904 | .magic = 1, |
905 | .dual_port = 1, | ||
903 | }; | 906 | }; |
904 | 907 | ||
905 | static struct sh_eth_cpu_data sh7619_data = { | 908 | static struct sh_eth_cpu_data sh7619_data = { |
@@ -932,6 +935,7 @@ static struct sh_eth_cpu_data sh771x_data = { | |||
932 | EESIPR_RRFIP | EESIPR_RTLFIP | EESIPR_RTSFIP | | 935 | EESIPR_RRFIP | EESIPR_RTLFIP | EESIPR_RTSFIP | |
933 | EESIPR_PREIP | EESIPR_CERFIP, | 936 | EESIPR_PREIP | EESIPR_CERFIP, |
934 | .tsu = 1, | 937 | .tsu = 1, |
938 | .dual_port = 1, | ||
935 | }; | 939 | }; |
936 | 940 | ||
937 | static void sh_eth_set_default_cpu_data(struct sh_eth_cpu_data *cd) | 941 | static void sh_eth_set_default_cpu_data(struct sh_eth_cpu_data *cd) |
@@ -2915,7 +2919,7 @@ static int sh_eth_vlan_rx_kill_vid(struct net_device *ndev, | |||
2915 | /* SuperH's TSU register init function */ | 2919 | /* SuperH's TSU register init function */ |
2916 | static void sh_eth_tsu_init(struct sh_eth_private *mdp) | 2920 | static void sh_eth_tsu_init(struct sh_eth_private *mdp) |
2917 | { | 2921 | { |
2918 | if (sh_eth_is_rz_fast_ether(mdp)) { | 2922 | if (!mdp->cd->dual_port) { |
2919 | sh_eth_tsu_write(mdp, 0, TSU_TEN); /* Disable all CAM entry */ | 2923 | sh_eth_tsu_write(mdp, 0, TSU_TEN); /* Disable all CAM entry */ |
2920 | sh_eth_tsu_write(mdp, TSU_FWSLC_POSTENU | TSU_FWSLC_POSTENL, | 2924 | sh_eth_tsu_write(mdp, TSU_FWSLC_POSTENU | TSU_FWSLC_POSTENL, |
2921 | TSU_FWSLC); /* Enable POST registers */ | 2925 | TSU_FWSLC); /* Enable POST registers */ |
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h index 35bfeeb3fcdc..5bbaf9e56e92 100644 --- a/drivers/net/ethernet/renesas/sh_eth.h +++ b/drivers/net/ethernet/renesas/sh_eth.h | |||
@@ -509,6 +509,7 @@ struct sh_eth_cpu_data { | |||
509 | unsigned rmiimode:1; /* EtherC has RMIIMODE register */ | 509 | unsigned rmiimode:1; /* EtherC has RMIIMODE register */ |
510 | unsigned rtrate:1; /* EtherC has RTRATE register */ | 510 | unsigned rtrate:1; /* EtherC has RTRATE register */ |
511 | unsigned magic:1; /* EtherC has ECMR.MPDE and ECSR.MPD */ | 511 | unsigned magic:1; /* EtherC has ECMR.MPDE and ECSR.MPD */ |
512 | unsigned dual_port:1; /* Dual EtherC/E-DMAC */ | ||
512 | }; | 513 | }; |
513 | 514 | ||
514 | struct sh_eth_private { | 515 | struct sh_eth_private { |