Reshuffle all of the DDR flush operations into a single switch/mux,
authoradrian <adrian@FreeBSD.org>
Sat, 4 Jul 2015 03:05:57 +0000 (03:05 +0000)
committeradrian <adrian@FreeBSD.org>
Sat, 4 Jul 2015 03:05:57 +0000 (03:05 +0000)
commite44e1c10f7185e84afe97a0190e157df199c1bd6
tree9458d788cf8221cb60b02e93c3cc649a1a6769f7
parent325681b5bb3e27e97fb4c3a1af18bf958fd26892
Reshuffle all of the DDR flush operations into a single switch/mux,
and start teaching subsystems about it.

The Atheros MIPS platforms don't guarantee any kind of FIFO consistency
with interrupts in hardware.  So software needs to do a flush when it
receives an interrupt and before it calls the interrupt handler.

There are new ones for the QCA934x and QCA955x, so do a few things:

* Get rid of the individual ones (for ethernet and IP2);
* Create a mux and enum listing all the variations on DDR flushes;
* replace the uses of IP2 with the relevant one (which will typically
  be "PCI" here);
* call the USB DDR flush before calling the real USB interrupt handlers;
* call the ethernet one upon receiving an interrupt that's for us,
  rather than never calling it during operation.

Tested:

* QCA9558 (TP-Link archer c7 v2)
* AR9331 (Carambola 2)

TODO:

* PCI, USB, ethernet, etc need to do a double-check to see if the
  interrupt was truely for them before doing the DDR.  For now I
  prefer "correct" over "fast".
13 files changed:
sys/mips/atheros/ar71xx_chip.c
sys/mips/atheros/ar71xx_cpudef.h
sys/mips/atheros/ar71xx_ehci.c
sys/mips/atheros/ar71xx_ohci.c
sys/mips/atheros/ar71xx_pci.c
sys/mips/atheros/ar724x_chip.c
sys/mips/atheros/ar724x_pci.c
sys/mips/atheros/ar91xx_chip.c
sys/mips/atheros/ar933x_chip.c
sys/mips/atheros/ar934x_chip.c
sys/mips/atheros/if_arge.c
sys/mips/atheros/qca955x_chip.c
sys/mips/atheros/qca955x_pci.c