Commit fd9abb3d authored by Steve Glendinning's avatar Steve Glendinning Committed by Jeff Garzik

SMSC LAN911x and LAN921x vendor driver

Attached is a driver for SMSC's LAN911x and LAN921x families of embedded
ethernet controllers.

There is an existing smc911x driver in the tree; this is intended to
replace it.  Dustin McIntire (the author of the smc911x driver) has
expressed his support for switching to this driver.

This driver contains workarounds for all known hardware issues, and has
been tested on all flavours of the chip on multiple architectures.

This driver now uses phylib, so this patch also adds support for the
device's internal phy
Signed-off-by: default avatarSteve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: default avatarBahadir Balban <Bahadir.Balban@arm.com>
Signed-off-by: default avatarDustin Mcintire <dustin@sensoria.com>
Signed-off-by: default avatarBill Gatliff <bgat@billgatliff.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent c5916cf8
...@@ -3853,6 +3853,12 @@ M: mhoffman@lightlink.com ...@@ -3853,6 +3853,12 @@ M: mhoffman@lightlink.com
L: lm-sensors@lm-sensors.org L: lm-sensors@lm-sensors.org
S: Maintained S: Maintained
SMSC911x ETHERNET DRIVER
P: Steve Glendinning
M: steve.glendinning@smsc.com
L: netdev@vger.kernel.org
S: Supported
SMX UIO Interface SMX UIO Interface
P: Ben Nizette P: Ben Nizette
M: bn@niasdigital.com M: bn@niasdigital.com
......
...@@ -979,6 +979,20 @@ config SMC911X ...@@ -979,6 +979,20 @@ config SMC911X
called smc911x. If you want to compile it as a module, say M called smc911x. If you want to compile it as a module, say M
here and read <file:Documentation/kbuild/modules.txt> here and read <file:Documentation/kbuild/modules.txt>
config SMSC911X
tristate "SMSC LAN911x/LAN921x families embedded ethernet support"
depends on ARM || SUPERH
select CRC32
select MII
select PHYLIB
---help---
Say Y here if you want support for SMSC LAN911x and LAN921x families
of ethernet controllers.
To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module
will be called smsc911x.
config NET_VENDOR_RACAL config NET_VENDOR_RACAL
bool "Racal-Interlan (Micom) NI cards" bool "Racal-Interlan (Micom) NI cards"
depends on ISA depends on ISA
......
...@@ -219,6 +219,7 @@ obj-$(CONFIG_S2IO) += s2io.o ...@@ -219,6 +219,7 @@ obj-$(CONFIG_S2IO) += s2io.o
obj-$(CONFIG_MYRI10GE) += myri10ge/ obj-$(CONFIG_MYRI10GE) += myri10ge/
obj-$(CONFIG_SMC91X) += smc91x.o obj-$(CONFIG_SMC91X) += smc91x.o
obj-$(CONFIG_SMC911X) += smc911x.o obj-$(CONFIG_SMC911X) += smc911x.o
obj-$(CONFIG_SMSC911X) += smsc911x.o
obj-$(CONFIG_BFIN_MAC) += bfin_mac.o obj-$(CONFIG_BFIN_MAC) += bfin_mac.o
obj-$(CONFIG_DM9000) += dm9000.o obj-$(CONFIG_DM9000) += dm9000.o
obj-$(CONFIG_PASEMI_MAC) += pasemi_mac_driver.o obj-$(CONFIG_PASEMI_MAC) += pasemi_mac_driver.o
......
...@@ -126,6 +126,27 @@ static struct phy_driver lan8700_driver = { ...@@ -126,6 +126,27 @@ static struct phy_driver lan8700_driver = {
.driver = { .owner = THIS_MODULE, } .driver = { .owner = THIS_MODULE, }
}; };
static struct phy_driver lan911x_int_driver = {
.phy_id = 0x0007c0d0, /* OUI=0x00800f, Model#=0x0d */
.phy_id_mask = 0xfffffff0,
.name = "SMSC LAN911x Internal PHY",
.features = (PHY_BASIC_FEATURES | SUPPORTED_Pause
| SUPPORTED_Asym_Pause),
.flags = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
/* basic functions */
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.config_init = smsc_phy_config_init,
/* IRQ related */
.ack_interrupt = smsc_phy_ack_interrupt,
.config_intr = smsc_phy_config_intr,
.driver = { .owner = THIS_MODULE, }
};
static int __init smsc_init(void) static int __init smsc_init(void)
{ {
int ret; int ret;
...@@ -142,8 +163,14 @@ static int __init smsc_init(void) ...@@ -142,8 +163,14 @@ static int __init smsc_init(void)
if (ret) if (ret)
goto err3; goto err3;
ret = phy_driver_register (&lan911x_int_driver);
if (ret)
goto err4;
return 0; return 0;
err4:
phy_driver_unregister (&lan8700_driver);
err3: err3:
phy_driver_unregister (&lan8187_driver); phy_driver_unregister (&lan8187_driver);
err2: err2:
...@@ -154,6 +181,7 @@ static int __init smsc_init(void) ...@@ -154,6 +181,7 @@ static int __init smsc_init(void)
static void __exit smsc_exit(void) static void __exit smsc_exit(void)
{ {
phy_driver_unregister (&lan911x_int_driver);
phy_driver_unregister (&lan8700_driver); phy_driver_unregister (&lan8700_driver);
phy_driver_unregister (&lan8187_driver); phy_driver_unregister (&lan8187_driver);
phy_driver_unregister (&lan83c185_driver); phy_driver_unregister (&lan83c185_driver);
......
This diff is collapsed.
This diff is collapsed.
/***************************************************************************
*
* Copyright (C) 2004-2008 SMSC
* Copyright (C) 2005-2008 ARM
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
***************************************************************************/
#ifndef __LINUX_SMSC911X_H__
#define __LINUX_SMSC911X_H__
#include <linux/phy.h>
/* platform_device configuration data, should be assigned to
* the platform_device's dev.platform_data */
struct smsc911x_platform_config {
unsigned int irq_polarity;
unsigned int irq_type;
phy_interface_t phy_interface;
};
/* Constants for platform_device irq polarity configuration */
#define SMSC911X_IRQ_POLARITY_ACTIVE_LOW 0
#define SMSC911X_IRQ_POLARITY_ACTIVE_HIGH 1
/* Constants for platform_device irq type configuration */
#define SMSC911X_IRQ_TYPE_OPEN_DRAIN 0
#define SMSC911X_IRQ_TYPE_PUSH_PULL 1
#endif /* __LINUX_SMSC911X_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment