Commit Graph

1263 Commits

Author SHA1 Message Date
Jayachandran C.
752a2fe776 Update the L1D cache flush sequence when enabling threads.
Added more comments to the code.
2012-03-27 07:51:42 +00:00
Jayachandran C.
68790561a5 Switch to interrupt based message handling for XLP 8xx B0.
Fixup some style issues in the file as well.
2012-03-27 07:47:13 +00:00
Jayachandran C.
91339fd498 Support for XLP4xx and XLP 8xx B0 revision
- Add 4xx processor IDs, add workaround in CPU detection code.
- Update frequency detection code for XLP 8xx.
- Add setting device frequency code.
- Update processor ID checking code.
2012-03-27 07:39:05 +00:00
Jayachandran C.
7aeda475e5 Fixes to the XLP startup code.
Changes are:
- Correct the order of calling init functions.
- Fix up checking excluding reset area.
2012-03-27 07:34:27 +00:00
Oleksandr Tymoshenko
5e608d0b09 Remap PMC interrupt for all cores 2012-03-24 06:28:15 +00:00
Oleksandr Tymoshenko
fa1e9b3a72 Add DTrace-related part to machine-dependent code:
- DTrace trap handler
- invop-related variables (unused on MIPS but still referenced from dtrace)
2012-03-24 05:17:38 +00:00
Oleksandr Tymoshenko
2a4f7a57fe Fix pmap_kextract prototype to align it with pmap.c change 2012-03-23 18:07:12 +00:00
Oleksandr Tymoshenko
f86a93b5be Add pseudo-device for handling PMC interrupts and link everything
PMC-related to build
2012-03-23 00:11:54 +00:00
Oleksandr Tymoshenko
ae849c7c42 Setup fake MODINFO variables for octeon kernel 2012-03-23 00:01:09 +00:00
Oleksandr Tymoshenko
1b930fb786 Rework MIPS PMC code:
- Replace MIPS24K-specific code with more generic framework that will
    make adding new CPU support easier
- Add MIPS24K support for new framework
- Limit backtrace depth to 1 for stability reasons and add option
    HWPMC_MIPS_BACKTRACE to override this limitation
2012-03-22 18:01:23 +00:00
Oleksandr Tymoshenko
a5fbfee1d0 Move PMC hook invocation to cpu_intr. The idea is the same as with ast()
call but there is no reason to implement it in assembler.
2012-03-22 17:47:52 +00:00
Jayachandran C.
0e37e252d2 Fix return type of mips pmap_kextract()
The return type should be vm_paddr_t, not vm_offset_t.
2012-03-22 15:14:10 +00:00
Juli Mallett
ce30db0b31 o) Don't keep drive parameters in a global, put them in the softc.
o) Don't report a bogus stripesize.
o) Eliminate a nearby gratuitous "proxy" indirection.
2012-03-21 10:27:12 +00:00
Ed Schouten
92396a3174 Remove pty(4) from our kernel configurations.
As of FreeBSD 8, this driver should not be used. Applications that use
posix_openpt(2) and openpty(3) use the pts(4) that is built into the
kernel unconditionally. If it turns out high profile depend on the
pty(4) module anyway, I'd rather get those fixed. So please report any
issues to me.

The pty(4) module is still available as a kernel module of course, so a
simple `kldload pty' can be used to run old-style pseudo-terminals.
2012-03-21 08:38:42 +00:00
Oleksandr Tymoshenko
fce0c7295d - Fix logic for detection if further processing of PMC should be performed.
pmc_intr returns one if one of the counters actually triggered the IRQ
- style(9) fixed
2012-03-18 01:43:41 +00:00
Adrian Chadd
0c7a79d76e style(9) changes. 2012-03-17 07:29:11 +00:00
Adrian Chadd
0e69f431d4 Begin fleshing out MII clock rate configuration changes.
These are needed for some particular port configurations where the default
speed isn't suitable for all link speed types. (Ie, changing 10/100/1000MBit
PLL rate requires a similar MII clock rate, rather than a fixed MII rate.)

This is:

* only currently implemented for the ar71xx;
* isn't used anywhere (yet), as the final interface for this hasn't yet
  been determined.
2012-03-17 07:25:23 +00:00
Oleksandr Tymoshenko
66134c7e59 Clean-up fake preload data generator:
- Use macros to push scalar values
- Fix type mismatch for module size
2012-03-15 23:53:24 +00:00
Oleksandr Tymoshenko
fba09d4c08 Fill out fake preload structure to let userland tools like pmc(3) know
about kernel module base address and actual size
2012-03-15 05:29:51 +00:00
Adrian Chadd
49def78fbb Remove a now unneeded ARGE_UNLOCK().
Whilst I'm here, remove a couple blank lines.
2012-03-13 06:50:56 +00:00
Adrian Chadd
8a5350984f Fix link status handling on if_arge upon system boot to allow bootp/NFS to
function.

From the submitter:

This patch fixes an issue I encountered using an NFS root with an
ar71xx-based MikroTik RouterBoard 450G on -current where the kernel fails
to contact a DHCP/BOOTP server via if_arge when it otherwise should be able
to.  This may be the same issue that Monthadar Al Jaberi reported against
an RSPRO on 6 March, as the signature is the same:

%%%

DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
.
.
.
DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
arge0: initialization failed: no memory for rx buffers
DHCP/BOOTP timeout for server 255.255.255.255
arge0: initialization failed: no memory for rx buffers

%%%

The primary issue that I found is that the DHCP/BOOTP message that
bootpc_call() is sending never makes it onto the wire, which I believe is
due to the following:

- Last December, a change was made to the ifioctl that bootpc_call() uses
to adjust the netmask around the sosend().

- The new ioctl (SIOCAIFADDR) performs an if_init when invoked, whereas the
old one (SIOCSIFNETMASK) did not.

- if_arge maintains its own sense of link state in sc->arge_link_status.

- On a single-phy interface, sc->arge_link_status is initialized to 0 in
arge_init_locked().

- sc->arge_link_status remains 0 until a phy state change notification
causes arge_link_task to run, notice the link is up, and set it to 1.

- The inits caused by the ifioctls in bootpc_call are reinitializing the
interface, but not the phy, so sc->arge_link_status goes to 0 and remains
there.

- arge_start_locked() always sees sc->arge_link_status == 0 and returns
without queuing anything.

The attached patch changes arge_init_locked() such that in the single-phy
case, instead of initializing sc->arge_link_status to 0, it runs
arge_link_task() to set it according to the current phy state.  This change
has allowed my setup to mount an NFS root successfully.

Submitted by:	Patrick Kelsey <kelsey@ieee.org>
Reviewed by:	juli
2012-03-13 06:28:52 +00:00
Juli Mallett
f8e47016ec Don't build kernel.tramp on Octeon. Probably building it should be opt-in
not opt-out, but I don't know enough about which ports need it to get the
defaults right.
2012-03-13 06:22:49 +00:00
Adrian Chadd
eeaef4bae5 Correctly (I hope) deallocate the if_arge RX buffer ring on arge_stop().
I had some interesting hangs until I realised I should try flushing the
DDR FIFO register and lo and behold, hangs stopped occuring.

I've put in a few DDR flushes here and there in case people decide to
reuse some of these functions.  It's very very likely they're almost
all superflous.

To test:

* Connect to a network with a _lot_ of broadcast traffic
* Do this:
  # while true; do ifconfig arge0 down; ifconfig arge0 up; done

This fixes the mbuf exhaustion that has been reported when the interface
state flaps up/down.
2012-03-13 06:15:20 +00:00
Juli Mallett
4ea65e2064 Remove TARGET_BIG_ENDIAN which should have been removed previously. 2012-03-12 21:26:09 +00:00
Juli Mallett
379663d70b o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern
required for the ABI the kernel is being built for.
   XXX This is implemented in a kind-of nasty way that involves including source
       files, but it's still an improvement.
o) Retire ISA_* options since they're unused and were always wrong.
2012-03-12 21:25:32 +00:00
Adrian Chadd
6ff44ffc53 Configuration changes/updates!
* enable ALQ and net80211/ath ALQ logging by default, to make it possible
  to get debug register traces.
* Update some comments
* Enable HWPMC for testing.
2012-03-12 20:32:23 +00:00
Juli Mallett
fee74cf7e8 Use 64-bit bus space constants on 64-bit kernels. 2012-03-12 18:56:16 +00:00
Juli Mallett
11ca697ba5 Remove more unused stuff, primarily a set of (unused, thankfully) PIO
functions.

Adjust nearby style of one assembly function END().
2012-03-12 18:10:01 +00:00
Juli Mallett
c8b31c8f20 Remove more unused code and declarations, and add dire warnings to the 64-bit
atomic ops used by 32-bit kernels.
2012-03-12 08:13:04 +00:00
Juli Mallett
312af517e3 Remove platform APIs which are not used by any code and which had only stub
implementations or no implementation on all platforms.

Some of these functions might be good ideas, but their semantics were unclear
given the lack of implementation, and an unlucky porter could be fooled into
trying to implement them or, worse, being baffled when something like
platform_trap_enter() failed to be called.
2012-03-12 07:34:15 +00:00
Oleksandr Tymoshenko
2a0fa68aca - Rename apb_intr to apb_filter since it's a filter handler
- Pass interrupt trapframe for handlers dow the chain
- Add PMC interrupt handler
    PMC interrupt is a special case, so we want handle it as soon as possible
    with minimum overhead. So we handle it apb filter routine.
2012-03-12 01:23:09 +00:00
Adrian Chadd
f0dc1b857c Begin modifying the PB92 config file to actually generate a flashable,
bootable image.

The kernel has to fit inside an 896KiB area in a 4MB SPI flash.
So a bunch of stuff can't be included (and more is to come), including
(unfortunately) IPv6.

TODO:

* GPIO modules need to be created
* Shrink the image a bit more by removing some of the CAM layer debugging
  strings.
2012-03-12 01:15:58 +00:00
Juli Mallett
e889b2b09e We've supported 64-bit PTEs for some time. 2012-03-11 22:17:01 +00:00
Juli Mallett
b5acc0d618 Disable the Simple Executive's error decoding/reporting code. 2012-03-11 06:55:17 +00:00
Juli Mallett
dc4ee6ca91 Merge the Cavium Octeon SDK 2.3.0 Simple Executive code and update FreeBSD to
make use of it where possible.

This primarily brings in support for newer hardware, and FreeBSD is not yet
able to support the abundance of IRQs on new hardware and many features in the
Ethernet driver.

Because of the changes to IRQs in the Simple Executive, we have to maintain our
own list of Octeon IRQs now, which probably can be pared-down and be specific
to the CIU interrupt unit soon, and when other interrupt mechanisms are added
they can maintain their own definitions.

Remove unmasking of interrupts from within the UART device now that the
function used is no longer present in the Simple Executive.  The unmasking
seems to have been gratuitous as this is more properly handled by the buses
above the UART device, and seems to work on that basis.
2012-03-11 06:17:49 +00:00
Juli Mallett
ecdb6b0261 Fix promiscuous mode with if_octm:
o) The MAC set must occur before the multicast list is set up as the former
   will enable the CAM unconditionally, while promiscuous mode disables it,
   so if promiscuous mode is to be set this must occur after the MAC is
   programmed.
o) The multicast list must be set up unconditionally as even if flags have
   not changed, if the interface has gone through a reinitialization, the
   state of the CAM as changed by the MAC initialization could be incorrect.
o) Call octm_init when flags change, even if the interface is already running.
2012-03-11 00:34:14 +00:00
Juli Mallett
86ce6e9fda Remove some headers not used by kernel or world and which are not present in
other ports.
2012-03-10 23:27:03 +00:00
Juli Mallett
21535672bb Fix reversed logic in previous commit that broke build and earned me quite the
pointy hat.

Submitted by:	bz
2012-03-10 18:35:38 +00:00
Juli Mallett
fff491331e Use ABI to determine bus_addr_t for cnMIPS. 2012-03-10 07:54:41 +00:00
Juli Mallett
4f32220bf6 o) Remove some CPU_CNMIPS-related magical thinking about the status register's
contents for user programs.
o) Conditionalize the installation of an XTLB handler on ABI, not CPU family.
2012-03-10 06:54:37 +00:00
Juli Mallett
fd71d13eb6 Get rid of mainbus.c. The version in nexus.c is being used and is
perfectly-sufficient and equally-crufty.
2012-03-10 06:45:21 +00:00
Juli Mallett
4b6b28c350 Don't truncate physical addresses to 32-bits. 2012-03-10 06:43:41 +00:00
Juli Mallett
13a7423bf5 Reduce diffs with freebsd32_sysarch. 2012-03-10 06:31:28 +00:00
Juli Mallett
fb2a44f292 o) Bump INTRCOUNT_COUNT to 256, since Octeon already has >128.
XXX It would be good to use a better way to size intrcnt.
o) Fix literal 4s that are supposed to be sizeof (u_long).
   XXX Why the * 2 here?  Is this an artifact of a different system that this
       code came from?  We seem to allocate twice as much space for intrcnt
       as we admit to in sintrcnt.
2012-03-10 05:38:04 +00:00
Juli Mallett
9ea99cd3b5 "Did you still want the not yet? I think we just arrived at yet."
Submitted by:	thompsa
2012-03-09 09:32:20 +00:00
Juli Mallett
f6f8319094 Enable COMPAT_FREEBSD32 for the Octeon kernel config by default. 2012-03-09 07:53:44 +00:00
Juli Mallett
3812e6817b Get rid of duplicated versions of the KSU bits. 2012-03-06 23:08:02 +00:00
Aleksandr Rybalko
7283f2ff0f Break long lines.
Approved by:	adri (mentor)
2012-03-06 22:45:54 +00:00
Aleksandr Rybalko
b906a7a912 Remove EoL whitespaces.
Approved by:	adri (mentor)
2012-03-06 22:16:10 +00:00
Juli Mallett
e13dfc355c Remove unused file. 2012-03-06 20:23:29 +00:00
Attilio Rao
9c170fd168 Disable the option VFS_ALLOW_NONMPSAFE by default on all the supported
platforms.
This will make every attempt to mount a non-mpsafe filesystem to the
kernel forbidden, unless it is expressely compiled with
VFS_ALLOW_NONMPSAFE option.

This patch is part of the effort of killing non-MPSAFE filesystems
from the tree.

No MFC is expected for this patch.
2012-03-06 20:01:25 +00:00
Juli Mallett
723616952d At the risk of reducing source compatibility with old NetBSD and Sprite:
o) Get rid of some unused macros related to features we don't intend to
   provide.
o) Get rid of macro definitions for MIPS-I CPUs.  We are not likely to
   support anything that predartes MIPS-III.
o) Respell MIPS3_* macros as MIPS_*, which is how most of them were being
   used already.
o) Eliminate a duplicate and mostly-unused set of exception vector macros.

There's still considerable duplication and lots more obsolete in our headers,
but this reduces one of the larger files to a size where one could reckon
about the correctness of its contents with a mere few hours of contemplation.

There is, of course, a question of whether we need definitions for fields,
registers and configurations that we are unlikely to ever use or implement,
even if they're not obsolete since 1991.  FreeBSD is not a processor
reference manual, and things that aren't used may be wrong, or may be
duplicated because nobody could possibly actually know whether they're
already defined.
2012-03-06 19:01:32 +00:00
Juli Mallett
0b94059f12 Garbage collect some unused symbols. 2012-03-06 08:40:21 +00:00
Juli Mallett
8e09ecbf10 Make the native sigreturn just wrap set_mcontext, much as freebsd32_sigreturn
does.
2012-03-06 08:10:48 +00:00
Juli Mallett
6fa3bc4f91 Store TLS base in the sigframe just as is done in freebsd32_sendsig. Because
the native sigreturn doesn't use set_mcontext like the COMPAT_FREEBSD32 version
does, this wouldn't actually result in overwriting the TLS base.  Probably it
makes sense to restructure the native sigreturn to use set_mcontext for
consistency, and to allow sigreturn to change the TLS base.
2012-03-06 08:02:10 +00:00
Juli Mallett
bdf4700515 Fix two and a half oversights in COMPAT_FREEBSD32 related to contexts and
TLS:
o) The mc_tls field used to store the TLS base when doing context gets and
   restores was left a pointer and not converted to a 32-bit integer.  This
   had the bug of not correctly capturing the TLS value desired by the user,
   and the extra nastiness of making the structure the wrong size.
o) The mc_tls field was not being saved by sendsig.  As a result, the TLS base
   would always be set to NULL when restoring from a signal handler.

Thanks to gonzo for helping track down a bunch of other TLS bugs that came out
of tracking these down.
2012-03-06 07:50:45 +00:00
Juli Mallett
22c6822677 When emulating rdhwr for TLS, use the 32-bit offset under COMPAT_FREEBSD32. 2012-03-06 07:47:28 +00:00
Oleksandr Tymoshenko
081fc905e2 Prepare for large TLS redo. Save pointer to the beginning of TLS area,
and offset it only if requested by RDHWR handler. Otherwise things
    get overly complicated - we need to track whether address passsed in
    request for setting td_md.md_tls is already offseted or not.
2012-03-06 03:25:50 +00:00
Juli Mallett
fb3c16bc48 In the trap messages that aid the primitive debugging environment of MIPS,
include the tid as well, so it's easier to tell which thread of a process
with multiple is responsible for a crash.
2012-03-06 02:23:15 +00:00
Juli Mallett
2bd5a2588e Fix tls base computation with COMPAT_FREEBSD32 on n64 kernels. The previous
version was missing an else and would always use the n64 TP_OFFSET.  Eliminate
some duplication of logic here.

It may be worth getting rid of some of the ifdefs and introducing gratuitous
SV_ILP32 runtime checks on n64 kernels without COMPAT_FREEBSD32 and on o32
kernels, similarly to how PowerPC works.
2012-03-04 05:19:55 +00:00
Juli Mallett
87775fcd35 Unbreak n64 build without COMPAT_FREEBSD32 by fixing mismatched preprocessor
conditionals.
2012-03-03 10:22:49 +00:00
Juli Mallett
9624d94701 o) Add COMPAT_FREEBSD32 support for MIPS kernels using the n64 ABI with userlands
using the o32 ABI.  This mostly follows nwhitehorn's lead in implementing
   COMPAT_FREEBSD32 on powerpc64.
o) Add a new type to the freebsd32 compat layer, time32_t, which is time_t in the
   32-bit ABI being used.  Since the MIPS port is relatively-new, even the 32-bit
   ABIs use a 64-bit time_t.
o) Because time{spec,val}32 has the same size and layout as time{spec,val} on MIPS
   with 32-bit compatibility, then, disable some code which assumes otherwise
   wrongly when built for MIPS.  A more general macro to check in this case would
   seem like a good idea eventually.  If someone adds support for using n32
   userland with n64 kernels on MIPS, then they will have to add a variety of
   flags related to each piece of the ABI that can vary.  That's probably the
   right time to generalize further.
o) Add MIPS to the list of architectures which use PAD64_REQUIRED in the
   freebsd32 compat code.  Probably this should be generalized at some point.

Reviewed by:	gonzo
2012-03-03 08:19:18 +00:00
Juli Mallett
4228a524fd When creating a handle for a subregion, be sure to actually math out the new
handle address, where we're using handles as raw addresses.

This fixes devices with subregions on Octeon PCI specifically, and likely also on
MIPS more generally, where there isn't another bus_space in use that was doing the
math already.
2012-03-02 21:46:31 +00:00
Juli Mallett
7b7463a5d2 If an Atheros device is attached to an Octeon, it's going to be by PCI. 2012-03-02 21:44:39 +00:00
Juli Mallett
3b7eabb569 Unbreak SMP on stock Octeon systems -- copy the core_mask from bootinfo into
sysinfo.  This should have been done as part of replacing bootinfo with sysinfo.
2012-03-02 20:34:15 +00:00
John Baldwin
831ce4cb3d - Change contigmalloc() to use the vm_paddr_t type instead of an unsigned
long for specifying a boundary constraint.
- Change bus_dma tags to use bus_addr_t instead of bus_size_t for boundary
  constraints.

These allow boundary constraints to be fully expressed for cases where
sizeof(bus_addr_t) != sizeof(bus_size_t).  Specifically, it allows a
driver to properly specify a 4GB boundary in a PAE kernel.

Note that this cannot be safely MFC'd without a lot of compat shims due
to KBI changes, so I do not intend to merge it.

Reviewed by:	scottl
2012-03-01 19:58:34 +00:00
Oleksandr Tymoshenko
f3318c38dc Revert part of old logic of assigning MAC addressess:
- Reserver respective number of addresses for managment port
- octm uses base address directly
- other drivers get MACs on "first come first served" basis

Reviewed by:	juli
2012-02-29 05:48:29 +00:00
Gavin Atkinson
1748d1e513 Correct capitalization of "Hz" in user-visible text (manpages, printf(),
etc).

MFC after:	3 days
2012-02-28 13:19:34 +00:00
Oleksandr Tymoshenko
57fa7d3101 Refctor address assignment for Octeon's ethernet ports:
- Centralize address assignment
- Make sure managment ports get first MAC address in pool
- Properly propagate fail if address allocation failed

Submitted by:	Andrew Duane <aduane@juniper.net>
2012-02-22 01:30:25 +00:00
Robert Watson
79f9811409 When initialising the CP0 status register during boot on 64-bit MIPS,
set all three of the kernel, supervisor, and user-mode 64-bit mode
flags.  While FreeBSD does not currently use the supervisor ring (and
hence this is effectively a NOP on most systems), doing this avoids
triggering an exception on 64-bit MIPS CPUs that don't support 32-bit
compatibility mode, and therefore don't allow clearing the SX bit.

Reviewed by:	gonzo
MFC after:	3 days
Sponsored by:	DARPA, SRI International
2012-02-14 20:34:25 +00:00
Oleksandr Tymoshenko
4c322abc56 - Reverse logic so base tls is fixed up with correct number 2012-02-10 23:24:33 +00:00
Oleksandr Tymoshenko
bdbf2b0837 - Fix spelling of R_MIPS_RELGOT
- Add R_MIPS_JALR relocation
- Add TLS relocation types

Obtained from:	NetBSD
2012-02-10 19:17:14 +00:00
Oleksandr Tymoshenko
d328a1b2f3 Fix-up value passed by thr_new syscall to make it compatible
with MIPS_TLS_GET/MIPS_TLS_SET sysarch API.
2012-02-10 07:03:45 +00:00
Oleksandr Tymoshenko
8d26fe2af5 Fix n32 build breakage 2012-02-09 22:48:35 +00:00
Oleksandr Tymoshenko
2675d18f77 - Emulate RDHWR instruction for TLS support
Reading register $29 with RDHWR is becoming the de-facto standard to
implement TLS.  According to linux-mips wiki, MIPS Technologies has
reserved hardware register $29 for ABI use.  Furthermore current GCC
makes the following assumptions:
- RDHWR is natively available or otherwise emulated by the kernel
- Register $29 holds the TLS pointer

Submitted by:	Robert Millan <rmh@debian.org>
2012-02-09 22:17:13 +00:00
David Schultz
2ee7b1d4ae Add C11 macros describing subnormal numbers to float.h.
Reviewed by:	bde
2012-01-23 06:36:41 +00:00
Oleksandr Tymoshenko
cccc098d9b We use port_index field of struct octusb_qh to reference USB state
of root HUB. Although it is initialized with port index of the
device's parent hub, which is worng. So track the USB tree up to
root HUB  and initialize this filed ptroprly

Rename port_index to root_port_index in order to reflect its
real semantics.
2012-01-20 23:37:04 +00:00
David Schultz
9fa03ecd01 Add parentheses where required. Without them, `sizeof LDBL_MAX'
is a syntax error and shouldn't be, while `1 FLT_ROUNDS' isn't a
syntax error and should be.  Thanks to bde for the examples.
2012-01-20 06:51:41 +00:00
David Schultz
cb659153f9 Fix the value of float_t to match what is implied by FLT_EVAL_METHOD. 2012-01-16 20:17:51 +00:00
David Schultz
89c570d28d Remove a confused comment and fix some minor bugs. 2012-01-16 05:23:27 +00:00
Adrian Chadd
a2d4a78a47 Stop overloading opt_global.h. 2012-01-16 05:07:32 +00:00
Adrian Chadd
46efd63a5b Build some more things (random, bridge/gif/gre, gpio, USB) as modules as well
so some embedded platform builds can use these instead of a fully monolithic
kernel.
2012-01-15 19:43:56 +00:00
Adrian Chadd
7fb4a4be07 Some of the atheros based embedded devices use one or more PCI NICs
on-board, glued to the AR71xx CPU.  These may forgo separate WMAC EEPROMs
(which store configuration and calibration data) and instead store
it in the main board SPI flash.

Normally the NIC reads the EEPROM attached to it to setup various PCI
configuration registers.  If this isn't done, the device will probe as
something different (eg 0x168c:abcd, or 0x168c:ff??.)  Other setup registers
are also written to which may control important functions.

This introduces a new compile option, AR71XX_ATH_EEPROM, which enables the
use of this particular code.  The ART offset in the SPI flash can be
specified as a hint against the relevant slot/device number, for example:

hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000
hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1fff5000

TODO:

* Think of a better name;
* Make the PCIe version of this fixup code also use this option;
* Maybe also check slot 19;
* This has to happen _before_ the SPI flash is set from memory-mapped
  to SPI-IO - so document that somewhere.
2012-01-15 19:29:33 +00:00
Oleksandr Tymoshenko
547cfad16d Fix backtrace for MIPS64:
- Properly print 64-bit addresses
    - Get whole 64 bits of address using kdbpeekd
    - Make check for kernel address compatible with MIPS64
2012-01-13 23:31:36 +00:00
Oleksandr Tymoshenko
33b570d348 - Fix .rela case of R_MIPS_26 relocation. Addednds save diferently for
.rel and .rela sections. It's shifted right two bits for former
   but saved as-is for latter.
2012-01-13 07:00:47 +00:00
Oleksandr Tymoshenko
3a51efc5df Fix relocations for MIPS64:
- Use Elf32_Addr as default, the only field that is
        64 bitw wide is R_MIPS_64
    - Add R_MIPS_HIGHER and R_MIPS_HGHEST handlers
    - Handle R_MIPS_HI16 and R_MIPS_LO16 for both .rel and
        .rela sections
2012-01-08 05:44:19 +00:00
Oleksandr Tymoshenko
70d3600fdf Fix DDB x/i addr[,count] command for count > 1 case 2012-01-08 00:34:39 +00:00
Adrian Chadd
93e26ff438 Fix the ar724x shift calculation when writing to the PCI config space.
This was preventing the ath driver from being loaded at runtime.
It worked fine when compiled statically into the kernel but not when
kldload'ed after the system booted.

The root cause was that PCIR_INTLINE (register 60) was being
overwritten by zeros when register 62 was being written to.
A subsequent read of this register would return 0, and thus
the rest of the PCI glue assumed an IRQ resource had already
been allocated.  This caused the device to fail to attach at
runtime as the device itself didn't contain any IRQ resources.

TODO: go back over the ar71xx and ar724x PCI config read/write
code and ensure it's correct.
2012-01-07 04:13:25 +00:00
Oleksandr Tymoshenko
6cc1d135cd - Add better COP2 (crypto coprocessor) context handler for Octeon. Keep
COP2 disabled and lazily allocate COP2 context structure in exception
    handler. Keep kernel and userland contexts separated.
2012-01-06 01:23:26 +00:00
Adrian Chadd
8f5aa976d7 This isn't required any longer - it turns out the flash
has ~ 1.7MB of space for a kernel.  There's thus plenty of
space for a full, non-module kernel.
2012-01-05 07:19:05 +00:00
Adrian Chadd
b018dade46 Use geom_uncompress now, rather than geom_uzip.
This results in a much smaller rootfs image and it easily
fits in the 8MB flash.
2012-01-05 03:38:34 +00:00
Andreas Tobler
3079d69f90 Apply the same change as in r229494.
Requested by: ed
2012-01-04 16:07:16 +00:00
Oleksandr Tymoshenko
1f74cf8ccf - Octeon-SDK strictly requires multi_count to be zero for
full and low speed devices.
2012-01-03 19:10:37 +00:00
Oleksandr Tymoshenko
af8b177113 - Properly set IRQ handlers for all USB ports 2012-01-01 09:12:21 +00:00
Adrian Chadd
a92de4a5f6 This particular work around isn't required any longer, now that the
11n radio backends are also added into the RF linker set.

This saves around 7k from the kernel binary.
2011-12-31 23:41:19 +00:00
Oleksandr Tymoshenko
868fb4d19b - struct clocktime sets different ranges for DOW and month
comparing to struct timeval. for clocktime they should be
    1..7 and 1..12 respectively

- CAPK-0100ND uses RTC without centruy bit (DS1307) so set it 21st
2011-12-31 23:21:36 +00:00
Adrian Chadd
b2e6077c31 Oops - this was referencing a local file, which I've done away with. 2011-12-31 15:56:00 +00:00
Oleksandr Tymoshenko
9db595847a - Pass proper endpoint number (without direction flag) to
cvmx_usb_open_pipe
2011-12-31 05:45:10 +00:00
Adrian Chadd
38192bfc9f Add a configuration file for the Atheros PB47 reference board.
This is an AR71xx based board with 8MB flash, 64MB RAM, a
Mini-PCI+ slot (see below) and a single 10/100/1000baseT
ethernet port.  It also has two USB ports.

This is an easier board than most to add as it doesn't have a
switch PHY on-board.  This made it (mostly) trivial to craft a
working configuration.

Things to note:

* This, like most other reference boards, use uboot rather then
  redboot.  It means that you typically have to manually flash
  both the kernel and rootfs partitions.

* Since there's currently no (nice) way to extract out the
  ethernet MAC and RAM from the uboot environment, the RAM
  will default to 32mb and the MAC will be something very
  incorrect.   I'll try to fix this up in a subsequent commit
  or two, even if it's just some hard-coded nonsense in
  ar71xx_machdep.c for now.

* The board is designed for a specific model of mini-PCI+
  NIC which never made it into production.  Normal mini-PCI
  NICs will work fine; if you happen to have the NIC in question
  then it will work fine with this board.
2011-12-30 09:48:35 +00:00
Adrian Chadd
687021dd92 Add a couple of missing wlan modules. 2011-12-30 09:39:24 +00:00