freebsd-skq/sys/mips/atheros/files.ar71xx
Adrian Chadd 57b8f9ca1d [ar71xx] add a very simple early boot driver called "caldata" to commit cross-layer atrocities.
The (eventually) upcoming ath(4) changes will include being able to load
ath(4) devices on the AHB bus (ie the on-die wifi part of the SoC)
as modules.

In order for this to happen, a copy of the calibration data needs to be
copied away before the SPI driver runs or the memory map access hack
won't work.

Now, ideally (!) there'd be some driver that can come up after the MTD
pieces (eg, SPI, NAND, etc) and load into a firmware chunk the calibration
data.

(Or, really really nicely, would be an actual async firmware API that
would lead itself to having a driver schedule a file read - or a raw device
read - to get to the calibration data.)

Now, until all of the above is done - I'm going to perpetuate the layer
breaking atrocity here by simply doing the PCI bus fixup EEPROM/calibration
data hack here.  This will work for any AR71xx (and later on, AR231x/AR531x)
device, as well as the handful of QCA MIPS + QCA9880v2 802.11ac boards with
NOR flash.

To use, this goes into the kernel config:

# Enable EEPROM hacks
options AR71XX_ATH_EEPROM
device ar71xx_caldata
device firmware

# This enables the ath_ahb driver (when I commit the change!) to
# pull data out of the firmware hack.
options ATH_EEPROM_FIRMWARE

In the hints file:

# ART calibration data mapping device
hint.ar71xx_caldata.0.at="nexus0"
hint.ar71xx_caldata.0.order=0

# Where the ART is - last 64k in the first 8MB of flash
hint.ar71xx_caldata.0.map.0.ath_fixup_addr=0x1fff0000
hint.ar71xx_caldata.0.map.0.ath_fixup_size=16384

# And now tell the ath(4) driver where to look!
hint.ath.0.eeprom_firmware="ar71xx_caldata.0.map.0.eeprom_firmware"

Tested:

* carambola2, AR933x SoC, using a set of ath and ath_hal modules to load

TODO:

* unify this bit of firmware loading code, as I will definitely need
  to include both the PCI bus firmware version (for PCI ID fixups too!)
  as well as AHB/on-chip calibration data.

* Commit the ath_ahb bus code

* Convert .. everything over.  That'll take the majority of the time.
2017-05-23 06:20:06 +00:00

36 lines
1.4 KiB
Plaintext

# $FreeBSD$
mips/atheros/apb.c optional ar71xx_apb
mips/atheros/ar71xx_caldata.c optional ar71xx_caldata
mips/atheros/ar71xx_gpio.c optional gpio
mips/atheros/ar71xx_machdep.c standard
mips/atheros/ar71xx_ehci.c optional ehci
mips/atheros/ar71xx_ohci.c optional ohci
mips/atheros/ar71xx_pci.c optional ar71xx_pci pci
mips/atheros/ar724x_pci.c optional ar724x_pci pci
mips/atheros/ar71xx_pci_bus_space.c optional pci
mips/atheros/ar71xx_spi.c optional ar71xx_spi
mips/atheros/ar71xx_macaddr.c standard
mips/atheros/pcf2123_rtc.c optional pcf2123_rtc ar71xx_spi
mips/atheros/ar71xx_wdog.c optional ar71xx_wdog
mips/atheros/if_arge.c optional arge
mips/atheros/uart_bus_ar71xx.c optional uart_ar71xx
mips/atheros/uart_cpu_ar71xx.c optional uart_ar71xx
mips/atheros/uart_bus_ar933x.c optional uart_ar933x
mips/atheros/uart_cpu_ar933x.c optional uart_ar933x
mips/atheros/uart_dev_ar933x.c optional uart_ar933x
mips/atheros/ar71xx_bus_space_reversed.c standard
mips/mips/intr_machdep.c standard
mips/mips/tick.c standard
mips/atheros/ar71xx_setup.c standard
mips/atheros/ar71xx_chip.c standard
mips/atheros/ar724x_chip.c standard
mips/atheros/ar91xx_chip.c standard
mips/atheros/ar933x_chip.c standard
mips/atheros/ar934x_chip.c standard
mips/atheros/qca953x_chip.c standard
mips/atheros/qca955x_chip.c standard
mips/atheros/ar71xx_fixup.c optional ar71xx_ath_eeprom
mips/atheros/qca955x_apb.c optional qca955x_apb
mips/atheros/qca955x_pci.c optional qca955x_pci pci