Author: dim
Date: Mon Jan 14 19:31:44 2013
New Revision: 245429
URL: http://svnweb.freebsd.org/changeset/base/245429

Log:
  Partial MFC of r234508 (by adrian):
  
    "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.
  
  (This is a prerequisite for the coming clang 3.2 upgrade.)

Modified:
  stable/9/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
  stable/9/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/ath/ath_hal/ah_eeprom_v4k.c
==============================================================================
--- stable/9/sys/dev/ath/ath_hal/ah_eeprom_v4k.c        Mon Jan 14 18:01:19 
2013        (r245428)
+++ stable/9/sys/dev/ath/ath_hal/ah_eeprom_v4k.c        Mon Jan 14 19:31:44 
2013        (r245429)
@@ -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: stable/9/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==============================================================================
--- stable/9/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon Jan 14 18:01:19 
2013        (r245428)
+++ stable/9/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon Jan 14 19:31:44 
2013        (r245429)
@@ -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;
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to