From owner-svn-src-all@FreeBSD.ORG Fri Apr 20 21:56:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35E40106564A; Fri, 20 Apr 2012 21:56:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13D4C8FC08; Fri, 20 Apr 2012 21:56:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3KLuDPs057324; Fri, 20 Apr 2012 21:56:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3KLuD58057320; Fri, 20 Apr 2012 21:56:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204202156.q3KLuD58057320@svn.freebsd.org> From: Adrian Chadd Date: Fri, 20 Apr 2012 21:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234508 - in head/sys/dev/ath/ath_hal: . ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 21:56:14 -0000 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;