aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2009-10-16 12:53:00 -0400
committerTony Lindgren <tony@atomide.com>2009-10-16 12:53:00 -0400
commit84f90c9cc81d8db172d4f768fc4010f508897366 (patch)
tree22dc6c2d0ea698e4e16651f14840e409fa7da5d5
parenta2bb28a0dbcc1370104a543d25eb28aab81d4a91 (diff)
omap: Change low-level serial init to use ioremap
Change low-level serial init to use ioremap Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap1/serial.c11
-rw-r--r--arch/arm/mach-omap2/serial.c14
2 files changed, 18 insertions, 7 deletions
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index ed07af109f00..cab41713fce2 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -64,7 +64,6 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
64 64
65static struct plat_serial8250_port serial_platform_data[] = { 65static struct plat_serial8250_port serial_platform_data[] = {
66 { 66 {
67 .membase = OMAP1_IO_ADDRESS(OMAP_UART1_BASE),
68 .mapbase = OMAP_UART1_BASE, 67 .mapbase = OMAP_UART1_BASE,
69 .irq = INT_UART1, 68 .irq = INT_UART1,
70 .flags = UPF_BOOT_AUTOCONF, 69 .flags = UPF_BOOT_AUTOCONF,
@@ -73,7 +72,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
73 .uartclk = OMAP16XX_BASE_BAUD * 16, 72 .uartclk = OMAP16XX_BASE_BAUD * 16,
74 }, 73 },
75 { 74 {
76 .membase = OMAP1_IO_ADDRESS(OMAP_UART2_BASE),
77 .mapbase = OMAP_UART2_BASE, 75 .mapbase = OMAP_UART2_BASE,
78 .irq = INT_UART2, 76 .irq = INT_UART2,
79 .flags = UPF_BOOT_AUTOCONF, 77 .flags = UPF_BOOT_AUTOCONF,
@@ -82,7 +80,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
82 .uartclk = OMAP16XX_BASE_BAUD * 16, 80 .uartclk = OMAP16XX_BASE_BAUD * 16,
83 }, 81 },
84 { 82 {
85 .membase = OMAP1_IO_ADDRESS(OMAP_UART3_BASE),
86 .mapbase = OMAP_UART3_BASE, 83 .mapbase = OMAP_UART3_BASE,
87 .irq = INT_UART3, 84 .irq = INT_UART3,
88 .flags = UPF_BOOT_AUTOCONF, 85 .flags = UPF_BOOT_AUTOCONF,
@@ -126,6 +123,14 @@ void __init omap_serial_init(void)
126 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 123 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
127 unsigned char reg; 124 unsigned char reg;
128 125
126 /* Static mapping, never released */
127 serial_platform_data[i].membase =
128 ioremap(serial_platform_data[i].mapbase, SZ_2K);
129 if (!serial_platform_data[i].membase) {
130 printk(KERN_ERR "Could not ioremap uart%i\n", i);
131 continue;
132 }
133
129 switch (i) { 134 switch (i) {
130 case 0: 135 case 0:
131 uart1_ck = clk_get(NULL, "uart1_ck"); 136 uart1_ck = clk_get(NULL, "uart1_ck");
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index ae2186892c85..a1949d4262cd 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -73,7 +73,6 @@ static LIST_HEAD(uart_list);
73 73
74static struct plat_serial8250_port serial_platform_data0[] = { 74static 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
88static struct plat_serial8250_port serial_platform_data1[] = { 87static 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
102static struct plat_serial8250_port serial_platform_data2[] = { 100static 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,
@@ -126,7 +123,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
126#ifdef CONFIG_ARCH_OMAP4 123#ifdef CONFIG_ARCH_OMAP4
127static struct plat_serial8250_port serial_platform_data3[] = { 124static struct plat_serial8250_port serial_platform_data3[] = {
128 { 125 {
129 .membase = OMAP2_IO_ADDRESS(OMAP_UART4_BASE),
130 .mapbase = OMAP_UART4_BASE, 126 .mapbase = OMAP_UART4_BASE,
131 .irq = 70, 127 .irq = 70,
132 .flags = UPF_BOOT_AUTOCONF, 128 .flags = UPF_BOOT_AUTOCONF,
@@ -605,6 +601,16 @@ void __init omap_serial_early_init(void)
605 struct device *dev = &pdev->dev; 601 struct device *dev = &pdev->dev;
606 struct plat_serial8250_port *p = dev->platform_data; 602 struct plat_serial8250_port *p = dev->platform_data;
607 603
604 /*
605 * Module 4KB + L4 interconnect 4KB
606 * Static mapping, never released
607 */
608 p->membase = ioremap(p->mapbase, SZ_8K);
609 if (!p->membase) {
610 printk(KERN_ERR "ioremap failed for uart%i\n", i + 1);
611 continue;
612 }
613
608 sprintf(name, "uart%d_ick", i+1); 614 sprintf(name, "uart%d_ick", i+1);
609 uart->ick = clk_get(NULL, name); 615 uart->ick = clk_get(NULL, name);
610 if (IS_ERR(uart->ick)) { 616 if (IS_ERR(uart->ick)) {