9
0
Fork 0
Commit Graph

30 Commits

Author SHA1 Message Date
Jean-Christophe PLAGNIOL-VILLARD 2263e27814 net: introduce phylib
Adapt phylib from linux

switch all the driver to it
reimplement mii bus

This will allow to have
 - phy drivers
 - to only connect the phy at then opening of the device
 - if the phy is not ready or not up fail on open

Same behaviour as in linux and will allow to share code and simplify porting.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-25 08:18:58 +02:00
Jan Weitzel a685c02ebf smsc911x: Check platformdata pointer
If pdata is NULL smc911x_probe will crash. Checking the zero initialized
priv->shift results in default configuration if pdata is not set.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-10 18:06:21 +02:00
Jean-Christophe PLAGNIOL-VILLARD 0c4ea17225 smc911x: fix typo pn check if the device is ready before using it
the check need to be inverted

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-10 08:26:24 +02:00
Jean-Christophe PLAGNIOL-VILLARD bfcd63fdc4 smc911x: check if the device is ready before using it
poll the READY bit in PMT_CTRL. Any other access to the device is
forbidden while this bit isn't set. Try for 100ms

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-03 09:49:06 +02:00
Jean-Christophe PLAGNIOL-VILLARD da9ef64678 smc911x: update chip detection
Use linux kernel chip detection from 3.5

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-03 09:49:06 +02:00
Jean-Christophe PLAGNIOL-VILLARD fb11747bfe smc911x: improve detection handle
detect if the bus is swapped and report a 32bit drivers is used on a 16bit bus

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-03 09:49:06 +02:00
Jean-Christophe PLAGNIOL-VILLARD 655dc6b8aa smc911x: add support to pass the shift via platform data
switch ipe337: to it at the same time to do not brake it

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-03 09:49:06 +02:00
Jean-Christophe PLAGNIOL-VILLARD 75880ac0ad smc911x: add 16bit bus width support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-03 09:49:06 +02:00
Jean-Christophe PLAGNIOL-VILLARD 187c55fdde smc911x: introduce read/write ops
This will allow to replace them depending on the platform data.
So we can specify shift and reg io witdh (16bit/32bit)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-03 09:49:06 +02:00
Jean-Christophe PLAGNIOL-VILLARD c3ec0b08bf smc911x: move register define to smc911x.h
this make the driver more readable

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-03 09:49:06 +02:00
Sascha Hauer f9b94c867b net smc911x: Use __iomem for register base
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 22:34:54 +02:00
Sascha Hauer e609cbe1e5 net drivers: remove unused type_data
Many net drivers set dev->type_data without ever using it, so
just remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:26 +01:00
Sascha Hauer 3ee7877a48 introduce io.h
To allow for some generic io accessors introduce io.h and use
this instead of asm/io.h throughout the tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-22 19:03:05 +02:00
Sascha Hauer 8fddb2edf6 net mii: add a parent pointer to miidevs and set it to the hardware device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-15 09:48:03 +02:00
Sascha Hauer 6d16fbdcd4 net: make the ethernet device a child of the hardware device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-15 09:48:03 +02:00
Sascha Hauer 439f6e62a0 smc911x: embed eth_device into priv
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:37:37 +02:00
Sascha Hauer c0195269e1 smc911x: switch to use resources
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:35:56 +02:00
Sascha Hauer 4fc4bc2c67 smc911x: use dev_* instead of printf
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:31:57 +02:00
Sascha Hauer 102f1811d0 net smc911x: Add LAN9221 support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-30 22:20:25 +02:00
Sascha Hauer c65d601648 smc911x: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 11:36:20 +01:00
Jean-Christophe PLAGNIOL-VILLARD 12f396a8b0 net: rework the mii support
this rework is done in order to add a phylib and allow to have phy driver support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-27 14:36:03 +02:00
Sascha Hauer c70689d727 network drivers: call net_receive directly instead of NetReceive
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:25 +02:00
Sascha Hauer 2f8df2a003 add a device_d to ethernet devices
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:46 +02:00
Sascha Hauer 6e921fcb3c Get rid of DEVICE_TYPE_ETHER usage
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:45 +02:00
Sascha Hauer a77e2a830b smc911x: fix wrong printf
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-02-20 18:27:35 +01:00
Marc Kleine-Budde 880c221b76 [smsc911x] undef FLOW if already defined
fixes:
drivers/net/smc911x.c:334:1: warning: "FLOW" redefined
In file included from include/asm/blackfin.h:33,
                 from include/asm/system.h:29,
                 from include/asm/bitops.h:33,
                 from include/linux/bitops.h:69,
                 from include/common.h:31,
                 from drivers/net/smc911x.c:29:
include/asm/cpu/defBF561.h:1654:1: warning: this is the location of the previous definition

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2007-11-12 12:07:04 +01:00
Juergen Beisert 5f26029b10 noisy support 2007-10-18 21:02:02 +02:00
sascha 1b272d80f1 change functions containing 'mac' or 'enet' in its name to 'ethaddr'.
change the parameter name for ethernet devices to 'ethaddr' aswell.
2007-10-18 11:17:16 +02:00
Sascha Hauer 8b0fa292f6 - coding style
- turn endless loop into timeout loop
- remove preliminary debug crap
2007-09-12 16:57:01 +02:00
Sascha Hauer 59432c41ce add blackfin network driver 2007-09-11 10:16:37 +02:00