diff options
author | sam <sam@FreeBSD.org> | 2009-07-07 18:11:05 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-07-07 18:11:05 +0000 |
commit | 145c06379f363db04725e5953ff5e49d4ef7d6e6 (patch) | |
tree | 085e3f9199ea1383709bb52dd5a684a70359c9d6 /sys/dev/ath/ath_hal/ar5416 | |
parent | 42e7fca3026b17c56b501548f4d6cfbf1445086d (diff) | |
download | FreeBSD-src-145c06379f363db04725e5953ff5e49d4ef7d6e6.zip FreeBSD-src-145c06379f363db04725e5953ff5e49d4ef7d6e6.tar.gz |
Fix ar5416 and later parts on big-endian platforms: setup the h/w byte
swizzler using the same technique used everywhere else.
Approved by: re (kib)
Diffstat (limited to 'sys/dev/ath/ath_hal/ar5416')
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416_reset.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c index 4593588..1b75715 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c @@ -1045,7 +1045,7 @@ ar5416SetResetPowerOn(struct ath_hal *ah) static HAL_BOOL ar5416SetReset(struct ath_hal *ah, int type) { - uint32_t tmpReg; + uint32_t tmpReg, mask; /* * Force wake @@ -1091,23 +1091,22 @@ ar5416SetReset(struct ath_hal *ah, int type) /* Clear AHB reset */ OS_REG_WRITE(ah, AR_RC, 0); - /* Set register and descriptor swapping on - * Bigendian platforms on cold reset - */ -#ifdef __BIG_ENDIAN__ - if (type == HAL_RESET_COLD) { - uint32_t mask; - - HALDEBUG(ah, HAL_DEBUG_RESET, - "%s Applying descriptor swap\n", __func__); - - mask = INIT_CONFIG_STATUS | AR_CFG_SWRD | AR_CFG_SWRG; + if (type == HAL_RESET_COLD) { + if (isBigEndian()) { + /* + * Set CFG, little-endian for register + * and descriptor accesses. + */ + mask = INIT_CONFIG_STATUS | AR_CFG_SWRD | AR_CFG_SWRG; #ifndef AH_NEED_DESC_SWAP - mask |= AR_CFG_SWTD; + mask |= AR_CFG_SWTD; #endif - OS_REG_WRITE(ah, AR_CFG, LE_READ_4(&mask)); + HALDEBUG(ah, HAL_DEBUG_RESET, + "%s Applying descriptor swap\n", __func__); + OS_REG_WRITE(ah, AR_CFG, LE_READ_4(&mask)); + } else + OS_REG_WRITE(ah, AR_CFG, INIT_CONFIG_STATUS); } -#endif ar5416InitPLL(ah, AH_NULL); |