9
0
Fork 0
Commit Graph

468 Commits

Author SHA1 Message Date
Sascha Hauer 1a9e93cc81 drivers/base: fix corrupt device tree
dev_add_child is a very unsafe function. If called multiple times
it allows setting the same device to different parents thus corrupting
the siblings list. This happens regularly since:

| commit c2e568d19c
| Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| Date:   Sat Nov 3 16:11:05 2012 +0100
|
|    bus: add bus device
|
|    automatically add it as parent of any bus device if none already specified
|
|    we have now a nice output per bus

If for example a FATfs is mounted this nice output per bus often ends with:

>     `---- fat0
>     `---- 0
>          `---- 0x86f0000087020031-0x86f000410df27124: /dev/<NULL>
>          `---- sram00
>               `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
>               `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
>               unable to handle NULL pointer dereference at address 0x0000000c
> pc : [<87f08a20>]    lr : [<87f08a04>]
> sp : 86eff8c0  ip : 87f3fbde  fp : ffffffff
> r10: ffffffff  r9 : 00000000  r8 : 00000003
> r7 : 86f075b8  r6 : 00000002  r5 : ffffffec  r4 : 86f07544
> r3 : 00000000  r2 : 43f900b4  r1 : 00000020  r0 : 00000005
> Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32
> [<87f08a20>] (do_devinfo_subtree+0x90/0x130) from [<87f08a90>] (do_devinfo_subtree+0x100/0x130)
>
> [<87f3e070>] (unwind_backtrace+0x0/0x90) from [<87f28514>] (panic+0x28/0x3c)
> [<87f28514>] (panic+0x28/0x3c) from [<87f3e4b8>] (do_exception+0x10/0x14)
> [<87f3e4b8>] (do_exception+0x10/0x14) from [<87f3e544>] (do_data_abort+0x2c/0x38)
> [<87f3e544>] (do_data_abort+0x2c/0x38) from [<87f3e268>] (data_abort+0x48/0x60)

This patch fixes this by adding a device to its parents children list in
register_device so that dev_add_child is no longer needed. This function
is removed from the tree. Now callers of register_device have to clearly
set the parent *before* registering a device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Jan Lübbe <jlu@pengutronix.de>
2012-12-12 15:04:27 +01:00
Sascha Hauer ac48b10467 net phylib: Clear BMCR_PDOWN bit
Some phys come up with this bit set, clear it so that these phys
can work. This has been observed with a ASIX compatible USB ethernet
adapter.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 17:52:55 +01:00
Sascha Hauer 8030ab24fa Merge branch 'kconfig' 2012-12-08 12:22:21 +01:00
Alexander Shiyan 4c20f9af97 Cleanup Kconfig files
This patch provides a global cleanup barebox Kconfig files. This includes
replacing spaces to tabs, formatting in accordance format, removing
extraneous lines and spaces. No functional changes.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 12:22:12 +01:00
Sascha Hauer 8f32824c6e Merge branch 'for-next/phylib'
Conflicts:
	drivers/net/phy/phy.c
2012-12-07 16:43:21 +01:00
Jan Luebbe bba73109ce net: phy: micrel: fix typo in driver name
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-05 19:53:49 +01:00
Jean-Christophe PLAGNIOL-VILLARD 90806eea09 mdio_bus: fix match
on barebox we have the weird way the return 0 true on bus match

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-05 13:22:01 +01:00
Antony Pavlov 300a23cba5 phylib: fix compiler warning
fixes:
 drivers/net/phy/phy.c:57: warning: no previous prototype for ‘phy_device_create’

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-26 09:06:57 +01:00
Jean-Christophe PLAGNIOL-VILLARD 34bcbaa2ba phylib: add micrel support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-20 09:38:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4a1e4d4b1d phylib: add fixup support
if board need specific phy fixup they can register it and then the code will
executed only if needed

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-20 09:38:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD 30298c0f3c mdio_bus: fix match
on barebox we have the weird way the return 0 true on bus match

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-20 09:38:26 +01:00
Jean-Christophe PLAGNIOL-VILLARD 9ea956db77 phylib: fix generic phy driver probe
the generic phy driver is used if no driver are found

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-20 09:38:26 +01:00
Jean-Christophe PLAGNIOL-VILLARD c811546712 macb/ether: split flags for drivers and phylib
as in the kernel use is_rmii
flags for pinctrl
phy_flags for phylib flags

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-19 10:19:08 +01:00
Jean-Christophe PLAGNIOL-VILLARD d1662f9db3 phylib: introduction of forced 100Mbps
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-19 10:19:07 +01:00
Jean-Christophe PLAGNIOL-VILLARD e7d143f036 phylib: export phy_id via param
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-19 10:19:07 +01:00
Sascha Hauer 1bfbbcca51 Merge branch 'for-next/phylib' 2012-11-16 14:02:49 +01:00
Sascha Hauer 6584c1f801 Merge branch 'for-next/net' 2012-11-16 14:02:37 +01:00
Sascha Hauer bf38ac7b89 Merge branch 'for-next/imx'
Conflicts:
	arch/arm/boards/guf-neso/lowlevel.c
	arch/arm/boards/pcm038/lowlevel.c
	commands/Makefile
2012-11-16 14:01:09 +01:00
Sascha Hauer e84241c994 Revert "net fec: connect phy at probe time"
While this makes sure that the phy fixups are applied even if
networking is not used on i.MX6, this patch due to latest phy
changes causes the startup of barebox delayed until we have a
link on the i.MX fec. Revert it for now and look for a better
solution later.

This reverts commit 3a17af33c0.
2012-11-16 09:38:36 +01:00
Jean-Christophe PLAGNIOL-VILLARD aa498eefce phy: add smsc phy driver support
as we to have specific phy init to fix chip issue link detection support

based on linux 3.6

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-15 14:24:26 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4f655dd24a phy: add phy_drivers_register
to allow to register an array of drivers

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-15 14:24:18 +01:00
Andreas Pretzsch ea26693b8f net smc911x: add support for external PHY
On LAN9115/LAN9117/LAN9215/LAN9217, external PHYs are supported.
Switch to external PHY based on hardware strap pin and/or override flags.
Also add a mask to platform data selecting external PHY address to be used.

Code based on linux/drivers/net/ethernet/smsc/smsc911x.c (fd9abb3d, d23f028a).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-12 08:29:48 +01:00
Andreas Pretzsch 78d3b8571c mdiobus: unbreak phy_device_connect(): honor masked out PHYs
commit 89dfe2d2af "mdiobus: do not scan
the bus at registration time" dropped the check for struct mii_bus
element phy_mask while scanning through all addresses.
Re-add this check.

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-12 08:28:18 +01:00
Sascha Hauer 89dfe2d2af mdiobus: do not scan the bus at registration time
Scanning the bus can take some time. If we do not need the ethernet
device, this is unnecessary, so delay the scan until the phy device
iactually is needed.

Andread Pretzsch: Fixup bug in scanning for all devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
2012-11-07 09:00:19 +01:00
Sascha Hauer c83623d010 net usb asix: Add missing line breaks in dev_* messages
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-01 08:43:05 +01:00
Sascha Hauer 51e9c42c74 net fec: call fec_init at probe time
fec_init() initializes some bits important for phy access, so do
this before the mdiobus is registered. This fixes mdiobus support
on i.MX28 boards in RMII mode.

Reported-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-31 21:51:36 +01:00
Sascha Hauer 745c16db7e mdiobus: return existing phydev in mdiobus_scan
Test if we already found a phy device on an address earlier and return
it if it exists. This makes it possible to call mdiobus_scan multiple
times.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-30 17:26:22 +01:00
Sascha Hauer 3a17af33c0 net fec: connect phy at probe time
Several i.MX boards (all i.MX6 boards) need to do some adjustments
to phy registers. If barebox itself does not use network, networking
won't work in the kernel if the kernel does not have the fixups. Connect
the phy at probe time so that these tweaks are done during probe so that
the kernel works without phy register tweaks. Also this has the effect
that the phy device is present and introspectable without doing fake
network transfers beforehand.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-30 17:17:35 +01:00
Sascha Hauer c0aabaff3b net gianfar: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-17 22:17:57 +02:00
Sascha Hauer b1b76f6027 ARM i.MX: get rid of imx-regs.h
- remove now unused __REG definitions
- include individual SoC register files instead of imx-regs.h
- move IMX_GPIO_NR to generic.h
- finally remove imx-regs.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-17 20:22:02 +02:00
Sascha Hauer aaad5cbad7 Merge branch 'for-next/clk' into for-next/imx
Conflicts:
	drivers/net/fec_imx.c
2012-10-17 20:21:46 +02:00
Sascha Hauer f393758c53 Merge branch 'for-next/imx-dt' into for-next/imx 2012-10-17 08:48:54 +02:00
Jean-Christophe PLAGNIOL-VILLARD 5d1d1c65a6 designware: set parent for eth_device and miibus
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-15 09:11:00 +02:00
Jean-Christophe PLAGNIOL-VILLARD 052a701207 net:designware: allow to pass the phy interface
If none set use NA (0) as before.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-15 08:54:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD 840d4858d0 designware: fix 100mps phy support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-15 08:54:14 +02:00
Sascha Hauer a4c8692240 ARM i.MX: Enable clocks in common place
On i.MX we enable all necessary clocks during startup of the clock
controller driver, so we do not need the register hacking in the drivers
anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-10 09:47:51 +02:00
Antony Pavlov 026e6aeb82 davinci_emac: fix comment for the _send function
The _send function should not return the length
of the transmitted packet.

See also

commit 76c4c9e48f
Author: Jan Luebbe <jlu@pengutronix.de>
Date:   Fri Sep 28 18:17:44 2012 +0200

    davinci_emac: return 0 on successful transmit

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-05 18:51:56 +02:00
Sascha Hauer 258e096e13 net fec_imx: determine fec version based on device ids
This adds the device id mechanism to the i.MX fec driver and
uses it to determine the fec version. Also adds devicetree
probing support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-05 12:32:37 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7407118bbf net/designware: fix phylib support
/opt/work/barebox/drivers/net/designware.c: In function 'dwc_update_linkspeed':
/opt/work/barebox/drivers/net/designware.c:234:9: error: 'mac_p' undeclared (first use in this function)
/opt/work/barebox/drivers/net/designware.c:234:9: note: each undeclared identifier is reported only once for each function it appears in
/opt/work/barebox/drivers/net/designware.c: In function 'dwc_ether_open':
/opt/work/barebox/drivers/net/designware.c:254:6: error: too few arguments to function 'phy_device_connect'
/opt/work/barebox/include/linux/phy.h:252:5: note: declared here
/opt/work/barebox/drivers/net/designware.c: At top level:
/opt/work/barebox/drivers/net/designware.c:226:13: warning: 'dwc_update_linkspeed' defined but not used

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:20:43 +02:00
Jean-Christophe PLAGNIOL-VILLARD 65f0148e22 net/designware: update version display to print user ID and Synosys ID
So we can check it with the kernel one

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:20:43 +02:00
Sascha Hauer df80e39547 net mdio_bus: Add missing bus_register
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:08:06 +02:00
Sascha Hauer 94de405d8f Merge branch 'for-next/imx-clk' 2012-10-04 15:24:57 +02:00
Sascha Hauer 70253cbbbb net fec: Switch to clk support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 15:19:56 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3c5327e660 switch all platform_bus device/driver registering to platform_driver/device_register
now register_driver and register_device are for bus only usage.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-04 15:19:12 +02:00
Sascha Hauer d1e65d2a7b Merge branch 'for-next/remove-fsf-address'
Conflicts:
	drivers/net/miidev.c
	include/miidev.h
2012-10-03 21:12:48 +02:00
Sascha Hauer 8338984862 Merge branch 'for-next/net' 2012-10-03 21:09:55 +02:00
Sascha Hauer d4541ee94f Merge branch 'for-next/driver' 2012-10-03 21:09:34 +02:00
Jan Luebbe 81b5356215 davinci_emac: get rid of mdio wrapper functions
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-29 12:58:18 +02:00
Jan Luebbe 419ae85d44 davinci_emac: adjust to new phylib framework
Also pass flags using platform_data and remove useless casts from void*.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-29 12:58:12 +02:00
Jan Luebbe 76c4c9e48f davinci_emac: return 0 on successful transmit
The _send function should not return the length of the transmitted packet.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-29 12:57:59 +02:00
Sascha Hauer 0dc9de2efd net/eth: fix link handling
Check link status on eth device open time and then periodically
every 5 seconds.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-27 23:55:12 +02:00
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
Sascha Hauer 26eab97b41 net fec_mpc5200: Use same platform_data as i.MX fec driver
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-23 20:35:20 +02:00
Jean-Christophe PLAGNIOL-VILLARD 660809446f net/tap: use xzalloc to allocate data
this will ensure the data are set to 0 (list as example)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-20 08:50:59 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:57:41 +02:00
Jan Luebbe 13e657f712 drivers/net: add driver for the EMAC device found in some TI SoCs
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:54:50 +02:00
Jan Luebbe d836d76d97 drivers/net/ksz8864rmn: add driver for Micrel KSZ8864RMN Ethernet Switch
It starts the switch and provides basic access to the registers.

This driver could also work with some other Micrel switches, possibly
with some small changes.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-14 11:47:42 +02:00
Eric Bénard 79101c609c miidev: fix 1G wrong detection
since 99e72c8bbd on an i.MX51 based board,
I get : "phy0: Link is up - 1000/Full". It seems miidev tries to probe
the PHY to early and gets 0x3ffff which leads to the wrong capabilities
setting.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-14 09:03:03 +02:00
Jean-Christophe PLAGNIOL-VILLARD 8b3bf5971a tap: fix missing parent setting on eth_device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:26:26 +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
Sascha Hauer 40830caf4e Merge branch 'for-next/smc911x' 2012-09-05 12:59:59 +02:00
Sascha Hauer 6662e16dbb Merge branch 'for-next/ppc'
Conflicts:
	arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
	arch/ppc/configs/p2020rdb_defconfig
	arch/ppc/mach-mpc85xx/include/mach/immap_85xx.h
2012-09-05 12:59:54 +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
Wolfram Sang b732f178b7 net: miidev: really wait for auto negotiation
miidev_wait_aneg() polled the wrong bit, so link detection did fail on
boards where the PHY had to come out of a powerdown mode.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-03 09:43:59 +02:00
Renaud Barbier caf788ae5a net: GIANFAR driver
This update adds the GIANFAR driver along with the configuration
and build files.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-10 21:15:36 +02:00
Sascha Hauer 149d4764a3 Merge branch 'for-next/ethernet' 2012-07-02 11:00:33 +02:00
Sascha Hauer 05772f77e8 Merge branch 'for-next/net-designware' 2012-07-02 11:00:05 +02:00
Sascha Hauer f22d4e2778 Merge branch 'for-next/sparse' 2012-07-02 10:59:37 +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 3e503822c7 use loff_t for file offsets
This is a first step for 64bit file support: Make the file sizes/offsets
64bit.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +02:00
Johannes Stezenbach 8f2fcf6554 miidev: consistent md and mw on phy regs
The dump generated by "md -w -s /dev/phy0"
suggests individual registers need to be
addressed by byte offset, not by register number.
E.g. to set the autonegotiation advertisement register
for 10Mbit only, use "mw -w -d /dev/phy0 8+2 0x0061".
The current mix of offset == register number, but
count == byte count is unintuitive.

Also, to be consistent with "md" on /dev/mem, round up
the count so "8+1" also works to access one register.
However, no attempt is made to do read-modify-write
single byte writes.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 13:58:18 +02:00
Johannes Stezenbach 99e72c8bbd miidev: add support for 1000Mbit
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 13:58:18 +02:00
Johannes Stezenbach 1b725b9c44 miidev: actually probe the PHY
Check if the PHY is really accessible (e.g. the
PHY address is correct) during probe.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 13:58:18 +02:00
Johannes Stezenbach 467d9d9cee miidev: fix auto negotiation
The auto negotiation result is the intersect
of the advertised abilities and the link partner abilities.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 13:58:14 +02:00
Johannes Stezenbach 54edd7cfa9 drivers/net: add designware driver
Straight forward port of Synopsys Designware ethernet
driver from u-boot v2012.04.01.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-26 17:41:12 +02:00
Juergen Beisert 79dc70c9ea netX/network: fix debug outputs
If DEBUG is defined it fails due to wrong variable names

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:45:55 +02:00
Sascha Hauer ba361ee78f Merge branch 'pu/mx6-v2' into next
Conflicts:
	arch/arm/Makefile
	arch/arm/mach-imx/Kconfig

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-24 10:38:23 +02:00
Sascha Hauer 7753263c50 net mii: Add mii_open/mii_close functions
Some phys need board specific fixups. To be able to do this
from board code add mii_open/mii_close functions so that the
board can use the regular mii_read/mii_write functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-24 10:31:47 +02:00
Sascha Hauer 86cfd96af4 net fec: Add i.MX6 support
Currently only 100Mb/s is tested. Freescale's U-Boot suggests that
there are some additional adjustments necessary for Gigabit support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-24 10:31:47 +02:00
Sascha Hauer abe4560c8a Use DEVICE_ID_DYNAMIC where applicable
We now have DEVICE_ID_DYNAMIC for dynamic allocation of device ids,
Use it where applicable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-16 09:43:02 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2452210ac9 net: at91_ether re-implement against new at91rm9200 api
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-02 10:26:14 +02:00
Wolfram Sang 6cbecc4163 net: miidev: properly check for MII reset
Wait until the reset bit is actually cleared instead of some
arbitrary delay (which caused problems with a PHY which was in some
energy saving mode).

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-23 08:23:11 +01:00
Wolfram Sang b7c9126750 net: miidev: Refactor timeout for aneg
First check the status at least once, then do timeout checks. Minor
cleanups also.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-23 08:23:11 +01:00
Wolfram Sang 76ed3bd9ef net: miidev: check for errors when accessing bus in restart_aneg
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-23 08:23:11 +01:00
Jan Weitzel 4088ab5588 NET: Add support for ks8851_mll
Add support for KS8851 16bit MLL chip from Micrel Inc.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-13 13:35:29 +01:00
Jean-Christophe PLAGNIOL-VILLARD 89c670c945 macb: fix mmu support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-06 09:46:01 +01:00
Jean-Christophe PLAGNIOL-VILLARD f4b9f8a9af macb: add timeout on send
This will ensure that we send an other packet only when the first one is send.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-06 09:45:57 +01:00
Sascha Hauer 78da28d088 net fec_mpc5200: drop type_data usage
Also, clean some whitespace damage.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:30 +01:00
Sascha Hauer 89fe5482e7 net fec_imx: drop type_data usage
Store the private data pointer in dev->priv as it's intended.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:30 +01: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 67d938b2ea net: use container_of instead of dev->type_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:22 +01:00
Sascha Hauer 4af196ebfc usb net: fix unregistration
First call mii_unregister which is done in the drivers unbind function,
then eth_unregister. Also, remove unregister_device which is done in
eth_unregister.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-14 23:57:00 +01:00
Sascha Hauer daa068fcfb usb net smsc95xx: add missing mii_unregister
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-14 23:56:46 +01:00
Sascha Hauer c3523db81f usb net smsc95xx: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-14 23:56:42 +01:00
Wolfram Sang 79b385b017 net: fec_imx: configure FEC for 10Mbit when necessary
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-25 18:10:26 +01:00
Wolfram Sang cae7e5b7f9 net: miidev: factor out miidev_get_status()
Currently, we can only print the phy_status. Factor out the routine to
get the status, so we can query it from fec drivers and configure
accordingly. Needed because mx28 needs a special bit set for 10Mbit.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-25 18:10:26 +01:00
Wolfram Sang ad0bd00a55 net: fec_imx: enable payload length check and pause frames
Q: "the linux driver add these bits, why not we?"
A: Because nobody activated the bits?

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-25 18:10:26 +01:00
Wolfram Sang 6b145cd3b3 net: fec_imx: refactor R_CNTRL setup
Introduce a variable which gets updated when needed and only written
once. Will make further additions easier.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-25 18:10:26 +01:00
Wolfram Sang eeabfc4ab5 net: fec_imx: small cleanups
remove double include, remove unused (and double in case of RCNTRL)
defines, sort the includes at least somewhat.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-25 18:10:26 +01:00
Sascha Hauer 3f8c7f6f19 net dm9k: Fix compiler warning
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 14:53:17 +01:00
Juergen Beisert c2580681e5 Remove the obsolet driver for the DM9000E ethernet device
Support for the old DM9000E device is now part of the new dm9k.c driver. So,
remove the old driver source and switch all users to the new driver.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-14 14:09:04 +01:00
Juergen Beisert 7989c230a2 Add support for more recent Davicom DM9k devices
This patch adds support for the more recent DM9000A and DM9000B types, and keeps
support for the older DM9000E device. As this patch is more or less a complete
re-wrote of the existing driver I add a new source file instead of fixing the
existing one. In a later patch the old driver will be removed.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-14 14:09:04 +01:00
Sascha Hauer 37b5fef49d net macb: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 13:06:10 +01:00
Sascha Hauer 38884dabbe remove irq support fragments
We never had interrupt support in barebox and we have no plans to
add interrupt support. Even if we do I doubt the current fragments
of irq support are helpful, so remove them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-28 11:41:33 +01:00
Sascha Hauer 7d593c7765 net fec_mpc5200: disable fec on shutdown
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-27 12:03:25 +02: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
Hubert Feurstein 51a4275c71 macb: handle clk_get error
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-12 12:24:59 +02:00
Hubert Feurstein 2acf27797c macb: whitespace cleanup
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-12 12:24:59 +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 def04cd255 net fec_mpc5200: fix lineendings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-15 09:45:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD 06c36cf09e dm9000: introduce add_dm9000_device to register dm9000 device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-29 14:04:24 +08:00
Jean-Christophe PLAGNIOL-VILLARD 3465da7aa8 dm9000: replace DM9000_WIDTH_8/16/32 by IORESOURCE_MEM_8/16/32BIT
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-29 14:04:24 +08:00
Sascha Hauer a6aefdeaee Merge branches 'pu-ethaddr', 'pu-fec', 'pu-imx-iim', 'pu-resources' and 'pu-resources1' into next 2011-07-29 12:09:58 +02:00
Sascha Hauer 2fd4fa2e99 ARM i.MX: rework IIM MAC address setting
Switch to the generic way of setting a MAC address for a
device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-29 12:05:26 +02:00
Sascha Hauer 6060de6e88 fec_mpc5200: switch to resources
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:40:16 +02:00
Sascha Hauer 07506a2282 smc91111: switch to resources
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 15:39:41 +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 2b2994a4f9 net i.MX fec: rename driver struct to be generic
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 12:07:39 +02:00
Sascha Hauer 98d9ce9bec net i.MX fec: embed ethernet device into priv
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 12:07:39 +02:00
Sascha Hauer 0b9bb06a36 net i.MX fec: remove unnecessary alignment
dma_alloc_coherent returns sufficiently aligned memory. While
at it, remove some unnecessary casts.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 12:07:39 +02:00
Sascha Hauer 7079d33597 net i.MX fec: make multi instance safe
The driver uses a static int once variable to alloc the
rx packets. remove this to make the driver multi instance
safe. While at it, remove the crappy selfmade alignment.
dma_alloc_coherent returns sufficiently aligned memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 12:07:39 +02:00
Franck Jullien 901cc10e60 nios2/altera_tse: Switch to resources
Switch to resources usage. Cleanup of the code.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-27 10:54:13 +02:00
Jean-Christophe PLAGNIOL-VILLARD bf466e7ad7 dm9000: switch to dev_request_mem_region
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-20 08:25:44 +02:00
Jean-Christophe PLAGNIOL-VILLARD 358ab3eb84 atmel/drivers: switch to dev_request_mem_region
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-20 08:25:43 +02:00
Sascha Hauer 025807bf89 net i.MX fec: convert to struct resource
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-19 00:12:51 +08:00
Jean-Christophe PLAGNIOL-VILLARD 23c7b4c4f0 dm9200: use "struct resource" instead of platform_data
drop iobase and iodata in favor of resources

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 07:57:51 +08:00
Jean-Christophe PLAGNIOL-VILLARD 1413523c99 macb: switch to "struct resource"
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 07:57:50 +08:00
Sascha Hauer c6abd61fa8 Merge branch 'master' into next 2011-06-20 09:08:13 +02:00
Hubert Feurstein cdc578325a macb: add support for board specific get_ethaddr function
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-20 08:46:27 +02:00
Franck JULLIEN 88210b2d40 Fix compiler warning
Fix incompatible pointer type warning.

Signed-off-by: Franck JULLIEN <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-05-16 08:23:49 +02:00
Franck JULLIEN 3260e9ef8d Nios2: Add Altera TSE driver
Add Altera Triple Speed Ethernet driver

Signed-off-by: Franck JULLIEN <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-05-02 09:41:07 +02:00
Franck JULLIEN 554d9671d5 Fix coding style in driver/net/Makefile
Signed-off-by: Franck JULLIEN <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-05-02 09:41:07 +02:00
Sascha Hauer 9ba8f95724 Merge branch 'omap-drivers' into next 2011-04-06 09:20:21 +02:00
Sascha Hauer 645eeeac99 usbnet: do not initialize ethernet device from usb device
The network layer will initialize this correctly for us.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 15:07:27 +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 63c108bf61 usb net: Add SMSC95xx support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-30 22:20:11 +02:00
Jean-Christophe PLAGNIOL-VILLARD a0c1644d84 dm9000: read the mac address from the register if none are specified
as barebox can be run as a second stage the first stage may have init it
before so re-used it

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-03 16:15:56 +01:00
Juergen Beisert 1f167559e2 Fix end of expression char (some lines forgotten in v1)
Its not a bug fix, just a clean up.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-03 16:15:56 +01:00
Juergen Beisert 4f72931ba4 Fix end of expression char
Its not a bug fix, just a clean up.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-03 16:15:56 +01:00
Robert Schwebel 90613cd09a tx28: fix kconfig warning
Without this patch (against next) I get this:

rsc@thebe:barebox$ make ARCH=arm CROSS_COMPILE=<path>/arm-v5te-linux-gnueabi- menuconfig
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
warning: (ARCH_IMX25 && ARCH_IMX27 && ARCH_IMX35 && ARCH_IMX51 && ARCH_IMX28) selects ARCH_HAS_FEC_IMX which has unmet direct dependencies (ARCH_IMX)
warning: (ARCH_IMX25 && ARCH_IMX27 && ARCH_IMX35 && ARCH_IMX51 && ARCH_IMX28) selects ARCH_HAS_FEC_IMX which has unmet direct dependencies (ARCH_IMX)

Add the option for the FEC on MX28 as well.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-02-10 08:16:47 +01:00
Sascha Hauer 06ea6c135d Merge branch 'next' 2011-02-03 10:49:18 +01:00
Sascha Hauer e88d86a445 ARM: rename STM arch to mxs
We never supported the sigmatel stm chips and probably
never will. So do the first step and rename the architecture
to mxs just like in the kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-20 10:43:24 +01:00
Baruch Siach 2f39e0604e miidev: allow read/write of all registers
Ethernet PHY devices have 32 registers, each 16 bits wide. Thus, the size of
the phy device should be 64 bytes.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-19 09:36:06 +01:00
Sascha Hauer 2f0109b1bb Merge branch 'master' into next 2011-01-17 09:43:40 +01:00
Sascha Hauer 06b7cc4875 fec i.MX28: Make it work with MMU on
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 09:42:56 +01: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
Sascha Hauer 0f81fc1ca9 dm9000: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 11:36:06 +01:00
Sascha Hauer 573400471d cs8900: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 11:35:58 +01:00
Sascha Hauer d31a7a7eca fec_imx: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:37:41 +01:00
Krzysztof Halasa c5baa0edc4 Fix error handling with malloc, memalign etc. Introduce xmemalign().
The idea is to panic() when there is no memory available for normal
operation. Exception: code which can consume arbitrary amount of RAM
(example: files allocated in ramfs) must report error instead of panic().

This patch also fixes code which didn't check for NULL from malloc() etc.

Usage: malloc(), memalign() return NULL when out of RAM.
xmalloc(), xmemalign() always return non-NULL or panic().

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:21:22 +01:00
Krzysztof Halasa d66ae58cd8 Cosmetic fixes, including format attributes for printf() and friends.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-21 09:02:40 +01:00
Juergen Beisert cf463d7430 MX28: add FEC support
The i.MX28 comes with an extended ethernet controller (ENET/FEC) which
is backwards compatible to the FEC known from other i.MX CPUs. Add a few
adaptions to the existing driver to make it work with the MX28 FEC.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-14 15:15:07 +01:00
Juergen Beisert 07965c6fa1 Fixup the FEC driver files
Some register bits are not defined in the IMX CPUs using this FEC (at least
I did not find anything about them in the related datasheets) and they will
get (partially) a new meaning in the i.MX28 CPU. So, removing them from the
source seems the best way to avoid any accidental usage on i.MX28.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-14 15:15:07 +01:00
Jean-Christophe PLAGNIOL-VILLARD a6e514b388 miidev: allow multiple dev
now we need to set the dev id to -1

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:55:25 +01:00
Marek Belisko 52f5f20baa smc91111: Various sparse fixes.
Patch fix all similar warnings found by sparse:
drivers/net/smc91111.c:488:9:
warning: incorrect type in argument 1 (different base types)
	expected void const volatile [noderef] <asn:2>*<noident>
	got unsigned long [unsigned] offset

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-19 09:35:09 +01:00
Sascha Hauer 884273c24f fec_imx: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:23 +02:00
Sascha Hauer fce89665e2 netx eth: Fix compilation
Also, replace __FUNCTION__ with __func__

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-02 12:50:05 +02:00
Sascha Hauer ac4c5e36bd ep93xx net driver: Fix compilation
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-02 12:48:35 +02:00
Sascha Hauer b610fbf17d fec_mpc5200: Fix compilation
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-02 12:45:10 +02: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
Jean-Christophe PLAGNIOL-VILLARD 086f96b8e6 macb: introduce HAS_MACB configuration
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-08-23 11:20:21 +08:00
Jean-Christophe PLAGNIOL-VILLARD 54d6627f02 dm9000: allow to specify that no srom is present
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-08-23 11:20:21 +08:00
Baruch Siach 9965f8f78a fec_imx: add support for IIM stored mac address
The mac address information is taken from the imx_iim driver if it's present.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-17 10:21:26 +02:00
Jean-Christophe PLAGNIOL-VILLARD 873910050e at91: implement clock framework
this implementation is based on linux one (v2.6.35-rc5-76-gd0c6f62)
it will calculate all the clock dynamically instead of statictly
this will use also the new clock framework

it will also print the clock status after the console init

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:09:00 +02:00
Sascha Hauer 322bace5fb usbnet: remove unused dev member in struct usbnet
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-24 11:36:42 +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
Jan Weitzel 972d116ada fix miiphy alloc
if fec was allocated using malloc. if fec->miiphy->dev->driver != 0
miiphy_probe is not called

Signed-off-by: Jan Weitzel <J.Weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-04-14 10:12:51 +02:00
Sascha Hauer e3b2046685 netx eth driver: remove local definition of ARRAY_SIZE
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:04 +02:00
Sascha Hauer 6f5a6b591a pass arguments to dma_* as unsigned long as the kernel does
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:03 +02:00
Matthias Kaehlcke e1e9fc4ce9 ep93xx eth driver: dump_xxx() cleanup
ep93xx eth driver dump_xxx() functions: Use %p to print pointer values,
remove unnecessary parentheses and declare as static

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-03 12:12:25 +01:00
Matthias Kaehlcke 7f9bde68aa ep93xx eth driver: Remove unnecessary parentheses in constant definitions
ep93xx eth driver: Remove unnecessary parentheses in definition of the constants
MII_ADDRESS_MAX and MII_REGISTER_MAX

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-03 12:12:25 +01:00
Matthias Kaehlcke e1cd82c07e ep93xx eth driver: Reorder functions to eliminate need for prototypes
ep93xx eth driver: Define ep93xx_eth_send_packet() and ep93xx_eth_rcv_packet()
before ep93xx_eth_probe(), and eliminate their prototype declarations

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-02 08:34:57 +01:00
Matthias Kaehlcke 0e46c2673e ep93xx eth driver: Fix dump_xxx_queue() parameter list
ep93xx eth driver: Add missing parameter to dump_rx_status_queue(),
dump_tx_descriptor_queue() and dump_tx_status_queue()

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-02 08:34:57 +01:00
Marc Kleine-Budde 4903636f98 smc91111: fix odering of mac address read from EEPROM
On my little endian PXA270, the ethernet address is byte swapped:

correct ethernet address: 00:50:c2:80:a7:bd
broken  ethernet address: 50:00:80:c2:bd:a7

The correct value is what the sticker on the baoard and the linux driver
says. This patch fixes the problem by reading the ethaddr byte-wise from
the eeprom.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 16:27:35 +01:00
Matthias Kaehlcke 6f4ed9536d Add EP93xx ethernet driver
Added ethernet driver for EP93xx SoCs

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-01-14 10:04:13 +01:00
Eric Benard faa8f98ea7 Fix a data abort with fec_imx
edev was allocated using malloc. On one board (NOR boot), we met data abort
in eth_register (at dev_add_param(dev, &edev->param_ip);).
Allocating edev with xzalloc (as in several other drivers) fixed the problem.

Signed-off-by: Eric Benard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-01-11 18:58:16 +01:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
This has been done with the following script:

find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \
	-e 's/u2boot/barebox/g' \
	-e 's/U2Boot/barebox/g' \
	-e 's/U-boot V2/barebox/g' \
	-e 's/u-boot v2/barebox/g' \
	-e 's/U-Boot V2/barebox/g' \
	-e 's/U-Boot-v2/barebox/g' \
	-e 's/U_BOOT/BAREBOX/g' \
	-e 's/UBOOT/BAREBOX/g' \
	-e 's/uboot/barebox/g' \
	-e 's/u-boot/barebox/g' \
	-e 's/u_boot/barebox/g' \
	-e 's/U-Boot/barebox/g' \
	-e 's/U-boot/barebox/g' \
	-e 's/U-BOOT/barebox/g'

find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \
	xargs -0 -r rename 's/u[-_]?boot/barebox/'

It needs some manual fixup following in the next patch

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-15 10:18:30 +01:00
Marc Kleine-Budde c985ea0cb6 fec_imx: remove trailing whitespace
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2009-11-21 19:49:02 +01:00
Jean-Christophe PLAGNIOL-VILLARD e988d5d990 [PPC] Move include/asm-ppc/arch-* to arch/ppc/*/include/mach
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-22 14:21:30 +02:00
Jean-Christophe PLAGNIOL-VILLARD b4521685bf [SANDBOX] Move include/asm-sandbox/arch-* to arch/sandbox/*/include/mach
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-22 14:21:29 +02:00
Jean-Christophe PLAGNIOL-VILLARD f6a579da9c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-22 14:21:25 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7ac3805353 at91: add cpu devices common api
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-20 15:02:37 +02:00
Jean-Christophe PLAGNIOL-VILLARD 81362c2b2a at91sam9: move to at91
this will allow to add at91rm9200 with the same api as done in the kernel

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-20 15:02:36 +02:00
Sascha Hauer 15abc47dba miiphy: Add missing lseek function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-19 15:58:53 +02:00
Sascha Hauer 1b019090f7 fec_imx: do not typedef struct
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 10:46:49 +02:00
Sascha Hauer aaf77314d8 sandbox tap driver: initialize device name
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-12 14:15:23 +02:00
Sascha Hauer 67551e7a76 fec_imx: initialize buffers on open time
We need to redo buffer initialization each time we open
the device, not only once on init time. Otherwise network
does not work if the last transfer was interrupted with
ctrl-c

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-09 11:57:07 +02:00
Sascha Hauer 3820307eb0 rename dma macros
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-25 13:34:57 +02:00
Sascha Hauer e471a5fd39 fec imx27: Add MMU support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-08-19 10:51:39 +02:00
Sascha Hauer 6437a0156a fec_imx: Make sure MII speed is correct before reading the phy
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-30 16:09:59 +02:00