【imx6ul】SIM7600CE 4G模块在imx6ul linux4.15上拨号上网

1、增加USB Serial内核驱动

CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_SERIAL_OPTION=y

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 204cd83..a8a80c7 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -96,6 +96,10 @@ static void option_instat_callback(struct urb *urb);

 #define NOVATELWIRELESS_VENDOR_ID              0x1410

+#define        SIMCOM_SIM7600_VID      0x1E0E
+
+#define        SIMCOM_SIM7600_PID      0x9001
+
 /* YISO PRODUCTS */

 #define YISO_VENDOR_ID                         0x0EAB
@@ -533,6 +537,9 @@ static const struct option_blacklist_info alcatel_x200_blacklist = {
        .sendsetup = BIT(0) | BIT(1),
        .reserved = BIT(4),
 };
+static const struct option_blacklist_info simcom_sim7600_blacklist = {
+       .reserved = BIT(5),
+};

 static const struct option_blacklist_info zte_0037_blacklist = {
        .sendsetup = BIT(0) | BIT(1),
@@ -675,6 +682,8 @@ static const struct usb_device_id option_ids[] = {
                .driver_info = (kernel_ulong_t) &net_intf1_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
+       { USB_DEVICE(SIMCOM_SIM7600_VID, SIMCOM_SIM7600_PID),
+               .driver_info = (kernel_ulong_t) &simcom_sim7600_blacklist },
        { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff, 0xff) },
        { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x01) },
        { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x01, 0x02) },

添加成功后,将打印如下信息:

usb 1-1.4: new high-speed USB device number 5 using ci_hdrc
option 1-1.4:1.0: GSM modem (1-port) converter detected
usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1.4:1.1: GSM modem (1-port) converter detected
usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB1
option 1-1.4:1.2: GSM modem (1-port) converter detected
usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB2
option 1-1.4:1.3: GSM modem (1-port) converter detected
usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB3
option 1-1.4:1.4: GSM modem (1-port) converter detected
usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB4
option 1-1.4:1.6: GSM modem (1-port) converter detected
usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB5

2、增加USN NDIS NET相关驱动

CONFIG_USBNET=y

同时编译sim7500_sim7600_wwan.c驱动,加载驱动后,成功提示:

simcom_wwan 1-1.4:1.5 wwan0: register 'simcom_wwan' at usb-ci_hdrc.1-1.4, SIMCOM wwan/QMI device, 0a:75:ad:60:5d:d6
usbcore: registered new interface driver simcom_wwan

注意不要使用linux4.15内核自带的qmi wwan驱动,虽然该驱动同样会正常提示打印出wwan0网卡,但是在拨号的时候总是不成功。

产生wwan0网卡:

【imx6ul】SIM7600CE 4G模块在imx6ul linux4.15上拨号上网_第1张图片

3、拨号上网

echo "AT\$QCRMCALL=1,1" > /dev/ttyUSB3 #拨号上网
udhcpc -i wwan0  #获取ip
ping 8.8.8.8    #ping外网测试

【imx6ul】SIM7600CE 4G模块在imx6ul linux4.15上拨号上网_第2张图片

你可能感兴趣的:(imx6ul)