aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@gmail.com>2006-01-05 15:53:02 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-05 15:53:02 -0500
commit2b9ac7c15c0c5c9d6057b9e297dabaebd208ffe8 (patch)
tree44b063c573993d2a735b70e58d28bf4671e6803b /arch
parent6a2273d6fc627d28a4de9beadf77ae6636b1e5d0 (diff)
[ARM] 3217/1: iop331 uarts as platform devices
Patch from Dan Williams Convert old-style serial devices to platform devices so that printk's are visible during the boot process. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-iop3xx/iop331-setup.c94
1 files changed, 68 insertions, 26 deletions
diff --git a/arch/arm/mach-iop3xx/iop331-setup.c b/arch/arm/mach-iop3xx/iop331-setup.c
index 53f60614498b..e6ea1cba6a17 100644
--- a/arch/arm/mach-iop3xx/iop331-setup.c
+++ b/arch/arm/mach-iop3xx/iop331-setup.c
@@ -18,7 +18,7 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/serial.h> 19#include <linux/serial.h>
20#include <linux/tty.h> 20#include <linux/tty.h>
21#include <linux/serial_core.h> 21#include <linux/serial_8250.h>
22 22
23#include <asm/io.h> 23#include <asm/io.h>
24#include <asm/pgtable.h> 24#include <asm/pgtable.h>
@@ -50,32 +50,74 @@ static struct map_desc iop331_std_desc[] __initdata = {
50 } 50 }
51}; 51};
52 52
53static struct uart_port iop331_serial_ports[] = { 53static struct resource iop33x_uart0_resources[] = {
54 { 54 [0] = {
55 .membase = (char*)(IOP331_UART0_VIRT), 55 .start = IOP331_UART0_PHYS,
56 .mapbase = (IOP331_UART0_PHYS), 56 .end = IOP331_UART0_PHYS + 0x3f,
57 .irq = IRQ_IOP331_UART0, 57 .flags = IORESOURCE_MEM,
58 .flags = UPF_SKIP_TEST, 58 },
59 .iotype = UPIO_MEM, 59 [1] = {
60 .regshift = 2, 60 .start = IRQ_IOP331_UART0,
61 .uartclk = IOP331_UART_XTAL, 61 .end = IRQ_IOP331_UART0,
62 .line = 0, 62 .flags = IORESOURCE_IRQ
63 .type = PORT_XSCALE, 63 }
64 .fifosize = 32 64};
65 } , { 65
66 .membase = (char*)(IOP331_UART1_VIRT), 66static struct resource iop33x_uart1_resources[] = {
67 .mapbase = (IOP331_UART1_PHYS), 67 [0] = {
68 .irq = IRQ_IOP331_UART1, 68 .start = IOP331_UART1_PHYS,
69 .flags = UPF_SKIP_TEST, 69 .end = IOP331_UART1_PHYS + 0x3f,
70 .iotype = UPIO_MEM, 70 .flags = IORESOURCE_MEM,
71 .regshift = 2, 71 },
72 .uartclk = IOP331_UART_XTAL, 72 [1] = {
73 .line = 1, 73 .start = IRQ_IOP331_UART1,
74 .type = PORT_XSCALE, 74 .end = IRQ_IOP331_UART1,
75 .fifosize = 32 75 .flags = IORESOURCE_IRQ
76 } 76 }
77}; 77};
78 78
79static struct plat_serial8250_port iop33x_uart0_data[] = {
80 {
81 .membase = (char*)(IOP331_UART0_VIRT),
82 .mapbase = (IOP331_UART0_PHYS),
83 .irq = IRQ_IOP331_UART0,
84 .uartclk = IOP331_UART_XTAL,
85 .regshift = 2,
86 .iotype = UPIO_MEM,
87 .flags = UPF_SKIP_TEST,
88 },
89 { },
90};
91
92static struct plat_serial8250_port iop33x_uart1_data[] = {
93 {
94 .membase = (char*)(IOP331_UART1_VIRT),
95 .mapbase = (IOP331_UART1_PHYS),
96 .irq = IRQ_IOP331_UART1,
97 .uartclk = IOP331_UART_XTAL,
98 .regshift = 2,
99 .iotype = UPIO_MEM,
100 .flags = UPF_SKIP_TEST,
101 },
102 { },
103};
104
105static struct platform_device iop33x_uart0 = {
106 .name = "serial8250",
107 .id = 0,
108 .dev.platform_data = iop33x_uart0_data,
109 .num_resources = 2,
110 .resource = iop33x_uart0_resources,
111};
112
113static struct platform_device iop33x_uart1 = {
114 .name = "serial8250",
115 .id = 1,
116 .dev.platform_data = iop33x_uart1_data,
117 .num_resources = 2,
118 .resource = iop33x_uart1_resources,
119};
120
79static struct resource iop33x_i2c_0_resources[] = { 121static struct resource iop33x_i2c_0_resources[] = {
80 [0] = { 122 [0] = {
81 .start = 0xfffff680, 123 .start = 0xfffff680,
@@ -117,6 +159,8 @@ static struct platform_device iop33x_i2c_1_controller = {
117}; 159};
118 160
119static struct platform_device *iop33x_devices[] __initdata = { 161static struct platform_device *iop33x_devices[] __initdata = {
162 &iop33x_uart0,
163 &iop33x_uart1,
120 &iop33x_i2c_0_controller, 164 &iop33x_i2c_0_controller,
121 &iop33x_i2c_1_controller 165 &iop33x_i2c_1_controller
122}; 166};
@@ -133,8 +177,6 @@ void __init iop33x_init(void)
133void __init iop331_map_io(void) 177void __init iop331_map_io(void)
134{ 178{
135 iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc)); 179 iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc));
136 early_serial_setup(&iop331_serial_ports[0]);
137 early_serial_setup(&iop331_serial_ports[1]);
138} 180}
139 181
140#ifdef CONFIG_ARCH_IOP331 182#ifdef CONFIG_ARCH_IOP331