linux内核配置问题----完善串口驱动
linux内核配置问题----完善串口驱动中,在drivers/serial/samsung.c中第53行添加以下内容:#include<mach/rehs-gpio.h>
其中rehs-gpio.h是内核原有的还是天嵌编写的?
我按照做了,但是编译时出现:
CC drivers/serial/serial_core.o
CC drivers/serial/samsung.o
drivers/serial/samsung.c: In function 's3c24xx_serial_startup':
drivers/serial/samsung.c:434: error: implicit declaration of function 's3c2410_gpio_cfgpin'
drivers/serial/samsung.c:434: error: 'S3C2410_GPH6' undeclared (first use in this function)
drivers/serial/samsung.c:434: error: (Each undeclared identifier is reported only once
drivers/serial/samsung.c:434: error: for each function it appears in.)
drivers/serial/samsun
g.c:435: error: implicit declaration of function 's3c2410_gpio_pullup'
drivers/serial/samsung.c:436: error: 'S3C2410_GPH7' undeclared (first use in this function)
make: *** Error 1
make: *** Error 2
make: *** Error 2
请问下是什么原因,需要重新定义'S3C2410_GPH7' 'S3C2410_GPH6'吗???? 哪个内核版本?肯定是因为忘记添加头文件了。 1# vanlos
#include<mach/rehs-gpio.h>
不知道是你copy贴上来的还是手写输入有误。
我只知道有 regs-gpio.h 而不是 rehs-gpio.h 3# embedsky_lxt
手写错误,是regs-gpio.h,你知道在2.6.30.4中在那个文件夹中吗?! 2# machoe
内核版本为2.6.35.7,应该是没有这个头文件,不知道在天嵌的2.6.30.4内核中在那个文件夹下? 5# vanlos
这些IO定义确实是在 mach/regs-gpio.h 中的。
而这些引脚设置IO函数是在
arch/arm/plat-s3c24xx/gpio.c 6# embedsky_lxt
发现问题了,在2.6.35.7中regs-gpio.h定义如下:
#define S3C2410_GPH6_TXD2 (0x02 << 12)
#define S3C2416_GPH6_TXD3 (0x02 << 12)
#define S3C2410_GPH6_nRTS1(0x03 << 12)
#define S3C2416_GPH6_nRTS2(0x03 << 12)
#define S3C2410_GPH7_RXD2 (0x02 << 14)
#define S3C2416_GPH7_RXD3 (0x02 << 14)
#define S3C2410_GPH7_nCTS1(0x03 << 14)
#define S3C2416_GPH7_nCTS2(0x03 << 14)
而在2.6.30.4中regs-gpio.h定义如下:
#define S3C2410_GPH6 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 6)
#define S3C2410_GPH6_INP (0x00 << 12)
#define S3C2410_GPH6_OUTP (0x01 << 12)
#define S3C2410_GPH6_TXD2 (0x02 << 12)
#define S3C2410_GPH6_nRTS1(0x03 << 12)
#define S3C2410_GPH7 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 7)
#define S3C2410_GPH7_INP (0x00 << 14)
#define S3C2410_GPH7_OUTP (0x01 << 14)
#define S3C2410_GPH7_RXD2 (0x02 << 14)
#define S3C2410_GPH7_nCTS1(0x03 << 14)
请问下,这是版本不同定义方式不同的问题,还是天嵌修改过的?? 6# embedsky_lxt
并且在2.6.35.7中 s3c2410_gpio_cfgpin函数,那么我在设置TXD2和RXD2时就只需要:
if (port->line == 2) {
s3c2410_gpio_pullup(S3C2410_GPH6_TXD2, 1);
s3c2410_gpio_pullup(S3C2410_GPH7_RXD2, 1);
}
不需要再使用s3c2410_gpio_cfgpin函数让S3C2410_GPH6指向S3C2410_GPH6_TXD2了吧? 6# embedsky_lxt
按照以上想法改过来之后,出现drivers/serial/samsung.c:434: error: implicit declaration of function 's3c2410_gpio_pullup' 问题已成功解决,感谢两位版主! 其实这个问题我已经在我写的移植教程中2.6.35中写过了,可能你没看到 楼主 请教这part如何修改 是2.6.30.4的 根据手册上做 也是这个错误 请教 我也是这个问题!请教管理员!
页:
[1]