linux 串口 cts,S3C2440 UART2被配置为CTS问题解决

Linux内核默认把uart2的功能设置为nRTS1、nTCTS1,没有作为正常串口使用,如果我们想要将uart2作为串口,需要做以下修改:linux2.6内核将GPHCON寄存器的值置为0x16faaa就是说GPH6被设置为nRTS1,GPH7被设置为nCTS1,此时,串口2是无法收发数据的。

1、修改arch/arm/mach-s3c2440/mach-smdk2440.c中的uart2的配置,修改后如下:

static struct s3c2410_uartcfg smdk2440_uartcfgs[] __initdata = {

[0] = {

.hwport           = 0,

.flags            = 0,

.ucon             = 0x3c5,

.ulcon            = 0x03,

.ufcon            = 0x51,

},

[1] = {

.hwport           = 1,

.flags            = 0,

.ucon             = 0x3c5,

.ulcon            = 0x03,

.ufcon            = 0x51,

},

/* IR port */

[2] = {

.hwport             = 2,

.flags             = 0,

.ucon             = 0x3c5,

.ulcon             = 0x03,/*old0x43*/

.ufcon             = 0x51,

}

};

2、vi drivers/serial/samsung.c

//增加以下头文件

#include

#include

在static int s3c24xx_serial_startup(struct uart_port *port)函数最后,添加

s3c2410_gpio_cfgpin(S3C2410_GPH(6), S3C2410_GPH6_TXD2);

s3c2410_gpio_pullup(S3C2410_GPH(6), 1);

s3c2410_gpio_cfgpin(S3C2410_GPH(7), S3C2410_GPH7_RXD2);

s3c2410_gpio_pullup(S3C2410_GPH(7), 1);

3、重新编译zImage下载进开发板即可0b1331709591d260c1c78e86d0c51c18.png

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值