Commit 2b9ac7c1 authored by Dan Williams's avatar Dan Williams Committed by Russell King

[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: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarDeepak Saxena <dsaxena@plexity.net>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 6a2273d6
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/serial_core.h> #include <linux/serial_8250.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -50,32 +50,74 @@ static struct map_desc iop331_std_desc[] __initdata = { ...@@ -50,32 +50,74 @@ static struct map_desc iop331_std_desc[] __initdata = {
} }
}; };
static struct uart_port iop331_serial_ports[] = { static struct resource iop33x_uart0_resources[] = {
{ [0] = {
.membase = (char*)(IOP331_UART0_VIRT), .start = IOP331_UART0_PHYS,
.mapbase = (IOP331_UART0_PHYS), .end = IOP331_UART0_PHYS + 0x3f,
.irq = IRQ_IOP331_UART0, .flags = IORESOURCE_MEM,
.flags = UPF_SKIP_TEST, },
.iotype = UPIO_MEM, [1] = {
.regshift = 2, .start = IRQ_IOP331_UART0,
.uartclk = IOP331_UART_XTAL, .end = IRQ_IOP331_UART0,
.line = 0, .flags = IORESOURCE_IRQ
.type = PORT_XSCALE, }
.fifosize = 32 };
} , {
.membase = (char*)(IOP331_UART1_VIRT), static struct resource iop33x_uart1_resources[] = {
.mapbase = (IOP331_UART1_PHYS), [0] = {
.irq = IRQ_IOP331_UART1, .start = IOP331_UART1_PHYS,
.flags = UPF_SKIP_TEST, .end = IOP331_UART1_PHYS + 0x3f,
.iotype = UPIO_MEM, .flags = IORESOURCE_MEM,
.regshift = 2, },
.uartclk = IOP331_UART_XTAL, [1] = {
.line = 1, .start = IRQ_IOP331_UART1,
.type = PORT_XSCALE, .end = IRQ_IOP331_UART1,
.fifosize = 32 .flags = IORESOURCE_IRQ
} }
}; };
static struct plat_serial8250_port iop33x_uart0_data[] = {
{
.membase = (char*)(IOP331_UART0_VIRT),
.mapbase = (IOP331_UART0_PHYS),
.irq = IRQ_IOP331_UART0,
.uartclk = IOP331_UART_XTAL,
.regshift = 2,
.iotype = UPIO_MEM,
.flags = UPF_SKIP_TEST,
},
{ },
};
static struct plat_serial8250_port iop33x_uart1_data[] = {
{
.membase = (char*)(IOP331_UART1_VIRT),
.mapbase = (IOP331_UART1_PHYS),
.irq = IRQ_IOP331_UART1,
.uartclk = IOP331_UART_XTAL,
.regshift = 2,
.iotype = UPIO_MEM,
.flags = UPF_SKIP_TEST,
},
{ },
};
static struct platform_device iop33x_uart0 = {
.name = "serial8250",
.id = 0,
.dev.platform_data = iop33x_uart0_data,
.num_resources = 2,
.resource = iop33x_uart0_resources,
};
static struct platform_device iop33x_uart1 = {
.name = "serial8250",
.id = 1,
.dev.platform_data = iop33x_uart1_data,
.num_resources = 2,
.resource = iop33x_uart1_resources,
};
static struct resource iop33x_i2c_0_resources[] = { static struct resource iop33x_i2c_0_resources[] = {
[0] = { [0] = {
.start = 0xfffff680, .start = 0xfffff680,
...@@ -117,6 +159,8 @@ static struct platform_device iop33x_i2c_1_controller = { ...@@ -117,6 +159,8 @@ static struct platform_device iop33x_i2c_1_controller = {
}; };
static struct platform_device *iop33x_devices[] __initdata = { static struct platform_device *iop33x_devices[] __initdata = {
&iop33x_uart0,
&iop33x_uart1,
&iop33x_i2c_0_controller, &iop33x_i2c_0_controller,
&iop33x_i2c_1_controller &iop33x_i2c_1_controller
}; };
...@@ -133,8 +177,6 @@ void __init iop33x_init(void) ...@@ -133,8 +177,6 @@ void __init iop33x_init(void)
void __init iop331_map_io(void) void __init iop331_map_io(void)
{ {
iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc)); iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc));
early_serial_setup(&iop331_serial_ports[0]);
early_serial_setup(&iop331_serial_ports[1]);
} }
#ifdef CONFIG_ARCH_IOP331 #ifdef CONFIG_ARCH_IOP331
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment