9
0
Fork 0
Commit Graph

51 Commits

Author SHA1 Message Date
Sascha Hauer 22b878d251 net: Pass eth_device to net_receive
So that barebox has the information which interface a packet
came from.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-15 08:15:21 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7ccaaf71fe macb: add support to read the mac address from register
check the 4 mac address register and return at the first valid

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:36:14 +02:00
Steffen Trumtrar 33552e74b4 net: macb: turn off endian_swp_pkt_en
The core has a bit for swapping packet data endianism.
Reset default from Cadence is off. Xilinx however, that uses this core on the
Zynq SoCs, opted for on. Turn it off for all devices.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-03 17:21:51 +02:00
Josh Cartwright 28acd8331d macb: rename platform data
The macb/gem core is used by the Zynq SoC.  In preparation of sharing
the macb driver between at91 and Zynq, rename the platform data to
'struct macb_platform_data', and move the definition to a common
location.

Signed-off-by: Josh Cartwright <joshc@eso.teric.us>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-03 17:21:51 +02:00
Jean-Christophe PLAGNIOL-VILLARD 58926bd26f macb: fix gem_recv circular buffer handling
as we use a full buffer no need to check the SOF
and reset the rx_tail

fix at the same time the gem detection so we can have the rx_buffer
allocated correctly according to the IP

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-15 16:49:36 +01:00
Alexander Shiyan 6a256321b8 Use new device_platform_driver() macro for drivers
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-13 09:23:28 +01:00
Jean-Christophe PLAGNIOL-VILLARD 9c305a0dbe macb: add cadence Gigabit GEM support
based on the kernel code
detect it via IP version

In the GEM we can use a full packet buffer for receive but the buffer size
need to be 64bit size aligned.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 19:59:52 +01:00
Jean-Christophe PLAGNIOL-VILLARD aa2095304a macb: fix tx ring size
the mininal tx ring size is 2 as if one we wrap on the same descriptor
and can cause IP lock on GEM (gigabit version) this is always the case

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 19:59:52 +01:00
Jean-Christophe PLAGNIOL-VILLARD 36bcee4892 net macb: reset the IP at init
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 09:34:50 +01:00
Jean-Christophe PLAGNIOL-VILLARD 044cb6a298 net macb: enable Tramsmit and Receive at open
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 09:34:46 +01:00
Jean-Christophe PLAGNIOL-VILLARD 882ae3da84 net macb: use the macro as in linux for tx/rx buffer ring size
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 09:34:42 +01:00
Jean-Christophe PLAGNIOL-VILLARD d702d97a8a net macb: sync remaining define with linux
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 09:34:37 +01:00
Jean-Christophe PLAGNIOL-VILLARD 2e2466f5ae net macb: call macb_init at probe explicitly
as eth_device init is planning for remove and we need the init before register
the mdio bus

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 09:34:29 +01:00
Jean-Christophe PLAGNIOL-VILLARD 0fcceb6c55 macb: drop non used define
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-08 09:35:40 +01:00
Jean-Christophe PLAGNIOL-VILLARD a097eabc81 macb: report timeout on send
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-08 09:35:39 +01:00
Jean-Christophe PLAGNIOL-VILLARD 554ab80b87 macb: use dev_xx message
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-08 09:34:58 +01:00
Jean-Christophe PLAGNIOL-VILLARD f7e3126619 macb: allow to pass the phy interface
as we will add later the GMAC IP verion support (GEM)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-29 11:44:49 +01:00
Jean-Christophe PLAGNIOL-VILLARD f0aa3cdf8d macb: sync register access and clock with the kernel
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-29 09:59:17 +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 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
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 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
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 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 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 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
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
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
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
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 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 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 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
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 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
Marc Kleine-Budde c18c577722 [mac] add force link support
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2009-05-18 16:20:04 +02:00
Marc Kleine-Budde dfc1d8ef6b [macb] clear RMII bit when using plain MII
When operating in plain MII mode, the driver assumes the RMII bit not
set. Although this is the power on reset value, clearing this bit helps
when playing with different network setups.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2009-05-18 16:20:04 +02:00
Marc Kleine-Budde f96f2d8e01 [macb] use phy_addr supplied by platform data
The driver was not using the phy address supplied by the platform
data. With this patch the miiphy.address is set phy addr supplied
by the mac platform data.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2009-01-13 12:12:40 +01:00
Sascha Hauer 4da7734725 macb eth driver: remove barrier() definition
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-26 11:40:51 +02:00
Sascha Hauer c10e20846d at91sam ether: Make more configurable via platform_data
Pass RMII and phy address via platform data rather than hardcoded.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-01 11:33:12 +02:00