From: Daniel Golle Date: Sun, 23 Apr 2017 23:38:07 +0000 (+0200) Subject: mac80211: rt2x00: reorder patches and prepare for MT7620 external PA X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3d71d1d9a98f55659acbfb8434406636310cb54b;p=openwrt%2Fstaging%2Fluka.git mac80211: rt2x00: reorder patches and prepare for MT7620 external PA Import change to make external PA capability consistent with the vendor driver instead of having the logic inverted. While at it, apply patches in the same order as they got merged upstream. Signed-off-by: Daniel Golle --- diff --git a/package/kernel/mac80211/patches/020-20-rt2x00-reverse-external-PA-capability-flag-logic.patch b/package/kernel/mac80211/patches/020-20-rt2x00-reverse-external-PA-capability-flag-logic.patch new file mode 100644 index 0000000000..35b1918fb8 --- /dev/null +++ b/package/kernel/mac80211/patches/020-20-rt2x00-reverse-external-PA-capability-flag-logic.patch @@ -0,0 +1,128 @@ +From 1f242a3de702d5a19c479685d35b050837122724 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Mon, 10 Apr 2017 15:29:45 +0200 +Subject: [PATCH] rt2x00: reverse external PA capability flag logic + +Consequently refer to external PA instead of inverting the logic and +use an internal PA capability flag which is a bit confusing. +Currently this is used for Rt3352 only, but MT7620A also allows for an +external PA which will be supported by a follow up patch. + +Signed-off-by: Daniel Golle +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 40 +++++++++++++------------- + drivers/net/wireless/ralink/rt2x00/rt2x00.h | 4 +-- + 2 files changed, 22 insertions(+), 22 deletions(-) + +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +index 201b12ed90c6..ba06ac2d876d 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -7014,9 +7014,9 @@ static void rt2800_init_rfcsr_3290(struct rt2x00_dev *rt2x00dev) + + static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) + { +- int tx0_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX0, ++ int tx0_ext_pa = test_bit(CAPABILITY_EXTERNAL_PA_TX0, + &rt2x00dev->cap_flags); +- int tx1_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX1, ++ int tx1_ext_pa = test_bit(CAPABILITY_EXTERNAL_PA_TX1, + &rt2x00dev->cap_flags); + u8 rfcsr; + +@@ -7056,9 +7056,9 @@ static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) + rt2800_rfcsr_write(rt2x00dev, 32, 0x80); + rt2800_rfcsr_write(rt2x00dev, 33, 0x00); + rfcsr = 0x01; +- if (!tx0_int_pa) ++ if (tx0_ext_pa) + rt2x00_set_field8(&rfcsr, RFCSR34_TX0_EXT_PA, 1); +- if (!tx1_int_pa) ++ if (tx1_ext_pa) + rt2x00_set_field8(&rfcsr, RFCSR34_TX1_EXT_PA, 1); + rt2800_rfcsr_write(rt2x00dev, 34, rfcsr); + rt2800_rfcsr_write(rt2x00dev, 35, 0x03); +@@ -7068,13 +7068,13 @@ static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) + rt2800_rfcsr_write(rt2x00dev, 39, 0xc5); + rt2800_rfcsr_write(rt2x00dev, 40, 0x33); + rfcsr = 0x52; +- if (tx0_int_pa) { ++ if (!tx0_ext_pa) { + rt2x00_set_field8(&rfcsr, RFCSR41_BIT1, 1); + rt2x00_set_field8(&rfcsr, RFCSR41_BIT4, 1); + } + rt2800_rfcsr_write(rt2x00dev, 41, rfcsr); + rfcsr = 0x52; +- if (tx1_int_pa) { ++ if (!tx1_ext_pa) { + rt2x00_set_field8(&rfcsr, RFCSR42_BIT1, 1); + rt2x00_set_field8(&rfcsr, RFCSR42_BIT4, 1); + } +@@ -7087,19 +7087,19 @@ static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) + rt2800_rfcsr_write(rt2x00dev, 48, 0x14); + rt2800_rfcsr_write(rt2x00dev, 49, 0x00); + rfcsr = 0x2d; +- if (!tx0_int_pa) ++ if (tx0_ext_pa) + rt2x00_set_field8(&rfcsr, RFCSR50_TX0_EXT_PA, 1); +- if (!tx1_int_pa) ++ if (tx1_ext_pa) + rt2x00_set_field8(&rfcsr, RFCSR50_TX1_EXT_PA, 1); + rt2800_rfcsr_write(rt2x00dev, 50, rfcsr); +- rt2800_rfcsr_write(rt2x00dev, 51, (tx0_int_pa ? 0x7f : 0x52)); +- rt2800_rfcsr_write(rt2x00dev, 52, (tx0_int_pa ? 0x00 : 0xc0)); +- rt2800_rfcsr_write(rt2x00dev, 53, (tx0_int_pa ? 0x52 : 0xd2)); +- rt2800_rfcsr_write(rt2x00dev, 54, (tx0_int_pa ? 0x1b : 0xc0)); +- rt2800_rfcsr_write(rt2x00dev, 55, (tx1_int_pa ? 0x7f : 0x52)); +- rt2800_rfcsr_write(rt2x00dev, 56, (tx1_int_pa ? 0x00 : 0xc0)); +- rt2800_rfcsr_write(rt2x00dev, 57, (tx0_int_pa ? 0x52 : 0x49)); +- rt2800_rfcsr_write(rt2x00dev, 58, (tx1_int_pa ? 0x1b : 0xc0)); ++ rt2800_rfcsr_write(rt2x00dev, 51, (tx0_ext_pa ? 0x52 : 0x7f)); ++ rt2800_rfcsr_write(rt2x00dev, 52, (tx0_ext_pa ? 0xc0 : 0x00)); ++ rt2800_rfcsr_write(rt2x00dev, 53, (tx0_ext_pa ? 0xd2 : 0x52)); ++ rt2800_rfcsr_write(rt2x00dev, 54, (tx0_ext_pa ? 0xc0 : 0x1b)); ++ rt2800_rfcsr_write(rt2x00dev, 55, (tx1_ext_pa ? 0x52 : 0x7f)); ++ rt2800_rfcsr_write(rt2x00dev, 56, (tx1_ext_pa ? 0xc0 : 0x00)); ++ rt2800_rfcsr_write(rt2x00dev, 57, (tx0_ext_pa ? 0x49 : 0x52)); ++ rt2800_rfcsr_write(rt2x00dev, 58, (tx1_ext_pa ? 0xc0 : 0x1b)); + rt2800_rfcsr_write(rt2x00dev, 59, 0x00); + rt2800_rfcsr_write(rt2x00dev, 60, 0x00); + rt2800_rfcsr_write(rt2x00dev, 61, 0x00); +@@ -8782,13 +8782,13 @@ static int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) + rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom); + + if (rt2x00_rt(rt2x00dev, RT3352)) { +- if (!rt2x00_get_field16(eeprom, ++ if (rt2x00_get_field16(eeprom, + EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352)) +- __set_bit(CAPABILITY_INTERNAL_PA_TX0, ++ __set_bit(CAPABILITY_EXTERNAL_PA_TX0, + &rt2x00dev->cap_flags); +- if (!rt2x00_get_field16(eeprom, ++ if (rt2x00_get_field16(eeprom, + EEPROM_NIC_CONF1_EXTERNAL_TX1_PA_3352)) +- __set_bit(CAPABILITY_INTERNAL_PA_TX1, ++ __set_bit(CAPABILITY_EXTERNAL_PA_TX1, + &rt2x00dev->cap_flags); + } + +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +index 8fdd2f9726ee..1bc353eafe37 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +@@ -719,8 +719,8 @@ enum rt2x00_capability_flags { + CAPABILITY_DOUBLE_ANTENNA, + CAPABILITY_BT_COEXIST, + CAPABILITY_VCO_RECALIBRATION, +- CAPABILITY_INTERNAL_PA_TX0, +- CAPABILITY_INTERNAL_PA_TX1, ++ CAPABILITY_EXTERNAL_PA_TX0, ++ CAPABILITY_EXTERNAL_PA_TX1, + }; + + /* +-- +2.12.2 + diff --git a/package/kernel/mac80211/patches/020-21-rt2800-fix-LNA-gain-assignment-for-MT7620.patch b/package/kernel/mac80211/patches/020-21-rt2800-fix-LNA-gain-assignment-for-MT7620.patch new file mode 100644 index 0000000000..3270ea2c56 --- /dev/null +++ b/package/kernel/mac80211/patches/020-21-rt2800-fix-LNA-gain-assignment-for-MT7620.patch @@ -0,0 +1,54 @@ +From 0109238d62a99ea779a7e28e21868118e7b8d69d Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Mon, 10 Apr 2017 14:28:14 +0200 +Subject: [PATCH 1/2] rt2800: fix LNA gain assignment for MT7620 +To: Stanislaw Gruszka +Cc: Helmut Schaa , + linux-wireless@vger.kernel.org, + Kalle Valo + +The base value used for MT7620 differs from Rt5392 which resulted in +quite bad RX signal quality. Fix this by using the correct base value as +well as the LNA calibration values for HT20. + +Reported-by: Tom Psyborg +Signed-off-by: Daniel Golle +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +index ba06ac2d876d..7135519a638c 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -3806,11 +3806,25 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, + } + + if (rt2x00_rt(rt2x00dev, RT5592) || rt2x00_rt(rt2x00dev, RT6352)) { ++ reg = 0x10; ++ if (!conf_is_ht40(conf)) { ++ if (rt2x00_rt(rt2x00dev, RT6352) && ++ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { ++ reg |= 0x5; ++ } else { ++ reg |= 0xa; ++ } ++ } + rt2800_bbp_write(rt2x00dev, 195, 141); +- rt2800_bbp_write(rt2x00dev, 196, conf_is_ht40(conf) ? 0x10 : 0x1a); ++ rt2800_bbp_write(rt2x00dev, 196, reg); + + /* AGC init */ +- reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2 * rt2x00dev->lna_gain; ++ if (rt2x00_rt(rt2x00dev, RT6352)) ++ reg = 0x04; ++ else ++ reg = rf->channel <= 14 ? 0x1c : 0x24; ++ ++ reg += 2 * rt2x00dev->lna_gain; + rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); + + rt2800_iq_calibrate(rt2x00dev, rf->channel); +-- +2.12.2 + diff --git a/package/kernel/mac80211/patches/020-22-rt2800-do-VCO-calibration-after-programming-ALC.patch b/package/kernel/mac80211/patches/020-22-rt2800-do-VCO-calibration-after-programming-ALC.patch new file mode 100644 index 0000000000..1dafb78f1c --- /dev/null +++ b/package/kernel/mac80211/patches/020-22-rt2800-do-VCO-calibration-after-programming-ALC.patch @@ -0,0 +1,34 @@ +From feb608c7986c14bab153f31f8e96f251072e6578 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Mon, 10 Apr 2017 15:33:20 +0200 +Subject: [PATCH 2/2] rt2800: do VCO calibration after programming ALC +To: Stanislaw Gruszka +Cc: Helmut Schaa , + linux-wireless@vger.kernel.org, + Kalle Valo + +Scanning fails if we don't do VCO calibration every time. +The vendor driver duplicates the VCO calibration function into the +channel switching logic, we can do the same with less duplication. + +Signed-off-by: Daniel Golle +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +index 7135519a638c..870bf315f98b 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -3407,6 +3407,8 @@ static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev, + rt2800_rfcsr_write(rt2x00dev, 42, 0x5b); + } + rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl); ++ ++ rt2800_vco_calibration(rt2x00dev); + } + + static void rt2800_bbp_write_with_rx_chain(struct rt2x00_dev *rt2x00dev, +-- +2.12.2 + diff --git a/package/kernel/mac80211/patches/020-23-rt2800-fix-mt7620-vco-calibration-registers.patch b/package/kernel/mac80211/patches/020-23-rt2800-fix-mt7620-vco-calibration-registers.patch new file mode 100644 index 0000000000..708b0b2d31 --- /dev/null +++ b/package/kernel/mac80211/patches/020-23-rt2800-fix-mt7620-vco-calibration-registers.patch @@ -0,0 +1,50 @@ +From 02c452f317b4a4d06c433c294e66896a389731c1 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Tue, 18 Apr 2017 11:09:53 +0200 +Subject: [PATCH] rt2800: fix mt7620 vco calibration registers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +To: Stanislaw Gruszka +Cc: Helmut Schaa , + linux-wireless@vger.kernel.org, + Kalle Valo , + Tom Psyborg + +Use register values from init LNA function instead of the ones from +restore LNA function. Apply register values based on rx path +configuration. + +Signed-off-by: Tomislav Požega +Signed-off-by: Daniel Golle +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +index 870bf315f98b..86cffee6876a 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -4932,7 +4932,7 @@ void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev) + rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); + + if (rt2x00_rt(rt2x00dev, RT6352)) { +- if (rt2x00dev->default_ant.tx_chain_num == 1) { ++ if (rt2x00dev->default_ant.rx_chain_num == 1) { + rt2800_bbp_write(rt2x00dev, 91, 0x07); + rt2800_bbp_write(rt2x00dev, 95, 0x1A); + rt2800_bbp_write(rt2x00dev, 195, 128); +@@ -4953,8 +4953,8 @@ void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev) + } + + if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { +- rt2800_bbp_write(rt2x00dev, 75, 0x60); +- rt2800_bbp_write(rt2x00dev, 76, 0x44); ++ rt2800_bbp_write(rt2x00dev, 75, 0x68); ++ rt2800_bbp_write(rt2x00dev, 76, 0x4C); + rt2800_bbp_write(rt2x00dev, 79, 0x1C); + rt2800_bbp_write(rt2x00dev, 80, 0x0C); + rt2800_bbp_write(rt2x00dev, 82, 0xB6); +-- +2.12.2 + diff --git a/package/kernel/mac80211/patches/020-24-rt2800-fix-mt7620-E2-channel-registers.patch b/package/kernel/mac80211/patches/020-24-rt2800-fix-mt7620-E2-channel-registers.patch new file mode 100644 index 0000000000..284a347f25 --- /dev/null +++ b/package/kernel/mac80211/patches/020-24-rt2800-fix-mt7620-E2-channel-registers.patch @@ -0,0 +1,41 @@ +From c426cb0ed15ee12dfdc8c53ddd1449ac617023cf Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Tue, 18 Apr 2017 11:45:37 +0200 +Subject: [PATCH] rt2800: fix mt7620 E2 channel registers +To: Stanislaw Gruszka +Cc: Helmut Schaa , + linux-wireless@vger.kernel.org, + Kalle Valo , + Tom Psyborg + +From: Tomislav Požega + +update RF register 47 and 54 values according to vendor driver + +Signed-off-by: Tomislav Požega +Signed-off-by: Daniel Golle +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +index 86cffee6876a..8585cdc3de53 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -8145,9 +8145,11 @@ static void rt2800_init_rfcsr_6352(struct rt2x00_dev *rt2x00dev) + rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xB3); + rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xD5); + rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x69); ++ rt2800_rfcsr_write_bank(rt2x00dev, 4, 47, 0x67); ++ rt2800_rfcsr_write_bank(rt2x00dev, 6, 47, 0x69); + rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFF); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x20); ++ rt2800_rfcsr_write_bank(rt2x00dev, 4, 54, 0x27); ++ rt2800_rfcsr_write_bank(rt2x00dev, 6, 54, 0x20); + rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66); + rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xFF); + rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x1C); +-- +2.12.2 + diff --git a/package/kernel/mac80211/patches/021-01-rt2800-fix-LNA-gain-assignment-for-MT7620.patch b/package/kernel/mac80211/patches/021-01-rt2800-fix-LNA-gain-assignment-for-MT7620.patch deleted file mode 100644 index 3270ea2c56..0000000000 --- a/package/kernel/mac80211/patches/021-01-rt2800-fix-LNA-gain-assignment-for-MT7620.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 0109238d62a99ea779a7e28e21868118e7b8d69d Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Mon, 10 Apr 2017 14:28:14 +0200 -Subject: [PATCH 1/2] rt2800: fix LNA gain assignment for MT7620 -To: Stanislaw Gruszka -Cc: Helmut Schaa , - linux-wireless@vger.kernel.org, - Kalle Valo - -The base value used for MT7620 differs from Rt5392 which resulted in -quite bad RX signal quality. Fix this by using the correct base value as -well as the LNA calibration values for HT20. - -Reported-by: Tom Psyborg -Signed-off-by: Daniel Golle ---- - drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -index ba06ac2d876d..7135519a638c 100644 ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -3806,11 +3806,25 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, - } - - if (rt2x00_rt(rt2x00dev, RT5592) || rt2x00_rt(rt2x00dev, RT6352)) { -+ reg = 0x10; -+ if (!conf_is_ht40(conf)) { -+ if (rt2x00_rt(rt2x00dev, RT6352) && -+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -+ reg |= 0x5; -+ } else { -+ reg |= 0xa; -+ } -+ } - rt2800_bbp_write(rt2x00dev, 195, 141); -- rt2800_bbp_write(rt2x00dev, 196, conf_is_ht40(conf) ? 0x10 : 0x1a); -+ rt2800_bbp_write(rt2x00dev, 196, reg); - - /* AGC init */ -- reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2 * rt2x00dev->lna_gain; -+ if (rt2x00_rt(rt2x00dev, RT6352)) -+ reg = 0x04; -+ else -+ reg = rf->channel <= 14 ? 0x1c : 0x24; -+ -+ reg += 2 * rt2x00dev->lna_gain; - rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); - - rt2800_iq_calibrate(rt2x00dev, rf->channel); --- -2.12.2 - diff --git a/package/kernel/mac80211/patches/021-02-rt2800-do-VCO-calibration-after-programming-ALC.patch b/package/kernel/mac80211/patches/021-02-rt2800-do-VCO-calibration-after-programming-ALC.patch deleted file mode 100644 index 1dafb78f1c..0000000000 --- a/package/kernel/mac80211/patches/021-02-rt2800-do-VCO-calibration-after-programming-ALC.patch +++ /dev/null @@ -1,34 +0,0 @@ -From feb608c7986c14bab153f31f8e96f251072e6578 Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Mon, 10 Apr 2017 15:33:20 +0200 -Subject: [PATCH 2/2] rt2800: do VCO calibration after programming ALC -To: Stanislaw Gruszka -Cc: Helmut Schaa , - linux-wireless@vger.kernel.org, - Kalle Valo - -Scanning fails if we don't do VCO calibration every time. -The vendor driver duplicates the VCO calibration function into the -channel switching logic, we can do the same with less duplication. - -Signed-off-by: Daniel Golle ---- - drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -index 7135519a638c..870bf315f98b 100644 ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -3407,6 +3407,8 @@ static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev, - rt2800_rfcsr_write(rt2x00dev, 42, 0x5b); - } - rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl); -+ -+ rt2800_vco_calibration(rt2x00dev); - } - - static void rt2800_bbp_write_with_rx_chain(struct rt2x00_dev *rt2x00dev, --- -2.12.2 - diff --git a/package/kernel/mac80211/patches/021-03-rt2800-fix-mt7620-vco-calibration-registers.patch b/package/kernel/mac80211/patches/021-03-rt2800-fix-mt7620-vco-calibration-registers.patch deleted file mode 100644 index 708b0b2d31..0000000000 --- a/package/kernel/mac80211/patches/021-03-rt2800-fix-mt7620-vco-calibration-registers.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 02c452f317b4a4d06c433c294e66896a389731c1 Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Tue, 18 Apr 2017 11:09:53 +0200 -Subject: [PATCH] rt2800: fix mt7620 vco calibration registers -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit -To: Stanislaw Gruszka -Cc: Helmut Schaa , - linux-wireless@vger.kernel.org, - Kalle Valo , - Tom Psyborg - -Use register values from init LNA function instead of the ones from -restore LNA function. Apply register values based on rx path -configuration. - -Signed-off-by: Tomislav Požega -Signed-off-by: Daniel Golle ---- - drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -index 870bf315f98b..86cffee6876a 100644 ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -4932,7 +4932,7 @@ void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev) - rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); - - if (rt2x00_rt(rt2x00dev, RT6352)) { -- if (rt2x00dev->default_ant.tx_chain_num == 1) { -+ if (rt2x00dev->default_ant.rx_chain_num == 1) { - rt2800_bbp_write(rt2x00dev, 91, 0x07); - rt2800_bbp_write(rt2x00dev, 95, 0x1A); - rt2800_bbp_write(rt2x00dev, 195, 128); -@@ -4953,8 +4953,8 @@ void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev) - } - - if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -- rt2800_bbp_write(rt2x00dev, 75, 0x60); -- rt2800_bbp_write(rt2x00dev, 76, 0x44); -+ rt2800_bbp_write(rt2x00dev, 75, 0x68); -+ rt2800_bbp_write(rt2x00dev, 76, 0x4C); - rt2800_bbp_write(rt2x00dev, 79, 0x1C); - rt2800_bbp_write(rt2x00dev, 80, 0x0C); - rt2800_bbp_write(rt2x00dev, 82, 0xB6); --- -2.12.2 - diff --git a/package/kernel/mac80211/patches/021-04-rt2800-fix-mt7620-E2-channel-registers.patch b/package/kernel/mac80211/patches/021-04-rt2800-fix-mt7620-E2-channel-registers.patch deleted file mode 100644 index 284a347f25..0000000000 --- a/package/kernel/mac80211/patches/021-04-rt2800-fix-mt7620-E2-channel-registers.patch +++ /dev/null @@ -1,41 +0,0 @@ -From c426cb0ed15ee12dfdc8c53ddd1449ac617023cf Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Tue, 18 Apr 2017 11:45:37 +0200 -Subject: [PATCH] rt2800: fix mt7620 E2 channel registers -To: Stanislaw Gruszka -Cc: Helmut Schaa , - linux-wireless@vger.kernel.org, - Kalle Valo , - Tom Psyborg - -From: Tomislav Požega - -update RF register 47 and 54 values according to vendor driver - -Signed-off-by: Tomislav Požega -Signed-off-by: Daniel Golle ---- - drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -index 86cffee6876a..8585cdc3de53 100644 ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8145,9 +8145,11 @@ static void rt2800_init_rfcsr_6352(struct rt2x00_dev *rt2x00dev) - rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xB3); - rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xD5); - rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x69); -+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 47, 0x67); -+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 47, 0x69); - rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFF); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x20); -+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 54, 0x27); -+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 54, 0x20); - rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66); - rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xFF); - rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x1C); --- -2.12.2 -