drivers: hv: vmbus: Replace page definition with Hyper-V specific one
[sfrench/cifs-2.6.git] / arch / arm / mach-iop33x / uart.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * arch/arm/mach-iop33x/uart.c
4  *
5  * Author: Dave Jiang (dave.jiang@intel.com)
6  * Copyright (C) 2004 Intel Corporation.
7  */
8
9 #include <linux/mm.h>
10 #include <linux/init.h>
11 #include <linux/major.h>
12 #include <linux/fs.h>
13 #include <linux/platform_device.h>
14 #include <linux/serial.h>
15 #include <linux/tty.h>
16 #include <linux/serial_8250.h>
17 #include <linux/io.h>
18 #include <asm/pgtable.h>
19 #include <asm/page.h>
20 #include <asm/mach/map.h>
21 #include <asm/setup.h>
22 #include <asm/memory.h>
23 #include <mach/hardware.h>
24 #include <asm/hardware/iop3xx.h>
25 #include <asm/mach/arch.h>
26
27 #define IOP33X_UART_XTAL 33334000
28
29 static struct plat_serial8250_port iop33x_uart0_data[] = {
30         {
31                 .membase        = (char *)IOP33X_UART0_VIRT,
32                 .mapbase        = IOP33X_UART0_PHYS,
33                 .irq            = IRQ_IOP33X_UART0,
34                 .uartclk        = IOP33X_UART_XTAL,
35                 .regshift       = 2,
36                 .iotype         = UPIO_MEM,
37                 .flags          = UPF_SKIP_TEST,
38         },
39         { },
40 };
41
42 static struct resource iop33x_uart0_resources[] = {
43         [0] = {
44                 .start  = IOP33X_UART0_PHYS,
45                 .end    = IOP33X_UART0_PHYS + 0x3f,
46                 .flags  = IORESOURCE_MEM,
47         },
48         [1] = {
49                 .start  = IRQ_IOP33X_UART0,
50                 .end    = IRQ_IOP33X_UART0,
51                 .flags  = IORESOURCE_IRQ,
52         },
53 };
54
55 struct platform_device iop33x_uart0_device = {
56         .name           = "serial8250",
57         .id             = PLAT8250_DEV_PLATFORM,
58         .dev            = {
59                 .platform_data          = iop33x_uart0_data,
60         },
61         .num_resources  = 2,
62         .resource       = iop33x_uart0_resources,
63 };
64
65
66 static struct resource iop33x_uart1_resources[] = {
67         [0] = {
68                 .start  = IOP33X_UART1_PHYS,
69                 .end    = IOP33X_UART1_PHYS + 0x3f,
70                 .flags  = IORESOURCE_MEM,
71         },
72         [1] = {
73                 .start  = IRQ_IOP33X_UART1,
74                 .end    = IRQ_IOP33X_UART1,
75                 .flags  = IORESOURCE_IRQ,
76         },
77 };
78
79 static struct plat_serial8250_port iop33x_uart1_data[] = {
80         {
81                 .membase        = (char *)IOP33X_UART1_VIRT,
82                 .mapbase        = IOP33X_UART1_PHYS,
83                 .irq            = IRQ_IOP33X_UART1,
84                 .uartclk        = IOP33X_UART_XTAL,
85                 .regshift       = 2,
86                 .iotype         = UPIO_MEM,
87                 .flags          = UPF_SKIP_TEST,
88         },
89         { },
90 };
91
92 struct platform_device iop33x_uart1_device = {
93         .name           = "serial8250",
94         .id             = PLAT8250_DEV_PLATFORM1,
95         .dev            = {
96                 .platform_data          = iop33x_uart1_data,
97         },
98         .num_resources  = 2,
99         .resource       = iop33x_uart1_resources,
100 };