赞
踩
首先,要先获得技术支持
步骤一,先在USB模块上完成4G
步骤二,移植到PCIE座子上
磨刀不费砍材功,请先拿到技术文档支持,我的参考是:Quectel_Android_RIL_Driver_V3.3.62_master_beta(支持EC200A).tgz
主要文件:Quectel_Android_RIL_Driver_V3.3.62_master_beta(支持EC200A)\libquectel-ril\arm64-v8a\libreference-ril.so
主要文档:Quectel_Android_RIL_Driver_User_Guide_V2.0.pdf
//##//##//##//##//##//##//##//##//##//##//##//##//##//##//##//##//##//##//##//##//##
系统部分:
1.添加rild库(\libquectel-ril\arm64-v8a\libreference-ril.so)
改名成:librk-ril.so
预制到:\device\rockchip\common\4g_modem\lib64\librk-ril.so
代码要清理重新编译,有遇到没有更新库的情况,更新后大编才可以
2.更新已下文件
- \vendor\rockchip\common\phone\bin\chat
- \vendor\rockchip\common\phone\etc\ppp\ip-down
- \vendor\rockchip\common\phone\etc\ppp\ip-up
- \vendor\rockchip\common\phone\etc\ql-ril.conf
- \vendor\rockchip\common\phone\lib\libreference-ril-ec20.so
3.关闭SELINUX
- \device\rockchip\common\BoardConfig.mk
- -BOARD_SELINUX_ENFORCING ?= true
- +BOARD_SELINUX_ENFORCING ?= false
如果卡在android动画,建议看一下降频篇
4.打开BOARD_HAS_RK_4G_MODEM
- #enable 3g dongle
- BOARD_HAVE_DONGLE ?= false
- ifeq ($(BOARD_HAVE_DONGLE),true)
- PRODUCT_PACKAGES += \
- android.hardware.radio@1.2-radio-service \
- android.hardware.radio.config@1.0-service
- PRODUCT_PACKAGES += \
- rild \
- com.android.phone.common
- endif
-
-
- #for rk 4g modem
- BOARD_HAS_RK_4G_MODEM ?= false
- +BOARD_HAS_RK_4G_MODEM ?= true
-
- ifeq ($(strip $(BOARD_HAS_RK_4G_MODEM)),true)
- DEVICE_MANIFEST_FILE += device/rockchip/common/4g_modem/manifest.xml
- endif
5.去掉property:ro.boot.noril
如果存在电话这一项,就执行下面的内容
设置setprop ro.radio.noril 为true
暂停ril-daemon服务
- - a/device/rockchip/common/init.rk30board.rc
- + b/device/rockchip/common/init.rk30board.rc
- @@ -238,7 +238,7 @@ on property:sys.boot_completed=1
-
- # for telephony function
- -on property:ro.boot.noril=true
- - setprop ro.radio.noril true
- - stop ril-daemon
- +#on property:ro.boot.noril=true
- +# setprop ro.radio.noril true
- +# stop ril-daemon
6.修改\manifest.xml
- \device\rockchip\common\4g_modem\manifest.xml
- <manifest version="1.0" type="device">
- <hal format="hidl">
- <name>android.hardware.radio</name>
- <transport>hwbinder</transport>
- <fqname>@1.1::IRadio/slot1</fqname>
- <fqname>@1.1::IRadio/slot2</fqname>
- <fqname>@1.2::ISap/slot1</fqname>
- <fqname>@1.4::IRadio/slot1</fqname>
- </hal>
- <hal format="hidl">
- <name>android.hardware.radio.deprecated</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IOemHook</name>
- <instance>slot1</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.radio</name>
- <transport>hwbinder</transport>
- <version>1.0</version>
- <interface>
- <name>IRadio</name>
- <instance>slot1</instance>
- </interface>
- </hal>
-
-
- </manifest>
-
- \device\rockchip\common\manifest.xml
-
- + <hal format="hidl">
- + <name>android.hardware.radio</name>
- + <transport>hwbinder</transport>
- + <fqname>@1.1::IRadio/slot1</fqname>
- + <fqname>@1.1::IRadio/slot2</fqname>
- + <fqname>@1.2::ISap/slot1</fqname>
- + </hal>
7.添加APN
- \vendor\rockchip\common\phone\etc\apns-full-conf.xml
-
- <apn carrier="IENTC"
- carrier_id = "2470"
- mcc="334"
- mnc="140"
- apn="ims"
- type="ims"
- user=""
- password=""
- mvno_type="spn"
- mvno_match_data="IENTC"
- />
- + <apn carrier="China Telecom" mcc="460" mnc="11" apn="ctnet" type="default,supl" />
- + <apn carrier="中国移动物联网4G" mcc="460" mnc="04" apn="cmiot" type="default,supl" />
- + <apn carrier="中国移动物联网2G" mcc="460" mnc="04" apn="cmmtm" type="default,supl" />
- + <apn carrier="中国联通物联网gzm2mapn" mcc="460" mnc="06" apn="unim2m.gzm2mapn" port="80" type="default,supl" />
- + <apn carrier="中国联通物联网njm2mapn" mcc="460" mnc="06" apn="unim2m.njm2mapn" type="default,supl" />
- + <apn carrier="中国电信物联网m2m" mcc="460" mnc="03" apn="CTNET" user="m2m" password="vnet.mobi" type="default" />
- </apns>
8.4G上网正常,但状态栏中没有4G图标(完全没有图标)
- device\rockchip\rk356x\overlay\frameworks\base\core\res\res\value\config.xml
- <!-- This string array should be overridden by the device to present a list of network
- attributes. This is used by the connectivity manager to decide which networks can coexist
- based on the hardware -->
- <!-- An Array of "[Connection name],[ConnectivityManager connection type],
- [associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
- <!-- the 5th element "resore-time" indicates the number of milliseconds to delay
- before automatically restore the default connection. Set -1 if the connection
- does not require auto-restore. -->
- <!-- the 6th element indicates boot-time dependency-met value. -->
- <string-array translatable="false" name="networkAttributes">
- <item>"wifi,1,1,2,-1,true"</item>
- + <item>"mobile,0,0,0,-1,true"</item>
- + <item>"mobile_mms,2,0,2,60000,true"</item>
- + <item>"mobile_supl,3,0,2,60000,true"</item>
- + <item>"mobile_dun,4,0,2,60000,true"</item>
- + <item>"mobile_hipri,5,0,3,60000,true"</item>
- + <item>"mobile_fota,10,0,2,60000,true"</item>
- + <item>"mobile_ims,11,0,2,60000,true"</item>
- + <item>"mobile_cbs,12,0,2,60000,true"</item>
- <item>"bluetooth,7,7,0,-1,true"</item>
- <item>"ethernet,9,9,9,-1,true"</item>
- </string-array>
9.打开权限在device\rockchip\common\ueventd.rockchip.rc中增加
- \device\rockchip\common\ueventd.rockchip.rc
- # for radio
- /dev/ttyUSB* 0666 radio radio
-
- #for uart
- /dev/ttyS3 0777 root system
- /dev/ttyS4 0777 root system
- /dev/ttyS5 0777 root system
- /dev/ttyS6 0777 root system
- /dev/ttyS9 0777 root system
- /dev/ttyS8 0777 root system
- /dev/ttyS9 0777 root system
- #for cdc-wdm0
- /dev/cdc-wdm* 0660 radio radio
- #for qcqmi0
- /dev/qcqmi* 0660 radio radio
- /dev/cdc-acm* 0660 radio radio
- /dev/ttyACM* 0660 radio radio
-
- #PCIe
- /dev/mhi_DUN 0660 radio radio
- /dev/mhi_DIAG 0660 radio radio
- /dev/mhi_BHI 0660 radio radio
- /dev/mhi_LOOPBACK 0660 radio radio
- /dev/mhi_QMI0 0660 radio radio
10.添加cdc-wdm0节点
- system\core\init\devices.cpp
- // Minors are broken up into groups of 128, starting at "001"
- int bus_id = uevent.minor / 128 + 1;
- int device_id = uevent.minor % 128 + 1;
- devpath = StringPrintf("/dev/bus/usb/%03d/%03d", bus_id, device_id);
- }
- +#if 1 //add by quectel for mknod /dev/cdc-wdmo
- + } else if (uevent.subsystem == "usbmisc" && !uevent.device_name.empty()) {
- + devpath = "/dev/" + uevent.device_name;
- +#endif
- } else if (StartsWith(uevent.subsystem, "usb")) {
- // ignore other USB events
11.应该实际上是使用的下面这个: //这个本来就有的
- device\rockchip\common\device.mk
- ifeq ($(strip $(TARGET_ARCH)), arm64)
- PRODUCT_PROPERTY_OVERRIDES += \
- vendor.rild.libpath=/vendor/lib64/librk-ril.so
-
- PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/4g_modem/bin64/dhcpcd:$(TARGET_COPY_OUT_VENDOR)/bin/dhcpcd \
- $(LOCAL_PATH)/4g_modem/lib64/librk-ril.so:$(TARGET_COPY_OUT_VENDOR)/lib64/librk-ril.so
- else
- PRODUCT_PROPERTY_OVERRIDES += \
- vendor.rild.libpath=/vendor/lib/librk-ril.so
-
- PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/4g_modem/bin32/dhcpcd:$(TARGET_COPY_OUT_VENDOR)/bin/dhcpcd \
- $(LOCAL_PATH)/4g_modem/lib32/librk-ril.so:$(TARGET_COPY_OUT_VENDOR)/lib/librk-ril.so
-
- endif
12更新加载文件点
- \vendor\rockchip\common\phone\phone.mk
- CUR_PATH := vendor/rockchip/common
-
- #########################################################
- # 3G Dongle SUPPORT
- #########################################################
- #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
-
- 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/bin/chat:system/bin/chat \
- + $(CUR_PATH)/phone/lib/libreference-ril-ec20.so:vendor/lib64/libreference-ril-ec20.so \
- + $(CUR_PATH)/phone/etc/ppp/ql-ril.conf:system/etc/ql-ril.conf \
- + $(CUR_PATH)/etc/spn-conf.xml:system/etc/spn-conf.xml
-
- ifeq ($(strip $(BOARD_HAVE_DONGLE)),true)
- PRODUCT_PACKAGES += \
- rild \
- libril-rk29-dataonly \
- usb_dongle \
- usb_modeswitch \
- chat
-
- PRODUCT_PROPERTY_OVERRIDES +=ro.boot.noril=false
- else
- PRODUCT_PROPERTY_OVERRIDES +=ro.boot.noril=true
- endif
-
-
- PRODUCT_PROPERTY_OVERRIDES += \
- keyguard.no_require_sim=true \
- ro.com.android.dataroaming=true \
- ril.function.dataonly=1
.13.修改ril-daemon
- - /hardware/ril/rild/rild.rc
- + /hardware/ril/rild/rild.rc
- @@ -1,5 +1,5 @@
- -service vendor.ril-daemon /vendor/bin/hw/rild
- +service ril-daemon /vendor/bin/hw/rild -l /vendor/lib64/libreference-ril-ec20.so
- class main
- - user radio
- - group radio cache inet misc audio log readproc wakelock
- - capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW
- + user root
- + group radio cache inet misc audio sdcard_rw log
- + capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW
14.指定使用的库,这里没有配,因为前面device.mk已经指定
- - a/device/rockchip/rk356x/device.mk
- + b/device/rockchip/rk356x/device.mk
- @@ -77,6 +77,9 @@ PRODUCT_PROPERTY_OVERRIDES += \
- ro.ril.ecclist=112,911 \
- ro.opengles.version=196610 \
- wifi.interface=wlan0 \
- ro.audio.monitorOrientation=true \
- debug.nfc.fw_download=false \
- debug.nfc.se=false \
- +# ro.telephony.default_network=9 \
- +# rild.libpath=/vendor/lib64/libquectel-ril-ec200t.so \
- +# rild.libargs=-d /dev/ttyUSB2 \
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。