8 个解决方案
#1
才20分
要修改驱动,不过还的看你硬件到底能不能做好,20分就这么点,还有细节不说...
要修改驱动,不过还的看你硬件到底能不能做好,20分就这么点,还有细节不说...
#2
....哥们分不多 最高也只给过40分而已 而且这个问题不是应该很简单吗? 做过的人应该很多吧
#3
42
43 static struct uart_port serial_platform_data[] = {
44 {
45 .membase = (unsigned char __iomem *)IO_ADDRESS(DAVINCI_UART0_BASE),
46 .mapbase = (unsigned long)DAVINCI_UART0_BASE,
47 .iotype = UPIO_MEM,
48 .irq = IRQ_UARTINT0,
49 .uartclk = 27000000,
50 .regshift = 2,
51 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
52 .line = 0,
53 },
54 {
55 .membase = (unsigned char __iomem *)IO_ADDRESS(DAVINCI_UART1_BASE),
56 .mapbase = (unsigned long)DAVINCI_UART1_BASE,
57 .iotype = UPIO_MEM,
58 .irq = IRQ_UARTINT1,
59 .uartclk = 27000000,
60 .regshift = 2,
61 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
62 .line = 1,
63 }
64
65 };
66
67 /*
68 * Just setup the initial console rest is taken care by the
69 * Linux 8250 serial driver
70 */
71 void davinci_serial_init(void)
72 {
73 #ifdef CONFIG_SERIAL_8250
74 early_serial_setup(&serial_platform_data[0]);
75 early_serial_setup(&serial_platform_data[1]);
76 #endif
77 }
我用的是davinci平台,开始只有一个串口,后面添加了一个,你也可以添加第三第四个,这个文件在
arch/arm/你的板子型号/servial.c下面,43行到65行做资源动态映射,在做硬件的时候要分配46行DAVINCI_UART0_BASE的物理地址,然后做驱动的时候还的分配47行 IRQ_UARTINT0中断号,如果实在没有可以几个串口共享同一个中断号,我最多看别人8个共享同一中断号,后面75行就是注册了.
#4
#5
...。谢谢这么点分你还回复 助人为乐的心情很高兴吧 我试下 结了给你分
#6
哥们 不给力啊 我都没有这个文件。。。
#7
arch/arm/mach-s3c6410/mach-smdk6410.c 看看这个下面有没得
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,
},
[2] = {
.hwport = 2,
.flags = 0,
.ucon = UCON,
.ulcon = ULCON,
.ufcon = UFCON,
}
};
static struct platform_device *smdk2410_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_iis,
};
static void __init smdk2410_map_io(void)
{
s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
s3c24xx_set_board(&smdk2410_board);
}
#8
static struct s3c2410_uartcfg smdk6410_uartcfgs[] = {
[0] = {
.hwport = 0,
.flags = 0,
.ucon = DEF_UCON,
.ulcon = DEF_ULCON,
.ufcon = DEF_UFCON,
.clocks = smdk6410_serial_clocks,
.clocks_size = ARRAY_SIZE(smdk6410_serial_clocks),
},
[1] = {
.hwport = 1,
.flags = 0,
.ucon = DEF_UCON,
.ulcon = DEF_ULCON,
.ufcon = DEF_UFCON,
.clocks = smdk6410_serial_clocks,
.clocks_size = ARRAY_SIZE(smdk6410_serial_clocks),
},
[2] = {
.hwport = 2,
.flags = 0,
.ucon = DEF_UCON,
.ulcon = DEF_ULCON,
.ufcon = DEF_UFCON,
.clocks = smdk6410_serial_clocks,
.clocks_size = ARRAY_SIZE(smdk6410_serial_clocks),
},
[3] = {
.hwport = 3,
.flags = 0,
.ucon = DEF_UCON,
.ulcon = DEF_ULCON,
.ufcon = DEF_UFCON,
.clocks = smdk6410_serial_clocks,
.clocks_size = ARRAY_SIZE(smdk6410_serial_clocks),
}
};
是这个样子的 DEF_UCON
然后怎么?
#1
才20分
要修改驱动,不过还的看你硬件到底能不能做好,20分就这么点,还有细节不说...
要修改驱动,不过还的看你硬件到底能不能做好,20分就这么点,还有细节不说...
#2
....哥们分不多 最高也只给过40分而已 而且这个问题不是应该很简单吗? 做过的人应该很多吧
#3
42
43 static struct uart_port serial_platform_data[] = {
44 {
45 .membase = (unsigned char __iomem *)IO_ADDRESS(DAVINCI_UART0_BASE),
46 .mapbase = (unsigned long)DAVINCI_UART0_BASE,
47 .iotype = UPIO_MEM,
48 .irq = IRQ_UARTINT0,
49 .uartclk = 27000000,
50 .regshift = 2,
51 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
52 .line = 0,
53 },
54 {
55 .membase = (unsigned char __iomem *)IO_ADDRESS(DAVINCI_UART1_BASE),
56 .mapbase = (unsigned long)DAVINCI_UART1_BASE,
57 .iotype = UPIO_MEM,
58 .irq = IRQ_UARTINT1,
59 .uartclk = 27000000,
60 .regshift = 2,
61 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
62 .line = 1,
63 }
64
65 };
66
67 /*
68 * Just setup the initial console rest is taken care by the
69 * Linux 8250 serial driver
70 */
71 void davinci_serial_init(void)
72 {
73 #ifdef CONFIG_SERIAL_8250
74 early_serial_setup(&serial_platform_data[0]);
75 early_serial_setup(&serial_platform_data[1]);
76 #endif
77 }
我用的是davinci平台,开始只有一个串口,后面添加了一个,你也可以添加第三第四个,这个文件在
arch/arm/你的板子型号/servial.c下面,43行到65行做资源动态映射,在做硬件的时候要分配46行DAVINCI_UART0_BASE的物理地址,然后做驱动的时候还的分配47行 IRQ_UARTINT0中断号,如果实在没有可以几个串口共享同一个中断号,我最多看别人8个共享同一中断号,后面75行就是注册了.
#4
#5
...。谢谢这么点分你还回复 助人为乐的心情很高兴吧 我试下 结了给你分
#6
哥们 不给力啊 我都没有这个文件。。。
#7
arch/arm/mach-s3c6410/mach-smdk6410.c 看看这个下面有没得
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,
},
[2] = {
.hwport = 2,
.flags = 0,
.ucon = UCON,
.ulcon = ULCON,
.ufcon = UFCON,
}
};
static struct platform_device *smdk2410_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_iis,
};
static void __init smdk2410_map_io(void)
{
s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
s3c24xx_set_board(&smdk2410_board);
}
#8
static struct s3c2410_uartcfg smdk6410_uartcfgs[] = {
[0] = {
.hwport = 0,
.flags = 0,
.ucon = DEF_UCON,
.ulcon = DEF_ULCON,
.ufcon = DEF_UFCON,
.clocks = smdk6410_serial_clocks,
.clocks_size = ARRAY_SIZE(smdk6410_serial_clocks),
},
[1] = {
.hwport = 1,
.flags = 0,
.ucon = DEF_UCON,
.ulcon = DEF_ULCON,
.ufcon = DEF_UFCON,
.clocks = smdk6410_serial_clocks,
.clocks_size = ARRAY_SIZE(smdk6410_serial_clocks),
},
[2] = {
.hwport = 2,
.flags = 0,
.ucon = DEF_UCON,
.ulcon = DEF_ULCON,
.ufcon = DEF_UFCON,
.clocks = smdk6410_serial_clocks,
.clocks_size = ARRAY_SIZE(smdk6410_serial_clocks),
},
[3] = {
.hwport = 3,
.flags = 0,
.ucon = DEF_UCON,
.ulcon = DEF_ULCON,
.ufcon = DEF_UFCON,
.clocks = smdk6410_serial_clocks,
.clocks_size = ARRAY_SIZE(smdk6410_serial_clocks),
}
};
是这个样子的 DEF_UCON
然后怎么?