From patchwork Sun Aug 21 14:49:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9292191 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 47293600CB for ; Sun, 21 Aug 2016 14:49:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38149281D2 for ; Sun, 21 Aug 2016 14:49:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CA2928657; Sun, 21 Aug 2016 14:49:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBDB0281D2 for ; Sun, 21 Aug 2016 14:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753283AbcHUOta (ORCPT ); Sun, 21 Aug 2016 10:49:30 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33943 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753148AbcHUOt2 (ORCPT ); Sun, 21 Aug 2016 10:49:28 -0400 Received: by mail-wm0-f68.google.com with SMTP id q128so9897043wma.1; Sun, 21 Aug 2016 07:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=90cE5OUZKu6xqOrCft4Hw8VWSmlbo6pzi0Q0j5AEcOo=; b=ygSNd9i9Wp7AusKO0ooXd/wQ4HZtprhXsPAqQiY9AI3FrxWvUiLvIrHIlgNrCLzlMY SEs85KW7GqwcLzyxB+Lh6dOPhY3M5vsFBic2w8WpexXXcbUxFXB/B4gjLSpLGkcYybiR gMBPCRtN7p5oSB9FgOMXoAz5XMy5aivm//ityf2LI/iWfNinzU3iIXazckMuDM5I8g7k OljDUrNCcTOl5XcUHn2ghzVs1qT28TMIYm1a9F9/GgZX2qjnTbznjKm86UEYxav9Gfxt zqFQIu1rZkdd9VBOh5qc2b9C6+cqyN+tG0O3X2zT4wHUt/daWbGgo9g9pF3oYXWAQUo4 8Pbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=90cE5OUZKu6xqOrCft4Hw8VWSmlbo6pzi0Q0j5AEcOo=; b=lubJfTCgBh01gNznFuobFr/IMAffGeT2Y4wWbNqtVTeP5LiO5qAmlCnWIpxbE8EP4V hg9wGcUhgPxdfoLIoVQW5KcFeniO9vbr9xDbJANgO04e8Fo3sVV0592QHCRq4WC5zsfH XyE6gaEId2U/xSJ+wXib9d7oMMIyuRL6PsGEPHTv8pUcnbbkkDOm6rJF4HNYFaW8Otz5 7P71jW+DwrGYcVas0iCP8IAgRmE3/PpLdP8EMavgXCBY+Anaz6IZRk3VabPzxyYzmVsU 4jpT1/zKGQEpCIRixa7pNyqzc0nG/oAbZgQufG1WYso4rac72juzpxnI0Eox/gu2Skvm uxNQ== X-Gm-Message-State: AEkoousBLUQkpUeE4TzxRO76WKRXCVXPaq/LJixmT6jdZGSbAZBEZbKFHT3dA0QkM+leug== X-Received: by 10.28.186.138 with SMTP id k132mr12378280wmf.65.1471790966614; Sun, 21 Aug 2016 07:49:26 -0700 (PDT) Received: from blackbox.darklights.net (p5DE388BA.dip0.t-ipconnect.de. [93.227.136.186]) by smtp.googlemail.com with ESMTPSA id c16sm15581351wme.4.2016.08.21.07.49.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Aug 2016 07:49:25 -0700 (PDT) From: Martin Blumenstingl To: kvalo@codeaurora.org, ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, devicetree@vger.kernel.org Cc: robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, chunkeey@googlemail.com, nbd@nbd.name, Martin Blumenstingl Subject: [PATCH 2/5] ath9k: Set the "big endian" bit of the AR9003 EEPROM templates Date: Sun, 21 Aug 2016 16:49:03 +0200 Message-Id: <20160821144906.30984-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160821144906.30984-1-martin.blumenstingl@googlemail.com> References: <20160821144906.30984-1-martin.blumenstingl@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We will default to the system's native endianness for the eepmisc value. This may be overwritten by the actual calibration data. If it is not overwritten we interpret the template data in it's native endianness, meaning that no swapping is required. --- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 10 +++++----- drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index ea7b819..6669e36 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -53,7 +53,7 @@ static const struct ar9300_eeprom ar9300_default = { .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_DEFAULT_VALUE, }, .rfSilent = 0, .blueToothOptions = 0, @@ -631,7 +631,7 @@ static const struct ar9300_eeprom ar9300_x113 = { .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_DEFAULT_VALUE, }, .rfSilent = 0, .blueToothOptions = 0, @@ -1210,7 +1210,7 @@ static const struct ar9300_eeprom ar9300_h112 = { .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_DEFAULT_VALUE, }, .rfSilent = 0, .blueToothOptions = 0, @@ -1789,7 +1789,7 @@ static const struct ar9300_eeprom ar9300_x112 = { .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_DEFAULT_VALUE, }, .rfSilent = 0, .blueToothOptions = 0, @@ -2367,7 +2367,7 @@ static const struct ar9300_eeprom ar9300_h116 = { .txrxMask = 0x33, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_DEFAULT_VALUE, }, .rfSilent = 0, .blueToothOptions = 0, diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h index 0a4c736..7e06f12 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h @@ -69,6 +69,12 @@ #define AR9300_BASE_ADDR 0x3ff #define AR9300_BASE_ADDR_512 0x1ff +#ifdef __BIG_ENDIAN +#define AR9300_EEPMISC_DEFAULT_VALUE AR5416_EEPMISC_BIG_ENDIAN +#else +#define AR9300_EEPMISC_DEFAULT_VALUE 0 +#endif + #define AR9300_OTP_BASE \ ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000) #define AR9300_OTP_STATUS \