Skip to contentSkip to conversation

rt2x00: add MediaTek/RaLink Rt3352 WiSoC

PATCH Superseded Daniel Golle 3 participants 7 messages Aug 21, 2012 – Sep 9, 2012 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2x00: add MediaTek/RaLink Rt3352 WiSoC

(sorry for posting twice, I previously forgot to merge the final commit removing a comment. now fixed.)

drivers/net/wireless/rt2x00/rt2800.h +5 -0
index e252e9b..b9566b2 100644
@@ -1936,6 +1936,11 @@ struct mac_iveiv_entry {
 #define BBP47_TSSI_ADC6			FIELD8(0x80)
 
 /*
+ * BBP 49
+ */
+#define BBP49_UPDATE_FLAG		FIELD8(0x01)
+
+/*
  * BBP 109
  */
 #define BBP109_TX0_POWER		FIELD8(0x0f)
drivers/net/wireless/rt2x00/rt2800lib.c +208 -5

393 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00.h +1 -0
index 8afb546..97f10d8 100644
@@ -188,6 +188,7 @@ struct rt2x00_chip {
 #define RT3071		0x3071
 #define RT3090		0x3090	/* 2.4GHz PCIe */
 #define RT3290		0x3290
+#define RT3352		0x3352  /* WSOC */
 #define RT3390		0x3390
 #define RT3572		0x3572
 #define RT3593		0x3593
Signature · 1 line
1.7.11.4
#1 lore raw
Quoted 2 lines · Daniel Golle

(sorry for posting twice, I previously forgot to merge the final commit removing a comment. now fixed.)

Please address my comments from previous patch.

Thanks
Stanislaw

#2 lore raw

PATCH v2 1/1 rt2x00: add MediaTek/RaLink Rt3352 WiSoC

Hi Stanislaw,

Thank you for reviewing!

Quoted 1 line · Stanislaw Gruszka

Please address my comments from previous patch.

I fixed the CodingStyle issues you mentioned and simplified the initilization of the TX_SW_CFG{0,1,2} registers similarly to other SoCs.

Best regards

--

drivers/net/wireless/rt2x00/rt2800.h +5 -0
index e252e9b..b9566b2 100644
@@ -1936,6 +1936,11 @@ struct mac_iveiv_entry {
 #define BBP47_TSSI_ADC6			FIELD8(0x80)
 
 /*
+ * BBP 49
+ */
+#define BBP49_UPDATE_FLAG		FIELD8(0x01)
+
+/*
  * BBP 109
  */
 #define BBP109_TX0_POWER		FIELD8(0x0f)
drivers/net/wireless/rt2x00/rt2800lib.c +206 -5

386 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00.h +1 -0
index 8afb546..97f10d8 100644
@@ -188,6 +188,7 @@ struct rt2x00_chip {
 #define RT3071		0x3071
 #define RT3090		0x3090	/* 2.4GHz PCIe */
 #define RT3290		0x3290
+#define RT3352		0x3352  /* WSOC */
 #define RT3390		0x3390
 #define RT3572		0x3572
 #define RT3593		0x3593
Signature · 1 line
1.7.12
#3 lore raw

Hi

Quoted 5 lines · Daniel Golle
Quoted 1 line · Stanislaw Gruszka

Please address my comments from previous patch.

I fixed the CodingStyle issues you mentioned and simplified the initilization of the TX_SW_CFG{0,1,2} registers similarly to other SoCs.

Thanks. Could you also provide information what was the source (registers programming) you based when writing this patch?

drivers/net/wireless/rt2x00/rt2800lib.c static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, · line 2278

Quoted 5 lines
drivers/net/wireless/rt2x00/rt2800lib.c +5 -0
+	if (rt2x00_rt(rt2x00dev, RT3352)) {
+		rt2800_bbp_write(rt2x00dev, 27, 0x0);
+		rt2800_bbp_write(rt2x00dev, 62, 0x26 + rt2x00dev->lna_gain);
+		rt2800_bbp_write(rt2x00dev, 27, 0x20);
+		rt2800_bbp_write(rt2x00dev, 62, 0x26 + rt2x00dev->lna_gain);

Writes two times to the same registers are intended?

Stanislaw

#4 lore raw

Hi Stanislaw,

Quoted 2 lines · Stanislaw Gruszka

Thanks. Could you also provide information what was the source (registers programming) you based when writing this patch?

The vendor-driver Allnet got for that board (which is not publicly available and we can't release its source)

Quoted 7 lines

drivers/net/wireless/rt2x00/rt2800lib.c static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, · line 2278

Quoted 5 lines
drivers/net/wireless/rt2x00/rt2800lib.c +5 -0
+	if (rt2x00_rt(rt2x00dev, RT3352)) {
+		rt2800_bbp_write(rt2x00dev, 27, 0x0);
+		rt2800_bbp_write(rt2x00dev, 62, 0x26 + rt2x00dev->lna_gain);
+		rt2800_bbp_write(rt2x00dev, 27, 0x20);
+		rt2800_bbp_write(rt2x00dev, 62, 0x26 + rt2x00dev->lna_gain);

Writes two times to the same registers are intended?

Yes, as this is how it is done in the vendor driver, to me it looks like register 27 acts as a switch selecting the destination for the value written to register 62 or something like that.

Thank you!

Daniel

#5 lore raw
Quoted 15 lines · Daniel Golle

Hi Stanislaw,

Quoted 2 lines · Stanislaw Gruszka

Thanks. Could you also provide information what was the source (registers programming) you based when writing this patch?

The vendor-driver Allnet got for that board (which is not publicly available and we can't release its source)

Quoted 7 lines

drivers/net/wireless/rt2x00/rt2800lib.c static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, · line 2278

Quoted 5 lines
drivers/net/wireless/rt2x00/rt2800lib.c +5 -0
+	if (rt2x00_rt(rt2x00dev, RT3352)) {
+		rt2800_bbp_write(rt2x00dev, 27, 0x0);
+		rt2800_bbp_write(rt2x00dev, 62, 0x26 + rt2x00dev->lna_gain);
+		rt2800_bbp_write(rt2x00dev, 27, 0x20);
+		rt2800_bbp_write(rt2x00dev, 62, 0x26 + rt2x00dev->lna_gain);

Writes two times to the same registers are intended?

Quoted 3 lines

Yes, as this is how it is done in the vendor driver, to me it looks like register 27 acts as a switch selecting the destination for the value written to register 62 or something like that.

Daniel,

Could you perhaps repost a new patch with a "finalized" commit message that covers the original patch and addresses Stanislaw's concerns in a single, neat message?

Thanks!

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#6 lore raw

Hi John!

Quoted 5 lines · John W. Linville

Daniel,

Could you perhaps repost a new patch with a "finalized" commit message that covers the original patch and addresses Stanislaw's concerns in a single, neat message?

Sure, here it comes:

--
Support for the RT3352 WiSoC was developed for and tested with the ALL5002 devboard running OpenWrt. For now, this supports only devices with internal TXALC. Corrections were made according to the remarks of Stanislaw Gruszka and Gertjan van Wingerde, thank you guys for reviewing!

drivers/net/wireless/rt2x00/rt2800.h +5 -0
index e13916f..6d67c3e 100644
@@ -1943,6 +1943,11 @@ struct mac_iveiv_entry {
 #define BBP47_TSSI_ADC6			FIELD8(0x80)
 
 /*
+ * BBP 49
+ */
+#define BBP49_UPDATE_FLAG		FIELD8(0x01)
+
+/*
  * BBP 109
  */
 #define BBP109_TX0_POWER		FIELD8(0x0f)
drivers/net/wireless/rt2x00/rt2800lib.c +206 -5

386 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00.h +1 -0
index f991e8b..49375c8 100644
@@ -188,6 +188,7 @@ struct rt2x00_chip {
 #define RT3071		0x3071
 #define RT3090		0x3090	/* 2.4GHz PCIe */
 #define RT3290		0x3290
+#define RT3352		0x3352  /* WSOC */
 #define RT3390		0x3390
 #define RT3572		0x3572
 #define RT3593		0x3593
Signature · 1 line
1.7.12