-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
MGV2000-CW创维版 1+8G,S905L2,无线MT7668RSN在5.10可用,建议纳入适配清单 #2616
Comments
有无试过6.x编译此WiFi驱动能正常使用的? |
https://github.com/SOUTH5663/MT7668/tree/k6.1 这个可以试试,我在这个分支基础上微调了6.6编译可用,6.1未测试 |
感谢分享,我添加到支持的设备列表里。 |
无法读取存储设备,可能是选择的u-boot不对(不要选择-m yes添加这个u-boot,或者选择其他的u-boot),也可能是dtb的频率高(调低dtb到25hz试试)。 |
谢谢O大指导,反复测试了25000000、30000000、35000000、37500000等频率,也在各种dtb和u-boot(例如u-boot-s905x-s912.bin、u-boot-p212.bin)之间横跳,连btrfs都试了,还是没有能从EMMC启动。 特别好奇之前竟然能成功,不知道发生了什么。 现在先用U盘启动,如果拿到其他同型号机器会再测试。 |
@w2xg2022 大哥我看你的 ty1608 1g内存在 armbian 里可用只有 800m。 |
我把选项也更新到126了 |
@jumkey 大佬,能拉个改好后的分支吗?我在6.1和6.6内核上报错,看不懂里面的代码😭 |
diff --git a/Makefile.x86 b/Makefile.x86
index 9bd034f..11d9018 100644
--- a/Makefile.x86
+++ b/Makefile.x86
@@ -20,7 +20,7 @@ ifeq ($(hif),)
hif=usb
endif
-MODULES_NAME := wlan_$(shell echo $(MTK_COMBO_CHIP) | tr A-Z a-z)
+MODULES_NAME := wlan_mt76x8
export CONFIG_MTK_COMBO_WIFI_HIF=$(hif)
diff --git a/drv_wlan/MT6632/wlan/mgmt/p2p_func.c b/drv_wlan/MT6632/wlan/mgmt/p2p_func.c
index 7bc03b4..1648520 100644
--- a/drv_wlan/MT6632/wlan/mgmt/p2p_func.c
+++ b/drv_wlan/MT6632/wlan/mgmt/p2p_func.c
@@ -1222,7 +1222,7 @@ VOID p2pFuncDfsSwitchCh(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN
DBGLOG(P2P, INFO, "p2pFuncDfsSwitchCh: Update to OS\n");
cfg80211_ch_switch_notify(prGlueInfo->prP2PInfo[prP2pRoleFsmInfo->ucRoleIndex]->prDevHandler,
- prGlueInfo->prP2PInfo[prP2pRoleFsmInfo->ucRoleIndex]->chandef);
+ prGlueInfo->prP2PInfo[prP2pRoleFsmInfo->ucRoleIndex]->chandef, 0, 0);
DBGLOG(P2P, INFO, "p2pFuncDfsSwitchCh: Update to OS Done\n");
if (prGlueInfo->prP2PInfo[prP2pRoleFsmInfo->ucRoleIndex]->chandef) {
diff --git a/drv_wlan/MT6632/wlan/os/linux/gl_cfg80211.c b/drv_wlan/MT6632/wlan/os/linux/gl_cfg80211.c
index 207e028..e13e104 100644
--- a/drv_wlan/MT6632/wlan/os/linux/gl_cfg80211.c
+++ b/drv_wlan/MT6632/wlan/os/linux/gl_cfg80211.c
@@ -2720,19 +2720,19 @@ mtk_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev, const
if (params == NULL)
return 0;
- else if (params->supported_rates == NULL)
+ else if (params->link_sta_params.supported_rates == NULL)
return 0;
/* init */
kalMemZero(&rCmdUpdate, sizeof(rCmdUpdate));
kalMemCopy(rCmdUpdate.aucPeerMac, mac, 6);
- if (params->supported_rates != NULL) {
+ if (params->link_sta_params.supported_rates != NULL) {
- u4Temp = params->supported_rates_len;
+ u4Temp = params->link_sta_params.supported_rates_len;
if (u4Temp > CMD_PEER_UPDATE_SUP_RATE_MAX)
u4Temp = CMD_PEER_UPDATE_SUP_RATE_MAX;
- kalMemCopy(rCmdUpdate.aucSupRate, params->supported_rates, u4Temp);
+ kalMemCopy(rCmdUpdate.aucSupRate, params->link_sta_params.supported_rates, u4Temp);
rCmdUpdate.u2SupRateLen = u4Temp;
}
@@ -2754,23 +2754,23 @@ mtk_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev, const
rCmdUpdate.u2ExtCapLen = u4Temp;
}
- if (params->ht_capa != NULL) {
+ if (params->link_sta_params.ht_capa != NULL) {
- rCmdUpdate.rHtCap.u2CapInfo = params->ht_capa->cap_info;
- rCmdUpdate.rHtCap.ucAmpduParamsInfo = params->ht_capa->ampdu_params_info;
- rCmdUpdate.rHtCap.u2ExtHtCapInfo = params->ht_capa->extended_ht_cap_info;
- rCmdUpdate.rHtCap.u4TxBfCapInfo = params->ht_capa->tx_BF_cap_info;
- rCmdUpdate.rHtCap.ucAntennaSelInfo = params->ht_capa->antenna_selection_info;
+ rCmdUpdate.rHtCap.u2CapInfo = params->link_sta_params.ht_capa->cap_info;
+ rCmdUpdate.rHtCap.ucAmpduParamsInfo = params->link_sta_params.ht_capa->ampdu_params_info;
+ rCmdUpdate.rHtCap.u2ExtHtCapInfo = params->link_sta_params.ht_capa->extended_ht_cap_info;
+ rCmdUpdate.rHtCap.u4TxBfCapInfo = params->link_sta_params.ht_capa->tx_BF_cap_info;
+ rCmdUpdate.rHtCap.ucAntennaSelInfo = params->link_sta_params.ht_capa->antenna_selection_info;
kalMemCopy(rCmdUpdate.rHtCap.rMCS.arRxMask,
- params->ht_capa->mcs.rx_mask, sizeof(rCmdUpdate.rHtCap.rMCS.arRxMask));
+ params->link_sta_params.ht_capa->mcs.rx_mask, sizeof(rCmdUpdate.rHtCap.rMCS.arRxMask));
- rCmdUpdate.rHtCap.rMCS.u2RxHighest = params->ht_capa->mcs.rx_highest;
- rCmdUpdate.rHtCap.rMCS.ucTxParams = params->ht_capa->mcs.tx_params;
+ rCmdUpdate.rHtCap.rMCS.u2RxHighest = params->link_sta_params.ht_capa->mcs.rx_highest;
+ rCmdUpdate.rHtCap.rMCS.ucTxParams = params->link_sta_params.ht_capa->mcs.tx_params;
rCmdUpdate.fgIsSupHt = TRUE;
}
/* vht */
- if (params->vht_capa != NULL) {
+ if (params->link_sta_params.vht_capa != NULL) {
/* rCmdUpdate.rVHtCap */
/* rCmdUpdate.rVHtCap */
}
@@ -2823,19 +2823,19 @@ mtk_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev, u8 *ma
if (params == NULL)
return 0;
- else if (params->supported_rates == NULL)
+ else if (params->link_sta_params.supported_rates == NULL)
return 0;
/* init */
kalMemZero(&rCmdUpdate, sizeof(rCmdUpdate));
kalMemCopy(rCmdUpdate.aucPeerMac, mac, 6);
- if (params->supported_rates != NULL) {
+ if (params->link_sta_params.supported_rates != NULL) {
- u4Temp = params->supported_rates_len;
+ u4Temp = params->link_sta_params.supported_rates_len;
if (u4Temp > CMD_PEER_UPDATE_SUP_RATE_MAX)
u4Temp = CMD_PEER_UPDATE_SUP_RATE_MAX;
- kalMemCopy(rCmdUpdate.aucSupRate, params->supported_rates, u4Temp);
+ kalMemCopy(rCmdUpdate.aucSupRate, params->link_sta_params.supported_rates, u4Temp);
rCmdUpdate.u2SupRateLen = u4Temp;
}
@@ -2857,23 +2857,23 @@ mtk_cfg80211_change_station(struct wiphy *wiphy, struct net_device *ndev, u8 *ma
rCmdUpdate.u2ExtCapLen = u4Temp;
}
- if (params->ht_capa != NULL) {
+ if (params->link_sta_params.ht_capa != NULL) {
- rCmdUpdate.rHtCap.u2CapInfo = params->ht_capa->cap_info;
- rCmdUpdate.rHtCap.ucAmpduParamsInfo = params->ht_capa->ampdu_params_info;
- rCmdUpdate.rHtCap.u2ExtHtCapInfo = params->ht_capa->extended_ht_cap_info;
- rCmdUpdate.rHtCap.u4TxBfCapInfo = params->ht_capa->tx_BF_cap_info;
- rCmdUpdate.rHtCap.ucAntennaSelInfo = params->ht_capa->antenna_selection_info;
+ rCmdUpdate.rHtCap.u2CapInfo = params->link_sta_params.ht_capa->cap_info;
+ rCmdUpdate.rHtCap.ucAmpduParamsInfo = params->link_sta_params.ht_capa->ampdu_params_info;
+ rCmdUpdate.rHtCap.u2ExtHtCapInfo = params->link_sta_params.ht_capa->extended_ht_cap_info;
+ rCmdUpdate.rHtCap.u4TxBfCapInfo = params->link_sta_params.ht_capa->tx_BF_cap_info;
+ rCmdUpdate.rHtCap.ucAntennaSelInfo = params->link_sta_params.ht_capa->antenna_selection_info;
kalMemCopy(rCmdUpdate.rHtCap.rMCS.arRxMask,
- params->ht_capa->mcs.rx_mask, sizeof(rCmdUpdate.rHtCap.rMCS.arRxMask));
+ params->link_sta_params.ht_capa->mcs.rx_mask, sizeof(rCmdUpdate.rHtCap.rMCS.arRxMask));
- rCmdUpdate.rHtCap.rMCS.u2RxHighest = params->ht_capa->mcs.rx_highest;
- rCmdUpdate.rHtCap.rMCS.ucTxParams = params->ht_capa->mcs.tx_params;
+ rCmdUpdate.rHtCap.rMCS.u2RxHighest = params->link_sta_params.ht_capa->mcs.rx_highest;
+ rCmdUpdate.rHtCap.rMCS.ucTxParams = params->link_sta_params.ht_capa->mcs.tx_params;
rCmdUpdate.fgIsSupHt = TRUE;
}
/* vht */
- if (params->vht_capa != NULL) {
+ if (params->link_sta_params.vht_capa != NULL) {
/* rCmdUpdate.rVHtCap */
/* rCmdUpdate.rVHtCap */
}
diff --git a/drv_wlan/MT6632/wlan/os/linux/gl_init.c b/drv_wlan/MT6632/wlan/os/linux/gl_init.c
index 54007d2..5dd5ac4 100644
--- a/drv_wlan/MT6632/wlan/os/linux/gl_init.c
+++ b/drv_wlan/MT6632/wlan/os/linux/gl_init.c
@@ -109,7 +109,7 @@ typedef struct _WLANDEV_INFO_T {
MODULE_AUTHOR(NIC_AUTHOR);
MODULE_DESCRIPTION(NIC_DESC);
-MODULE_SUPPORTED_DEVICE(NIC_NAME);
+//MODULE_SUPPORTED_DEVICE(NIC_NAME);
/* MODULE_LICENSE("MTK Propietary"); */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/drv_wlan/MT6632/wlan/os/linux/gl_kal.c b/drv_wlan/MT6632/wlan/os/linux/gl_kal.c
index b534a5f..b97a94b 100644
--- a/drv_wlan/MT6632/wlan/os/linux/gl_kal.c
+++ b/drv_wlan/MT6632/wlan/os/linux/gl_kal.c
@@ -89,6 +89,8 @@
#define FILE_NAME_MAX CFG_FW_NAME_MAX_LEN /* the maximum length of a file name */
#define FILE_NAME_TOTAL 8 /* the maximum number of all possible file name */
+#define netif_rx_ni netif_rx
+
/*******************************************************************************
* D A T A T Y P E S
********************************************************************************
diff --git a/drv_wlan/MT6632/wlan/os/linux/include/gl_kal.h b/drv_wlan/MT6632/wlan/os/linux/include/gl_kal.h
index 12192f5..423a5aa 100644
--- a/drv_wlan/MT6632/wlan/os/linux/include/gl_kal.h
+++ b/drv_wlan/MT6632/wlan/os/linux/include/gl_kal.h
@@ -812,7 +812,7 @@ do { \
(_Interval) += KAL_GET_TIME_INTERVAL(); \
}
-#define KAL_GET_HOST_CLOCK() local_clock()
+#define KAL_GET_HOST_CLOCK() ktime_get_ns()
/*******************************************************************************
* F U N C T I O N D E C L A R A T I O N S
diff --git a/drv_wlan/MT7663/wlan/common/wlan_lib.c b/drv_wlan/MT7663/wlan/common/wlan_lib.c
index 25fe6e2..51cafd2 100644
--- a/drv_wlan/MT7663/wlan/common/wlan_lib.c
+++ b/drv_wlan/MT7663/wlan/common/wlan_lib.c
@@ -74,6 +74,7 @@
#include <linux/sched/clock.h>
#include <linux/sched/task.h>
#include <linux/sched/mm.h>
+#include <linux/ktime.h>
/*******************************************************************************
* C O N S T A N T S
这是6.6的patch 没有加内核版本判断,你可以保存成patch文件应用。local_clock()不知道为啥没导出我随便改成了ktime_get_ns()除错。 |
CC [M] /root/src/MT7668/drv_wlan/MT6632/wlan/os/linux/gl_proc.o 大佬,我的armbian系统目前是6.6.50-ophub内核,又又又出现了新的报错😂 |
EXTRA_CFLAGS加个-O0试试 |
niceeeeeee,终于编译成功了,非常感谢大佬鼎力相助!! |
Device Information | 设备信息
Armbian Version | 系统版本
Describe the bug | 问题描述
Armbian_24.11.0_amlogic_s905l2_bookworm_6.6.53_server_2024.10.02.img.gz下HDMI有输出、有线正常,但无线、蓝牙未驱动。如果要写入EMMC需要修改默认meson-gxl-s905l2-x7-5g.dtb的mmc@74000,0xbebc200 -> 0x2faf080;写入EMMC选119(s905l2 MGV2000,MGV3000,M301A,CM201-1 meson-gxl-s905l2-x7-5g.dtb),写入后可正常使用。
希望板载MT7668RSN无线能用起来,爬了很多文发现只能在5.10内核中实现,经过一番折腾确实也成功了,iperf3内网实测可以跑140Mpbs左右,突破了百兆有线,有实际利用价值了。
先上图:
过程整理:
前置作业
1、刷入安卓底包S905L2_A9_Armbian.img,引导U盘启动(紫屏按2次电源键可恢复正常;先进magisk后重启,再用外置系统启动器)
2、基于Armbian_24.11.0_amlogic_s905l2_bookworm_6.6.53_server_2024.10.02.img.gz用rufus制作U盘,使用默认dtb即meson-gxl-s905l2-x7-5g.dtb
3、MT7668驱动只适用内核5.10.x,运行armbian-update -k 5.10调整内核版本
4、5.10.x(实际是5.10.228)还需要启用extlinux\extlinux.conf,并复制u-boot-s905x-s912.bin为u-boot.ext,才能正常启动和使用
编译过程
1、对齐gcc版本
mkdir -p /usr/local/toolchain
cd /usr/local/toolchain
wget https://github.com/ophub/kernel/releases/download/dev/arm-gnu-toolchain-13.3.rel1-aarch64-aarch64-none-elf.tar.xz
tar -Jxf arm-gnu-toolchain-13.3.rel1-aarch64-aarch64-none-elf.tar.xz
echo 'export PATH=$PATH:/usr/local/toolchain/arm-gnu-toolchain-13.3.rel1-aarch64-aarch64-none-elf/bin/' | tee -a /etc/profile.d/gcc-aarch64-none-elf.sh
source /etc/profile
ln -sf /usr/local/toolchain/arm-gnu-toolchain-13.3.rel1-aarch64-aarch64-none-elf/bin/aarch64-none-elf-gcc /usr/local/bin/gcc
2、修改驱动源代码
cd /root
git clone -b 5.15 https://github.com/fujianzz/mt7668-ce
cd mt7668-ce/MT7668-WiFi/
sed -i 's/kernel_version/5.10.228-ophub/' /root/mt7668-ce/MT7668-WiFi/Makefile.x86
sed -i 's/x86/arm64/' /root/mt7668-ce/MT7668-WiFi/Makefile.x86
3、开始编译
make EXTRA_CFLAGS="-w" CROSS_COMPILE= -f Makefile.x86 -j$(nproc)
4、安装驱动
cp /root/mt7668-ce/MT7668-WiFi/7668_firmware/* /usr/lib/firmware/
cp -f /root/mt7668-ce/MT7668-WiFi/drv_wlan/MT6632/wlan/wlan_mt76x8_sdio.ko /lib/modules/5.10.228-ophub/kernel/drivers/net/wireless/
depmod -a
modprobe wlan_mt76x8_sdio
后续操作
1、删除临时文档(可选)
rm -rf /usr/local/toolchain/arm-gnu-toolchain-13.3.rel1-aarch64-aarch64-none-elf.tar.xz
rm -rf /root/mt7668-ce/
2、无线连接路由器(iperf3内网测速约140Mbps)
nmtui
3、写入EMMC(可选)
需要修改dtb/dts中mmc@74000的0xbebc200 -> 0x2faf080,才能写入EMMC
armbian-install -m yes(一定要加-m yes参数,才能正确生成u-boot.emmc)
选119,119 s905l2 MGV2000,MGV3000,M301A,CM201-1 meson-gxl-s905l2-x7-5g.dtb
总结和文档下载
链接:https://pan.baidu.com/s/19_nMbN06wxXuo9lUrt0DmA?pwd=iafy
提取码:iafy
1、安卓9底包:S905L2_A9_Armbian.rar
2、改过的5.10版本dtb:meson-gxl-s905l2-x7-5g.dtb
3、完整固件:Armbian_24.11.0_amlogic_s905l2_mgv2000-cw_wifi_bookworm_5.10.228_server_2024.10.02.img.gz(root/1234)
遗留问题:
1、如果直接用Armbian_24.11.0_amlogic_s905l2_mgv2000-cw_wifi_bookworm_5.10.228_server_2024.10.02.img.gz,第一次启动可能需要插拔网线才能取得IP【只需一次】
2、蓝牙不可用
3、关闭[wlan]相关跑码,太烦了
4、6.1、6.6内核适配MT7668
参考资料:
1、驱动编译:https://github.com/fujianzz/mt7668-armbian
2、缝合安卓底包:#2539
@ophub 搜索过issue,看到比较多MGV2000 JL版,不知道CW版有没有重复,麻烦视需要纳入适配清单。谢谢。
The text was updated successfully, but these errors were encountered: