S3C2440 UART2被配置为CTS问题处理
发布时间:2021-12-22 11:32:24 所属栏目:PHP教程 来源:互联网
导读:Linux内核默认把uart2的功能设置为nRTS1、nTCTS1,没有作为正常串口使用,如果我们想要将uart2作为串口,需要做以下修改:linux2.6内核将GPHCON寄存器的值置为0x16faaa就是说GPH6被设置为nRTS1,GPH7被设置为nCTS1,此时,串口2是无法收发数据的。 1、修改ar
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 <linux/gpio.h> #include <mach/regs-gpio.h> 在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下载进开发板即可 ![]() (编辑:应用网_丽江站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |