一,移植环境
(红色粗字体字为修改后内容,蓝色粗体字为特别注意内容)
1.主机环境:Virtualbox 下ubuntu-10.10
2.编译编译环境:arm-linux-gcc v4.4.3
3.uboot : U-Boot 1.3.4(友坚提供)
4.linux内核版本:2.6.21.5
5.硬件平台:采用友坚UT2416CV02核心板开发的平台
6.参考:
linux内核支持S3C2416的UART3 (http://www.itkee.com/os/detail-1677.html )
S3C2416 User's Manual, Revision 1.10
二,添加UART3
S3C2416支持4个UART,但友坚给出的内核只支持3个UART(ttySAC0,ttySAC1,ttySAC2),而不支持UART3 及 ttySAC3。下面介绍在友坚给出的内核基础上实现UART3。
1.添加UART3的资源设置
<1>. 打开 kernel2416/arch/arm/plat-s3c24xx/devs.c ,定位到113行附近,更改如下:
/*
#if defined (CONFIG_CPU_S3C6400) || defined (CONFIG_CPU_S3C6410)
static struct resource s3c_uart3_resource[] = {
[0] = {
.start = S3C2443_PA_UART3,
.end = S3C2443_PA_UART3 + 0x3ff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_UART3,
.end = IRQ_UART3,
.flags = IORESOURCE_IRQ,
}
};
#endif
** change by bobee, 2012-03-8 */
static struct resource s3c2410_uart3_resource[] = {
[0] = {
.start = S3C2443_PA_UART3,
.end = S3C2443_PA_UART3 + 0x3fff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_S3CUART_RX3,
.end = IRQ_S3CUART_ERR3,
.flags = IORESOURCE_IRQ,
}
};
<2>. 定位到157行附近,
#if defined (CONFIG_CPU_S3C6400) || defined (CONFIG_CPU_S3C6410) || defined (CONFIG_CPU_S3C2416)
[3] = {
.resources = s3c2410_uart3_resource,
.nr_resources = ARRAY_SIZE(s3c2410_uart3_resource),
},
#endif
<3>. 定位到179行附近,
#if defined (CONFIG_CPU_S3C6400) || defined (CONFIG_CPU_S3C6410) || defined (CONFIG_CPU_S3C2416)// add by bobee, 2011-03-08
static struct platform_device s3c24xx_uart_device3 = {
.id = 3,
};
#endif
<4>. 定位到189行附近,
#if defined (CONFIG_CPU_S3C6400) || defined (CONFIG_CPU_S3C6410) || defined (CONFIG_CPU_S3C2416) // add by bobee, 2011-03-08
&s3c24xx_uart_device3,
#endif
2.添加UART3的默认配置
打开