project/bcm63xx/u-boot.git
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-avr32
Wolfgang Denk [Thu, 7 Jun 2012 21:41:03 +0000 (23:41 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-avr32

* 'master' of git://git.denx.de/u-boot-avr32:
  avr32:board.c: fix compile warning
  avr32:grasshopper: fix PHY initialisation

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-mips
Wolfgang Denk [Thu, 7 Jun 2012 21:38:54 +0000 (23:38 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-mips

* 'master' of git://git.denx.de/u-boot-mips:
  MIPS: board.c: move extern declarations to u-boot-mips.h
  MIPS: bootm_qemu_mips.c: make checkpatch.pl clean
  MIPS: bootm.c: make checkpatch.pl clean

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Wolfgang Denk [Thu, 7 Jun 2012 21:34:11 +0000 (23:34 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

* 'master' of git://git.denx.de/u-boot-sh:
  sh/ap_sh4a_4a: Fix typo of operator in ET0_ETXD4
  sh: Add SH7269 device and RSK2+SH7269 board
  sh: Set CONFIG_SH_ETHER_PHY_MODE and CONFIG_SH_ETHER_SH7734_MII to boards with sh_eth
  sh: Add support for AP-SH4A-4A board
  sh: Add register definition of PFC for SH7734
  sh: r0p7734: Add support I2C controller
  sh: Add bit control functions
  sh: Add support for r0p7734 board
  sh: Add support Renesas SH7734

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agoMPC8xxx: Define cache ops for USB
Marek Vasut [Fri, 25 May 2012 14:14:46 +0000 (16:14 +0200)]
MPC8xxx: Define cache ops for USB

This patch conditionally defines flush_dcache_range() and
invalidate_dcache_range() on MPC8xxx, to avoid EHCI complaining,
resulting in the following output:

$ ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- ./MAKEALL MPC8572DS
Configuring for MPC8572DS board...
make: *** [u-boot] Error 1
powerpc-linux-gnu-size: './u-boot': No such file
e1000.c: In function ‘e1000_initialize’:
e1000.c:5264:13: warning: assignment from incompatible pointer type [enabled by default]
tsec.c: In function ‘tsec_initialize’:
tsec.c:638:12: warning: assignment from incompatible pointer type [enabled by default]
drivers/usb/host/libusb_host.o: In function `ehci_td_buffer':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:186: undefined reference to `flush_dcache_range'
drivers/usb/host/libusb_host.o: In function `ehci_submit_async':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:346: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:348: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:349: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:372: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:374: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:376: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:386: undefined reference to `invalidate_dcache_range'
make: *** [u-boot] Error 1

--------------------- SUMMARY ----------------------------
Boards compiled: 1
Boards with errors: 1 ( MPC8572DS )
----------------------------------------------------------

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
12 years agoavr32:board.c: fix compile warning
Andreas Bießmann [Fri, 25 May 2012 10:29:33 +0000 (12:29 +0200)]
avr32:board.c: fix compile warning

This patch fixes following warning:

---8<---
board.c: In function 'board_init_r':
board.c:257: warning: unused variable 's'
--->8---

Patch de30122bb58fee7b0f94bcfabab595b6ad757336 missed to remove this variable
too.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
12 years agoavr32:grasshopper: fix PHY initialisation
Andreas Bießmann [Fri, 25 May 2012 10:29:32 +0000 (12:29 +0200)]
avr32:grasshopper: fix PHY initialisation

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
12 years agoMIPS: board.c: move extern declarations to u-boot-mips.h
Daniel Schwierzeck [Sun, 3 Jun 2012 21:46:04 +0000 (23:46 +0200)]
MIPS: board.c: move extern declarations to u-boot-mips.h

This fixes some remaining checkpatch.pl warnings.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
12 years agoMIPS: bootm_qemu_mips.c: make checkpatch.pl clean
Daniel Schwierzeck [Sun, 3 Jun 2012 21:46:04 +0000 (23:46 +0200)]
MIPS: bootm_qemu_mips.c: make checkpatch.pl clean

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
12 years agoMIPS: bootm.c: make checkpatch.pl clean
Daniel Schwierzeck [Sun, 3 Jun 2012 21:46:04 +0000 (23:46 +0200)]
MIPS: bootm.c: make checkpatch.pl clean

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
12 years agosh/ap_sh4a_4a: Fix typo of operator in ET0_ETXD4
Nobuhiro Iwamatsu [Tue, 22 May 2012 04:59:38 +0000 (13:59 +0900)]
sh/ap_sh4a_4a: Fix typo of operator in ET0_ETXD4

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add SH7269 device and RSK2+SH7269 board
Phil Edworthy [Tue, 15 May 2012 22:15:51 +0000 (22:15 +0000)]
sh: Add SH7269 device and RSK2+SH7269 board

This is an sh2a device (max 266MHz) with FPU, video display
controller (VDC), 8 serial ports, 4 I2C channels, 3 CAN ports,
SD and on-chip USB.

The RSK2+SH7269 board uses the SH7269 processor. It is often
referred to as just rsk7269.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Set CONFIG_SH_ETHER_PHY_MODE and CONFIG_SH_ETHER_SH7734_MII to boards with sh_eth
Nobuhiro Iwamatsu [Wed, 16 May 2012 01:23:21 +0000 (10:23 +0900)]
sh: Set CONFIG_SH_ETHER_PHY_MODE and CONFIG_SH_ETHER_SH7734_MII to boards with sh_eth

The board with sh_eth needs to set CONFIG_SH_ETHER_PHY_MODE.
And SH7734 needs to set value of CONFIG_SH_ETHER_SH7734_MII.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add support for AP-SH4A-4A board
Nobuhiro Iwamatsu [Wed, 9 May 2012 06:59:30 +0000 (15:59 +0900)]
sh: Add support for AP-SH4A-4A board

The AP-SH4A-4A board has SH7734, 64MB DDR2-SDRAM, USB,
Ethernet, and more.

This patch supports the following functions:
  - 64MB DDR2-SDRAM
  - 16MB NOR Flash memory
  - Serial console (SCIF)
  - Ethernet (SH-Ether with Gigabit)
  - I2C

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add register definition of PFC for SH7734
Nobuhiro Iwamatsu [Wed, 9 May 2012 07:00:01 +0000 (16:00 +0900)]
sh: Add register definition of PFC for SH7734

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: r0p7734: Add support I2C controller
Nobuhiro Iwamatsu [Fri, 2 Mar 2012 03:58:33 +0000 (12:58 +0900)]
sh: r0p7734: Add support I2C controller

This read MAC address from Serial EEPROM and set.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add bit control functions
Nobuhiro Iwamatsu [Wed, 15 Feb 2012 07:47:01 +0000 (16:47 +0900)]
sh: Add bit control functions

This provide bit control functions as clrbits_*, setbits_* and
clrsetbits_*.

V2: Fix comment style and error of whitespace.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Acked-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add support for r0p7734 board
Nobuhiro Iwamatsu [Thu, 12 Jan 2012 02:12:28 +0000 (11:12 +0900)]
sh: Add support for r0p7734 board

The r0p7734 board has SH7734, 128MB DDR2-SDRAM, USB,
Ethernet, and more.

This patch supports the following functions:
- 128MB DDR2-SDRAM
- 32MB NOR Flash memory
- Serial console (SCIF)
- Ethernet (SH-Ether/SMSC)

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add support Renesas SH7734
Nobuhiro Iwamatsu [Wed, 11 Jan 2012 01:45:01 +0000 (10:45 +0900)]
sh: Add support Renesas SH7734

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agonet: sh-eth: Add support Gigabit of SH7734
Nobuhiro Iwamatsu [Tue, 15 May 2012 15:49:39 +0000 (15:49 +0000)]
net: sh-eth: Add support Gigabit of SH7734

SH7734 support GMII. This add register infomation and the function
which enable GMII.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
12 years agonet: sh_eth: Add support SH7734 Ethernet device
Nobuhiro Iwamatsu [Thu, 2 Feb 2012 21:28:49 +0000 (21:28 +0000)]
net: sh_eth: Add support SH7734 Ethernet device

SH7734 has one channel ethernet device.
This support 10/100/1000Base, and RMII/MII/GMII.
And this has the same structure as SH7763.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
12 years agonet: Allow filtering on debug traces in the net subsystem
Joe Hershberger [Wed, 23 May 2012 08:01:04 +0000 (08:01 +0000)]
net: Allow filtering on debug traces in the net subsystem

Add several levels of DEBUG prints so that you can limit the noise to
the severety of your problem.

DEBUG_LL_STATE = Link local state machine changes
DEBUG_DEV_PKT = Packets or info directed to the device
DEBUG_NET_PKT = Packets on info on the network at large
DEBUG_INT_STATE = Internal network state changes

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Work-around for brain-damaged Cisco equipment with arp-proxy
Joe Hershberger [Wed, 23 May 2012 08:00:13 +0000 (08:00 +0000)]
net: Work-around for brain-damaged Cisco equipment with arp-proxy

Cisco's arp-proxy feature fails to ignore the link-local address range
This means that a link-local device on a network with this Cisco
equipment will reply to ARP requests for our device (in addition to
our reply).
If we happen to reply first, the requester's ARP table will be
populated with our MAC address, and one packet will be sent to us...
shortly following this, the requester will get an ARP reply from the
Cisco equipment telling the requester to send packets their way
instead of to our device from now on.
This work-around detects this link-local condition and will delay
replying to the ARP request for 5ms so that the first packet is sent
to the Cisco equipment and all following packets are sent to our
device.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Add link-local addressing support
Joe Hershberger [Wed, 23 May 2012 08:00:12 +0000 (08:00 +0000)]
net: Add link-local addressing support

Code based on networking/zcip.c in busybox
commit 8531d76a15890c2c535908ce888b2e2aed35b172

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Separate ArpRequest() into lower-level func
Joe Hershberger [Wed, 23 May 2012 08:00:11 +0000 (08:00 +0000)]
net: Separate ArpRequest() into lower-level func

Link-local support will need to send ARP packets, but needs more
fine-grained control over the contents.  Split the implementation
into 2 parts so link-local can share the code.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Don't copy every packet that waits for an ARP
Joe Hershberger [Wed, 23 May 2012 07:59:24 +0000 (07:59 +0000)]
net: Don't copy every packet that waits for an ARP

Use the NetArpTxPacket for the ARP packet, not to hold what used to
be in NetTxPacket.
This saves a copy and makes the code easier to understand.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Make sure NetLoop is initialized when using NetConsole
Joe Hershberger [Wed, 23 May 2012 07:59:23 +0000 (07:59 +0000)]
net: Make sure NetLoop is initialized when using NetConsole

Fix NetConsole bug that causes first packet header to claim a
source IP address of 0.0.0.0

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Fix net buffer initialization
Joe Hershberger [Wed, 23 May 2012 07:59:22 +0000 (07:59 +0000)]
net: Fix net buffer initialization

A new non-static function net_init() will initialize buffers and
read from the environment.  Only update from the env on each entry
to NetLoop().

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Remove unused parameter from NetInitLoop()
Joe Hershberger [Wed, 23 May 2012 07:59:21 +0000 (07:59 +0000)]
net: Remove unused parameter from NetInitLoop()

Noone uses it.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Remove static allocation for MAC address in PingSend()
Joe Hershberger [Wed, 23 May 2012 07:59:20 +0000 (07:59 +0000)]
net: Remove static allocation for MAC address in PingSend()

Don't force ARP clients to return the MAC address if they don't care
(such as ping)

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Add option CONFIG_BOOTP_MAY_FAIL
Joe Hershberger [Wed, 23 May 2012 07:59:19 +0000 (07:59 +0000)]
net: Add option CONFIG_BOOTP_MAY_FAIL

This is useful if you want to look for a DHCP server, but try some
other settings if not available.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Fix unused variable compile warning
Joe Hershberger [Wed, 23 May 2012 07:59:18 +0000 (07:59 +0000)]
net: Fix unused variable compile warning

If CONFIG_BOOTP_SERVERIP is not defined, unused variable warning is
reported.  This was fixed upstream using a compiler feature instead
of a simple reorder of the statements.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Don't write the "serverip" env var if configured not to
Joe Hershberger [Wed, 23 May 2012 07:59:17 +0000 (07:59 +0000)]
net: Don't write the "serverip" env var if configured not to

Before this patch, bootp would not overwrite the value, but the
value was still clobbered in the env

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Add net_update_ether() to handle ARP and Ping replies
Joe Hershberger [Wed, 23 May 2012 07:59:16 +0000 (07:59 +0000)]
net: Add net_update_ether() to handle ARP and Ping replies

When the network is VLAN or SNAP, net_update_ether() will preserve
the original Ethernet packet header and simply replace the src and
dest MACs and the protocol

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor to separate the UDP handler from the ARP handler
Joe Hershberger [Wed, 23 May 2012 07:59:15 +0000 (07:59 +0000)]
net: Refactor to separate the UDP handler from the ARP handler

Call a built-in dummy if none is registered... don't require
protocols to register a handler (eliminating dummies)
NetConsole now uses the ARP handler when waiting on arp
(instead of needing a #define hack in arp.c)
Clear handlers at the end of net loop

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor to protect access to the NetState variable
Joe Hershberger [Wed, 23 May 2012 07:59:14 +0000 (07:59 +0000)]
net: Refactor to protect access to the NetState variable

Changes to NetState now go through an accessor function called
net_set_state()

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Refactor to use NetSendPacket instead of eth_send directly
Joe Hershberger [Wed, 23 May 2012 07:59:13 +0000 (07:59 +0000)]
net: Refactor to use NetSendPacket instead of eth_send directly

Use this entry-point consistently across the net/ code
Use a static inline function to preserve code size

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor ping receive handler
Joe Hershberger [Wed, 23 May 2012 07:59:12 +0000 (07:59 +0000)]
net: Refactor ping receive handler

There is no need to call through the handler... inline it

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Move debug trace to point of action
Joe Hershberger [Wed, 23 May 2012 07:59:11 +0000 (07:59 +0000)]
net: Move debug trace to point of action

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor bootp packet length computations
Joe Hershberger [Wed, 23 May 2012 07:59:10 +0000 (07:59 +0000)]
net: Refactor bootp packet length computations

Eliminate pointer subtraction that recovers values computed earlier

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor packet length computations
Joe Hershberger [Wed, 23 May 2012 07:59:09 +0000 (07:59 +0000)]
net: Refactor packet length computations

Save the length when it is computed instead of forgetting it and
subtracting pointers to figure it out again.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Refactor NetSendUDPPacket to share more code
Joe Hershberger [Wed, 23 May 2012 07:59:08 +0000 (07:59 +0000)]
net: Refactor NetSendUDPPacket to share more code

Share more of the code that is common between ARP vs not.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor IP, UPD, and ICMP header writing functions
Joe Hershberger [Wed, 23 May 2012 07:59:07 +0000 (07:59 +0000)]
net: Refactor IP, UPD, and ICMP header writing functions

ICMP (ping) was reimplementing IP header code... it now shares code.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: cosmetic: Replace magic numbers in arp.c with constants
Joe Hershberger [Wed, 23 May 2012 07:58:17 +0000 (07:58 +0000)]
net: cosmetic: Replace magic numbers in arp.c with constants

Use field names and sizes when accessing ARP packets

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: cosmetic: Rename tmp to reply_ip_addr in arp.c
Joe Hershberger [Wed, 23 May 2012 07:58:16 +0000 (07:58 +0000)]
net: cosmetic: Rename tmp to reply_ip_addr in arp.c

Renamed for clarity

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: cosmetic: Alphabetize includes in net.c
Joe Hershberger [Wed, 23 May 2012 07:58:15 +0000 (07:58 +0000)]
net: cosmetic: Alphabetize includes in net.c

Easier to find when alphabetized

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: cosmetic: Rename OPT_SIZE to OPT_FIELD_SIZE
Joe Hershberger [Wed, 23 May 2012 07:58:14 +0000 (07:58 +0000)]
net: cosmetic: Rename OPT_SIZE to OPT_FIELD_SIZE

Clearer constant name.
Also remove related BOOTP_SIZE which was unused and doesn't take
into account VLAN packets.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: cosmetic: Rename CDPHandler to cdp_receive
Joe Hershberger [Wed, 23 May 2012 07:58:13 +0000 (07:58 +0000)]
net: cosmetic: Rename CDPHandler to cdp_receive

This is not called as a handler, so don't name it that way

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: cosmetic: Rename "x" to "eth_proto"
Joe Hershberger [Wed, 23 May 2012 07:58:12 +0000 (07:58 +0000)]
net: cosmetic: Rename "x" to "eth_proto"

x is a poor variable name

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: cosmetic: Add a more explicit comment about 802.2
Joe Hershberger [Wed, 23 May 2012 07:58:11 +0000 (07:58 +0000)]
net: cosmetic: Add a more explicit comment about 802.2

Make the comment more accurate about the header including SNAP

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: cosmetic: Rename parameter len to payload_len
Joe Hershberger [Wed, 23 May 2012 07:58:10 +0000 (07:58 +0000)]
net: cosmetic: Rename parameter len to payload_len

This name more explicitly claims that it does not include the
header size

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: cosmetic: Un-typedef ICMP_t
Joe Hershberger [Wed, 23 May 2012 07:58:09 +0000 (07:58 +0000)]
net: cosmetic: Un-typedef ICMP_t

Remove typedef and lower-case name

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: cosmetic: Un-typedef ARP_t
Joe Hershberger [Wed, 23 May 2012 07:58:08 +0000 (07:58 +0000)]
net: cosmetic: Un-typedef ARP_t

Remove typedef and lower-case letters

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: cosmetic: Un-typedef VLAN_Ethernet_t
Joe Hershberger [Wed, 23 May 2012 07:58:07 +0000 (07:58 +0000)]
net: cosmetic: Un-typedef VLAN_Ethernet_t

Eliminate the typedef and remove capital letters

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: cosmetic: Un-typedef Ethernet_t
Joe Hershberger [Wed, 23 May 2012 07:58:06 +0000 (07:58 +0000)]
net: cosmetic: Un-typedef Ethernet_t

Separate the Ethernet header from the 802 header.
Base the size constants on the structs.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: cosmetic: Split struct ip_udp_hdr into ip_hdr
Joe Hershberger [Wed, 23 May 2012 07:58:05 +0000 (07:58 +0000)]
net: cosmetic: Split struct ip_udp_hdr into ip_hdr

Add a structure that only contains IP header fields to be used by
functions that don't need UDP
Rename IP_HDR_SIZE_NO_UDP to IP_HDR_SIZE

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: cosmetic: Un-typedef IP_t
Joe Hershberger [Wed, 23 May 2012 07:58:04 +0000 (07:58 +0000)]
net: cosmetic: Un-typedef IP_t

Rename IP header related things to IP_UDP. The existing definition
of IP_t includes UDP header, so name it to accurately describe the
structure.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Move RARP receive logic out of net.c
Joe Hershberger [Wed, 23 May 2012 07:58:03 +0000 (07:58 +0000)]
net: Move RARP receive logic out of net.c

Separate this functionality out of the net.c behemoth

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Move PING out of net.c
Joe Hershberger [Wed, 23 May 2012 07:58:02 +0000 (07:58 +0000)]
net: Move PING out of net.c

Separate this functionality out of the net.c behemoth

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Move ARP out of net.c
Joe Hershberger [Wed, 23 May 2012 07:58:01 +0000 (07:58 +0000)]
net: Move ARP out of net.c

Separate this functionality out of the net.c behemoth

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Encapsulate CDP packet identification
Joe Hershberger [Wed, 23 May 2012 07:58:00 +0000 (07:58 +0000)]
net: Encapsulate CDP packet identification

Checking for CDP packets should be encapsulated, not copied code.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Move CDP out of net.c
Joe Hershberger [Wed, 23 May 2012 07:57:59 +0000 (07:57 +0000)]
net: Move CDP out of net.c

Separate this functionality out of the net.c behemoth

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Move MAC-seeded rand out of bootp.c
Joe Hershberger [Wed, 23 May 2012 07:57:58 +0000 (07:57 +0000)]
net: Move MAC-seeded rand out of bootp.c

Make the MAC-seeded random number generator available to /net in
general.  MAC-seeded rand will be needed by link-local as well, so
give it an interface.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Remove CMD_PING where there's no CMD_NET
Joe Hershberger [Wed, 23 May 2012 07:57:57 +0000 (07:57 +0000)]
net: Remove CMD_PING where there's no CMD_NET

Some boards claim to need ping, but don't support net.
That makes no sense, and causes problems now that ping
is in a separate file.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Fix remaining API interface breakage
Joe Hershberger [Tue, 22 May 2012 18:36:19 +0000 (18:36 +0000)]
net: Fix remaining API interface breakage

These are all the files which use the API incorrectly but did not get
built using MAKEALL -a powerpc|arm.  I have no compiler for them, but
the remaining issues should be far less than without this patch.

Any outstanding issues are left to the maintainers of boards that use
these drivers.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/rtl8169.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 18:09:57 +0000 (18:09 +0000)]
drivers/net/rtl8169.c: Fix compile warning

Fix this:
rtl8169.c: In function 'rtl8169_initialize':
rtl8169.c:907:13: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/pcnet.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 18:09:56 +0000 (18:09 +0000)]
drivers/net/pcnet.c: Fix compile warning

Fix this:
pcnet.c: In function 'pcnet_initialize':
pcnet.c:224:13: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agoarch/powerpc/cpu/mpc8260/ether_scc.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 18:09:55 +0000 (18:09 +0000)]
arch/powerpc/cpu/mpc8260/ether_scc.c: Fix compile warning

Fix this:
ether_scc.c: In function 'mpc82xx_scc_enet_initialize':
ether_scc.c:377:14: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/xilinx_axi_emac.c: Fix compile warning
Stephan Linz [Tue, 22 May 2012 12:18:11 +0000 (12:18 +0000)]
drivers/net/xilinx_axi_emac.c: Fix compile warning

Fix this:
xilinx_axi_emac.c: In function 'xilinx_axiemac_initialize':
xilinx_axi_emac.c:646: warning: assignment from incompatible pointer type

Signed-off-by: Stephan Linz <linz@li-pro.net>
12 years agodrivers/net/xilinx_emaclite.c: Fix compile warning
Stephan Linz [Tue, 22 May 2012 12:18:10 +0000 (12:18 +0000)]
drivers/net/xilinx_emaclite.c: Fix compile warning

Fix this:
xilinx_emaclite.c: In function 'xilinx_emaclite_initialize':
xilinx_emaclite.c:371: warning: assignment from incompatible pointer type

Signed-off-by: Stephan Linz <linz@li-pro.net>
12 years agodrivers/net/xilinx_ll_temac.c: Fix compile warning
Stephan Linz [Tue, 22 May 2012 12:18:09 +0000 (12:18 +0000)]
drivers/net/xilinx_ll_temac.c: Fix compile warning

Fix this:
xilinx_ll_temac.c: In function 'xilinx_ll_temac_initialize':
xilinx_ll_temac.c:332: warning: assignment from incompatible pointer type
xilinx_ll_temac.c:340: warning: assignment from incompatible pointer type

Signed-off-by: Stephan Linz <linz@li-pro.net>
12 years agonet: Remove redefinitions of net.h functions
Joe Hershberger [Tue, 22 May 2012 10:28:57 +0000 (10:28 +0000)]
net: Remove redefinitions of net.h functions

Some copy/pasted drivers redefine functions
defined in include/net.h.  Remove these so that
the definitions can be changed without error.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agodrivers/qe/uec.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:21 +0000 (07:56 +0000)]
drivers/qe/uec.c: Fix compile warning

Fix this:
uec.c: In function 'uec_initialize':
uec.c:1404:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/uli526x.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:20 +0000 (07:56 +0000)]
drivers/net/uli526x.c: Fix compile warning

Fix this:
uli526x.c: In function 'uli526x_initialize':
uli526x.c:243:13: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/tsi108_eth.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:19 +0000 (07:56 +0000)]
drivers/net/tsi108_eth.c: Fix compile warning

Fix this:
tsi108_eth.c: In function 'tsi108_eth_initialize':
tsi108_eth.c:745:13: warning: assignment from incompatible pointer type
tsi108_eth.c: In function 'tsi108_eth_recv':
tsi108_eth.c:989:4: warning: passing argument 1 of 'NetReceive' discards qualifiers from pointer target type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/rtl8139.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:18 +0000 (07:56 +0000)]
drivers/net/rtl8139.c: Fix compile warning

Fix this:
rtl8139.c: In function 'rtl8139_initialize':
rtl8139.c:234:13: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/ns8382x.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:17 +0000 (07:56 +0000)]
drivers/net/ns8382x.c: Fix compile warning

Fix this:
ns8382x.c: In function 'ns8382x_initialize':
ns8382x.c:352:13: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/natsemi.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:16 +0000 (07:56 +0000)]
drivers/net/natsemi.c: Fix compile warning

Fix this:
natsemi.c: In function 'natsemi_initialize':
natsemi.c:338:13: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/fm/eth.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:15 +0000 (07:56 +0000)]
drivers/net/fm/eth.c: Fix compile warning

Fix this:
eth.c: In function 'fm_eth_initialize':
eth.c:651:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/e1000.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:14 +0000 (07:56 +0000)]
drivers/net/e1000.c: Fix compile warning

Fix this:
e1000.c: In function 'e1000_initialize':
e1000.c:5264:13: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agoboard/esd/cpci405/cpci405.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:13 +0000 (07:56 +0000)]
board/esd/cpci405/cpci405.c: Fix compile warning

Fix this:
cpci405.c: In function 'do_get_bpip':
cpci405.c:737:4: warning: format '%ld' expects type 'long int', but argument 3 has type 'IPaddr_t'
cpci405.c:737:4: warning: format '%ld' expects type 'long int', but argument 4 has type 'IPaddr_t'
cpci405.c:737:4: warning: format '%ld' expects type 'long int', but argument 5 has type 'IPaddr_t'
cpci405.c:737:4: warning: format '%ld' expects type 'long int', but argument 6 has type 'IPaddr_t'
cpci405.c:700:8: warning: unused variable 'bd'

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agoarch/powerpc/cpu/mpc85xx/ether_fcc.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:12 +0000 (07:56 +0000)]
arch/powerpc/cpu/mpc85xx/ether_fcc.c: Fix compile warning

Fix this:
ether_fcc.c: In function 'fec_initialize':
ether_fcc.c:453:15: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agoarch/powerpc/cpu/mpc8260/ether_fcc.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:11 +0000 (07:56 +0000)]
arch/powerpc/cpu/mpc8260/ether_fcc.c: Fix compile warning

Fix this:
ether_fcc.c: In function 'fec_initialize':
ether_fcc.c:390:15: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agoarch/powerpc/cpu/mpc8220/fec.c: Fix compile warning
Joe Hershberger [Tue, 22 May 2012 07:56:10 +0000 (07:56 +0000)]
arch/powerpc/cpu/mpc8220/fec.c: Fix compile warning

Fix this:
fec.c: In function 'mpc8220_fec_recv':
fec.c:791:9: warning: passing argument 1 of 'NetReceive' discards qualifiers from pointer target type
include/net.h:438:13: note: expected 'uchar *' but argument is of type 'volatile uchar *'
fec.c: In function 'mpc8220_fec_initialize':
fec.c:839:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agodrivers/net/smc91111.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:32 +0000 (14:45 +0000)]
drivers/net/smc91111.c: Fix compile warning

Fix this:
smc91111.c: In function 'smc91111_initialize':
smc91111.c:1363:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/macb.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:31 +0000 (14:45 +0000)]
drivers/net/macb.c: Fix compile warning

Fix this:
macb.c: In function 'macb_eth_initialize':
macb.c:564:15: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/lan91c96.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:30 +0000 (14:45 +0000)]
drivers/net/lan91c96.c: Fix compile warning

Fix this:
lan91c96.c: In function 'lan91c96_initialize':
lan91c96.c:811:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/ks8695eth.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:29 +0000 (14:45 +0000)]
drivers/net/ks8695eth.c: Fix compile warning

Fix this:
ks8695eth.c: In function 'ks8695_eth_initialize':
ks8695eth.c:236:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/ftmac100.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:28 +0000 (14:45 +0000)]
drivers/net/ftmac100.c: Fix compile warning

Fix this:
ftmac100.c: In function 'ftmac100_initialize':
ftmac100.c:266:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/fec_mxc.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:27 +0000 (14:45 +0000)]
drivers/net/fec_mxc.c: Fix compile warning

Fix this:
fec_mxc.c: In function 'fec_probe':
fec_mxc.c:926:13: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/enc28j60.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:26 +0000 (14:45 +0000)]
drivers/net/enc28j60.c: Fix compile warning

Fix this:
enc28j60.c: In function 'enc28j60_initialize':
enc28j60.c:967:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/eepro100.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:25 +0000 (14:45 +0000)]
drivers/net/eepro100.c: Fix compile warning

Fix this:
eepro100.c: In function 'eepro100_initialize':
eepro100.c:464:13: warning: assignment from incompatible pointer type
eepro100.c: In function 'eepro100_recv':
eepro100.c:694:4: warning: passing argument 1 of 'NetReceive' discards qualifiers from pointer target type
include/net.h:438:13: note: expected 'uchar *' but argument is of type 'volatile u8 *'

The use of a descriptor like this may mean DMA will update this at will
Beware this may be a source of trouble on some boards

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/dnet.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:24 +0000 (14:45 +0000)]
drivers/net/dnet.c: Fix compile warning

Fix this:
dnet.c: In function 'dnet_eth_initialize':
dnet.c:380:15: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/dm9000x.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:23 +0000 (14:45 +0000)]
drivers/net/dm9000x.c: Fix compile warning

Fix this:
dm9000x.c: In function 'dm9000_initialize':
dm9000x.c:636:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/dc2114x.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:22 +0000 (14:45 +0000)]
drivers/net/dc2114x.c: Fix compile warning

Fix this:
dc2114x.c: In function 'dc21x4x_initialize':
dc2114x.c:305:15: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/cs8900.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:21 +0000 (14:45 +0000)]
drivers/net/cs8900.c: Fix compile warning

Fix this:
cs8900.c: In function 'cs8900_initialize':
cs8900.c:326:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc Joe Hershberger <joe.hershberger@gmail.com>

12 years agodrivers/net/calxedaxgmac.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:20 +0000 (14:45 +0000)]
drivers/net/calxedaxgmac.c: Fix compile warning

Fix this:
calxedaxgmac.c: In function 'xgmac_rx':
calxedaxgmac.c:479:2: warning: passing argument 1 of 'NetReceive' discards qualifiers from pointer target type
include/net.h:438:13: note: expected 'uchar *' but argument is of type 'volatile unsigned char *'
calxedaxgmac.c: In function 'calxedaxgmac_initialize':
calxedaxgmac.c:547:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/at91_emac.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:19 +0000 (14:45 +0000)]
drivers/net/at91_emac.c: Fix compile warning

Fix this:
at91_emac.c: In function 'at91emac_register':
at91_emac.c:524:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/armada100_fec.c: Fix compile warning
Joe Hershberger [Mon, 21 May 2012 14:45:18 +0000 (14:45 +0000)]
drivers/net/armada100_fec.c: Fix compile warning

Fix this:
armada100_fec.c: In function 'armada100_fec_register':
armada100_fec.c:723:12: warning: assignment from incompatible pointer type

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodrivers/net/4xx_enet.c: Fix build warning
Anatolij Gustschin [Mon, 21 May 2012 10:48:18 +0000 (10:48 +0000)]
drivers/net/4xx_enet.c: Fix build warning

Fix:
4xx_enet.c: In function 'ppc_4xx_eth_initialize':
4xx_enet.c:2029: warning: assignment from incompatible pointer type

Tested on sequoia board.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Anatolij Gustschin <agust@denx.de>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
12 years agodavinci: Fix Ethernet driver interface warning
Joe Hershberger [Mon, 21 May 2012 05:54:01 +0000 (05:54 +0000)]
davinci: Fix Ethernet driver interface warning

Fixes:
davinci_emac.c: In function 'davinci_emac_initialize':
davinci_emac.c:796:12: warning: assignment from incompatible pointer type [enabled by default]

Tested on da850_am18xxevm

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>