GPRS模块--完整的内核修改兼容GPRS模块


前言:

重新梳理了添加GPRS模块的过程,以下对linux3.0内核进行的完整修改,用于兼容GPRS模块的同时,兼容ubifs根文件类型的系统;


在开发板可以跑通linuxrom-s3c2440的基础上进行修改:

[guozhihao@localhost ~]$ cd Desktop/fl2440/linux/linux-3.0        //到源码文件夹下进行修改

[guozhihao@localhost linux-3.0]$ export TERM=vt100                //设置窗口模式

[guozhihao@localhost linux-3.0]$ make menuconfig                //生成菜单

 

以下修改是使内核对ubifs根文件系统支持,进入后:

General setup --->

    [ ]Initial RAM filesysem and RAM disk(initramfs/initrd) support   取消initramfs根文件类型系统启动

Device Drivers  --->

    [*]Memory Technology Device (TMD) support --->

        <*>Enable UBI - Unsorted block images --->            勾选后才有File systems里的ubifs根文件系统的支持

                (4096) UBI wear-leveling threshold (NEW)

                (1)   Percentage of reserved eraseblocks for bad eraseblocks handling (NEW)

                < >   MTD devices emulation driver (gluebi) (NEW)

                [ ]   UBI debugging (NEW)

File systems --->

    [*] Miscellaneous filesystems  --->

        <*>UBIFS file system support                支持ubifs文件系统

        [*]Extended attributes support

        [*]Advanced compression options

        [*]LZO compression support (NEW)

        [*]ZLIB compression support (NEW)

        [ ] Enable debugging support (NEW)

 

以下修改是使内核对GPRS模块的各项功能的支持,还是对Linux3.0进行修改:

Device Drivers  --->

    [*]USB support --->

        <*>USB Serial Converter support --->

            <*>USB Winchiphead CH341 Single Port Serial Driver          勾选后让内核支持ch341驱动(由于我们的GPRS模块是通过串口转的模式usb连接在fl2440上,而且对应的驱动为CH341)  

            <*>USB driver for GSM and CDMA modems        支持GSM和CDMA模块

    

    Charcter devices --->

        <*>GSM MUX line discipline support                        支持GSM(GPRS模块基础)的多路复用



    [*]Network device support --->                                //该选项下有关PPP的全部勾选

        <*>PPP(point-to-point) support                        GPRS模块拨号上网功能需要的内核支持

        .....

        <*>PPP over Ethernet (EXPERIMENTAL)

usb时钟修改:

修改drivers/usb/host/ohci-s3c2410.c

添加头文件#include <mach/regs-clock.h>

static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)

{

    struct s3c2410_hcd_info *info = dev->dev.platform_data;



    unsigned long upllvalue = (0x38 <<12) | (0x02 << 4) | (0x01);    //添加代码

    unsigned long upllvalue1 = (0x38 <<12) | (0x02 << 4) | (0x02);    //添加代码



    dev_dbg(&dev->dev, "s3c2410_start_hc:\n");

   

     __raw_writel(upllvalue, S3C2410_UPLLCON);    //添加代码

    mdelay(20);

    __raw_writel(upllvalue1,S3C2410_UPLLCON);    //添加代码

    mdelay(20);

....

否则不修改会出现这种问题:

编译内核后重新烧入到开发板:

运行效果我们可以通过查看内核运行过程中的打印信息:

~ >: dmesg

......                                        //挂载UBIFS根文件系统的部分内容

UBIFS: mounted UBI device 0, volume 0, name "rootfs"

UBIFS: file system size:   37416960 bytes (36540 KiB, 35 MiB, 290 LEBs)

UBIFS: journal size:       5160960 bytes (5040 KiB, 4 MiB, 40 LEBs)

UBIFS: media format:       w4/r0 (latest is w4/r0)

UBIFS: default compressor: lzo

UBIFS: reserved for root:  0 bytes (0 KiB)

....                                        //模块所需的内核支持

PPP generic driver version 2.4.2

PPP Deflate Compression module registered

PPP BSD Compression module registered

PPP MPPE Compression module registered

USB Serial support registered for GSM modem (1-port)

usbcore: registered new interface driver option

option: v0.7.2:USB Driver for GSM modems

USB Serial support registered for ch341-uart

usbcore: registered new interface driver ch341

当插入/移除GPRS模块之后,内核打印信息:

ch341 1-1.3:1.0: ch341-uart converter detected

usb 1-1.3: ch341-uart converter now attached to ttyUSB0

ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0

ch341 1-1.3:1.0: device disconnected

使用microcom命令测试串口:

~ >: microcom -s 115200 /dev/ttyUSB0

AT

OK

成功添加完毕;

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值