aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/renesas
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>2012-03-25 14:59:51 -0400
committerDavid S. Miller <davem@davemloft.net>2012-03-27 22:38:08 -0400
commitf0e81fecd4f83de7854262c8a6b3af19dfa99bf9 (patch)
tree54c7d0330c90ab0f07adf86fc58255d260e5a221 /drivers/net/ethernet/renesas
parentb7440892802be38e6eeb0a17897deeb85476eff4 (diff)
net: sh_eth: Add support SH7734
Add define of SH7734 register and sh_eth_reset_hw_crc function. V3: Rebase net/HEAD. V2: Do not split line of #if defined. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/renesas')
-rw-r--r--drivers/net/ethernet/renesas/Kconfig5
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c20
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.h11
3 files changed, 28 insertions, 8 deletions
diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
index 9755b49bbef..3fb2355af37 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -7,7 +7,8 @@ config SH_ETH
7 depends on SUPERH && \ 7 depends on SUPERH && \
8 (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \ 8 (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || \
9 CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \ 9 CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7619 || \
10 CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7757) 10 CPU_SUBTYPE_SH7724 || CPU_SUBTYPE_SH7734 || \
11 CPU_SUBTYPE_SH7757)
11 select CRC32 12 select CRC32
12 select NET_CORE 13 select NET_CORE
13 select MII 14 select MII
@@ -16,4 +17,4 @@ config SH_ETH
16 ---help--- 17 ---help---
17 Renesas SuperH Ethernet device driver. 18 Renesas SuperH Ethernet device driver.
18 This driver supporting CPUs are: 19 This driver supporting CPUs are:
19 - SH7710, SH7712, SH7763, SH7619, SH7724, and SH7757. 20 - SH7619, SH7710, SH7712, SH7724, SH7734, SH7763 and SH7757.
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 8615961c128..8bdf070ace9 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * SuperH Ethernet device driver 2 * SuperH Ethernet device driver
3 * 3 *
4 * Copyright (C) 2006-2008 Nobuhiro Iwamatsu 4 * Copyright (C) 2006-2012 Nobuhiro Iwamatsu
5 * Copyright (C) 2008-2009 Renesas Solutions Corp. 5 * Copyright (C) 2008-2012 Renesas Solutions Corp.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License, 8 * under the terms and conditions of the GNU General Public License,
@@ -38,6 +38,7 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/ethtool.h> 39#include <linux/ethtool.h>
40#include <linux/if_vlan.h> 40#include <linux/if_vlan.h>
41#include <linux/clk.h>
41#include <linux/sh_eth.h> 42#include <linux/sh_eth.h>
42 43
43#include "sh_eth.h" 44#include "sh_eth.h"
@@ -279,8 +280,9 @@ static struct sh_eth_cpu_data *sh_eth_get_cpu_data(struct sh_eth_private *mdp)
279 return &sh_eth_my_cpu_data; 280 return &sh_eth_my_cpu_data;
280} 281}
281 282
282#elif defined(CONFIG_CPU_SUBTYPE_SH7763) 283#elif defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763)
283#define SH_ETH_HAS_TSU 1 284#define SH_ETH_HAS_TSU 1
285static void sh_eth_reset_hw_crc(struct net_device *ndev);
284static void sh_eth_chip_reset(struct net_device *ndev) 286static void sh_eth_chip_reset(struct net_device *ndev)
285{ 287{
286 struct sh_eth_private *mdp = netdev_priv(ndev); 288 struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -314,6 +316,9 @@ static void sh_eth_reset(struct net_device *ndev)
314 sh_eth_write(ndev, 0x0, RDFAR); 316 sh_eth_write(ndev, 0x0, RDFAR);
315 sh_eth_write(ndev, 0x0, RDFXR); 317 sh_eth_write(ndev, 0x0, RDFXR);
316 sh_eth_write(ndev, 0x0, RDFFR); 318 sh_eth_write(ndev, 0x0, RDFFR);
319
320 /* Reset HW CRC register */
321 sh_eth_reset_hw_crc(ndev);
317} 322}
318 323
319static void sh_eth_set_duplex(struct net_device *ndev) 324static void sh_eth_set_duplex(struct net_device *ndev)
@@ -370,8 +375,17 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
370 .no_trimd = 1, 375 .no_trimd = 1,
371 .no_ade = 1, 376 .no_ade = 1,
372 .tsu = 1, 377 .tsu = 1,
378#if defined(CONFIG_CPU_SUBTYPE_SH7734)
379 .hw_crc = 1,
380#endif
373}; 381};
374 382
383static void sh_eth_reset_hw_crc(struct net_device *ndev)
384{
385 if (sh_eth_my_cpu_data.hw_crc)
386 sh_eth_write(ndev, 0x0, CSMR);
387}
388
375#elif defined(CONFIG_CPU_SUBTYPE_SH7619) 389#elif defined(CONFIG_CPU_SUBTYPE_SH7619)
376#define SH_ETH_RESET_DEFAULT 1 390#define SH_ETH_RESET_DEFAULT 1
377static struct sh_eth_cpu_data sh_eth_my_cpu_data = { 391static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index 57dc2626111..e66de182353 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * SuperH Ethernet device driver 2 * SuperH Ethernet device driver
3 * 3 *
4 * Copyright (C) 2006-2008 Nobuhiro Iwamatsu 4 * Copyright (C) 2006-2012 Nobuhiro Iwamatsu
5 * Copyright (C) 2008-2011 Renesas Solutions Corp. 5 * Copyright (C) 2008-2012 Renesas Solutions Corp.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License, 8 * under the terms and conditions of the GNU General Public License,
@@ -98,6 +98,8 @@ enum {
98 CEECR, 98 CEECR,
99 MAFCR, 99 MAFCR,
100 RTRATE, 100 RTRATE,
101 CSMR,
102 RMII_MII,
101 103
102 /* TSU Absolute address */ 104 /* TSU Absolute address */
103 ARSTR, 105 ARSTR,
@@ -172,6 +174,7 @@ static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = {
172 [RMCR] = 0x0458, 174 [RMCR] = 0x0458,
173 [RPADIR] = 0x0460, 175 [RPADIR] = 0x0460,
174 [FCFTR] = 0x0468, 176 [FCFTR] = 0x0468,
177 [CSMR] = 0x04E4,
175 178
176 [ECMR] = 0x0500, 179 [ECMR] = 0x0500,
177 [ECSR] = 0x0510, 180 [ECSR] = 0x0510,
@@ -200,6 +203,7 @@ static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = {
200 [CERCR] = 0x0768, 203 [CERCR] = 0x0768,
201 [CEECR] = 0x0770, 204 [CEECR] = 0x0770,
202 [MAFCR] = 0x0778, 205 [MAFCR] = 0x0778,
206 [RMII_MII] = 0x0790,
203 207
204 [ARSTR] = 0x0000, 208 [ARSTR] = 0x0000,
205 [TSU_CTRST] = 0x0004, 209 [TSU_CTRST] = 0x0004,
@@ -377,7 +381,7 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = {
377/* 381/*
378 * Register's bits 382 * Register's bits
379 */ 383 */
380#ifdef CONFIG_CPU_SUBTYPE_SH7763 384#if defined(CONFIG_CPU_SUBTYPE_SH7734) || defined(CONFIG_CPU_SUBTYPE_SH7763)
381/* EDSR */ 385/* EDSR */
382enum EDSR_BIT { 386enum EDSR_BIT {
383 EDSR_ENT = 0x01, EDSR_ENR = 0x02, 387 EDSR_ENT = 0x01, EDSR_ENR = 0x02,
@@ -751,6 +755,7 @@ struct sh_eth_cpu_data {
751 unsigned rpadir:1; /* E-DMAC have RPADIR */ 755 unsigned rpadir:1; /* E-DMAC have RPADIR */
752 unsigned no_trimd:1; /* E-DMAC DO NOT have TRIMD */ 756 unsigned no_trimd:1; /* E-DMAC DO NOT have TRIMD */
753 unsigned no_ade:1; /* E-DMAC DO NOT have ADE bit in EESR */ 757 unsigned no_ade:1; /* E-DMAC DO NOT have ADE bit in EESR */
758 unsigned hw_crc:1; /* E-DMAC have CSMR */
754}; 759};
755 760
756struct sh_eth_private { 761struct sh_eth_private {