Commit Graph

95424 Commits

Author SHA1 Message Date
Luiz Otavio O Souza
09b2544b71 Remove all the instances of '#undef DEBUG' from kernel.
Suggested by:	rpaulo
Approved by:	adrian (mentor)
2013-10-25 18:38:44 +00:00
Nathan Whitehorn
6ad36cf2c8 Make sure to get the right node when looking up #interrupt-cells. 2013-10-25 15:37:58 +00:00
Nathan Whitehorn
178cdf9a39 Convert e500 PCI driver to use common PPC PCI bus glue. No functional
changes.
2013-10-25 14:43:16 +00:00
Nathan Whitehorn
b27a2490bc Remove dead reference to PSL_MBO. 2013-10-25 14:38:46 +00:00
Nathan Whitehorn
d4602c7200 Remove some #ifdef and duplication in the MSR bit definitions. This adds
some security features to the Book-E kernel as well.
2013-10-25 14:37:15 +00:00
Nathan Whitehorn
6751474523 Use common OFW root code to set up fdtbus. This is an almost purely
negative diff that should improve reliability somewhat. There should be
no differences in behavior -- please report any that crop up. This has been
tested on ARM and PPC systems.

Tested by:	ray
2013-10-25 13:29:07 +00:00
Aleksandr Rybalko
4162dff98a Test UARTs physical address instead of virtual. 2013-10-25 11:44:39 +00:00
Adrian Chadd
dfd325ea2c Add a configuration file and hints file for the Alfa Networks Hornet UB
board.

This is another AR9331 board similar to the Carambola2. It has different
ethernet and LED wiring though.

They make a variety of boards that mostly differ on the amount of RAM/flash
available.  Alfa Networks graciously donated a handful of 64MB RAM/16MB flash
boards so I can finish off 802.11s support for the AR93xx chips and do up
a tech demonstration with it.

This is enough to bring up the board.

Tested:

* Alfa networks UB Hornet board - 64MB ram, 16MB flash version.

Thankyou to Alfa Networks for the development boards!

Sponsored by:	Alfa Networks (hardware only)
2013-10-25 04:06:54 +00:00
Nathan Whitehorn
a3550e73e4 Be a little more suspicious of thermal sensors, which can have single
crazy readings occasionally. One wild reading should not be enough to
trigger a shutdown, so instead wait for several concerning readings in
a row.

PR:		powerpc/180593
Submitted by:	Julio Merino
MFC after:	1 week
2013-10-25 03:55:52 +00:00
Andrey V. Elsukov
baa09f1891 Initialize inc_fibnum for properly handling ICMP6_PACKET_TOO_BIG errors
in multifib environment.

PR:		183265
MFC after:	1 week
2013-10-25 01:02:25 +00:00
Justin Hibbits
594ce9ad6f ELF PowerPC64 ABI puts the LR save word at 16 byte offset, not 8. 2013-10-25 00:17:12 +00:00
Peter Grehan
4083db7d5d Fix panic in the tap driver when a tap and vmnet interface were
created after each other e.g.

 ifconfig tap0
 ifconfig vmnet0
 <panic>

Appears to be a cut'n'paste error from the tap code to the vmnet
code where the name string wasn't updated in the call to make_dev().

Reviewed by:	glebius
MFC after:	3 days
2013-10-24 22:21:31 +00:00
Nathan Whitehorn
e3f4d74e21 Remove some of the code required for supporting ssm(4) on SPARC in favor
of a more PowerPC/FDT-focused design. Whenever SPARC64 is integrated
into this rework, this should be (trivially) revisited.
2013-10-24 21:49:23 +00:00
Konstantin Belousov
c54a713f6a Make pci_get_dma_tag() non-static. Since the function is only
referenced by pointer, making it non-static should not have even the
negligible impact on the existing code.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-24 20:29:29 +00:00
Konstantin Belousov
83cc1cfaea Add some definitions for the bits in root control and status PCIe cap
registers.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-24 20:25:29 +00:00
Konstantin Belousov
feb96b46a2 Move the PCI_DMA_BOUNDARY definition into the pcivar.h.
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-24 20:21:37 +00:00
Konstantin Belousov
5596528930 Add ddb 'show ioapic' and 'show all ioapics' commands.
Reviewed by:	jhb (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-10-24 20:13:40 +00:00
Sergey Kandaurov
b2420d4d0b Modernize pass(4) description to the 21st century.
Reviewed by:	mav
2013-10-24 19:49:55 +00:00
Sergey Kandaurov
af52cb44d8 Correct typo. s/an an/an/ 2013-10-24 19:32:20 +00:00
Marius Strobl
2ce472e736 Move the implementation of bus_space_barrier(9) to the inline function in
the header. Actually, there's only one version for all types of busses, so
it doesn't make sense to walk up the hierarchy.
2013-10-24 17:06:41 +00:00
Adrian Chadd
e94527beaf Fix a use-after-free node reference issue when waiting for a return
from a management frame transmission.

This bug is a bit loopy, so here goes.

The underlying cause is pretty easy to understand - the node isn't
referenced before passing into the callout, so if the node is deleted
before the callout fires, it'll dereference free'd memory.

The code path however is slightly more convoluted.

The functions _say_ mgt_tx - ie management transmit - which is partially
true.  Yes, that callback is attached to the mbuf for some management
frames.  However, it's only for frames relating to scanning and
authentication attempts.  It helpfully drives the VAP state back to
"SCAN" if the transmission fails _OR_ (as I subsequently found out!)
if the transmission succeeds but the state machine doesn't make progress
towards being authenticated and active.

Now, the code itself isn't terribly clear about this.

It _looks_ like it's just handling the transmit failure case.

However, when you look at what goes on in the transmit success case, it's
moving the VAP state back to SCAN if it hasn't changed state since
the time the callback was scheduled.  Ie, if it's in ASSOC or AUTH still,
it'll go back to SCAN.  But if it has transitioned to the RUN state,
the comparison will fail and it'll not transition things back to the
SCAN state.

So, to fix this, I decided to leave everything the way it is and merely
fix the locking and remove the node reference.

The _better_ fix would be to turn this callout into a "assoc/auth request"
timeout callback and make the callout locked, thus eliminating all races.
However, until all the drivers have been fixed so that transmit completions
occur outside of any locking that's going on, it's going to be impossible
to do this without introducing LORs.  So, I leave some of the evilness
in there.

Tested:

* AR5212, ath(4), STA mode
* 5100 and 4965 wifi, iwn(4), STA mode
2013-10-24 17:04:16 +00:00
Luiz Otavio O Souza
585300e937 Add an OFW SPI compatible bus. Fix the spibus probe to return
BUS_PROBE_GENERIC and not BUS_PROBE_SPECIFIC (0) so the OFW SPI bus can
attach when enabled.  Export the spibus devclass_t and driver_t
declarations.

Submitted by:	ray
Approved by:	adrian (mentor)
2013-10-24 16:56:38 +00:00
Luiz Otavio O Souza
07897970fb Add the Raspberry Pi SPI controller driver.
Reviewed by:	rpaulo
Approved by:	adrian (mentor)
2013-10-24 16:27:33 +00:00
Edward Tomasz Napierala
84fb32a371 Don't spin with mutex hold when there is not enough room in the send socket
buffer.  While here, make the code flow somewhat nicer.

Thanks to mav@ for tracking it down.

Tested by:	mav
MFC after:	3 days
Sponsored by:	FreeBSD Foundation
2013-10-24 15:54:06 +00:00
Nathan Whitehorn
238b0483a7 Do not map IRQs twice. This fixes PowerPC/FDT systems with multiple PICs,
which would try to treat the previously-mapped interrupts from
fdt_decode_intr() as interrupt line numbers on the same parent PIC.
2013-10-24 15:44:29 +00:00
Nathan Whitehorn
544234026d Allow PIC drivers to translate firmware sense codes for themselves. This
is designed to replace the tables in dev/fdt/fdt_ARCH.c, but will not
happen quite yet.
2013-10-24 15:37:32 +00:00
Nathan Whitehorn
863527800c interrupt-parent and #interrupt-cells are written to the tree using
encode-int.
2013-10-24 14:15:05 +00:00
Alexander Motin
030844d1e7 Some microoptimizations for da and ada drivers:
- Replace ordered_tag_count counter with single flag;
 - From da remove outstanding_cmds counter, duplicating pending_ccbs list;
 - From da_softc remove unused links field.
2013-10-24 14:05:44 +00:00
Aleksandr Rybalko
3a1f3e0d0c Fix crossed fingers output. Only comment changed. 2013-10-24 09:27:06 +00:00
Mark Johnston
2e1ae0b3e9 Redefine the io provider using the SDT(9) macros instead of doing everything
manually. This change has no functional impact.

Discussed with:	gnn
2013-10-24 02:39:07 +00:00
Adrian Chadd
8a5e5a978d Break out the debug code into a new include file in preparation for
some more iwn work.
2013-10-24 01:03:42 +00:00
Adrian Chadd
b876a4a384 Add #ifdef wrapper around definitions so they aren't included multiple
times.
2013-10-24 01:02:54 +00:00
Pedro F. Giffuni
4b367145f7 UFS2: make di_extsize unsigned.
di_extsize is the EA size and as such it should be unsigned.
Adjust related types for consistency.

Reviewed by:	mckusick (previous version)
MFC after:	3 weeks
2013-10-24 00:33:29 +00:00
Brooks Davis
dd2f74a820 MFP4:
Change 221534 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/27 16:05:30

        FreeBSD/mips stores page-table entries in a near-identical format
        to MIPS TLB entries -- only it overrides certain "reserved" bits
        in the MIPS-defined EntryLo register to hold software-defined bits
        (swbits) to avoid significantly increasing the page table memory
        footprint.  On n32 and n64, these bits were (a) colliding with
        MIPS64r2 physical memory extensions and (b) being improperly
        cleared.

        Attempt to fix both of these problems by pushing swbits further
        along 64-bit EntryLo registers into the reserved space, and
        improving consistency between C-based and assembly-based clearing
        of swbits -- in particular, to use the same definition.  This
        should stop swbits from leaking into TLB entries -- while ignored
        by most current MIPS hardware, this would cause a problem with
        (much) larger physical memory sizes, and also leads to confusing
        hardware-level tracing as physical addresses contain unexpected
        (and inconsistent) higher bits.

        Discussed with: imp, jmallett

Change 1187301 by brooks@brooks_zenith on 2013/10/23 14:40:10
        Loop back the initial commit of 221534 to HEAD.  Correct its
        implementation for mips32.

MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-23 21:35:39 +00:00
Nathan Whitehorn
a8126ae500 Factor out MI portions of the PowerPC nexus device into /sys/dev/ofw. The
sparc64 driver will be modified to use this shortly.
2013-10-23 20:00:14 +00:00
Nathan Whitehorn
e3bb91c23f Typo while reviewing diffs. Sorry for the breakage! 2013-10-23 19:56:13 +00:00
Xin LI
5fbb683079 Update driver to version 10.0.664.0.
Many thanks to Emulex for their continued support of FreeBSD.

Submitted by:	Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com>
MFC after:	3 day
2013-10-23 18:58:38 +00:00
Alexander Motin
eeb9405409 Remove 128KB bzero() call done for every block I/O data buffer.
On my tests this improves performance of the new iSCSI target backed by
GEOM STRIPE of SSDs from 75K to 110K IOPS.

Reviewed by:	ken
2013-10-23 17:55:35 +00:00
Nathan Whitehorn
f214848258 Add two new interfaces to ofw_bus:
- ofw_bus_map_intr()
  Maps an (iparent, IRQ) tuple to a system-global interrupt number in some
  platform dependent way. This is meant to be implemented as a replacement
  for [FDT_]MAP_IRQ() that is an MI interface that knows about the bus
  hierarchy.
- ofw_bus_config_intr()
  Configures an interrupt (previously mapped) based on firmware sense flags.
  This replaces manual interpretation of the sense field in bus drivers and
  will, in a follow-up, allow that interpretation to be redirected to the PIC
  drivers where it belongs. This will eventually replace the tables in
  /sys/dev/fdt/fdt_ARCH.c

The PowerPC/AIM code has been converted to use these globally, with an
implementation in terms of MAP_IRQ() and powerpc_config_intr(), assuming
OpenPIC, at the bus root in nexus(4). The ofw_bus_config_intr() will shortly
be integrated into pic_if.m and bounced through nexus into the PIC tree.

FDT integration will happen significantly later due to larger testing
requirements. This patch in general also lays the groundwork for the removal
of /sys/dev/fdt/fdt_ARCH.c and machine/fdt.h.
2013-10-23 17:24:21 +00:00
Brooks Davis
8a60ded44f BERI_SIM.hint is no longer used, remove it.
MFC after:	3 days
Sponsored by:	DARPA/AFRL
2013-10-23 15:24:05 +00:00
Alexander Motin
ec08c07e8c Minor (mostly cosmetical) addition to r256960. 2013-10-23 14:58:09 +00:00
Nathan Whitehorn
1c02b4c9fb A quick addendum: the standard says that timebase-frequency can be either
32 or 64 bits, so allow either.
2013-10-23 14:34:04 +00:00
Nathan Whitehorn
d26eb2c194 If the device tree directly contains the timebase frequency, use it. This
property is required by ePAPR, but maintain the fallback to bus-frequency
for compatibility.

MFC after:	2 weeks
2013-10-23 14:28:59 +00:00
Brooks Davis
efd01e3755 Revert addition of sbintime and getsbintime that crept into r256963.
Pointyhat:	brooks
2013-10-23 14:28:42 +00:00
Nathan Whitehorn
081431ad8f Use OF_getencprop() in preference to OF_getprop() for numerical quantities.
Since all supported PowerPC systems are big-endian, this is a no-op, but
this is preparatory work to moving this to /sys/dev/ofw.
2013-10-23 14:06:41 +00:00
Nathan Whitehorn
755c959170 Remove OF_instance_to_package() hack for FDT and replace with use of the
generic OF_xref_phandle() API universally. Also replace some related
explicit uses of fdt32_to_cpu() with OF_getencprop() calls.
2013-10-23 14:04:09 +00:00
Nathan Whitehorn
d3a0a0f37e Make all Open Firmware internal interfaces endian-safe by using the new
OF_getencprop() API. This removes one explicit endianness conversion in
ofw_iicbus.c.
2013-10-23 13:55:41 +00:00
Brooks Davis
0e902f8a24 Revert r256934, it needs work to build on mips32. 2013-10-23 13:32:52 +00:00
John Baldwin
3380883230 Finish r254925 and remove the last remaining sysctl name list macro. The
one port that used it has been fixed to use the more portable
getprotoent(3) instead.
2013-10-23 13:22:50 +00:00
Luiz Otavio O Souza
f02d731f89 Enable the build of OFW I2C bus for FDT systems.
Approved by:	adrian (mentor)
2013-10-23 13:09:57 +00:00