Commit Graph

988 Commits

Author SHA1 Message Date
Hans Petter Selasky
b0a5e05f62 We don't need to call EOWRITE4(sc, EHCI_USBINTR, 0) directly from each EHCI
bus driver at detach, hence ehci_detach() does exactly this since r199718.

Submitted by:	Luiz Otavio O Souza
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-12 07:49:11 +00:00
Adrian Chadd
a043f08ec2 if_arge has had a strange bug that only appears during high traffic
levels. TX would hang, RX wouldn't. A bit of digging showed the interface
send queue was full, but IFF_DRV_OACTIVE was clear and the hardware TX
queue was empty.

It turns out that there wasn't a check to drain the interface send
queue once hardware TX had completed, so if the interface send queue
had filled up in the meantime, subsequent packets would be dropped
by the higher layers and if_start (and thus arge_start()) would never
be called.

The fix is simple - call arge_start_locked() in the software interrupt
handler after the hardware TX queue has been handled or a TX underrun
occured. This way the interface send queue gets drained.
2011-04-05 06:46:07 +00:00
Adrian Chadd
85df7b525a * Add some more debugging to if_arge
* Make doubly sure that IFF_DRV_OACTIVE is set if the hardware TX queue is full
2011-04-05 06:33:35 +00:00
Adrian Chadd
ef2732b2ee Put the ARGE_DEBUG behind a kernel config option. 2011-04-05 05:29:10 +00:00
Adrian Chadd
ce1d8cf9e0 Begin fleshing out a functioning debugging setup for if_arge.
I'm seeing TX hangs when doing large amounts of TX traffic;
an interface reset fixes it. This will hopefully help me identify
why.
2011-04-05 05:15:48 +00:00
Hans Petter Selasky
3ea3537594 - Correct EHCI interrupt disabling at detach.
Submitted by:	Luiz Otavio O Souza
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-03 20:17:49 +00:00
Adrian Chadd
f7a5c9d346 Import the initial CPU support for the MIPS RALink RT305x SoC.
This is a MIPS4KC CPU with various embedded peripherals, including
wireless and ethernet support.

This commit includes the platform, UART, ethernet MAC and GPIO support.
The interrupt-driven GPIO code is disabled for now pending GPIO changes
from the submitter.

Submitted by:	Aleksandr Rybalko <ray@dlink.ua>
2011-04-03 14:39:55 +00:00
Adrian Chadd
77ae677e4a Add in some missing flags in the EHCI initialisation code,
needed to get USB working on the AR913x/AR724x.
2011-04-03 14:34:28 +00:00
Adrian Chadd
dcd35c3150 Commit configuration files for the AR913x SoC and the TP-Link WR-1043ND.
The AR91XX_BASE{,.hints} files define all the common parameters for
the AR913x SoC systems.

The TP-1043ND config file adds local parameters.
2011-04-03 13:19:58 +00:00
Adrian Chadd
0b11462b7d A handful of the openwrt devices use a MAC address that's at a hard-coded
offset in the flash.

Some devices (eg the TPLink WR-1043ND) don't have a flash environment
partition which can be queried for the current board settings.

This particular workaround allows for image creators to use a hint
to set the base MAC address. For example:

hint.arge.0.eeprommac=0x1f01fc00
2011-04-02 03:48:15 +00:00
Adrian Chadd
dba9c85977 Break out the ath PCI logic into a separate device/module.
Introduce the AHB glue for Atheros embedded systems. Right now it's
hard-coded for the AR9130 chip whose support isn't yet in this HAL;
it'll be added in a subsequent commit.

Kernel configuration files now need both 'ath' and 'ath_pci' devices; both
modules need to be loaded for the ath device to work.
2011-03-31 08:07:13 +00:00
Adrian Chadd
eab9f72a5a Implement AR724x USB initialisation code.
This (again) still requires an offset for the AR913x/AR724x before USB will
function.

Submitted by: Luiz Otavio O Souzau <loos.br@gmail.com>
2011-03-31 02:36:22 +00:00
Adrian Chadd
3c14a0e3fb The previous commit didn't completely rename this to what it should be. 2011-03-28 09:10:59 +00:00
Adrian Chadd
01754fac52 Refactor out the ar71xx mac address code into something that's
just for Redboot.

At some point we're going to need to build options for different
boot environments - for example, the UBoot setups I've seen simply
have the MAC address hard-coded at a fixed location in flash.
The OpenWRT support simply yanks the if_arge MAC directly from that
in code, rather than trying to find a uboot environment to pull it
from.
2011-03-27 13:55:35 +00:00
Adrian Chadd
c720b9bd9e Add an option - AR71XX_REALMEM - which overrides the amount of
memory detected from Redboot, or overrides the "otherwise" case
if no Redboot information was found.

Some AR71XX platforms don't use Redboot (eg TP-LINK devices using
UBoot; some later Ubiquiti devices which apparently also use
UBoot) and at least one plain out lies - the Ubiquiti LS-SR71A
Redboot says there's 16mb of RAM when in fact there's 32mb.

A more "clean" solution will be needed at a later date.
2011-03-27 08:44:27 +00:00
Adrian Chadd
83d59d21b5 Add some missing flags needed for AR913x/AR724x USB to correctly operate.
The AR913x/AR724x USB lives at a different offset to the AR71xx
USB, so this needs to be either adjusted for in a subsequent
commit, or updated in hints for kernels compiled for those
platforms.

Submitted by: Luiz Otavio O Souzau <loos.br@gmail.com>
2011-03-27 08:32:47 +00:00
Bjoern A. Zeeb
d2b74735b8 For now remove options FLOWTABLE from the remaining GENERIC kernel
configurations and make it opt-in for those who want it.  LINT will
still build it.

While it may be a perfect win in some scenarios, it still troubles users
(see PRs) in general cases.  In addition we are still allocating resources
even if disabled by sysctl and still leak arp/nd6 entries in case of
interface destruction.

Discussed with:	qingli (2010-11-24, just never executed)
Discussed with: juli (OCTEON1)
PR:		kern/148018, kern/155604, kern/144917, kern/146792
MFC after:	2 weeks
2011-03-19 15:50:34 +00:00
Juli Mallett
e22b8a5a3b o) Set MAC addresses starting at the MAC base for all management ports, not
just the MR-730.
o) Start MAC addresses for the non-management ports after the management ports.

Submitted by:	Bhanu Prakash (with modifications)
2011-03-16 22:51:34 +00:00
Juli Mallett
26de5f20cc o) Tear down receive interrupt on detach.
Submitted by:	Bhanu Prakash
2011-03-16 08:56:22 +00:00
Juli Mallett
64974004ec o) Clean up FPA pools on module unload.
o) Allocate output buffer pool based on available output queues.

Submitted by:	Bhanu Prakash (with modifications)
2011-03-16 08:51:36 +00:00
Juli Mallett
dea2d4206e o) Properly size caches and TLB on Octeon.
o) Make COP0_SYNC do nothing on Octeon, which is fully interlocked.

Submitted by:	Bhanu Prakash (with modifications)
2011-03-16 08:22:29 +00:00
Adrian Chadd
23dcc4c655 * Add wireless MAC reset, in prep for bringing over AR9130 support.
* Whilst I'm here, reformat to fit inside 80 characters.
2011-03-13 08:46:58 +00:00
Adrian Chadd
c55baa23d8 Add the missing AR724x DDR flush routines for if_arge0.
Submitted by: Luiz Otavio O Souza
2011-03-13 08:36:57 +00:00
Adrian Chadd
85a5701186 Fix the TX underrun status reset; remove a now unused variable.
Submitted by: Luiz Otavio O Souza
2011-03-13 08:34:14 +00:00
Adrian Chadd
2b60eabf75 Commit FIFO configuration fixes from OpenWRT. This fixes performance
issues with if_arge on the AR913x and AR724x.

Reference: https://dev.openwrt.org/ticket/6754
Submitted by: Luiz Otavio O Souza
2011-03-13 08:28:21 +00:00
Dmitry Chagin
e5d81ef1b5 Extend struct sysvec with new method sv_schedtail, which is used for an
explicit process at fork trampoline path instead of eventhadler(schedtail)
invocation for each child process.

Remove eventhandler(schedtail) code and change linux ABI to use newly added
sysvec method.

While here replace explicit comparing of module sysentvec structure with the
newly created process sysentvec to detect the linux ABI.

Discussed with:	kib

MFC after:	2 Week
2011-03-08 19:01:45 +00:00
Jayachandran C.
1e4b58070b Increase NKPT in case of n32 and n64 to support more physical memory.
On n32, vm_page_startup() needs more virtual mem to map vm_page structs.
The new value of 256 will allow us to support 16GB RAM.
2011-03-01 04:21:56 +00:00
Jayachandran C.
0474933dcc Use new thread's stack to invoke pmap_activate in cpu_switch()
Restore the SP from the new thread's PCB before calling pmap_activate.
Remove some old FIXME comments.
2011-03-01 03:25:18 +00:00
Jayachandran C.
7d66f0801b Use correct types and fromats for physical address
- Use vm_paddr_t for pa in pmap_steal_memory()
- Use uintmax_t and %jx to ensure that physical address are printed
  correctly in cpu_startup() and pmap_bootstrap()
2011-02-28 21:33:26 +00:00
Jayachandran C.
daa7be0b2e Use vm_offset_t for virtual addresses.
The unsigned int type used now is incorrect in n64 compilation.
2011-02-28 20:55:41 +00:00
Rebecca Cran
6bccea7c2b Fix typos - remove duplicate "the".
PR:	bin/154928
Submitted by:	Eitan Adler <lists at eitanadler.com>
MFC after: 	3 days
2011-02-21 09:01:34 +00:00
Alan Cox
e6ffa21488 Remove pmap fields that are either unused or not fully implemented.
Discussed with:	kib
2011-02-17 15:36:29 +00:00
Juli Mallett
cb2096acbf The Lanner MR-730 uses the first two MACs at its MAC base for the 10/100
management ports, and gigabit ports start at an offset of 2 from the MAC
base.
2011-02-12 02:41:33 +00:00
Juli Mallett
1591f3f18c Allow the platform code to return a bitmask of running cores rather than just
a number of cores, this allows for a sparse set of CPUs.  Implement support
for sparse core masks on Octeon.

XXX jeff@ suggests that all_cpus should include cores that are offline or
    running other applications/OSes, so the platform API should be further
    extended to allow us to set all_cpus to include all cores that are
    physically-present as opposed to only those that are running FreeBSD.

Submitted by:	Bhanu Prakash (with modifications)
Reviewed by:	jchandra
Glanced at by:	kib, jeff, jhb
2011-02-12 02:08:24 +00:00
Juli Mallett
70019a0be7 o) Cavium Octeon doesn't need nop barriers.
o) Have mips_wblush just do syncw, not sync on Cavium Octeon.
o) Add support for reading and writing some Octeon-specific registers.
   NB: Some of these are not entirely Octeon-specific.

Submitted by:	Bhanu Prakash
2011-02-06 22:21:18 +00:00
Tijl Coosemans
4e518ddb21 Replace __LP64__ with __mips_n64. This partly reverts r217147.
Requested by:	jmallett, imp
Approved by:	kib (mentor)
2011-02-04 13:09:46 +00:00
Matthew D Fleming
08b163fa51 Put the general logic for being a CPU hog into a new function
should_yield().  Use this in various places.  Encapsulate the common
case of check-and-yield into a new function maybe_yield().

Change several checks for a magic number of iterations to use
should_yield() instead.

MFC after:	1 week
2011-02-02 16:35:10 +00:00
Jayachandran C.
21835e695a Implement sf_buf using direct map (XKPHYS) in MIPS n64.
- Provide trivial implementation of sf_buf_alloc(), sf_buf_free(),
  sf_buf_kva() and sf_buf_page() using direct map for n64.
- uio_machdep.c - use macros so that the direct map will be used in
  case of n64.

Reviewed by:	imp (earlier version)
Obtained from:	jmallett (user/jmallett/octeon)
2011-01-27 14:49:22 +00:00
Sergey Kandaurov
4053b05b91 Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize.
Submitted by:	perryh pluto.rain.com (previous version)
Reviewed by:	jhb
Approved by:	kib (mentor)
Tested by:	universe
2011-01-21 10:26:26 +00:00
Juli Mallett
2e2b4ad457 If there is no WQE available for a packet that needs segmentation, drop it
and return.
2011-01-20 23:51:03 +00:00
Juli Mallett
3e46966ed3 Remove some compile-time options from the driver, particularly async IOBDMA
support which is unused on FreeBSD and which complicates working on the
code now, can easily be added back later by someone determined to use it.
2011-01-20 23:34:59 +00:00
Warner Losh
266a41b11e Use simplified ldscripts rather than specific ones 2011-01-20 19:17:05 +00:00
Jayachandran C.
8026971f99 Move 'cpu CPU_RMI' to std.xlr, this is common for all XLR cpus. 2011-01-20 12:45:29 +00:00
Jayachandran C.
e91c7635e9 Re-format XLR configuartion files and remove obsolete options. 2011-01-20 09:01:14 +00:00
Jayachandran C.
c400881470 ldscript and conf cleanup for MIPS
- Remove sys/conf/ldscript.mips.64 and sys/conf/ldscript.mips.n32 and use
  ldscript.mips for all ABIs. The default OUTPUT_FORMAT of the toolchain
  is correct.
- Remove LDSCRIPT_NAME entires from XLR n32 and n64 conf files.
- Remove TARGET_BIG_ENDIAN from XLR conf files.
- Fix machine entry in XLRN32
2011-01-20 08:15:11 +00:00
Jayachandran C.
1104442832 Fixes in the XLR platform code
- Fix bug in pic.h, assign reg variable, before return.
- In xlr_pci.c, need to ignore the result of mmio read.
2011-01-20 08:08:19 +00:00
Oleksandr Tymoshenko
eb46a7a590 Fix build by changing format for size_t to %jd 2011-01-20 05:44:36 +00:00
Matthew D Fleming
cbc134ad03 Introduce signed and unsigned version of CTLTYPE_QUAD, renaming
existing uses.  Rename sysctl_handle_quad() to sysctl_handle_64().
2011-01-19 23:00:25 +00:00
Juli Mallett
166bee2858 Fix format of physical addresses; this fixes the n32 build. 2011-01-19 21:45:40 +00:00
Juli Mallett
2a05a35c57 Don't do a device_identify to add uart0, it's already hinted.
Reported by:	imp
2011-01-19 07:06:28 +00:00