在linux-2.6.33.5内核中添加对s3c2410串口2的配置
来源:互联网 发布:java xpath html 编辑:程序博客网 时间:2024/06/06 09:28
这几天,突然发现移植好的s3c2410的串口2在linux系统下竟然不能用,赶紧查了很多资料,发现,若要在linux系统下是用s3c23410的串口2 ,需要修改内核,把s3c2410的串口2配置成普通的串口。
1.修改arch/arm/mach-s3c2440/mach-smdk2440.c中的uart2的配置,修改后如下:
static struct s3c2410_uartcfg smdk2410_uartcfgs[] __initdata = {
[0] = {
.hwport = 0,
.flags = 0,
.ucon = UCON,
.ulcon = ULCON,
.ufcon = UFCON,
},
[1] = {
.hwport = 1,
.flags = 0,
.ucon = UCON,
.ulcon = ULCON,
.ufcon = UFCON,
},
/* IR port */
[2] = {
.hwport = 2,
.flags = 0,
.ucon = 0x3c5,
.ulcon = 0x03,
[0] = {
.hwport = 0,
.flags = 0,
.ucon = UCON,
.ulcon = ULCON,
.ufcon = UFCON,
},
[1] = {
.hwport = 1,
.flags = 0,
.ucon = UCON,
.ulcon = ULCON,
.ufcon = UFCON,
},
/* IR port */
[2] = {
.hwport = 2,
.flags = 0,
.ucon = 0x3c5,
.ulcon = 0x03,
.ufcon = 0x51,
}
2. 在drivers/serial/samsung.c中添加对uart2控制器的配置,配置为普通串口。
}
2. 在drivers/serial/samsung.c中添加对uart2控制器的配置,配置为普通串口。
添加头文件:#include <linux/gpio.h>
#include <mach/regs-gpio.h>
#include <mach/regs-gpio.h>
在static int s3c24xx_serial_startup(struct uart_port *port)函数中,添加
if (port->line == 2) {
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);
}
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.编译内核,下载进板子后,进行测试,串口2终于可以正常工作了。
参考:http://bbs.witech.com.cn/archiver/?tid-468-page-1.html开贴详述linux-2.6.33内核的移植
- 在linux-2.6.33.5内核中添加对s3c2410串口2的配置
- linux 2.6.24.4在S3C2410上的移植(内核配置)(基于GEC2410)
- linux 2.6.22.1内核在s3c2410平台的移植
- linux 2.6.22.1内核在s3c2410平台的移植
- linux 2.6.22.1内核在s3c2410平台的移植
- Linux内核在s3c2410平台的移植
- 移植基于linux-2.6.26.5内核s3c2410触摸屏驱动移植(在make menuconfig时的配置选项位置)
- S3C2410 & Linux 2.6 内核
- linux内核对S3C2410睡眠模式的支持
- linux内核对S3C2410睡眠模式的支持
- linux内核对S3C2410睡眠模式的支持
- linux内核对S3C2410睡眠模式的支持
- linux内核对S3C2410睡眠模式的支持
- linux内核对S3C2410睡眠模式的支持
- linux内核对S3C2410睡眠模式的支持
- linux内核对S3C2410睡眠模式的支持
- linux内核对S3C2410睡眠模式的支持
- S3C2410的WINCE BSP添加串口支持
- C++全局对象的析构函数有时候没有被调用?非也!(编译器为VC++6.0)
- Archlinux上fcitx怎麼才能輸入正體中文
- 1096最小生成树
- The Android University ACM Team Selection Contest
- 省赛2D题
- 在linux-2.6.33.5内核中添加对s3c2410串口2的配置
- undefined reference to错误的解决方法
- fstab修改有误导致无法启动的解决方法
- J2EE (三) Filter详解
- C++ 智能指针详解
- jshoper3x在线商城系统更新说明及未来开发计划
- ARP协议分析
- ubuntu快捷键
- 白话数字签名(番外篇)——签名EXE文件(上)