blob: ac297cd0276c0f0a4bf9b9713071c80c3b3aea38 [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>
Lennert Buytenhekc680b772006-09-18 23:24:52 +010020#include <asm/io.h>
21#include <asm/pgtable.h>
22#include <asm/page.h>
23#include <asm/mach/map.h>
24#include <asm/setup.h>
25#include <asm/system.h>
26#include <asm/memory.h>
27#include <asm/hardware.h>
28#include <asm/hardware/iop3xx.h>
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010032#define IOP33X_UART_XTAL 33334000
Lennert Buytenhekc680b772006-09-18 23:24:52 +010033
34static struct plat_serial8250_port iop33x_uart0_data[] = {
35 {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010036 .membase = (char *)IOP33X_UART0_VIRT,
37 .mapbase = IOP33X_UART0_PHYS,
38 .irq = IRQ_IOP33X_UART0,
39 .uartclk = IOP33X_UART_XTAL,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010040 .regshift = 2,
41 .iotype = UPIO_MEM,
42 .flags = UPF_SKIP_TEST,
43 },
44 { },
45};
46
47static struct resource iop33x_uart0_resources[] = {
48 [0] = {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010049 .start = IOP33X_UART0_PHYS,
50 .end = IOP33X_UART0_PHYS + 0x3f,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010051 .flags = IORESOURCE_MEM,
52 },
53 [1] = {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010054 .start = IRQ_IOP33X_UART0,
55 .end = IRQ_IOP33X_UART0,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010056 .flags = IORESOURCE_IRQ,
57 },
58};
59
60struct platform_device iop33x_uart0_device = {
61 .name = "serial8250",
62 .id = PLAT8250_DEV_PLATFORM,
63 .dev = {
64 .platform_data = iop33x_uart0_data,
65 },
66 .num_resources = 2,
67 .resource = iop33x_uart0_resources,
68};
69
70
71static struct resource iop33x_uart1_resources[] = {
72 [0] = {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010073 .start = IOP33X_UART1_PHYS,
74 .end = IOP33X_UART1_PHYS + 0x3f,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010075 .flags = IORESOURCE_MEM,
76 },
77 [1] = {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010078 .start = IRQ_IOP33X_UART1,
79 .end = IRQ_IOP33X_UART1,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010080 .flags = IORESOURCE_IRQ,
81 },
82};
83
84static struct plat_serial8250_port iop33x_uart1_data[] = {
85 {
Lennert Buytenhekc852ac82006-09-18 23:26:25 +010086 .membase = (char *)IOP33X_UART1_VIRT,
87 .mapbase = IOP33X_UART1_PHYS,
88 .irq = IRQ_IOP33X_UART1,
89 .uartclk = IOP33X_UART_XTAL,
Lennert Buytenhekc680b772006-09-18 23:24:52 +010090 .regshift = 2,
91 .iotype = UPIO_MEM,
92 .flags = UPF_SKIP_TEST,
93 },
94 { },
95};
96
97struct platform_device iop33x_uart1_device = {
98 .name = "serial8250",
99 .id = PLAT8250_DEV_PLATFORM1,
100 .dev = {
101 .platform_data = iop33x_uart1_data,
102 },
103 .num_resources = 2,
104 .resource = iop33x_uart1_resources,
105};