From owner-freebsd-wireless@FreeBSD.ORG Mon Aug 11 00:10:43 2014 Return-Path: Delivered-To: freebsd-wireless@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5593AED for ; Mon, 11 Aug 2014 00:10:43 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2500020B5 for ; Mon, 11 Aug 2014 00:10:43 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s7B0AhGb087225 for ; Mon, 11 Aug 2014 00:10:43 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-wireless@FreeBSD.org Subject: [Bug 192567] New: [ath] AR9331 regulator programming is checking OTP but reading garbage Date: Mon, 11 Aug 2014 00:10:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: wireless X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: adrian@freebsd.org X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-wireless@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 00:10:43 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192567 Bug ID: 192567 Summary: [ath] AR9331 regulator programming is checking OTP but reading garbage Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: Needs Triage Severity: Affects Only Me Priority: --- Component: wireless Assignee: freebsd-wireless@FreeBSD.org Reporter: adrian@freebsd.org The AR9331 HAL is programming the regulator during reset. However, it's reading values from the OTP which seems to (a) read correctly from the OTP, but (b) read 0xbadc0ffe. I'm not sure why that is yet (eg is the OTP hardware off?) Now, on the AR9331 boards I have (eg carambola 2) the calibration data is in the NOR flash rather than OTP. So, this won't .. work. I'm not sure which boards will use OTP in this instance. But the code seems to check and use the OTP value. Ie: ar9300_internal_regulator_apply(): ... if ((reg_val & 0x80) == 0x80){ usb_valid = 1; reg_usb = reg_val & 0x000000ff; } ... if ((reg_val & 0x80000000) == 0x80000000){ pmu_valid = 1; reg_pmu = (reg_val & 0xff000000) >> 24; } ... 0xbadc0ffe has both of those bits set! ath9k doesn't bother checking the OTP here. It just uses some local values to program in. So, what should be done? * Is the code correct but OTP isn't on for some reason? * Should I be checking the in-flash calibration data? * should I just ignore OTP and use hard-coded values like ath9k? -a -- You are receiving this mail because: You are the assignee for the bug.