高通平台模块modem增加AT Port和GPS NMEA Port 方法

Posted zhiru20

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了高通平台模块modem增加AT Port和GPS NMEA Port 方法相关的知识,希望对你有一定的参考价值。

1.修改 AP boot
diff --git a/arch/arm/mach-msm/smd_tty.c b/arch/arm/mach-msm/smd_tty.c
index 68e0f41..4903614 100755
--- a/arch/arm/mach-msm/smd_tty.c
+++ b/arch/arm/mach-msm/smd_tty.c
@@ -86,7 +86,7 @@ static struct smd_config smd_configs[] = {
     {5, "APPS_RIVA_ANT_CMD", NULL, SMD_APPS_WCNSS},
     {6, "APPS_RIVA_ANT_DATA", NULL, SMD_APPS_WCNSS},
     {7, "DATA1", NULL, SMD_APPS_MODEM},
-    {11, "DATA11", NULL, SMD_APPS_MODEM},
+    //{11, "DATA11", NULL, SMD_APPS_MODEM},//防止被占用
     {21, "DATA21", NULL, SMD_APPS_MODEM},
     //{27, "GPSNMEA", NULL, SMD_APPS_MODEM},//防止被占用
     {36, "LOOPBACK", "LOOPBACK_TTY", SMD_APPS_MODEM},

2.+++ b/drivers/usb/gadget/u_smd.c
@@ -52,7 +52,7 @@ struct smd_port_info smd_pi[SMD_N_PORTS] = {
         .name = "DS",
     },
     {
-        .name = "UNUSED",
+        .name = "DATA11",//增加SMD AT Port
     },
    {

        .name = "GPSNMEA",//增加SMD Gps Port
     },
3.
修改USB文件,修改前(9025):
echo $mode > /sys/bus/platform/devices/usb_bam/enable

echo 0 > /sys/class/android_usb/android$num/enable

echo 0x9025 > /sys/class/android_usb/android$num/idProduct

echo 0x0221 > /sys/class/android_usb/android$num/idVendor

echo diag > /sys/class/android_usb/android0/f_diag/clients

echo smd,tty > /sys/class/android_usb/android0/f_serial/transports

echo SMD,BAM2BAM > /sys/class/android_usb/android0/f_rmnet/transports

echo diag,adb,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions

echo 1 > /sys/class/android_usb/android$num/enable
修改后:
echo $mode > /sys/bus/platform/devices/usb_bam/enable

echo 0 > /sys/class/android_usb/android$num/enable

echo 0x9025 > /sys/class/android_usb/android$num/idProduct

echo 0x0221 > /sys/class/android_usb/android$num/idVendor

echo diag > /sys/class/android_usb/android0/f_diag/clients

echo smd,tty,smd,smd > /sys/class/android_usb/android0/f_serial/transports

echo SMD,BAM2BAM > /sys/class/android_usb/android0/f_rmnet/transports

echo diag,adb,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions

echo 1 > /sys/class/android_usb/android$num/enable
注,由于驱动顺序问题,最好先增一个VID,同时修改USB Driver驱动文件,同时MI_0 MI顺序与echo顺序一一对应

将修改的文件放入/bin/usb/compositions,(bat脚本)
@echo off
adb shell rm -f boot_hsusb_composition
adb shell ln -s /bin/usb/compositions/9099 boot_hsusb_composition
@echo creat a link 9099 /........
adb shell mv boot_hsusb_composition /bin/usb
@echo mv the new boot_hsusb_composition To /bin/usb ........
adb shell sync
adb reboot
@echo LTE start to reboot, waiting...
@pause
4.MODEM端 AT Port已有初始化;
5.GPS Port(SIO_PORT_SMD_GPS_NMEA),

关闭#define FEATURE_CGPS_LBS_TASK_NMEA_PORT,且修改NV_CGPS_NMEA_CONFIG_INFO_I                     = 5047,为(3(SMD),0);
 

以上是关于高通平台模块modem增加AT Port和GPS NMEA Port 方法的主要内容,如果未能解决你的问题,请参考以下文章

高通平台,AP和CP端相关qmi接口,AT命令,NV等porting目录

高通平台开发系列讲解(PCIE篇)MHI (Modem Host Interface)驱动详解

高通平台开发系列讲解(PCIE篇)MHI (Modem Host Interface)驱动详解

高通平台开发系列讲解(GPS篇)gpsONE 系统架构

高通平台开发系列讲解(GPS篇)gpsONE 系统架构

高通平台开发系列讲解(GPS篇)NMEA数据包解析