Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.12 ramips2 #58

Draft
wants to merge 11 commits into
base: 6.12-draft2
Choose a base branch
from
419 changes: 286 additions & 133 deletions package/kernel/mac80211/patches/build/140-trace_backport.patch

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions package/kernel/mac80211/patches/build/999-01-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/backport-include/asm/unaligned.h
+++ b/backport-include/asm/unaligned.h
@@ -1,6 +1,10 @@
#ifndef __BACKPORT_ASM_GENERIC_UNALIGNED_H
#define __BACKPORT_ASM_GENERIC_UNALIGNED_H
+#if LINUX_VERSION_IS_LESS(6,12,0)
#include_next <asm/unaligned.h>
+#else
+#include_next <linux/unaligned.h>
+#endif

#if LINUX_VERSION_IS_LESS(5,7,0)
static inline u32 __get_unaligned_be24(const u8 *p)
15 changes: 15 additions & 0 deletions package/kernel/mac80211/patches/build/999-03-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- a/backport-include/linux/acpi_amd_wbrf.h
+++ b/backport-include/linux/acpi_amd_wbrf.h
@@ -5,11 +5,11 @@
*/

#ifndef _ACPI_AMD_WBRF_H
-#define _ACPI_AMD_WBRF_H

#if LINUX_VERSION_IS_GEQ(6,8,0)
#include_next <linux/acpi_amd_wbrf.h>
#else
+#define _ACPI_AMD_WBRF_H
#include <linux/device.h>
#include <linux/notifier.h>

Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ Signed-off-by: Daniel Golle <[email protected]>

--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -305,6 +305,24 @@ static void rt2800_rf_write(struct rt2x0
@@ -305,6 +305,28 @@ static void rt2800_rf_write(struct rt2x0
mutex_unlock(&rt2x00dev->csr_mutex);
}

+#if LINUX_VERSION_IS_LESS(6,12,0)
+void rt6352_enable_pa_pin(struct rt2x00_dev *rt2x00dev, int enable)
+#else
+static void rt6352_enable_pa_pin(struct rt2x00_dev *rt2x00dev, int enable)
+#endif
+{
+ if (!rt2x00dev->pinctrl)
+ return;
Expand All @@ -52,7 +56,7 @@ Signed-off-by: Daniel Golle <[email protected]>
static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = {
[EEPROM_CHIP_ID] = 0x0000,
[EEPROM_VERSION] = 0x0001,
@@ -10428,8 +10446,10 @@ static void rt2800_restore_rf_bbp_rt6352
@@ -10428,8 +10450,10 @@ static void rt2800_restore_rf_bbp_rt6352
static void rt2800_calibration_rt6352_stage1(struct rt2x00_dev *rt2x00dev)
{
if (rt2x00_has_cap_external_pa(rt2x00dev) ||
Expand All @@ -64,7 +68,7 @@ Signed-off-by: Daniel Golle <[email protected]>

rt2800_r_calibration(rt2x00dev);
}
@@ -10453,6 +10473,8 @@ static void rt2800_calibration_rt6352_st
@@ -10453,6 +10477,8 @@ static void rt2800_calibration_rt6352_st
!rt2x00_has_cap_external_lna_bg(rt2x00dev))
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -3842,14 +3842,16 @@ static void rt2800_config_channel_rf7620
@@ -3846,14 +3846,16 @@ static void rt2800_config_channel_rf7620
rt2x00_set_field8(&rfcsr, RFCSR19_K, rf->rf4);
rt2800_rfcsr_write(rt2x00dev, 19, rfcsr);

Expand All @@ -39,7 +39,7 @@

rfcsr = rt2800_rfcsr_read(rt2x00dev, 1);
rt2x00_set_field8(&rfcsr, RFCSR1_TX2_EN_MT7620,
@@ -3883,18 +3885,23 @@ static void rt2800_config_channel_rf7620
@@ -3887,18 +3889,23 @@ static void rt2800_config_channel_rf7620
rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x20);
}

Expand Down Expand Up @@ -73,7 +73,7 @@

if (!test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) {
if (conf_is_ht40(conf)) {
@@ -4008,25 +4015,29 @@ static void rt2800_config_alc_rt6352(str
@@ -4012,25 +4019,29 @@ static void rt2800_config_alc_rt6352(str
if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
rt2x00_warn(rt2x00dev, "RF busy while configuring ALC\n");

Expand Down Expand Up @@ -121,7 +121,7 @@
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl);

rt2800_vco_calibration(rt2x00dev);
@@ -4524,7 +4535,8 @@ static void rt2800_config_channel(struct
@@ -4528,7 +4539,8 @@ static void rt2800_config_channel(struct
if (rt2x00_rt(rt2x00dev, RT6352)) {
/* BBP for GLRT BW */
bbp = conf_is_ht40(conf) ?
Expand All @@ -131,7 +131,7 @@
0x15 : 0x1a;
rt2800_bbp_glrt_write(rt2x00dev, 141, bbp);

@@ -6042,18 +6054,34 @@ static int rt2800_init_registers(struct
@@ -6046,18 +6058,34 @@ static int rt2800_init_registers(struct
} else if (rt2x00_rt(rt2x00dev, RT5350)) {
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
} else if (rt2x00_rt(rt2x00dev, RT6352)) {
Expand Down Expand Up @@ -178,7 +178,7 @@
reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1);
rt2x00_set_field32(&reg, TX_ALC_CFG_1_ROS_BUSY_EN, 0);
rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg);
@@ -7160,14 +7188,16 @@ static void rt2800_init_bbp_6352(struct
@@ -7164,14 +7192,16 @@ static void rt2800_init_bbp_6352(struct
rt2800_bbp_write(rt2x00dev, 188, 0x00);
rt2800_bbp_write(rt2x00dev, 189, 0x00);

Expand All @@ -203,7 +203,7 @@

/* BBP for G band GLRT function (BBP_128 ~ BBP_221) */
rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00);
@@ -10404,6 +10434,9 @@ static void rt2800_restore_rf_bbp_rt6352
@@ -10408,6 +10438,9 @@ static void rt2800_restore_rf_bbp_rt6352
rt2800_register_write(rt2x00dev, RF_BYPASS3, 0x0);
}

Expand All @@ -213,7 +213,7 @@
if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16);
rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x23);
@@ -10485,6 +10518,9 @@ static void rt2800_calibration_rt6352_st
@@ -10489,6 +10522,9 @@ static void rt2800_calibration_rt6352_st
rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
}

Expand All @@ -223,7 +223,7 @@
if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
@@ -10575,31 +10611,36 @@ static void rt2800_init_rfcsr_6352(struc
@@ -10579,31 +10615,36 @@ static void rt2800_init_rfcsr_6352(struc
rt2800_rfcsr_write(rt2x00dev, 42, 0x5B);
rt2800_rfcsr_write(rt2x00dev, 43, 0x00);

Expand Down Expand Up @@ -285,7 +285,7 @@

/* Initialize RF channel register to default value */
rt2800_rfcsr_write_chanreg(rt2x00dev, 0, 0x03);
@@ -10665,63 +10706,71 @@ static void rt2800_init_rfcsr_6352(struc
@@ -10669,63 +10710,71 @@ static void rt2800_init_rfcsr_6352(struc

rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0xC5);

Expand Down Expand Up @@ -412,7 +412,7 @@

/* Initialize RF DC calibration register to default value */
rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47);
@@ -10784,12 +10833,17 @@ static void rt2800_init_rfcsr_6352(struc
@@ -10788,12 +10837,17 @@ static void rt2800_init_rfcsr_6352(struc
rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00);
rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00);

Expand Down
12 changes: 12 additions & 0 deletions package/kernel/mac80211/patches/rt2x00/999-01-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
@@ -19,6 +19,9 @@

#include "rt2x00.h"
#include "rt2x00soc.h"
+#if LINUX_VERSION_IS_GEQ(6,12,0)
+#include "rt2800lib.h"
+#endif

static void rt2800lib_eeprom_swap(struct rt2x00_dev *rt2x00dev)
{
39 changes: 39 additions & 0 deletions package/kernel/mac80211/patches/rt2x00/999-02-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
@@ -124,7 +124,11 @@ exit_free_device:
}
EXPORT_SYMBOL_GPL(rt2x00soc_probe);

+#if LINUX_VERSION_IS_LESS(6,12,0)
int rt2x00soc_remove(struct platform_device *pdev)
+#else
+void rt2x00soc_remove(struct platform_device *pdev)
+#endif
{
struct ieee80211_hw *hw = platform_get_drvdata(pdev);
struct rt2x00_dev *rt2x00dev = hw->priv;
@@ -135,8 +139,10 @@ int rt2x00soc_remove(struct platform_dev
rt2x00lib_remove_dev(rt2x00dev);
rt2x00soc_free_reg(rt2x00dev);
ieee80211_free_hw(hw);
+#if LINUX_VERSION_IS_LESS(6,12,0)

return 0;
+#endif
}
EXPORT_SYMBOL_GPL(rt2x00soc_remove);

--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h
@@ -17,7 +17,11 @@
* SoC driver handlers.
*/
int rt2x00soc_probe(struct platform_device *pdev, const struct rt2x00_ops *ops);
+#if LINUX_VERSION_IS_LESS(6,12,0)
int rt2x00soc_remove(struct platform_device *pdev);
+#else
+void rt2x00soc_remove(struct platform_device *pdev);
+#endif
#ifdef CONFIG_PM
int rt2x00soc_suspend(struct platform_device *pdev, pm_message_t state);
int rt2x00soc_resume(struct platform_device *pdev);
14 changes: 14 additions & 0 deletions package/kernel/mt76/patches/999-01-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/mac80211.c
+++ b/mac80211.c
@@ -613,7 +613,11 @@ int mt76_create_page_pool(struct mt76_de
{
struct page_pool_params pp_params = {
.order = 0,
+#if LINUX_VERSION_IS_LESS(6,12,0)
.flags = PP_FLAG_PAGE_FRAG,
+#else
+ .flags = 0,
+#endif
.nid = NUMA_NO_NODE,
.dev = dev->dma_dev,
};
18 changes: 18 additions & 0 deletions package/kernel/mt76/patches/999-02-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- a/tools/eeprom.c
+++ b/tools/eeprom.c
@@ -220,10 +220,14 @@ mt76_eeprom_changes(void)
}

buf = malloc(EEPROM_PART_SIZE);
+ if (!buf)
+ return EXIT_FAILURE;
fseek(f, mtd_offset, SEEK_SET);
ret = fread(buf, 1, EEPROM_PART_SIZE, f);
- if (ret != EEPROM_PART_SIZE)
+ if (ret != EEPROM_PART_SIZE) {
+ free(buf);
return EXIT_FAILURE;
+ }
for (i = 0; i < EEPROM_PART_SIZE; i++) {
if (buf[i] == eeprom_data[i])
continue;
1 change: 1 addition & 0 deletions target/linux/ramips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SUBTARGETS:=mt7620 mt7621 mt76x8 rt288x rt305x rt3883
FEATURES:=squashfs gpio

KERNEL_PATCHVER:=6.6
KERNEL_TESTING_PATCHVER:=6.12

define Target/Description
Build firmware images for Ralink RT288x/RT3xxx based boards.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <asm/mach-ralink/ralink_regs.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/version.h>

#include <linux/switch.h>
Expand Down
Loading
Loading