RK3288+RTL8201F-VB-CG网卡,在android5.1的3.10kernel上怎么配置?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RK3288+RTL8201F-VB-CG网卡,在android5.1的3.10kernel上怎么配置?相关的知识,希望对你有一定的参考价值。
有没有人知道,还有哪里要改的?
由于在 RK 系列的 SoC 中内置了以太网 MAC 控制器,所以只需要搭配一颗以太网 PHY 芯片, 即可实现以太网卡功能。 按照规范,即使是不同厂家的 PHY,仍然有一部分寄存器的定义是通用的, 只要配置了这些通用的寄存器,基本上 PHY 就可以正常工作。 因此,在 Linux 驱动中有通用的 PHY 驱动,目前的芯片所配套的 SDK 中使用的都是通用驱动,当然 SoC 中的 MAC 驱动是需要实现的。 10/100M 以太网 PHY 与 MAC 之间的接口主要有 MII 和 RMII。 10/100/1000M 以太网 PHY 与 MAC 之间的接口主要有 RGMII。网卡使用的是RTL8211,和参考设计一致,因此只要配置一下DTS就可以了。 参考技术A RK3288 android 5.1官方SDK(rk3288_android5.1_v1.00_20150515,已更新到20180412),在Rockchip官方提供的RK_EVB_RK3288核心板上验证OK。
根据Rockchip官方提供的补丁和配置方法,WiFi和以太网可以共存,而且WiFi配置连接因特网,以太网连接内部局域网,互不干扰。以下是具体的修改方法和补丁:
1)实现以太网wifi共存,补丁如下:
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 327fb8a..e5bcb04 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -166,9 +166,17 @@ public class ConnectivityService extends IConnectivityManager.Stub
private static final String TAG = "ConnectivityService";
private static final boolean DBG = true;
private static final boolean VDBG = false;
private static final boolean LOGD_RULES = false;
+ private static final boolean LOGD_BLOCKED_NETWORKINFO = true;
+
+ // if true:
+ // wifi and ethernet can coexist, if wifi and ethernet connect together, prefered to use ethernet
+ // if false:
+ // wifi and ethernet can't coexist, if wifi and ethernet connect together, will tear down wifi
+ // TODO: still have bug in this case to fix (like can't reconnect wifi when ethernet disconnect)
rk3288 usb无线网卡支持 8188eu
第一部分是kernel
内核配置参考rk文档,把device driver 下wireless相关的先勾选上。
编译到buildin有问题,识别不到,所以打算编译成ko
cd kernel/drivers/net/wireless/rockchip_wlan/rtl8188eu
make -C /home/lzm/workspace/rk3288/zy_n10/kernel/ M=`pwd` modules
得到8188eu.ko
lsusb,看vid pid,是存在的
看初始化函数,发现被注释,修改打开
第二部分,android打开Settings配置
commit e0394d5bb67a76fedbbbdca3f9cba39fbdd9c576
Author: songyoulin <songyoulin@star-net.cn>
Date: Tue Oct 17 16:25:15 2017 +0800
provide EthernetSettings interface
packages/apps/Settings/AndroidManifest.xml | 9 ++++-----
packages/apps/Settings/src/com/android/settings/Settings.java | 1 +
packages/apps/Settings/src/com/android/settings/SettingsActivity.java | 1 +
commit 17dad10a1276a568e2952741a9a188d0bd6ced19
Author: youchangning <youchangning@star-net.cn>
Date: Tue Nov 15 09:35:39 2016 +0800
hide settings
device/rockchip/rk3288/system.prop | 2 +-
packages/apps/Settings/src/com/android/settings/SettingsActivity.java | 16 ++++++++++++++++
--- a/packages/apps/Settings/src/com/android/settings/SettingsActivity.java
+++ b/packages/apps/Settings/src/com/android/settings/SettingsActivity.java
@@ -1224,6 +1224,10 @@ public class SettingsActivity extends Activity
|| Utils.isMonkeyRunning())
removeTile = true;
+
+ if (!showDev)
+ removeTile = true;
+
else if (id == R.id.nfc_payment_settings)
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC))
removeTile = true;
@@ -1260,6 +1264,18 @@ public class SettingsActivity extends Activity
if (!"box".equals(SystemProperties.get("ro.target.product", "tablet")))
removeTile = true;
+ else if ((id == R.id.power_save_settings) ||
+ (id == R.id.location_settings) ||
+ (id == R.id.account_settings) ||
+ (id == R.id.security_settings) ||
+ (id == R.id.accessibility_settings) ||
+ (id == R.id.language_settings) ||
+ (id == R.id.display_settings) ||
+ (id == R.id.notification_settings) ||
+ (id == R.id.date_time_settings))
+ if (!showDev)
+ removeTile = true;
+
if (UserHandle.MU_ENABLED && UserHandle.myUserId() != 0
commit 203df58cfb3281b9445b86e302eac883c93e970f
E/WifiService( 456): Invoking mWifiStateMachine.setWifiEnabled
E/WifiStateMachine( 456): setting operational mode to 1
E/RkWifiCtrl( 456): Wifi driver is not ready.
E/RkWifiCtrl( 456): rk_wifi_load_driver:(insmod)
E/RkWifiCtrl( 456): rk_wifi_load_driver: open(/sys/class/rkwifi/driver) for write failed: Permission denied (13)
E/WifiStateMachine( 456): Failed to load driver
E/WifiStateMachine( 456): setSuspendOptimizations: 2 true
E/WifiStateMachine( 456): mSuspendOptNeedsDisabled 0
W/Vibrator( 456): Failed to vibrate; no vibrator service.
E/WifiService( 456): Invoking mWifiStateMachine.setWifiEnabled
rk这个有点坑了。。。
lzm@compilere:~/workspace/rk3288/zy_n10$ grep -rn "rk_wifi_load_driver" *
hardware/libhardware_legacy/include/hardware_legacy/wifi.h:58:int rk_wifi_load_driver(int enable);
hardware/libhardware_legacy/wifi/wifi.c:315: if (rk_wifi_load_driver(1) < 0)
hardware/libhardware_legacy/wifi/wifi.c:376: ret = rk_wifi_load_driver(0);
hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c:48:int rk_wifi_load_driver(int enable);
hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c:195:int rk_wifi_load_driver(int enable)
hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c:201: ALOGE("rk_wifi_load_driver:(%s)", enable? "insmod":"rmmod");
hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c:216: ALOGE("rk_wifi_load_driver: open(%s) for write failed: %s (%d)",
hardware/libhardware_legacy/wifi/rk_wifi_ctrl.c:224: ALOGE("rk_wifi_load_driver: write(%s) failed: %s (%d)",
属于hal层,
HAL概述
https://www.cnblogs.com/lcw/p/3335505.html
编译完放置在 /system/lib/
130|root@EMT100T:/sys/class/rkwifi # ls /system/lib/
libhardware.so libharfbuzz_ng.so libhwui.so
libhardware_legacy.so libhevcdec.so
单独编译:
source build/envsetup.sh
lzm@compilere:~/workspace/rk3288/zy_n10$ lunch
You‘re building on Linux
Lunch menu... pick a combo:
1. rk3288-user
2. rk3288-userdebug
3. rk3288_box-userdebug
4. rk3288-eng
5. mini_emulator_mips-userdebug
6. mini_emulator_arm64-userdebug
7. mini_emulator_x86-userdebug
8. mini_emulator_x86_64-userdebug
9. m_e_arm-userdebug
10. aosp_shamu-userdebug
11. aosp_flounder-userdebug
Which would you like? [aosp_arm-eng] 2
cd hardware/libhardware_legacy
mm
android源码目录下的build/envsetup.sh文件,描述编译的命令
- m: Makes from the top of the tree.
- mm: Builds all of the modules in the current directory.
- mmm: Builds all of the modules in the supplied directories.
要想使用这些命令,首先需要在android源码根目录执行. build/envsetup.sh 脚本设置环境
m:编译所有的模块
mm:编译当前目录下的模块,当前目录下要有Android.mk文件
mmm:编译指定路径下的模块,指定路径下要有Android.mk文件
下面举个例子说明,假设我要编译android下的\\hardware\\libhardware_legacy\\power模块,当前目录为源码根目录,方法如下:
1、. build/envsetup.sh
2、mmm hardware/libhardware_legacy/power/
或者 :
1、. build/envsetup.sh
2、cd hardware/libhardware_legacy/power/
3、mm
adb shell am start com.android.settings/com.android.settings.Settings
130|root@EMT100T:/ # logcat -s RkWifiCtrl
--------- beginning of main
--------- beginning of system
D/RkWifiCtrl( 439): check_wifi_preload: Wifi driver is not preload when bootup, load when open wifi.
E/RkWifiCtrl( 439): rk_wifi_load_driver:(rmmod)
E/RkWifiCtrl( 439): Wifi driver is not ready.
D/RkWifiCtrl( 439): check_wifi_preload: Wifi driver is not preload when bootup, load when open wifi.
E/RkWifiCtrl( 439): Wifi driver is not ready.
E/RkWifiCtrl( 439): rk_wifi_load_driver:(insmod)
E/RkWifiCtrl( 439): Wifi driver is not ready.
E/RkWifiCtrl( 439): Wifi driver is not ready.
E/RkWifiCtrl( 439): Wifi driver is not ready.
E/RkWifiCtrl( 439): Wifi driver is not ready.
E/RkWifiCtrl( 439): Wifi driver is not ready.
E/RkWifiCtrl( 439): Wifi driver is not ready.
E/RkWifiCtrl( 439): Wifi driver is not ready.
以上是关于RK3288+RTL8201F-VB-CG网卡,在android5.1的3.10kernel上怎么配置?的主要内容,如果未能解决你的问题,请参考以下文章
RK3399驱动开发 | 17 - RTL8152 USB有线网卡调试(基于linux5.4.32内核)
RK3399驱动开发 | 17 - RTL8152 USB有线网卡调试(基于linux5.4.32内核)
睿普康芯片,以太网百兆PHY芯片,RPC8201,以太网千兆PHY芯片,RPC8211,国产PHY芯片,替换瑞昱的RTL8201,RTL8211,裕太微YT8512和YT8531,TI的DP83822