summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-04-20 21:56:13 +0000
committeradrian <adrian@FreeBSD.org>2012-04-20 21:56:13 +0000
commit9e5483e0b11a6965fc0cc022db72b98eb7eee802 (patch)
tree45d57052f329f280be2f0bf02cad60fd370faa9d /sys/dev
parentc5c6fab45cbf5e0831f3376736ecb82fdf72b28e (diff)
downloadFreeBSD-src-9e5483e0b11a6965fc0cc022db72b98eb7eee802.zip
FreeBSD-src-9e5483e0b11a6965fc0cc022db72b98eb7eee802.tar.gz
"Upgrade" the AR9285 code to support PCI/ART EEPROM on flash.
I've just verified that this boots on an Atheros AP91. I haven't verified it with traffic though, so YMMV.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ath/ath_hal/ah_eeprom_v4k.c12
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9280_attach.c2
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_attach.c12
3 files changed, 18 insertions, 8 deletions
diff --git a/sys/dev/ath/ath_hal/ah_eeprom_v4k.c b/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
index 927f08e..12cb67e 100644
--- a/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
+++ b/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
@@ -298,12 +298,12 @@ ath_hal_v4kEepromAttach(struct ath_hal *ah)
"%s Error reading Eeprom MAGIC\n", __func__);
return HAL_EEREAD;
}
- }
- HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n",
- __func__, magic);
- if (magic != AR5416_EEPROM_MAGIC) {
- HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n");
- return HAL_EEMAGIC;
+ HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n",
+ __func__, magic);
+ if (magic != AR5416_EEPROM_MAGIC) {
+ HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n");
+ return HAL_EEMAGIC;
+ }
}
ee = ath_hal_malloc(sizeof(HAL_EEPROM_v4k));
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
index 0b5c24b..af8eb92 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
@@ -169,7 +169,6 @@ ar9280Attach(uint16_t devid, HAL_SOFTC sc,
ar5416InitState(AH5416(ah), devid, sc, st, sh, status);
-
/*
* Use the "local" EEPROM data given to us by the higher layers.
* This is a private copy out of system flash. The Linux ath9k
@@ -180,7 +179,6 @@ ar9280Attach(uint16_t devid, HAL_SOFTC sc,
AH_PRIVATE((ah))->ah_eepromRead = ath_hal_EepromDataRead;
AH_PRIVATE((ah))->ah_eepromWrite = NULL;
ah->ah_eepromdata = eepromdata;
- }
/* XXX override with 9280 specific state */
/* override 5416 methods for our needs */
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
index 0fbe414..b43b485 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
@@ -134,6 +134,18 @@ ar9285Attach(uint16_t devid, HAL_SOFTC sc,
ar5416InitState(AH5416(ah), devid, sc, st, sh, status);
+ /*
+ * Use the "local" EEPROM data given to us by the higher layers.
+ * This is a private copy out of system flash. The Linux ath9k
+ * commit for the initial AR9130 support mentions MMIO flash
+ * access is "unreliable." -adrian
+ */
+ if (eepromdata != AH_NULL) {
+ AH_PRIVATE(ah)->ah_eepromRead = ath_hal_EepromDataRead;
+ AH_PRIVATE(ah)->ah_eepromWrite = NULL;
+ ah->ah_eepromdata = eepromdata;
+ }
+
/* XXX override with 9285 specific state */
/* override 5416 methods for our needs */
AH5416(ah)->ah_initPLL = ar9280InitPLL;
OpenPOWER on IntegriCloud