linux3.18内核移植到GT2440成功---完善串口
来源:互联网 发布:佳能ip2780清零软件 编辑:程序博客网 时间:2024/05/16 09:35
linux3.18内核移植到GT2440成功---完善串口
在linux3.1.8内核里面只支持 2 个串口,也就是芯片的 UART0 和 UART1,而 UART2 的驱动是针对红外接口的,而不是串口驱动,这里将其修改为串口驱动。
一.修改
1.修改内核源码“arch/arm/mach-s3c2440/mach-smdk2440.c”文件的smdk2440_uartcfgs结构体数组,
将其改为:
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,
},
[2] = {
.hwport = 2,
.flags = 0,
.ucon = 0x3c5,
.ulcon = 0x3, /*修改为3*/
.ufcon = 0x51,
}
};
2.在drivers/tty/serial/samsung.c中
添加头文件:
#include <mach/gpio-fns.h>
#include <mach/regs-gpio.h>
3.在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);
}
添加后为:
static int s3c24xx_serial_startup(struct uart_port *port)
{
struct s3c24xx_uart_port *ourport = to_ourport(port);
int ret;
dbg("s3c24xx_serial_startup: port=%p (%08lx,%p)\n",
port->mapbase, port->membase);
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);
}
rx_enabled(port) = 1;
ret = request_irq(ourport->rx_irq, s3c24xx_serial_rx_chars, 0,
s3c24xx_serial_portname(port), ourport);
if (ret != 0) {
printk(KERN_ERR "cannot get irq %d\n", ourport->rx_irq);
return ret;
}
ourport->rx_claimed = 1;
dbg("requesting tx irq...\n");
tx_enabled(port) = 1;
ret = request_irq(ourport->tx_irq, s3c24xx_serial_tx_chars, 0,
s3c24xx_serial_portname(port), ourport);
if (ret) {
printk(KERN_ERR "cannot get irq %d\n", ourport->tx_irq);
goto err;
}
ourport->tx_claimed = 1;
dbg("s3c24xx_serial_startup ok\n");
/* the port reset code should have done the correct
* register setup for the port controls */
return ret;
err:
s3c24xx_serial_shutdown(port);
return ret;
}
二.配置
Device Drivers --->
Character devices --->
Serial drivers --->
< > 8250/16550 and compatible serial support
│ │ *** Non-8250 serial port support ***
│ │ <*> Samsung SoC serial support
│ │ [ ] Samsung SoC serial debug
│ │ [*] Support for console on Samsung SoC serial port
│ │ < > Samsung S3C2410 Serial port support
│ │ <*> Samsung S3C2440/S3C2442/S3C2416 Serial port support
│ │ < > MAX3100 support
│ │ < > MAX3107 support
│ │ < > Support for timberdale UART
- linux3.18内核移植到GT2440成功---完善串口
- linux3.1.8内核移植到gt2440---CS8900A驱动移植
- linux3.6.5内核移植到S3C6410
- 移植linux3.3内核到ST2410
- 移植Linux3.4.2版本内核到mini2440
- 移植Linux3.4.2版本内核到mini2440
- 移植Linux3.4.2版本内核到mini2440
- linux3.18 内核移植记录(Exynos4412)
- linux3.1内核移植到S3C2416的过程和问题。
- 移植Linux3.4.2版本内核到mini2440(一)
- 移植Linux3.0内核到fl2440开发板
- Linux3.0.1移植YAFFS2 成功
- YAFFS2移植Linux3.0.1 成功
- ok6410最新版linux3内核移植
- Linux3.2.81内核移植(2440)
- YAFFS2移植到linux3.6.7
- alsa 移植到Linux3.0
- linux3.4.2移植到fl2440
- 嵌入式学习笔记(2)——51单片机之开发环境搭建
- ★★★你必须知道二维码知识-如何在QR二维码加上LOGO并建立微门户
- 【jxl】将int型和String型插入excel单元格的方法
- 大数据量时Mysql的优化要点
- Java通过JNDI获取数据源
- linux3.18内核移植到GT2440成功---完善串口
- Google Closure: 糟糕的JavaScript
- 程序写程序 必须要求需求文档
- 计算机基础知识
- ODT .NET 详解之环境搭配
- loj4j的配置跟使用
- Qt自定义插件关闭时崩溃
- [OpenStack] 云计算的前世今生
- DB2中with递归的妙用