Commit Graph

27463 Commits

Author SHA1 Message Date
Luiz Otavio O Souza
34aa2211e7 Ignore IIC_ENOADDR from iicbus_reset() as it only means we have a
master-only controller.

This fixes the iic bus scan with i2c(8) (on supported controllers).

Tested with gpioiic(4).
2014-05-31 14:38:05 +00:00
Luiz Otavio O Souza
e72f32cd0f Add a bounds verification to the SCL and SDA pin values.
At attach, print the SCL and SDA pin numbers.

Remove a stray blank line.

Remove the GPIOBUS locking from gpioiic_reset(), it is already called with
this lock held.  This fixes a crash when you try to scan the iicbus with
i2c(8).
2014-05-31 14:27:50 +00:00
Navdeep Parhar
368541ba1e cxgbe(4): Fix a NULL dereference when the very first call to
get_scatter_segment() in get_fl_payload() fails.  While here,
fix the code to adjust fl_bufs_used when a failure occurs for
any other scatter segment.

MFC after:	3 days
2014-05-30 22:59:45 +00:00
Hans Petter Selasky
4be86ee126 It appears the ISP/SAF1761 sometimes is busy when reading the status
word of the PTD and simply returns a value of zero. Retry a few times
before giving up.

Sponsored by:	DARPA, AFRL
2014-05-30 16:44:03 +00:00
John Baldwin
f1f7034d11 Use callout_*() rather than timeout()/untimeout().
Reviewed by:	imp
2014-05-30 15:46:10 +00:00
Hans Petter Selasky
ce19294c0e Make driver detach code in USB mass storage test optional.
Sponsored by:	DARPA, AFRL
2014-05-30 13:45:20 +00:00
Hans Petter Selasky
74c1f36628 Add ISP/SAF1761 bootloader bus interface file.
Sponsored by:	DARPA, AFRL
2014-05-30 13:42:11 +00:00
Hans Petter Selasky
e045de0740 Add support for basic read, write and read capacity disk operations to
the USB mass storage test utility file.

Sponsored by:	DARPA, AFRL
2014-05-30 07:30:24 +00:00
Ed Maste
c6317b8376 Correct vt(4) border calculations on font switch
If a vt(4) font does not exactly fit the screen dimensions, the console
window is offset so that it is centered.  A rectangle is drawn at the
top, left, right, and bottom of the screen, to erase any leftovers that
are outside of the new usable console area.

If the x offset or y offset is 0 then the left border or top border
respectively is not drawn.  The right and bottom borders may be one
pixel larger than necessary due to rounding, and are always drawn.

Prior to this change a 0 offset would result in a panic when calling
vt_drawrect with an x or y coordinate of -1.

Sponsored by:	The FreeBSD Foundation
2014-05-29 21:52:42 +00:00
Ed Maste
7cd5ec40cf Update size in vt_grow if we don't have to reallocate
vt_grow may be called with a new size that's larger than previous but
does not require reallocation - for example, when the number of columns
is the same and new number of rows is less than the history size.
Prior to this change we would fail to update vb_scr_size, and then hit
a KASSERT when trying to write to the newly visible rows.

Sponsored by:	The FreeBSD Foundation
2014-05-29 21:10:33 +00:00
Olivier Houchard
8bc9a079ef In uart_bus_grab(), use the ier_mask instead of a custom hack for XScale.
Suggested by:	jmg
2014-05-29 21:00:06 +00:00
Ed Maste
ba23b43576 Correct KASSERT strings
Rows refer to height and cols to width.
2014-05-29 20:26:01 +00:00
Olivier Houchard
caf6d6b491 In the grab function, keep the bit 6 on in the IER, on XScale, using 0
turns the UART off, which is unfortunate if one want to use it as a console.
2014-05-29 19:57:51 +00:00
Konstantin Belousov
c33ce50343 Add support for the unmapped i/o to mfi(4).
Tested by:	Nicholas Esborn <nick@desert.net>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-05-29 16:20:34 +00:00
Aleksandr Rybalko
bf03576620 Remove driver as unused.
MFC after:	7 days
Sponsored by:	The FreeBSD Foundation
2014-05-29 12:29:58 +00:00
Hans Petter Selasky
2994bac4ba Add some more spinlocks to protect the state of the USB transfer
queue. Rename some functions to indicate locking requirements.

MFC after:	1 week
2014-05-29 11:11:19 +00:00
Hans Petter Selasky
0b4dc07df8 Hook the ISP/SAF1761 driver into MIPS kernel builds.
- Update FDT file for BERI DE4 boards.
- Add needed kernel configuration keywords.
- Rename module to saf1761otg so that the device unit number does not
interfere with the hardware ID in dmesg.

Sponsored by:	DARPA, AFRL
2014-05-29 10:46:09 +00:00
Hans Petter Selasky
580bc2220a Optimise the ISP/SAF1761 driver:
- Use an interrupt filter for handling the data path interrupts. This
increases the throughput significantly.
- Implement support for USB suspend and resume in USB host mode.

Sponsored by:	DARPA, AFRL
2014-05-29 10:06:18 +00:00
Hans Petter Selasky
4272b84663 Fixes for ISP/SAF1761 host mode:
- Make the USB hardware skip PTDs which are not allocated.
- Peek host memory twice. Sometimes the PTD status is incorrectly
returned as zero.
- Ensure the host channel is always freed when software TD
is completing.
- Add correct configuration of interrupt polarity and type.
- Set CERR to 2 for asynchronous traffic to avoid having to
reactivate the PTD when a NAK token is received.
- Fix detection of STALL PID.

Sponsored by:	DARPA, AFRL
2014-05-28 16:28:22 +00:00
Marius Strobl
bdec45e2bc Actually, just merge r233362 and do away with the unnecessary uint8_t
pointer casting altogether.
2014-05-28 14:26:46 +00:00
Marius Strobl
50253ed99d Commit the right version of r266793. 2014-05-28 12:32:07 +00:00
Marius Strobl
3ac1248373 - Fix compilation with PAE support enabled by improving the casting of
physical addresses.
- Nuke the unused softc of emujoy(4).
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after:	3 days
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-05-28 09:01:35 +00:00
Marius Strobl
0c12d5ed93 Fix DMA handling in radeon_dummy_page_init():
- Based on actual usage and on what Linux does, dummy_page.addr should
  contain the physical bus address of the dummy page rather than its
  virtual one. As a side-effect, correcting this bug fixes compilation
  with PAE support enabled by getting rid of an inappropriate cast.
- Also based on actual usage of dummy_page.addr, theoretically Radeon
  devices could do a maximum of 44-bit DMA. In reality, though, it is
  more likely that they only support 32-bit DMA, at least that is what
  radeon_gart_table_ram_alloc() sets up for, too. However, passing ~0
  to drm_pci_alloc() as maxaddr parameter translates to 64-bit DMA on
  amd64/64-bit machines. Thus, use BUS_SPACE_MAXSIZE_32BIT instead,
  which the existing 32-bit DMA limits within the drm2 code spelled as
  0xFFFFFFFF should also be changed to.

Reviewed by:	dumbbell
MFC after:      1 week
Sponsored by:   Bally Wulff Games & Entertainment GmbH
2014-05-28 08:59:23 +00:00
Luigi Rizzo
0d88706547 reference the correct variable in a comment
MFC after:	3 days
2014-05-28 06:50:16 +00:00
Gavin Atkinson
9194f39024 Remove debugging printf that crept in in r266770.
Submitted by:	adrian, nwhitehorn
MFC after:	2 weeks
2014-05-27 23:05:12 +00:00
John Baldwin
2cc18341a1 Various cleanups and fixes:
- Switch from timeout() to callout_*() for per-request timers.
- Use device_find_child() in the identify routine.
- Use device_printf() instead of passing device_get_nameunit() to
  printf().
- Expand the SBP_LOCK coverage simplifying the locking.
- Uninline STAILQ_FOREACH_SAFE().

Tested by:	sbruno
2014-05-27 19:56:02 +00:00
Gavin Atkinson
a94ec03f8f Add support for the Intel Centrino Wireless-N 105 chipset.
MFC after:	2 weeks
Relnotes:	yes
2014-05-27 19:39:57 +00:00
Navdeep Parhar
298d969c53 cxgbe(4): netmap support for Terminator 5 (T5) based 10G/40G cards.
Netmap gets its own hardware-assisted virtual interface and won't take
over or disrupt the "normal" interface in any way.  You can use both
simultaneously.

For kernels with DEV_NETMAP, cxgbe(4) carves out an ncxl<N> interface
(note the 'n' prefix) in the hardware to accompany each cxl<N>
interface.  These two ifnet's per port share the same wire but really
are separate interfaces in the hardware and software.  Each gets its own
L2 MAC addresses (unicast and multicast), MTU, checksum caps, etc.  You
should run netmap on the 'n' interfaces only, that's what they are for.

With this, pkt-gen is able to transmit > 45Mpps out of a single 40G port
of a T580 card.  2 port tx is at ~56Mpps total (28M + 28M) as of now.
Single port receive is at 33Mpps but this is very much a work in
progress.  I expect it to be closer to 40Mpps once done.  In any case
the current effort can already saturate multiple 10G ports of a T5 card
at the smallest legal packet size.  T4 gear is totally untested.

trantor:~# ./pkt-gen -i ncxl0 -f tx -D 00:07:43🆎cd:ef
881.952141 main [1621] interface is ncxl0
881.952250 extract_ip_range [275] range is 10.0.0.1:0 to 10.0.0.1:0
881.952253 extract_ip_range [275] range is 10.1.0.1:0 to 10.1.0.1:0
881.962540 main [1804] mapped 334980KB at 0x801dff000
Sending on netmap:ncxl0: 4 queues, 1 threads and 1 cpus.
10.0.0.1 -> 10.1.0.1 (00:00:00:00:00:00 -> 00:07:43🆎cd:ef)
881.962562 main [1882] Sending 512 packets every  0.000000000 s
881.962563 main [1884] Wait 2 secs for phy reset
884.088516 main [1886] Ready...
884.088535 nm_open [457] overriding ifname ncxl0 ringid 0x0 flags 0x1
884.088607 sender_body [996] start
884.093246 sender_body [1064] drop copy
885.090435 main_thread [1418] 45206353 pps (45289533 pkts in 1001840 usec)
886.091600 main_thread [1418] 45322792 pps (45375593 pkts in 1001165 usec)
887.092435 main_thread [1418] 45313992 pps (45351784 pkts in 1000834 usec)
888.094434 main_thread [1418] 45315765 pps (45406397 pkts in 1002000 usec)
889.095434 main_thread [1418] 45333218 pps (45378551 pkts in 1001000 usec)
890.097434 main_thread [1418] 45315247 pps (45405877 pkts in 1002000 usec)
891.099434 main_thread [1418] 45326515 pps (45417168 pkts in 1002000 usec)
892.101434 main_thread [1418] 45333039 pps (45423705 pkts in 1002000 usec)
893.103434 main_thread [1418] 45324105 pps (45414708 pkts in 1001999 usec)
894.105434 main_thread [1418] 45318042 pps (45408723 pkts in 1002001 usec)
895.106434 main_thread [1418] 45332430 pps (45377762 pkts in 1001000 usec)
896.107434 main_thread [1418] 45338072 pps (45383410 pkts in 1001000 usec)
...

Relnotes:	Yes
Sponsored by:	Chelsio Communications.
2014-05-27 18:18:41 +00:00
Sean Bruno
aa475e141c Add PCI ID for AMT based serial interface found on the Lenovo T61.
uart2: <Intel AMT - PM965/GM965 KT Controller> port 0x1830-0x1837
	mem 0xfe024000-0xfe024fff irq 17 at device 3.3 on pci0
uart2: console (115200,n,8,1)

Tested as tty and serial console.  Seems "fine"
2014-05-27 13:35:31 +00:00
Hans Petter Selasky
6df8a79713 - Correct bus space resource type for register access.
- Add configuration of interrupt type and polarity via FDT.

Sponsored by:	DARPA, AFRL
2014-05-27 10:12:16 +00:00
Hans Petter Selasky
21c85d9d3b Multiple fixes and improvements:
- Put "_LE_" into the register access macros to indicate little endian
byte order is expected by the hardware.
- Avoid using the bounce buffer when not strictly needed. Try to move
data directly using bus-space functions first.
- Ensure we preserve the reserved bits in the power down mode
register. Else the hardware goes into a non-recoverable state.
- Always use 32-bit access when writing or reading registers or FIFOs,
because the hardware is 32-bit oriented and don't really understand 8-
and 16-bit access.
- Correct writes to the memory address register. There is no need to
shift the register offset.
- Correct interval for interrupt endpoints.
- Optimise 90ns internal memory buffer read delay.
- Rename PDT into PTD, which is how the datasheet writes it.
- Add missing programming for activating host controller PTDs.

Sponsored by:	DARPA, AFRL
2014-05-27 10:01:19 +00:00
Kevin Lo
d32048bb6d - Improve performance by fixing incorrect Rx/Tx handling
- Rename definition of AXGE_* to reflect reality
- Add new USB IDs
2014-05-27 08:14:54 +00:00
Kevin Lo
26c79a7652 Remove r264317 by accident.
Spotted by:	Kuan-Chung Chiu
2014-05-27 01:47:23 +00:00
Eitan Adler
eb0a187849 e1000: add missing braces
Obtained from:	DragonFlyBSD
2014-05-26 02:19:50 +00:00
Hans Petter Selasky
3bee4e7bdb Make SAF1761 driver endian safe.
Sponsored by:	DARPA, AFRL
2014-05-25 06:42:43 +00:00
Alexander Motin
c2a0f07a10 Increase taskqueue thread priority from idle to PRIBIO.
Idle priority is not even time-share, so if system is busy in any way,
those events may never be executed.  Since in some cases system waits
for events processed by that thread, that may cause deadlocks.
2014-05-24 13:00:49 +00:00
Bjoern A. Zeeb
255cd9fd58 Move the tcp_fields_to_host() and tcp_fields_to_net() (inline)
functions to the tcp_var.h header file in order to avoid further
duplication with upcoming commits.

Reviewed by:	np
MFC after:	2 weeks
2014-05-23 20:15:01 +00:00
Navdeep Parhar
7a5b897dfe cxgbe(4): Remove stray if_up from the code that creates the tracing ifnet. 2014-05-23 01:45:44 +00:00
Edward Tomasz Napierala
8acd0be199 Make iwn(4) able to get itself back into working condition after
"fatal firmware error" happens.  Previously it was neccessary to reset
it manually, using "/etc/rc.d/netif restart".

Approved by:	adrian@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-05-22 15:29:25 +00:00
Edward Tomasz Napierala
43c2aa0f86 Erm, revert r266544; wrong tree. 2014-05-22 15:00:32 +00:00
Edward Tomasz Napierala
983aa498d5 Make iwn(4) able to get itself back into working condition after
"fatal firmware error" happens.  Previously it was neccessary to reset
it manually, using "/etc/rc.d/netif restart".

Approved by:	adrian@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-05-22 14:56:34 +00:00
Hans Petter Selasky
1593e8754e - Give firmware loading more time.
MFC after:	3 days
2014-05-22 12:01:43 +00:00
Hans Petter Selasky
c73bbf989d - Fix a bug where the TLBPC value was forced to being odd for IN
direction isochronous transfers.
- Remove setting of fields which does not belong to the respective
TRBs. These fields are currently set as zero and this is more a
cosmetic change.

MFC after:	3 days
Submitted by:	Horse Ma <HMa@wyse.com>
2014-05-22 11:58:15 +00:00
Aleksandr Rybalko
c23c960364 Proper fix of VT_LOCKSWITCH ioctl.
Sponsored by:	The FreeBSD Foundation
2014-05-22 09:31:18 +00:00
Hans Petter Selasky
885476cb9a - Stop transfers when RSU init fails.
- Make sure TX/RX lists don't leak and are only allocated once.
- Fix off-by one transfer index computation.
- Give firmware loading more time.

MFC after:	3 days
2014-05-22 06:28:09 +00:00
Hans Petter Selasky
8e14e4a03a Implement interrupt endpoint methods for host mode transfers.
Sponsored by:	DARPA, AFRL
2014-05-21 17:22:41 +00:00
Hans Petter Selasky
400b4e53bd - Split transmit queue into one for each type. Apparently there will
be a race when using a single active queue for all transmit types.
- Last argument of usb_pause_mtx() is ticks and not milliseconds.
- Remove unused watchdog.
- Remove some unused fields from the RSU softc structure.
- Workaround usbd_transfer_start() recursion from inside of completion
callback.

MFC after:	3 days
2014-05-21 16:52:55 +00:00
Aleksandr Rybalko
7ee92f6e08 Fix tty locking.
o Correct expected values for VT_LOCKSWITCH ioctl.
o Check current window for locked state.

Sponsored by:	The FreeBSD Foundation
2014-05-21 11:15:38 +00:00
Hans Petter Selasky
c13c64fa63 - Replace some constants with macros.
- Need to set the pre-fetch memory address when reading the host memory.
- We currently assume that no endianness conversion is needed.

Sponsored by:	DARPA, AFRL
2014-05-21 09:26:02 +00:00
Kevin Lo
61c067adc3 - Configure Rx bulk
- Announce flow control capability to PHY drivers
2014-05-21 08:09:44 +00:00