blob: bbf54d794ce81edf74ce922e37285780d3139850 [file] [log] [blame]
Lennert Buytenhekc680b772006-09-18 23:24:52 +01001/*
Lennert Buytenhekc852ac82006-09-18 23:26:25 +01002 * arch/arm/mach-iop33x/uart.c
Lennert Buytenhekc680b772006-09-18 23:24:52 +01003 *
4 * Author: Dave Jiang (dave.jiang@intel.com)
5 * Copyright (C) 2004 Intel Corporation.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/mm.h>
13#include <linux/init.h>
14#include <linux/major.h>
15#include <linux/fs.h>
16#include <linux/platform_device.h>
17#include <linux/serial.h>
18#include <linux/tty.h>
19#include <linux/serial_8250.h>
Russell Kingfced80c2008-09-06 12:10:45 +010020#include <linux/io.h>
Lennert Buytenhekc680b772006-09-18 23:24:52 +010021#include <asm/pgtable.h>
22#include <asm/page.h>
23#include <asm/mach/map.h>
24#include <asm/setup.h>
Lennert Buytenhekc680b772006-09-18 23:24:52 +010025#include <asm/memory.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010026#include <mach/hardware.h>
Lennert Buytenhekc680b772006-09-18 23:24:52 +010027#include <asm/hardware/iop3xx.h>
Lennert Buytenhekc680b772006-09-18 23:24:52 +010028#include <asm/mach/arch.h>
29
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010030#define IOP33X_UART_XTAL 33334000
Lennert Buytenhekc680b772006-09-18 23:24:52 +010031
32static struct plat_serial8250_port iop33x_uart0_data[] = {
33 {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010034 .membase = (char *)IOP33X_UART0_VIRT,
35 .mapbase = IOP33X_UART0_PHYS,
36 .irq = IRQ_IOP33X_UART0,
37 .uartclk = IOP33X_UART_XTAL,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010038 .regshift = 2,
39 .iotype = UPIO_MEM,
40 .flags = UPF_SKIP_TEST,
41 },
42 { },
43};
44
45static struct resource iop33x_uart0_resources[] = {
46 [0] = {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010047 .start = IOP33X_UART0_PHYS,
48 .end = IOP33X_UART0_PHYS + 0x3f,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010049 .flags = IORESOURCE_MEM,
50 },
51 [1] = {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010052 .start = IRQ_IOP33X_UART0,
53 .end = IRQ_IOP33X_UART0,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010054 .flags = IORESOURCE_IRQ,
55 },
56};
57
58struct platform_device iop33x_uart0_device = {
59 .name = "serial8250",
60 .id = PLAT8250_DEV_PLATFORM,
61 .dev = {
62 .platform_data = iop33x_uart0_data,
63 },
64 .num_resources = 2,
65 .resource = iop33x_uart0_resources,
66};
67
68
69static struct resource iop33x_uart1_resources[] = {
70 [0] = {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010071 .start = IOP33X_UART1_PHYS,
72 .end = IOP33X_UART1_PHYS + 0x3f,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010073 .flags = IORESOURCE_MEM,
74 },
75 [1] = {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010076 .start = IRQ_IOP33X_UART1,
77 .end = IRQ_IOP33X_UART1,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010078 .flags = IORESOURCE_IRQ,
79 },
80};
81
82static struct plat_serial8250_port iop33x_uart1_data[] = {
83 {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010084 .membase = (char *)IOP33X_UART1_VIRT,
85 .mapbase = IOP33X_UART1_PHYS,
86 .irq = IRQ_IOP33X_UART1,
87 .uartclk = IOP33X_UART_XTAL,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010088 .regshift = 2,
89 .iotype = UPIO_MEM,
90 .flags = UPF_SKIP_TEST,
91 },
92 { },
93};
94
95struct platform_device iop33x_uart1_device = {
96 .name = "serial8250",
97 .id = PLAT8250_DEV_PLATFORM1,
98 .dev = {
99 .platform_data = iop33x_uart1_data,
100 },
101 .num_resources = 2,
102 .resource = iop33x_uart1_resources,
103};