Fix remaining bug of the off-by-one error ;)
[openwrt.git] / target / linux / ixp4xx / patches-2.6.28 / 191-cambria_optional_uart.patch
1 --- a/arch/arm/mach-ixp4xx/cambria-setup.c
2 +++ b/arch/arm/mach-ixp4xx/cambria-setup.c
3 @@ -34,6 +34,7 @@
4 #include <asm/mach/arch.h>
5 #include <asm/mach/flash.h>
6 #include <asm/setup.h>
7 +#include <linux/irq.h>
8
9 struct cambria_board_info {
10 unsigned char *model;
11 @@ -127,6 +128,43 @@ static struct platform_device cambria_ua
12 .resource = &cambria_uart_resource,
13 };
14
15 +static struct resource cambria_optional_uart_resources[] = {
16 + {
17 + .start = 0x52000000,
18 + .end = 0x52000fff,
19 + .flags = IORESOURCE_MEM
20 + },
21 + {
22 + .start = 0x53000000,
23 + .end = 0x53000fff,
24 + .flags = IORESOURCE_MEM
25 + }
26 +};
27 +
28 +static struct plat_serial8250_port cambria_optional_uart_data[] = {
29 + {
30 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_BUGGY_UART,
31 + .iotype = UPIO_MEM,
32 + .regshift = 0,
33 + .uartclk = 1843200,
34 + },
35 + {
36 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_BUGGY_UART,
37 + .iotype = UPIO_MEM,
38 + .regshift = 0,
39 + .uartclk = 1843200,
40 + },
41 + { },
42 +};
43 +
44 +static struct platform_device cambria_optional_uart = {
45 + .name = "serial8250",
46 + .id = PLAT8250_DEV_PLATFORM1,
47 + .dev.platform_data = cambria_optional_uart_data,
48 + .num_resources = 2,
49 + .resource = cambria_optional_uart_resources,
50 +};
51 +
52 static struct resource cambria_pata_resources[] = {
53 {
54 .flags = IORESOURCE_MEM
55 @@ -283,6 +321,19 @@ static void __init cambria_gw23xx_setup(
56
57 static void __init cambria_gw2350_setup(void)
58 {
59 + *IXP4XX_EXP_CS2 = 0xbfff0003;
60 + set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING);
61 + cambria_optional_uart_data[0].mapbase = 0x52FF0000;
62 + cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52FF0000, 0x0fff);
63 + cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3;
64 +
65 + *IXP4XX_EXP_CS3 = 0xbfff0003;
66 + set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING);
67 + cambria_optional_uart_data[1].mapbase = 0x53FF0000;
68 + cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53FF0000, 0x0fff);
69 + cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4;
70 +
71 + platform_device_register(&cambria_optional_uart);
72 platform_device_register(&cambria_npec_device);
73 platform_device_register(&cambria_npea_device);
74
75 @@ -290,10 +341,26 @@ static void __init cambria_gw2350_setup(
76 platform_device_register(&cambria_usb1_device);
77
78 platform_device_register(&cambria_gpio_leds_device);
79 +
80 + *IXP4XX_EXP_CS2 = 0xBFFF3C43;
81 + *IXP4XX_EXP_CS3 = 0xBFFF3C43;
82 }
83
84 static void __init cambria_gw2358_setup(void)
85 {
86 + *IXP4XX_EXP_CS3 = 0xbfff0003;
87 + set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING);
88 + cambria_optional_uart_data[0].mapbase = 0x53FC0000;
89 + cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x53FC0000, 0x0fff);
90 + cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3;
91 +
92 + set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING);
93 + cambria_optional_uart_data[1].mapbase = 0x53F80000;
94 + cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff);
95 + cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4;
96 +
97 + platform_device_register(&cambria_optional_uart);
98 +
99 platform_device_register(&cambria_npec_device);
100 platform_device_register(&cambria_npea_device);
101
This page took 0.057717 seconds and 5 git commands to generate.