svn commit: r279512 - head/sys/dev/ath
Adrian Chadd
adrian at FreeBSD.org
Mon Mar 2 02:14:46 UTC 2015
Author: adrian
Date: Mon Mar 2 02:14:44 2015
New Revision: 279512
URL: https://svnweb.freebsd.org/changeset/base/279512
Log:
Lay some groundwork for having this stuff hang off of AHB rather than
the CPU nexus.
* Add ahb as a possible bus attachment
* Lay a comment down to remind me or whoever else ends up trying
to debug why the EEPROM isn't mapped in as to what's going on.
Modified:
head/sys/dev/ath/if_ath_ahb.c
Modified: head/sys/dev/ath/if_ath_ahb.c
==============================================================================
--- head/sys/dev/ath/if_ath_ahb.c Mon Mar 2 02:08:43 2015 (r279511)
+++ head/sys/dev/ath/if_ath_ahb.c Mon Mar 2 02:14:44 2015 (r279512)
@@ -153,12 +153,24 @@ ath_ahb_attach(device_t dev)
eepromsize = ATH_EEPROM_DATA_SIZE * 2;
}
-
rid = 0;
device_printf(sc->sc_dev, "eeprom @ %p (%d bytes)\n",
(void *) eepromaddr, eepromsize);
- psc->sc_eeprom = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, (uintptr_t) eepromaddr,
- (uintptr_t) eepromaddr + (uintptr_t) (eepromsize - 1), 0, RF_ACTIVE);
+ /*
+ * XXX this assumes that the parent device is the nexus
+ * and will just pass through requests for all of memory.
+ *
+ * Later on, when this has to attach off of the actual
+ * AHB, this won't work.
+ *
+ * Ideally this would be done in machdep code in mips/atheros/
+ * and it'd expose the EEPROM via the firmware interface,
+ * so the ath/ath_ahb drivers can be loaded as modules
+ * after boot-time.
+ */
+ psc->sc_eeprom = bus_alloc_resource(dev, SYS_RES_MEMORY,
+ &rid, (uintptr_t) eepromaddr,
+ (uintptr_t) eepromaddr + (uintptr_t) (eepromsize - 1), 0, RF_ACTIVE);
if (psc->sc_eeprom == NULL) {
device_printf(dev, "cannot map eeprom space\n");
goto bad0;
@@ -349,6 +361,7 @@ static driver_t ath_ahb_driver = {
};
static devclass_t ath_devclass;
DRIVER_MODULE(ath, nexus, ath_ahb_driver, ath_devclass, 0, 0);
+DRIVER_MODULE(ath, apb, ath_ahb_driver, ath_devclass, 0, 0);
MODULE_VERSION(ath, 1);
MODULE_DEPEND(ath, wlan, 1, 1, 1); /* 802.11 media layer */
MODULE_DEPEND(ath, if_ath, 1, 1, 1); /* if_ath driver */
More information about the svn-src-all
mailing list