All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabor Juhos <juhosg@openwrt.org>
To: Andreas Hartmann <andihartmann@01019freenet.de>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: Re: [rt2x00-users] [PATCH 01/19] rt2x00: rt2800lib: add BBP register initialization for RT3593
Date: Sat, 29 Jun 2013 13:18:04 +0200	[thread overview]
Message-ID: <51CEC26C.2020600@openwrt.org> (raw)
In-Reply-To: <51CE6FB5.2000706@01019freenet.de>

[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]

Hi Adnreas,

> thanks for your submission. I tried to test it, but stuck at the problem
> mentioned below.
> 
> 
> Regards,
> Andreas
> 
> Gabor Juhos wrote:
>> Based on the Ralink DPO_RT5572_LinuxSTA_2.6.0.1_20120629
>> driver.
>>
>> References:
>>   NICInitRT3593BbpRegisters in chips/rt3593.c
>>   NICInitBBP in common/rtmp_init.c
>>   NICInitAsicFromEEPROM in common/rtmp_init.c
>>
>> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
>> ---
>>  drivers/net/wireless/rt2x00/rt2800lib.c |   19 +++++++++++++++++++
>>  1 file changed, 19 insertions(+)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
>> index 6f58ceb..32ecd1a 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
>> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
>> @@ -4505,6 +4505,22 @@ static void rt2800_init_bbp_3572(struct rt2x00_dev *rt2x00dev)
>>  	rt2800_disable_unused_dac_adc(rt2x00dev);
>>  }
>>  
>> +static void rt2800_init_bbp_3593(struct rt2x00_dev *rt2x00dev)
>> +{
>> +	rt2800_init_bbp_early(rt2x00dev);
>> +
>> +	rt2800_bbp_write(rt2x00dev, 79, 0x13);
>> +	rt2800_bbp_write(rt2x00dev, 80, 0x05);
>> +	rt2800_bbp_write(rt2x00dev, 81, 0x33);
>> +	rt2800_bbp_write(rt2x00dev, 137, 0x0f);
>> +
>> +	rt2800_bbp_write(rt2x00dev, 84, 0x19);
>> +
>> +	/* Enable DC filter */
>> +	if (rt2x00_rt_rev_gte(rt2x00dev, RT3593, REV_RT3593E))
> 
> Where is REV_RT3593E defined?
> 
> /tmp/backports-20130617/drivers/net/wireless/rt2x00/rt2800lib.c: In
> function ‘rt2800_init_bbp_3593’:
> /tmp/backports-20130617/drivers/net/wireless/rt2x00/rt2800lib.c:5325:43:
> error: ‘REV_RT3593E’ undeclared (first use in this function)

You are right, the patch-set should have contained 20 patches, but the first one
is missing. I will post that along with the second version of the series.

However if you want to try it in the meantime, you can find the patch in the
attachment. It must be applied before the other patches.

-Gabor

[-- Attachment #2: 0001-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch --]
[-- Type: text/x-patch, Size: 2227 bytes --]

>From 9afda5e728c713da1a3e55ba0860a3705e5a2cd6 Mon Sep 17 00:00:00 2001
From: Gabor Juhos <juhosg@openwrt.org>
Date: Thu, 9 May 2013 14:20:09 +0200
Subject: [PATCH v2 01/20] rt2x00: rt2800lib: add MAC register initialization
 for RT3593

Based on the Ralink DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.

Reference:
  NICInitRT3593MacRegisters in chips/rt3593.c

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
 drivers/net/wireless/rt2x00/rt2800.h    |    1 +
 drivers/net/wireless/rt2x00/rt2800lib.c |   17 +++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index 9216834..02bc80d 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -88,6 +88,7 @@
 #define REV_RT3071E			0x0211
 #define REV_RT3090E			0x0211
 #define REV_RT3390E			0x0211
+#define REV_RT3593E			0x0211
 #define REV_RT5390F			0x0502
 #define REV_RT5390R			0x1502
 #define REV_RT5592C			0x0221
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 7b216f9..6f58ceb 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3715,6 +3715,23 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
 	} else if (rt2x00_rt(rt2x00dev, RT3572)) {
 		rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400);
 		rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
+	} else if (rt2x00_rt(rt2x00dev, RT3593)) {
+		rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000402);
+		rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000);
+		if (rt2x00_rt_rev_lt(rt2x00dev, RT3593, REV_RT3593E)) {
+			rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1,
+					   &eeprom);
+			if (rt2x00_get_field16(eeprom,
+					       EEPROM_NIC_CONF1_DAC_TEST))
+				rt2800_register_write(rt2x00dev, TX_SW_CFG2,
+						      0x0000001f);
+			else
+				rt2800_register_write(rt2x00dev, TX_SW_CFG2,
+						      0x0000000f);
+		} else {
+			rt2800_register_write(rt2x00dev, TX_SW_CFG2,
+					      0x00000000);
+		}
 	} else if (rt2x00_rt(rt2x00dev, RT5390) ||
 		   rt2x00_rt(rt2x00dev, RT5392) ||
 		   rt2x00_rt(rt2x00dev, RT5592)) {
-- 
1.7.10


  reply	other threads:[~2013-06-29 11:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 19:12 [PATCH 00/19] rt2x00: add experimental support for RT3593 Gabor Juhos
2013-06-28 19:12 ` [PATCH 01/19] rt2x00: rt2800lib: add BBP register initialization " Gabor Juhos
2013-06-29  5:25   ` [rt2x00-users] " Andreas Hartmann
2013-06-29 11:18     ` Gabor Juhos [this message]
2013-06-28 19:12 ` [PATCH 02/19] rt2x00: rt2800lib: add RFCSR " Gabor Juhos
2013-06-28 19:12 ` [PATCH 03/19] rt2x00: rt2800lib: add BBP post " Gabor Juhos
2013-06-28 19:12 ` [PATCH 04/19] rt2x00: rt2800lib: add TX power configuration " Gabor Juhos
2013-06-28 19:12 ` [PATCH 05/19] rt2x00: rt2800lib: fix BBP1_TX_ANTENNA field configuration for 3T devices Gabor Juhos
2013-06-28 19:12 ` [PATCH 06/19] rt2x00: rt2800lib: fix antenna configuration for RT3593 Gabor Juhos
2013-06-28 19:12 ` [PATCH 07/19] rt2x00: rt2800lib: add rt2800_txpower_to_dev helper Gabor Juhos
2013-06-28 19:12 ` [PATCH 08/19] rt2x00: rt2800lib: fix default TX power values for RT3593 Gabor Juhos
2013-06-28 19:12 ` [PATCH 09/19] rt2x00: rt2800lib: introduce rt2800_get_txmixer_gain_{24,5}g helpers Gabor Juhos
2013-06-28 19:12 ` [PATCH 10/19] rt2x00: rt2800lib: hardcode TX mixer gain values for RT3593 Gabor Juhos
2013-06-28 19:12 ` [PATCH 11/19] rt2x00: rt2x00lib: fix LNA_A[12] " Gabor Juhos
2013-06-28 19:12 ` [PATCH 12/19] rt2x00: rt2800lib: add default_power3 field for three-chain devices Gabor Juhos
2013-06-28 19:12 ` [PATCH 13/19] rt2x00: rt2800lib: add rf_vals for RF3053 Gabor Juhos
2013-06-28 19:12 ` [PATCH 14/19] rt2x00: rt2800lib: add channel configuration " Gabor Juhos
2013-06-28 19:12 ` [PATCH 15/19] rt2x00: rt2800lib: enable VCO recalibration " Gabor Juhos
2013-06-28 19:12 ` [PATCH 16/19] rt2x00: rt2800lib: enable RF3053 support Gabor Juhos
2013-06-28 19:12 ` [PATCH 17/19] rt2x00: rt2800lib: enable RT3593 support Gabor Juhos
2013-06-28 19:12 ` [PATCH 18/19] rt2x00: rt2800usb: use correct [RT]XWI size for RT3593 Gabor Juhos
2013-06-28 19:12 ` [PATCH 19/19] rt2x00: rt2800usb: add USB device ID for Linksys AE3000 Gabor Juhos
2013-06-29 15:04 ` [rt2x00-users] [PATCH 00/19] rt2x00: add experimental support for RT3593 Andreas Hartmann
2013-07-01  7:43   ` Gabor Juhos
2013-06-30  8:59 ` Andreas Hartmann
2013-07-01 12:19   ` Gabor Juhos
2013-07-01 15:20     ` Andreas Hartmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51CEC26C.2020600@openwrt.org \
    --to=juhosg@openwrt.org \
    --cc=andihartmann@01019freenet.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.