Commit Graph

23 Commits

Author SHA1 Message Date
Oleksandr Tymoshenko
5b03aba6c8 Switch TI platform support code from using FreeBSD's custom-baked DTS
files to vendor-provided ones. It should make easier to adopt platform
code to new revisions of hardware and to use DTS overlays for various
Beaglebone extensions (shields/capes).

Original dts filenames were not changed, they're now wrappers over dts
files provided by TI. So make sure you update .dtb files on your
devices as part of kernel update

GPIO addressing was changed: instead of one global /dev/gpioc0 there
are per-bank instances of /dev/gpiocX. Each bank has 32 pins so for
instance pin 121 on /dev/gpioc0 in old addressing scheme is now pin 25
on /dev/gpioc3

On Pandaboard serial console devices was changed from /dev/ttyu0 to
/dev/ttyu2 so you'll have to update /etc/ttys to get login prompt
on serial port in multiuser mode. Single user mode serial console
should work as-is

Differential Revision:	https://reviews.freebsd.org/D2146
Reviewed by:	rpaulo, ian, Michal Meloun, Svatopluk Kraus
2015-05-22 03:16:18 +00:00
Bjoern A. Zeeb
6333a401ff Fix cpsw(4) after r277203 which folded 'struct m_hdr' into 'struct mbuf'.
While in theory this should have been a transparent change (and was for all
other drivers), cpsw(4) never used the proper accessor macros in a few
places but spelt the indirect m_hdr.mh_* out itself.  Convert those to
use m_len and m_data and unbreak the driver build.
2015-01-15 02:22:52 +00:00
Luiz Otavio O Souza
1210d2685f Fix cpsw_detach() to not panic when called from cpsw_attach().
For an unkown reason (at moment), sometimes if_cpsw cannot read from PHY
and fails to attach calling cpsw_detach() which end up in a panic.

Fix it by doing the proper check before detach the miibus and also fix the
leak of few variables.

And to actually make it work, ether_ifattach() has to be moved to the end
of cpsw_attach() to avoid a race where calling ether_ifdetach() before
domain_init() (which will only run later on) would make it crash at
INP_INFO_RLOCK() on in_pcbpurgeif0().

Tested on:	BBB (am335x)
MFC after:	1 week
2014-10-24 21:08:02 +00:00
Gleb Smirnoff
6625a48525 Mechanically convert to if_inc_counter(). 2014-09-19 09:20:16 +00:00
Ian Lepore
add35ed5b8 Follow r261352 by updating all drivers which are children of simplebus
to check the status property in their probe routines.

Simplebus used to only instantiate its children whose status="okay"
but that was improper behavior, fixed in r261352.  Now that it doesn't
check anymore and probes all its children; the children all have to
do the check because really only the children know how to properly
interpret their status property strings.

Right now all existing drivers only understand "okay" versus something-
that's-not-okay, so they all use the new ofw_bus_status_okay() helper.
2014-02-02 19:17:28 +00:00
Ian Lepore
99895358c0 Sweep up a bit of arm-land fallout after r257244; include necessary
headers directly that are no longer available via accidental include.
2013-10-28 15:20:17 +00:00
Ian Lepore
33ff10ea55 Add a macro that gets the physical address of a memory mapped device
register from a bus space resource.

Note that this macro is just for ARM, and is intended to have a short
lifespan.  The DMA engines in some SoCs need the physical address of a
memory-mapped device register as one of the arguments for the transfer.
Several scattered ad-hoc solutions have been converted to use this macro,
which now also serves to mark the places where a more complete fix needs
to be applied (after that fix has been designed).
2013-03-17 03:04:43 +00:00
Tim Kientzle
ae6aefaf57 Another overhaul of the CPSW driver for BeagleBone
Major changes:
  * Finally tracked down the flow control setting that
    seems to have been causing TX stalls and watchdog timeouts
  * RX and TX paths now share a lot more code
  * TX interrupt is no longer used; we instead GC finished
    tx queue entries at the bottom of the start routine.
  * TX start now queues fragmented packets directly; it only
    invokes defrag() for occasional very fragmented packets.
  * "sysctl dev.cpsw" dumps controller statistics and queue counts
  * Host Error Interrupt will give extensive debugging information
    if the controller chokes on the queued data.
2013-02-03 01:08:01 +00:00
Tim Kientzle
d7631c7111 Shuffle the TX underrun to work the same way as the RX underrun,
as suggested by YongHyeon PYUN.
2013-01-05 20:37:40 +00:00
Tim Kientzle
ebc4238eea While trying to track down the root cause for
TX stalls in this driver, I've also had some
time to evaluate the effectiveness of different
watchdog strategies.

This is the latest attempt, which consolidates
all of the watchdog logic in one place and
consistently detects TX stalls and resets within
a couple of seconds.
2013-01-05 17:59:44 +00:00
Tim Kientzle
5bf325556b Overhauled CPSW driver for TI CPSW Ethernet module
(as used in AM335x SoC for BeagleBone).

Among other things:
 * Watchdog reset doesn't hang the driver.
 * Disconnecting cable doesn't hang the driver.
 * ifconfig up/down doesn't hang the driver
 * Out-of-memory no longer panics the driver.

Known issues:
 * Doesn't have good support for fragmented packets
   (calls m_defrag() on TX, assumes RX packets are never fragmented)
 * Promisc and allmulti still unimplimented
 * addmulti and delmulti still unimplemented
 * TX queue still stalls (but watchdog now consistently recovers in ~5s)
 * No sysctl monitoring
 * Only supports port0
 * No switch configuration support
 * Not tested on anything but BeagleBone

Committed from: BeagleBone
2013-01-01 18:55:04 +00:00
Gleb Smirnoff
eb1b1807af Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags within sys.

Exceptions:

- sys/contrib not touched
- sys/mbuf.h edited manually
2012-12-05 08:04:20 +00:00
Tim Kientzle
5daf64fb7d Do proper padding of runt packets using code copied from bge(4).
Reviewed by:	gnn
2012-10-25 04:37:47 +00:00
Tim Kientzle
ea4597d0ab Refer to headers locally. This makes it a lot easier
to build this driver out-of-tree.
2012-10-25 04:33:47 +00:00
Tim Kientzle
747d299f0a Don't repeat the POSTREAD dma sync. 2012-10-22 02:28:48 +00:00
Tim Kientzle
da44817ee6 Replace deprecated M_DONTWAIT with M_NOWAIT. 2012-10-19 05:50:56 +00:00
Tim Kientzle
83e5430018 Fix an mbuf leak in cpsw driver, clean up mbuf management:
* Record TX mbufs when we get them so we can release them.
 * Set TX/RX mbuf slots to NULL when we are no longer responsible for them
 * Move dma sync on RX into RX intr routine
2012-10-15 04:10:49 +00:00
Tim Kientzle
2e88f5cd34 Cut-and-paste dropped semicolon. 2012-10-14 23:07:54 +00:00
Tim Kientzle
4cc21ce89a Name cpsw_stop to cpsw_stop_locked consistently with other functions
in this file that assume locks are already held.
2012-10-14 23:00:24 +00:00
Tim Kientzle
a97afde093 Return correct packet size. 2012-10-14 22:58:12 +00:00
John-Mark Gurney
2b539bdcb3 remove some unnecessary debugging statements, dead code and incorrect
comment...

Reviewed by:	gnn, imp
2012-09-16 19:42:27 +00:00
Tim Kientzle
0be65db279 Correctly fetch the MAC address.
Break down the bytes directly into the softc;
the intermediate buffer isn't needed here.
Break down the bytes in the correct order.
2012-08-27 04:43:30 +00:00
Oleksandr Tymoshenko
e53470fee3 Merging of projects/armv6, part 10
- Support for Texas Instruments SoCs:
	- AM335x
	- OMAP4

- Kernel configs, DTS for Beaglebone and Pandaboard

Submitted by:	Ben Gray, Damjan Marion
2012-08-15 06:31:32 +00:00