[RK3128][Android 6.0] 3G模块调试



硬件平台:RK3128
Android版本:6.0
Kernel版本:3.10.92
模块名:UC-15 3G模块

一、驱动配置:


1、添加PID,VID。

修改kernel/drivers/usb/serial/option.c,添加:

{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9090)}, //UC-15

2、上电使能:
Dts中添加:
    5v_power_en {
        compatible = "5v_en";
        3gpower,pin =<&gpio2 GPIO_A2 GPIO_ACTIVE_LOW>;
        3gen,pin =<&gpio0 GPIO_D6 GPIO_ACTIVE_HIGH>;
        status = "okay";//okay
    };
然后添加misc驱动以便在开机时上电和使能模块。

3、USB和PPP配置
这一块平台默认都是打开的,没开的可以开下,如下:
Device Drivers  --->
[*] USB support  --->
      <*>     USB Modem (CDC ACM) support
      <*>   USB Serial Converter support  --->
            [*]   USB Generic Serial Driver
      <*>   USB driver for GSM and CDMA modems

PPP配置:
Device Drivers  --->
[*] Network device support  --->
       <*>   PPP (point-to-point protocol) support
       <*>     PPP Deflate compression
       <*>     PPP support for async serial ports
       <*>     PPP support for sync tty ports

二、RIL库
将厂家提供的RIL源码复制到hardware/ril/ 下,需要注意,在rk3128 android6.0源码下,有hardware/ril/librilutils/proto这样一个文件夹,这个系统要用到,所以需要保留hardware/ril/librilutils/Android.mk中proto的相关内容,不然会编译不过。

三、系统配置

1、修改system/core/rootdir/init.rc,添加:

service ril-daemon /system/bin/rild -l /system/lib/libreference-ril.so
    class main
    socket rild stream 660 root radio
    socket sap_uim_socket1 stream 660 bluetooth bluetooth
    socket rild-debug stream 660 radio system
    user root
    group radio cache inet misc audio log

启动服务是在rockchip/common/init.rk30board.rc:
on property:ro.boot.baseband=N/A
    setprop ro.radio.noril false
    start ril-daemon

2、修改device/rockchip/rk312x/system.prop:
rild.libpath=/system/lib/libreference-ril.so
rild.libargs=-d /dev/ttyUSB0

3、添加权限
修改device/rockchip/common/ueventd.rockchip.rc,添加:
# for radio
/dev/ttyUSB0              0660   radio      radio
/dev/ttyUSB1              0660   radio      radio
/dev/ttyUSB2              0660   radio      radio
/dev/ttyUSB3              0660   radio      radio
/dev/ttyUSB4              0660   radio      radio

四、注意事项

1、模块挂载成功后,内核会有如下log输出:
[    5.382480] usb 1-1.1: New USB device found, idVendor=05c6, idProduct=9090
[    5.382520] usb 1-1.1: New USB device strings: Mfr=3, Product=2, SerialNumber=4
[    5.382547] usb 1-1.1: Product: UMTS/HSPA Module
[    5.382569] usb 1-1.1: Manufacturer: Quectel, Incorporated
[    5.479168] option 1-1.1:1.0: GSM modem (1-port) converter detected
[    5.480514] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0
[    5.481647] option 1-1.1:1.1: GSM modem (1-port) converter detected
[    5.482896] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1
[    5.484041] option 1-1.1:1.2: GSM modem (1-port) converter detected
[    5.488255] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2
[    5.489471] option 1-1.1:1.3: GSM modem (1-port) converter detected
[    5.507673] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB3
[    5.508908] option 1-1.1:1.4: GSM modem (1-port) converter detected
[    5.510120] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB4

如果没有,请检查上电和使能脚控制是否正确,PID,VID是否正确添加。

2、通过adb查看服务是否启动:
shell@rk312x:/ $ ps | grep rild
ps | grep rild
root      177   1     7200   1468  hrtimer_na 00000000 S /system/bin/rild
说明服务启动。
如果没有启动,先查看以下两个文件是否存在:
out/target/product/rk312x/system/bin/rild
out/target/product/rk312x/system/lib/libreference-ril.so
以及启动服务脚本是否运行。

你可能感兴趣的:(Rockchip)