svn commit: r234508 - in head/sys/dev/ath/ath_hal: . ar9002
Adrian Chadd
adrian at FreeBSD.org
Fri Apr 20 21:56:14 UTC 2012
Author: adrian
Date: Fri Apr 20 21:56:13 2012
New Revision: 234508
URL: http://svn.freebsd.org/changeset/base/234508
Log:
"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.
Modified:
head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Fri Apr 20 21:52:57 2012 (r234507)
+++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Fri Apr 20 21:56:13 2012 (r234508)
@@ -298,12 +298,12 @@ ath_hal_v4kEepromAttach(struct ath_hal *
"%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));
Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri Apr 20 21:52:57 2012 (r234507)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri Apr 20 21:56:13 2012 (r234508)
@@ -169,7 +169,6 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s
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 s
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 */
Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri Apr 20 21:52:57 2012 (r234507)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri Apr 20 21:56:13 2012 (r234508)
@@ -134,6 +134,18 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s
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;
More information about the svn-src-head
mailing list