Date: Thu, 16 Apr 2015 07:40:02 +0000 (UTC) From: Kevin Lo <kevlo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281592 - head/sys/dev/usb/wlan Message-ID: <201504160740.t3G7e2s7095158@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevlo Date: Thu Apr 16 07:40:01 2015 New Revision: 281592 URL: https://svnweb.freebsd.org/changeset/base/281592 Log: Enable LDO to 2.5V before efuse r/w action in order to prevent incorrect mac address read from efuse. Reported by: swills Tested by: rpaulo and myself on RPi Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 16 07:17:00 2015 (r281591) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 16 07:40:01 2015 (r281592) @@ -1195,7 +1195,7 @@ urtwn_efuse_read(struct urtwn_softc *sc) uint8_t *rom = (uint8_t *)&sc->rom; uint16_t addr = 0; uint32_t reg; - uint8_t off, msk; + uint8_t off, msk, vol; int i; urtwn_efuse_switch_power(sc); @@ -1228,10 +1228,15 @@ urtwn_efuse_read(struct urtwn_softc *sc) printf("\n"); } #endif + /* Disable LDO 2.5V. */ + vol = urtwn_read_1(sc, R92C_EFUSE_TEST + 3); + urtwn_write_1(sc, R92C_EFUSE_TEST + 3, vol & ~(0x80)); + } static void urtwn_efuse_switch_power(struct urtwn_softc *sc) { + uint8_t vol; uint32_t reg; reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); @@ -1250,6 +1255,12 @@ urtwn_efuse_switch_power(struct urtwn_so urtwn_write_2(sc, R92C_SYS_CLKR, reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); } + + /* Enable LDO 2.5V. */ + vol = urtwn_read_1(sc, R92C_EFUSE_TEST + 3); + vol &= 0x0f; + vol |= 0x30; + urtwn_write_1(sc, R92C_EFUSE_TEST + 3, (vol | 0x80)); } static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504160740.t3G7e2s7095158>