您好,登錄后才能下訂單哦!
CPU : RK3399
系統: Android 7.1
1 、通過串口打印或者 adb 獲取模塊的 pid 和 vid ,順便可以看到生成 4 個虛擬串口 /dev/ttyUSB*
[ 11.734379 ] usb 1 - 1.1 : new high-speed USB device number 3 using ehci-platform
[ 11.828247 ] usb 1 - 1.1 : New USB device found, idVendor=2c7c, idProduct= 0125
[ 11.828386 ] usb 1 - 1.1 : New USB device strings: Mfr= 1 , Product= 2 , SerialNumber= 0
[ 11.828413 ] usb 1 - 1.1 : Product: Android
[ 11.828436 ] usb 1 - 1.1 : Manufacturer: Android
[ 11.835480 ] option 1 - 1.1 : 1.0 : GSM modem ( 1 -port) converter detected
[ 11.841217 ] usb 1 - 1.1 : GSM modem ( 1 -port) converter now attached to ttyUSB0
[ 11.844988 ] option 1 - 1.1 : 1.1 : GSM modem ( 1 -port) converter detected
[ 11.851892 ] usb 1 - 1.1 : GSM modem ( 1 -port) converter now attached to ttyUSB1
[ 11.853964 ] option 1 - 1.1 : 1.2 : GSM modem ( 1 -port) converter detected
[ 11.864677 ] usb 1 - 1.1 : GSM modem ( 1 -port) converter now attached to ttyUSB2
[ 11.865658 ] option 1 - 1.1 : 1.3 : GSM modem ( 1 -port) converter detected
[ 11.871387 ] usb 1 - 1.1 : GSM modem ( 1 -port) converter now attached to ttyUSB3
2 、在代碼中添加模塊的 pid 和 vid ,原始代碼中已經包含移遠的幾個模塊,仿照現有的添加 EC20
diff --git a/kernel/drivers/usb/serial/option.c b/kernel/drivers/usb/serial/option.c
index 1799aa0..f6c9e5d 100644
--- a/kernel/drivers/usb/serial/option.c
+++ b/kernel/drivers/usb/serial/option.c
@@ - 241 , 6 + 241 , 7 @@ static void option_instat_callback( struct urb *urb);
#define QUECTEL_VENDOR_ID 0x2c7c
/* These Quectel products use Quectel's vendor ID */
+ #define QUECTEL_PRODUCT_EC20 0x0125
#define QUECTEL_PRODUCT_EC21 0x0121
#define QUECTEL_PRODUCT_EC25 0x0125
#define QUECTEL_PRODUCT_BG96 0x0296
@@ - 1200 , 6 + 1201 , 8 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5),
.driver_info = (kernel_ulong_t)&yuga_clm920_nc5_blacklist },
/* Quectel products using Quectel vendor ID */
+ { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC20),
+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25)
3 、添加模塊的 so 庫,此庫需要移遠提供, so 支持的系統要匹配,將 so 庫拷貝到下面的路徑
vendor/rockchip/common/phone/lib/libreference-ril.so
4 、打開 device/rockchip/common/device.mk 文件,修改 rild.libpath 路徑為 rild.libpath=/system/lib64/libreference-ril.so
diff --git a/device/rockchip/common/device.mk b/device/rockchip/common/device.mk
index be2cb2c..69034a7 100755
--- a/device/rockchip/common/device.mk
+++ b/device/rockchip/common/device.mk
@@ - 699 , 7 + 699 , 7 @@ endif
ifeq ($(strip $(BOARD_HAVE_DONGLE)), true )
ifeq ($(strip $(TARGET_ARCH)), arm64)
PRODUCT_PROPERTY_OVERRIDES += \
- rild.libpath=/system/lib64/libril-rk29-dataonly.so
+ rild.libpath=/system/lib64/libreference-ril.so
else
PRODUCT_PROPERTY_OVERRIDES += \
rild.libpath=/system/lib/libril-rk29-dataonly.so
因為 rk3399 是 64 位 CPU ,所以 ifeq ($(strip $(TARGET_ARCH)), arm64) 條件成立。
但是前提都是 BOARD_HAVE_DONGLE 變量值為 true
注:本人測試,修改下面兩個文件中的 rild.libpath 不起作用
device/rockchip/rk3399/system.prop
device/rockchip/rk3399/rk3399_all/system.prop
5 、編譯時將 so 庫拷貝到上面指定目錄 /system/lib64/libreference-ril.so
diff --git a/vendor/rockchip/common/phone/phone.mk b/vendor/rockchip/common/phone/phone.mk
index 946aacd..f8fc6e7 100755
--- a/vendor/rockchip/common/phone/phone.mk
+++ b/vendor/rockchip/common/phone/phone.mk
@@ - 8 , 7 + 8 , 8 @@ PRODUCT_COPY_FILES += \
$(CUR_PATH)/phone/etc/ppp/ip-down:system/etc/ppp/ip-down \
$(CUR_PATH)/phone/etc/ppp/ip-up:system/etc/ppp/ip-up \
$(CUR_PATH)/phone/etc/ppp/call-pppd:system/etc/ppp/call-pppd \
- $(CUR_PATH)/phone/etc/operator_table:system/etc/operator_table
+ $(CUR_PATH)/phone/etc/operator_table:system/etc/operator_table \
+ $(CUR_PATH)/phone/lib/libreference-ril.so:system/lib64/libreference-ril.so
ifeq ($(strip $(PRODUCT_MODEM)), DTS4108C)
PRODUCT_COPY_FILES += \
6 、設置 BOARD_HAVE_DONGLE 變量
diff --git a/device/rockchip/rk3399/rk3399_all.mk b/device/rockchip/rk3399/rk3399_all.mk
index 7a2d870..ce5060c 100755
--- a/device/rockchip/rk3399/rk3399_all.mk
+++ b/device/rockchip/rk3399/rk3399_all.mk
@@ - 63 , 7 + 63 , 7 @@ BOARD_NFC_SUPPORT := false
BOARD_HAS_GPS := false
# for 3G/4G modem dongle support
-BOARD_HAVE_DONGLE := false
+BOARD_HAVE_DONGLE := true
BOARD_GRAVITY_SENSOR_SUPPORT := true
此時移植完成,只要 so 庫沒問題,就可以正常上網。
如果 radio log 中打印如下信息:
RIL_SAP_Init not defined or exported in /system/lib64/libril-rk29-dataonly.so
檢查 rild.libpath 的路徑和名稱是否正確。
No /proc/cmdline exception=java.io.FileNotFoundException: /proc/cmdline (Permission denied)
此報錯不影響聯網,可以忽略
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。