diff options
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-rw-r--r-- | arch/arm/mach-omap2/serial.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 54dfeb5d5667..2e17b57f5b23 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -24,10 +24,10 @@ | |||
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | 26 | ||
27 | #include <mach/common.h> | 27 | #include <plat/common.h> |
28 | #include <mach/board.h> | 28 | #include <plat/board.h> |
29 | #include <mach/clock.h> | 29 | #include <plat/clock.h> |
30 | #include <mach/control.h> | 30 | #include <plat/control.h> |
31 | 31 | ||
32 | #include "prm.h" | 32 | #include "prm.h" |
33 | #include "pm.h" | 33 | #include "pm.h" |
@@ -73,7 +73,6 @@ static LIST_HEAD(uart_list); | |||
73 | 73 | ||
74 | static struct plat_serial8250_port serial_platform_data0[] = { | 74 | static struct plat_serial8250_port serial_platform_data0[] = { |
75 | { | 75 | { |
76 | .membase = OMAP2_IO_ADDRESS(OMAP_UART1_BASE), | ||
77 | .mapbase = OMAP_UART1_BASE, | 76 | .mapbase = OMAP_UART1_BASE, |
78 | .irq = 72, | 77 | .irq = 72, |
79 | .flags = UPF_BOOT_AUTOCONF, | 78 | .flags = UPF_BOOT_AUTOCONF, |
@@ -87,7 +86,6 @@ static struct plat_serial8250_port serial_platform_data0[] = { | |||
87 | 86 | ||
88 | static struct plat_serial8250_port serial_platform_data1[] = { | 87 | static struct plat_serial8250_port serial_platform_data1[] = { |
89 | { | 88 | { |
90 | .membase = OMAP2_IO_ADDRESS(OMAP_UART2_BASE), | ||
91 | .mapbase = OMAP_UART2_BASE, | 89 | .mapbase = OMAP_UART2_BASE, |
92 | .irq = 73, | 90 | .irq = 73, |
93 | .flags = UPF_BOOT_AUTOCONF, | 91 | .flags = UPF_BOOT_AUTOCONF, |
@@ -101,7 +99,6 @@ static struct plat_serial8250_port serial_platform_data1[] = { | |||
101 | 99 | ||
102 | static struct plat_serial8250_port serial_platform_data2[] = { | 100 | static struct plat_serial8250_port serial_platform_data2[] = { |
103 | { | 101 | { |
104 | .membase = OMAP2_IO_ADDRESS(OMAP_UART3_BASE), | ||
105 | .mapbase = OMAP_UART3_BASE, | 102 | .mapbase = OMAP_UART3_BASE, |
106 | .irq = 74, | 103 | .irq = 74, |
107 | .flags = UPF_BOOT_AUTOCONF, | 104 | .flags = UPF_BOOT_AUTOCONF, |
@@ -116,7 +113,6 @@ static struct plat_serial8250_port serial_platform_data2[] = { | |||
116 | #ifdef CONFIG_ARCH_OMAP4 | 113 | #ifdef CONFIG_ARCH_OMAP4 |
117 | static struct plat_serial8250_port serial_platform_data3[] = { | 114 | static struct plat_serial8250_port serial_platform_data3[] = { |
118 | { | 115 | { |
119 | .membase = OMAP2_IO_ADDRESS(OMAP_UART4_BASE), | ||
120 | .mapbase = OMAP_UART4_BASE, | 116 | .mapbase = OMAP_UART4_BASE, |
121 | .irq = 70, | 117 | .irq = 70, |
122 | .flags = UPF_BOOT_AUTOCONF, | 118 | .flags = UPF_BOOT_AUTOCONF, |
@@ -159,8 +155,6 @@ static inline void __init omap_uart_reset(struct omap_uart_state *uart) | |||
159 | 155 | ||
160 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) | 156 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) |
161 | 157 | ||
162 | static int enable_off_mode; /* to be removed by full off-mode patches */ | ||
163 | |||
164 | static void omap_uart_save_context(struct omap_uart_state *uart) | 158 | static void omap_uart_save_context(struct omap_uart_state *uart) |
165 | { | 159 | { |
166 | u16 lcr = 0; | 160 | u16 lcr = 0; |
@@ -539,7 +533,7 @@ static inline void omap_uart_idle_init(struct omap_uart_state *uart) {} | |||
539 | #define DEV_CREATE_FILE(dev, attr) | 533 | #define DEV_CREATE_FILE(dev, attr) |
540 | #endif /* CONFIG_PM */ | 534 | #endif /* CONFIG_PM */ |
541 | 535 | ||
542 | static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = { | 536 | static struct omap_uart_state omap_uart[] = { |
543 | { | 537 | { |
544 | .pdev = { | 538 | .pdev = { |
545 | .name = "serial8250", | 539 | .name = "serial8250", |
@@ -589,12 +583,22 @@ void __init omap_serial_early_init(void) | |||
589 | * if not needed. | 583 | * if not needed. |
590 | */ | 584 | */ |
591 | 585 | ||
592 | for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { | 586 | for (i = 0; i < ARRAY_SIZE(omap_uart); i++) { |
593 | struct omap_uart_state *uart = &omap_uart[i]; | 587 | struct omap_uart_state *uart = &omap_uart[i]; |
594 | struct platform_device *pdev = &uart->pdev; | 588 | struct platform_device *pdev = &uart->pdev; |
595 | struct device *dev = &pdev->dev; | 589 | struct device *dev = &pdev->dev; |
596 | struct plat_serial8250_port *p = dev->platform_data; | 590 | struct plat_serial8250_port *p = dev->platform_data; |
597 | 591 | ||
592 | /* | ||
593 | * Module 4KB + L4 interconnect 4KB | ||
594 | * Static mapping, never released | ||
595 | */ | ||
596 | p->membase = ioremap(p->mapbase, SZ_8K); | ||
597 | if (!p->membase) { | ||
598 | printk(KERN_ERR "ioremap failed for uart%i\n", i + 1); | ||
599 | continue; | ||
600 | } | ||
601 | |||
598 | sprintf(name, "uart%d_ick", i+1); | 602 | sprintf(name, "uart%d_ick", i+1); |
599 | uart->ick = clk_get(NULL, name); | 603 | uart->ick = clk_get(NULL, name); |
600 | if (IS_ERR(uart->ick)) { | 604 | if (IS_ERR(uart->ick)) { |
@@ -631,7 +635,7 @@ void __init omap_serial_init(void) | |||
631 | { | 635 | { |
632 | int i; | 636 | int i; |
633 | 637 | ||
634 | for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { | 638 | for (i = 0; i < ARRAY_SIZE(omap_uart); i++) { |
635 | struct omap_uart_state *uart = &omap_uart[i]; | 639 | struct omap_uart_state *uart = &omap_uart[i]; |
636 | struct platform_device *pdev = &uart->pdev; | 640 | struct platform_device *pdev = &uart->pdev; |
637 | struct device *dev = &pdev->dev; | 641 | struct device *dev = &pdev->dev; |