Commit graph

330 commits

Author SHA1 Message Date
Pyun YongHyeon 57c81d92ae Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.

Reported by:	Karim (fodillemlinkarimi <> gmail dot com)
2011-10-17 19:49:00 +00:00
Kevin Lo 281f0ca8e7 Remove duplicate header includes 2011-06-26 10:07:48 +00:00
Adrian Chadd cc641d93c6 Fix GPIO_MAXPINS calculation for the AR71xx, AR724x, AR913x SoC.
Submitted by:	Luiz Otavio O Souza <loos.br@gmail.com>
2011-05-06 02:45:02 +00:00
Marius Strobl 3fcb7a5365 - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP
(reporting IFM_LOOP based on BMCR_LOOP is left in place though as
  it might provide useful for debugging). For most mii(4) drivers it
  was unclear whether the PHYs driven by them actually support
  loopback or not. Moreover, typically loopback mode also needs to
  be activated on the MAC, which none of the Ethernet drivers using
  mii(4) implements. Given that loopback media has no real use (and
  obviously hardly had a chance to actually work) besides for driver
  development (which just loopback mode should be sufficient for
  though, i.e one doesn't necessary need support for loopback media)
  support for it is just dropped as both NetBSD and OpenBSD already
  did quite some time ago.
- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Restructure the PHY entry points to use a structure of entry points
  instead of discrete function pointers, and extend this to include
  a "reset" entry point. Make sure any PHY-specific reset routine is
  always used, and provide one for lxtphy(4) which disables MII
  interrupts (as is done for a few other PHYs we have drivers for).
  This includes changing NIC drivers which previously just called the
  generic mii_phy_reset() to now actually call the PHY-specific reset
  routine, which might be crucial in some cases. While at it, the
  redundant checks in these NIC drivers for mii->mii_instance not being
  zero before calling the reset routines were removed because as soon
  as one PHY driver attaches mii->mii_instance is incremented and we
  hardly can end up in their media change callbacks etc if no PHY driver
  has attached as mii_attach() would have failed in that case and not
  attach a miibus(4) instance.
  Consequently, NIC drivers now no longer should call mii_phy_reset()
  directly, so it was removed from EXPORT_SYMS.
- Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe().
  The purpose of that function is to perform the common steps to attach
  a PHY driver instance and to hook it up to the miibus(4) instance and to
  optionally also handle the probing, addition and initialization of the
  supported media. So all a PHY driver without any special requirements
  has to do in its bus attach method is to call mii_phy_dev_attach()
  along with PHY-specific MIIF_* flags, a pointer to its PHY functions
  and the add_media set to one. All PHY drivers were updated to take
  advantage of mii_phy_dev_attach() as appropriate. Along with these
  changes the capability mask was added to the mii_softc structure so
  PHY drivers taking advantage of mii_phy_dev_attach() but still
  handling media on their own do not need to fiddle with the MII attach
  arguments anyway.
- Keep track of the PHY offset in the mii_softc structure. This is done
  for compatibility with NetBSD/OpenBSD.
- Keep track of the PHY's OUI, model and revision in the mii_softc
  structure. Several PHY drivers require this information also after
  attaching and previously had to wrap their own softc around mii_softc.
  NetBSD/OpenBSD also keep track of the model and revision on their
  mii_softc structure. All PHY drivers were updated to take advantage
  as appropriate.
- Convert the mebers of the MII data structure to unsigned where
  appropriate. This is partly inspired by NetBSD/OpenBSD.
- According to IEEE 802.3-2002 the bits actually have to be reversed
  when mapping an OUI to the MII ID registers. All PHY drivers and
  miidevs where changed as necessary. Actually this now again allows to
  largely share miidevs with NetBSD, which fixed this problem already
  9 years ago. Consequently miidevs was synced as far as possible.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
  weren't explicitly converted to support flow control before. It's
  unclear whether flow control actually works with these but typically
  it should and their net behavior should be more correct with these
  changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from:	NetBSD (partially)
Reviewed by:	yongari (earlier version), silence on arch@ and net@
2011-05-03 19:51:29 +00:00
Adrian Chadd b1b9d50bd9 Some AR724x PCIe fixes, which should wrap up the first round
of endian-ness issues with the AR724x.

From Luiz:

* Fix the bus space tag used so endian-ness is correctly handled;
* Only do the workaround for the AR7240; AR7241/AR7242 (PB92)
  don't require this

From me:

* Add a read flush from openwrt

Submitted by:	Luiz Otavio O Souza
2011-05-01 23:32:37 +00:00
Adrian Chadd 9a70a84852 The AR724x SoC's require the irq status line to be acked/cleared.
This allows console IO to occur correctly once the kernel is in multi-user
mode.

Submitted by:	Luiz Otavio O Souza
2011-04-30 12:07:15 +00:00
Adrian Chadd 569fa65ddd Call the DDR FIFO flush method when IP2 interrupts occur. 2011-04-30 11:56:04 +00:00
Adrian Chadd 41426ac408 Flip off debugging for now. 2011-04-30 11:40:31 +00:00
Adrian Chadd d7fc7abf5a Add some initial PCIe bridge support for the AR724x chipsets.
This is reported to work on the AR7240 based Ubiquiti Rocket M5
but I haven't tested it on that hardware. I also don't yet have
it fully working on the AR7242 based development board here;
probe/attach functions but the register space resource looks like
the endian-ness is wrong (0x10000000 instead of 0x00001000).o

Further digging will be required.

Submitted by:	Luiz Otavio O Souza
2011-04-30 11:36:16 +00:00
Adrian Chadd af0167995c In preparation for the AR724x PCIe bus code, make the AR71xx PCI bus
glue require 'device ar71xx_pci' .

Users of the AR71xx board configs will now require this for functioning
PCI:

device pci
device ar71xx_pci
2011-04-30 11:28:21 +00:00
Adrian Chadd bb21522438 Add a missing DDR FIFO method for the ar71xx. 2011-04-30 02:31:56 +00:00
Adrian Chadd f0fb75ebd2 Tidy up the naming of the ip2 DDR flush routine, and add an inline
accessor method (which is currently unused) in there.
2011-04-29 06:25:11 +00:00
Adrian Chadd c746f80ee3 Add the IP2 DDR flush handlers.
These aren't yet used in the interrupt handler path but should be.
2011-04-28 11:13:26 +00:00
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 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 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 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
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
Adrian Chadd 8779d9c963 Add missing ar91xx definition for the WMAC reset control. 2011-01-09 06:17:46 +00:00
Oleksandr Tymoshenko 99629fa36d - Populate dump_avail with proper values from phys_avail 2010-12-09 07:01:03 +00:00
Warner Losh 161b83b959 Remove the 'machine mips' from DEFAULTS. Put the proper 'machine mips
mipsel' or 'machine mips mipseb' into the config file (with a few 64's
tossed in for good measure).  This will let us build the proper
kernels with different worlds as part of make universe.
2010-11-13 22:34:12 +00:00
Marius Strobl d6c65d276e Converted the remainder of the NIC drivers to use the mii_attach()
introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these
are only straight forward conversions though.

Reviewed by:	yongari
2010-10-15 15:00:30 +00:00
Oleksandr Tymoshenko 8c01516d7e - Fix values of CS1_EN and CS2_EN flags
- Unbreak kernel build by fixing naming convention of
    GPIO_FUNC flags

Spotted by: Luiz Otavio O Souza, Andrew Thompson
2010-09-29 23:06:41 +00:00
Oleksandr Tymoshenko da5c5453e7 AR71XX_GPIO_* defines were introduced by adrian@ a while ago,
remove duplicated.
2010-09-29 21:01:16 +00:00
Oleksandr Tymoshenko 0dfca27f07 Add AR71XX GPIO bus driver. 2010-09-28 03:31:34 +00:00
Andrew Thompson 08e58cc093 Make a note of which platforms the mac strings come from.
Suggested by:	adrian
2010-09-17 01:13:48 +00:00
Andrew Thompson 3441a301f2 Use getenv to find the mac address since it could be in the bootloader
environment or command line and under different names.
2010-09-17 01:09:12 +00:00
Andriy Gapon 3d844eddb7 bus_add_child: change type of order parameter to u_int
This reflects actual type used to store and compare child device orders.
Change is mostly done via a Coccinelle (soon to be devel/coccinelle)
semantic patch.
Verified by LINT+modules kernel builds.

Followup to:	r212213
MFC after:	10 days
2010-09-10 11:19:03 +00:00
Adrian Chadd 813b73a5a9 Migrate if_arge to use the PLL cpuops.
This has been lightly tested on the AR7161 and AR9132.
2010-08-19 16:29:08 +00:00
Adrian Chadd 303fea5cdc Implement PLL generalisation in preparation for use in if_arge.
* Add a function to write to the relevant PLL register
* Break out the PLL configuration for the AR71XX into the CPU ops,
  lifted from if_arge.c.
* Add the AR91XX PLL configuration ops, using the AR91XX register
  definitions.
2010-08-19 16:25:15 +00:00
Adrian Chadd 44c5dea1d8 add the PLL set functions to cpuops 2010-08-19 16:15:30 +00:00
Adrian Chadd 88e08e7ce6 Fix mistaken indenting. 2010-08-19 12:52:49 +00:00
Adrian Chadd c4df93502d Add some initial AR724X chipset support.
This is untested but should at least allow an AR724X to boot.

The current code is lacking the detail needed to expose the PCIe bus.
It is also lacking any NIC, PLL or flush/WB code.
2010-08-19 11:53:55 +00:00
Adrian Chadd f3135331c6 Add initial Atheros AR91XX support.
This works well enough to bring a system up to single-user mode
using an MDROOT.

Known Issues:

* The EHCI USB doesn't currently work and will panic the kernel during
  attach.
* The onboard ethernet won't work until the PLL routines have been
  fleshed out and shoe-horned into if_arge.
* The WMAC device glue (and quite likely the if_ath support)
  hasn't yet been implemented.
2010-08-19 11:40:10 +00:00
Adrian Chadd c2ddd1eef7 Add missing licence. 2010-08-19 11:18:50 +00:00
Adrian Chadd 8d19ed7cbc style(9) pick from imp@ . 2010-08-19 11:16:52 +00:00
Adrian Chadd 292899c376 Remove now unused 'reg'. 2010-08-19 02:15:39 +00:00
Adrian Chadd 6f96ebf309 Initialise the USB system using cpuops rather than the AR71XX specific method. 2010-08-19 02:14:53 +00:00
Adrian Chadd 1d11005672 Migrate the CPU reset path to use the new cpuops. 2010-08-19 02:12:04 +00:00
Adrian Chadd 5b877d30b5 Remove the now-unused DDR flush register value. 2010-08-19 02:10:05 +00:00
Adrian Chadd 23f10186b5 Make the PCI initialisation path use the new cpuops rather than directly
programming the reset register.
2010-08-19 02:05:16 +00:00
Adrian Chadd fd11fd075a Make if_arge use the new cpuops rather than hard coding the DDR flush registers. 2010-08-19 02:04:35 +00:00
Adrian Chadd 70bd9230d1 Preparation work for supporting the AR91xx and AR724x.
* Implement a SoC probe function, from Linux, which determines the
  SoC family, type and revision. This only probes the AR71xx series
  SoC and (currently) panics on others.

* Migrate some of the AR71XX specific hardware init (USB device, determining
  system frequencies) into using the cpuops introduced in an earlier commit.
  Other SoC specific hardware stuff (per-device flush/WB, GPIO pin wiring,
  Ethernet PLL setup, other things I've likely missed) will be introduced in
  subsequent commits.

Reviewed by:	imp@
Obtained from:	(partially) Linux
2010-08-19 02:03:12 +00:00
Adrian Chadd 5429211e0a Add a DDR flush function, inspired by both Linux and if_arge.c. 2010-08-18 09:11:45 +00:00
Adrian Chadd 3692b33ce3 Add a further register definition for USB device initialisation.
Obtained from:	Linux
2010-08-18 08:22:58 +00:00
Adrian Chadd 4d843b15ca Bring over the first cut of the Atheros-specific SoC operations.
Each of these SoCs have different devices, different hardware initialisation
methods and, quite likely, different quirks. These functions will abstract
out the SoC differences and keep these differences out of the drivers (eg
USB init, if_arge, etc.)
2010-08-18 08:22:09 +00:00
Adrian Chadd 7f8184068f Import initial AR91XX and AR724X CPU register definitions.
Obtained from:	Linux
2010-08-18 00:26:14 +00:00
Oleksandr Tymoshenko d8484ec681 - Add interrupts counter for PCI devices 2010-08-05 21:31:29 +00:00
Adrian Chadd ff97a64735 Add TX-path aligned/unaligned stats for if_arge. 2010-07-08 15:20:57 +00:00
Adrian Chadd ef54d27641 Address PR kern/148307 - fix if_ath TX mbuf alignment/size constraint checks
The existing code only checked the alignment of the first mbuf and
didn't enforce the size constraints.

This commit introduces a simple function to check the alignment and
size of all mbufs in the list. This fixes the initial issue in the
PR.

PR: kern/148307
Reviewed by: gonzo@
2010-07-08 14:59:32 +00:00
Adrian Chadd d06458f7f7 Introduce a sysctl block for if_arge and, for now, a blank debug sysctl
placeholder for later.

Add in a missing FreeBSD ID string.
2010-07-08 14:34:15 +00:00
Adrian Chadd ac35b90587 Fix the CS line definitions. These bits are for the CS2/CS1 lines
rather than CS1/CS0.

This has been tested on the Ubiqiti Routerstation Pro board.
2010-07-07 15:05:44 +00:00
Adrian Chadd 7107f92fd6 Comment about the shared pins I know about. 2010-06-24 05:17:21 +00:00
Adrian Chadd e3ded4845c AR71XX GPIO register definitions.
Reviewed by:	gonzo@
2010-06-23 03:59:26 +00:00
Adrian Chadd 7bc1af9566 Extend the AR71XX watchdog debugging and data.
* Add some per-device sysctl entries which record the watchdog state -
  whether it is armed; whether the last reboot was due to the watchdog.
* Add a per-device sysctl debug flag to enable logging watchdog arming/
  disarming.

Reviewed by:	gonzo@
2010-06-19 12:12:39 +00:00
Maxim Sobolev e50d35e6c6 Add new tunable 'net.link.ifqmaxlen' to set default send interface
queue length. The default value for this parameter is 50, which is
quite low for many of today's uses and the only way to modify this
parameter right now is to edit if_var.h file. Also add read-only
sysctl with the same name, so that it's possible to retrieve the
current value.

MFC after:	1 month
2010-05-03 07:32:50 +00:00
Oleksandr Tymoshenko d51a8afbfe - Fix mutex type for miibus_mtx: it's not spinlock, it's def lock 2010-04-08 18:32:13 +00:00
Alexander Kabaev 779fea6010 Define DMA_RX_STATUS_OVERFLOW with correct value.
The RX overflow is reported in bit 2 on real hardware and Linux driver
for the same device already has this defined correctly.
This fixes frequent interrupt storms seen on RouterStation Pro boards.

Discussed with:	gonzo
2010-02-19 17:37:46 +00:00
Oleksandr Tymoshenko c1517c0df5 - Increase timeouts to 100 milliseconds, 1 millisecond is definitely not
enough for PCI controller to get into shape

Thanks to: adrian@
2010-01-28 21:55:56 +00:00
Oleksandr Tymoshenko d86043b594 - Call post-boot fixup function in order to get proper static
symbols resolving in DDB
- When zeroing .bss/.sbss do not round end address to page boundary,
    it's not neccessary and might destroy data pased by trampoline or
    boot loader
2010-01-25 00:44:05 +00:00
Warner Losh 657a57d730 Update from old DDB convetion to initialize debugger to new KDB way.
Always call kdb_init().  If we have KDB enabled, then provide a handy
place to break to the debugger.
2010-01-23 00:18:12 +00:00
Oleksandr Tymoshenko 61b1ecf6d3 - Add driver for PCF2123, SPI real time clock/calendar 2010-01-22 22:14:12 +00:00
Oleksandr Tymoshenko 9e3ed0a7fe - Remove unnecessary register writes in activate_device
and deactivate_device
- Save state before attaching driver and restore it when
    detaching
- Clear CLK bit after last bit of byte has been sent over
    the bus providing falling edge for last byte in transfer
- Fix several places where CS0 was always assumed
- Add $FreeBSD$ to ar71xxreg.h
2010-01-21 00:15:59 +00:00
Warner Losh 3ad9e328b8 Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the
BSP.  Provide a missing prototype.
2010-01-09 03:08:22 +00:00
Warner Losh a096e4b36b Centralize initialization of pcpu, and set curthread early... 2010-01-08 22:48:21 +00:00
Oleksandr Tymoshenko 2839b59a94 - Add intr counters for APB interrupts 2009-11-18 22:53:05 +00:00
Oleksandr Tymoshenko 2b8344b8fa - Handle multiphy MAC case: create interface with
fixed-state media with parameters set via hints
    and configure MAC accordingly to these parameters.
    All the underlying PHY magic is done by boot manager
    on startup. At the moment there is no proper way
    to make active and control all PHYs simultaneously
    from one MII bus and there is no way to associate
    incoming/outgoing packet with specific PHY.
2009-11-12 21:27:58 +00:00
Oleksandr Tymoshenko 445ee40baa - include register definitions for respective controllers 2009-11-12 20:48:04 +00:00
Oleksandr Tymoshenko bec244c750 - Access to all 5 PHYs goes through registers in MAC0 memory
space, rewrite miibus accessors respectively
2009-11-08 07:26:02 +00:00
Oleksandr Tymoshenko 40a554d7ac - Fix: Wrong register is used for initial value reading 2009-11-06 21:53:38 +00:00
Oleksandr Tymoshenko 6450bdc708 - Fix initialization of PLL registers (different shifts for
arge0/arge1)
- Use base MAC address to generate MACs for arge1 and above
2009-11-06 06:50:45 +00:00
Oleksandr Tymoshenko d6994d3b0e - Replace dumb cut'n'paste call with not to self (XXX) 2009-11-05 03:54:03 +00:00
Oleksandr Tymoshenko 896ef84ff0 - style(9): replace whitespaces with tabs 2009-11-04 23:34:58 +00:00
Oleksandr Tymoshenko a0d684a583 - Remove noisy "Implement me" stubs
- Handle SIOCSIFFLAGS ioctl
2009-11-04 23:33:36 +00:00
Randall Stewart 8fae280afb With this commit our friend RMI will now compile. I have
not tested it and the chances of it running yet are about
ZERO.. but it will now compile. The hard part now begins,
 making it run ;-)
2009-10-30 08:53:11 +00:00
Oleksandr Tymoshenko 12dfccb876 - Fix build with DEVICE_POLLING enabled 2009-10-30 01:40:32 +00:00
Andrew Thompson 3c2330f2e4 Parse and save the command line passed in from RedBoot (exec -c "xxx") and also
the board specific environment variables.

This is not ar71xx specific and should be shared better.
2009-10-28 21:27:56 +00:00
Randall Stewart 3f907e3338 Does 4 things:
1) Adds future RMI directories
2) Places intr_machdep.c in specfic files.arch pointing to the generic
   intr_machdep.c.  This allows us to have an architecture dependant intr_machdep.c
   (which we will need for RMI) in the machine specific directory
3) removes intr_machdep.c from files.mips
4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. We
   may need to look at finding a better place to put this. But first I want to
   get this thing compiling.
2009-10-15 21:03:32 +00:00
Oleksandr Tymoshenko cb00f8cae5 - Fix CPU divisor mask
Repored by: Luiz Otavio O Souza
2009-10-11 21:28:56 +00:00
Oleksandr Tymoshenko a7420595db - Remove flags accidently brought by dumb cut'n'paste coding 2009-09-03 18:27:55 +00:00
Oleksandr Tymoshenko d0c60705f1 - Fix phy address calculation 2009-09-03 18:23:23 +00:00
Oleksandr Tymoshenko 143acbd6fe - Make USB part of AR71XX kernel buildable again 2009-07-30 23:54:00 +00:00
Oleksandr Tymoshenko 4bdb59f342 - Add AR71XX watchdog timer driver 2009-07-09 20:16:01 +00:00
Oleksandr Tymoshenko 61bfa4ba5d - Move CPU/AHB frequency calculations to functions to
prevent code duplication
2009-07-09 20:11:26 +00:00
Oleksandr Tymoshenko 63080dcd94 - Fix PCI routing code 2009-07-08 17:20:53 +00:00
Oleksandr Tymoshenko 41d99511cb - Fix off-by-one bug in arge_fixup_rx. If mbuf is located
by the end of the page and even number of bytes long,
    that may cause TLBMiss exception for unallocated address.
- Fix mess with DMA sync opeartions
2009-07-08 02:21:08 +00:00
Oleksandr Tymoshenko d7766b4586 - Flush PCI register write before delay
Spotted by: Pyun YongHyeon
2009-06-19 05:00:17 +00:00
Oleksandr Tymoshenko 8766ab738d - Take into account only unmasked bits in interrupt status register 2009-06-16 00:02:02 +00:00
Oleksandr Tymoshenko fdf7155886 - Fix functions prototypes to make compiler happy 2009-06-12 12:17:32 +00:00
Oleksandr Tymoshenko 40570d7175 - Revert fix by dwhite that has been accidentally lost in r192783
commit.
2009-05-28 00:47:50 +00:00
Oleksandr Tymoshenko 66ecdee881 - style(9) fixes
- Get rid of obsolete mask_fn
2009-05-26 17:50:50 +00:00
Oleksandr Tymoshenko 571ef3dd82 - arge_poll should be decalred only if DEVICE_POLLING is enabled
- Revert Rx buffer nsegments from BUS_SPACE_UNRESTRICTED to
	ARGE_MAXFRAGS
2009-05-26 17:43:32 +00:00
Oleksandr Tymoshenko ccbbcd481f - Add polling support
- Get rid of arge_fix_chain, use m_defrag like if_vr
- Rework interrupt handling routine to avoid race that lead
    to disabling RX interrupts
- Enable full duplex if requested
- Properly set station MAC address
- Slightly optimize RX loop
- Initialize FILTERMATCH and FILTERMASK registers as linux driver does
2009-05-26 03:45:58 +00:00
Oleksandr Tymoshenko 5dc8f9e2ee - Calculate clock frequency using PLL registers 2009-05-23 18:18:06 +00:00
Oleksandr Tymoshenko 41917f9933 - Wrong logical operator was used for flag check 2009-05-23 06:30:03 +00:00
Doug White 58f0ea3143 Remove unused variable. 2009-05-22 20:08:13 +00:00
Doug White 58a5af46ef Add some missing bits to arge:
* In arge_attach(), hard reset the MAC blocks before configuring the MAC.
 * In arge_reset_dma(), clear pending packet interrupts based off
   the hardware counter instead of acking every packet in the ring,
   as the hardware counter can exceed the ring size. If the reset
   was successful the counters will be zero anyway.
 * In arge_encap(), remove an unused variable.
 * In arge_tx_locked(), remove redundant setting of the EMPTY flag as
   the TX DMA engine sets it for us.
 * In arge_intr(), remember to clear the interrupt status bits
   relayed from arge_intr_filter().
 * Handle RX overflow and TX underflow.
 * In arge_tx_intr(), remember to unmask the TX interrupt bits
   after processing them.
2009-05-21 22:12:42 +00:00
Oleksandr Tymoshenko f92ba06830 - ar71xx increases Count value every two cycles 2009-05-19 02:51:30 +00:00
Oleksandr Tymoshenko 495d422f49 - Add SPI bus driver for ar71xx SoC 2009-05-18 23:32:04 +00:00
Oleksandr Tymoshenko b665f0d4b7 - Set MAC Address obtained from RedBoot or generate random one 2009-05-16 02:45:38 +00:00
Oleksandr Tymoshenko 89616da3f5 - Get memory size and base MAC address from RedBoot (if available) 2009-05-16 02:43:24 +00:00
Oleksandr Tymoshenko bcc90b6ff5 - Add pci bus space that translates byte order to little endian,
may be it will be merged with bus_space_reversed later
- Handle memory resources close to bus in order to control
    bus_space_tag
2009-05-15 21:36:50 +00:00
Oleksandr Tymoshenko b75cca0708 - Calculate clock frequency using PLL registers
- Remove stale comments
2009-05-15 01:54:32 +00:00
Oleksandr Tymoshenko b31707c849 - Calculate CPU frequency using dividers from PLL registers 2009-05-15 01:53:09 +00:00
Oleksandr Tymoshenko 9b54fef7f5 - Add definitions for PLL CPU Config register fields 2009-05-15 01:51:47 +00:00
Oleksandr Tymoshenko ce205fb47f - Add SPI-related registers 2009-05-14 21:27:03 +00:00
Oleksandr Tymoshenko a88b9b52e3 - Remove garbage debug output 2009-05-14 21:15:27 +00:00
Oleksandr Tymoshenko 5db10e923d - Add interrupt handling for AR71XX PCI bridge 2009-05-07 03:39:23 +00:00
Oleksandr Tymoshenko ccf532a44b - Rollback to the hack with 3-bytes offset in base address.
uart_bus_XXXXX resources are handled in uart(4) code
    and we need more sophysticated way to define which space
    should be used for device based on hints
2009-05-06 02:46:04 +00:00
Oleksandr Tymoshenko 07e615d625 - Add APB base and size for memory rman in apb 2009-05-06 02:31:46 +00:00
Oleksandr Tymoshenko ccf8f87398 - Handle memory requests on apb level, do not pass them up to
nexus
- Unmask IRQ in bus_intr_setup
- Do not count timer IRQ (IRQ0) as stray
2009-05-06 02:31:07 +00:00
Oleksandr Tymoshenko 26a323c653 - accummulate interrupt causes in filter instead of rewriting old. The only
place where status should be overrided - interrupt handler
2009-04-29 03:21:53 +00:00
Oleksandr Tymoshenko c058a01081 - Remove garbage debug output
- ar71xx_bus_space_reversed is bus_space_tag_t, use it this way
2009-04-19 23:06:15 +00:00
Oleksandr Tymoshenko e6a88aa8ad - Add EHCI controller driver for AR71XX-based boards. 2009-04-19 22:58:36 +00:00
Oleksandr Tymoshenko 06dfe15065 - Handle byte-order issue for non-word accesses to memory mapped
registers with ar71xx_bus_space_reversed. Note, that byte order
    of values is handled by drivers. bus_spaces fixes only position
    of register in word.
- Replace .hints hack for AR71XX UART with ar71xx_bus_space_reversed.
2009-04-19 22:56:35 +00:00
Oleksandr Tymoshenko cf6e3ada35 Fix USB2 quick'n'dirty porting, now system successfully detects OHCI 2009-04-15 05:37:17 +00:00
Oleksandr Tymoshenko cbc6cfe0ed - Port AR71XX OHCI controller to new USB stack 2009-04-15 03:04:33 +00:00
Oleksandr Tymoshenko fd7391fc0c - Revert changes accidentally killed by merge operation 2009-04-14 22:53:22 +00:00