aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTzachi Perelstein <tzachi@marvell.com>2007-10-23 15:14:42 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-01-26 10:03:50 -0500
commitca26f7d3ed3c841e561613a9ea2f44ca899e27de (patch)
tree1a4957d5a6560db179821a1709420344caf9dd2f
parent51cbff1d6f1946f97b847f9a144737eca20ede84 (diff)
[ARM] Orion: platform device registration for UART, USB and NAND
Signed-off-by: Tzachi Perelstein <tzachi@marvell.com> Reviewed-by: Nicolas Pitre <nico@marvell.com> Reviewed-by: Lennert Buytenhek <buytenh@marvell.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-orion/common.c123
-rw-r--r--include/asm-arm/arch-orion/platform.h25
2 files changed, 148 insertions, 0 deletions
diff --git a/arch/arm/mach-orion/common.c b/arch/arm/mach-orion/common.c
index 69363cbcb63b..ab1000eeaefe 100644
--- a/arch/arm/mach-orion/common.c
+++ b/arch/arm/mach-orion/common.c
@@ -12,6 +12,8 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/serial_8250.h>
15#include <asm/page.h> 17#include <asm/page.h>
16#include <asm/timex.h> 18#include <asm/timex.h>
17#include <asm/mach/map.h> 19#include <asm/mach/map.h>
@@ -54,6 +56,119 @@ void __init orion_map_io(void)
54} 56}
55 57
56/***************************************************************************** 58/*****************************************************************************
59 * UART
60 ****************************************************************************/
61
62static struct resource orion_uart_resources[] = {
63 {
64 .start = UART0_BASE,
65 .end = UART0_BASE + 0xff,
66 .flags = IORESOURCE_MEM,
67 },
68 {
69 .start = IRQ_ORION_UART0,
70 .end = IRQ_ORION_UART0,
71 .flags = IORESOURCE_IRQ,
72 },
73 {
74 .start = UART1_BASE,
75 .end = UART1_BASE + 0xff,
76 .flags = IORESOURCE_MEM,
77 },
78 {
79 .start = IRQ_ORION_UART1,
80 .end = IRQ_ORION_UART1,
81 .flags = IORESOURCE_IRQ,
82 },
83};
84
85static struct plat_serial8250_port orion_uart_data[] = {
86 {
87 .mapbase = UART0_BASE,
88 .membase = (char *)UART0_BASE,
89 .irq = IRQ_ORION_UART0,
90 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
91 .iotype = UPIO_MEM,
92 .regshift = 2,
93 .uartclk = ORION_TCLK,
94 },
95 {
96 .mapbase = UART1_BASE,
97 .membase = (char *)UART1_BASE,
98 .irq = IRQ_ORION_UART1,
99 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
100 .iotype = UPIO_MEM,
101 .regshift = 2,
102 .uartclk = ORION_TCLK,
103 },
104 { },
105};
106
107static struct platform_device orion_uart = {
108 .name = "serial8250",
109 .id = PLAT8250_DEV_PLATFORM,
110 .dev = {
111 .platform_data = orion_uart_data,
112 },
113 .resource = orion_uart_resources,
114 .num_resources = ARRAY_SIZE(orion_uart_resources),
115};
116
117/*******************************************************************************
118 * USB Controller - 2 interfaces
119 ******************************************************************************/
120
121static struct resource orion_ehci0_resources[] = {
122 {
123 .start = ORION_USB0_REG_BASE,
124 .end = ORION_USB0_REG_BASE + SZ_4K,
125 .flags = IORESOURCE_MEM,
126 },
127 {
128 .start = IRQ_ORION_USB0_CTRL,
129 .end = IRQ_ORION_USB0_CTRL,
130 .flags = IORESOURCE_IRQ,
131 },
132};
133
134static struct resource orion_ehci1_resources[] = {
135 {
136 .start = ORION_USB1_REG_BASE,
137 .end = ORION_USB1_REG_BASE + SZ_4K,
138 .flags = IORESOURCE_MEM,
139 },
140 {
141 .start = IRQ_ORION_USB1_CTRL,
142 .end = IRQ_ORION_USB1_CTRL,
143 .flags = IORESOURCE_IRQ,
144 },
145};
146
147static u64 ehci_dmamask = 0xffffffffUL;
148
149static struct platform_device orion_ehci0 = {
150 .name = "orion-ehci",
151 .id = 0,
152 .dev = {
153 .dma_mask = &ehci_dmamask,
154 .coherent_dma_mask = 0xffffffff,
155 },
156 .resource = orion_ehci0_resources,
157 .num_resources = ARRAY_SIZE(orion_ehci0_resources),
158};
159
160static struct platform_device orion_ehci1 = {
161 .name = "orion-ehci",
162 .id = 1,
163 .dev = {
164 .dma_mask = &ehci_dmamask,
165 .coherent_dma_mask = 0xffffffff,
166 },
167 .resource = orion_ehci1_resources,
168 .num_resources = ARRAY_SIZE(orion_ehci1_resources),
169};
170
171/*****************************************************************************
57 * General 172 * General
58 ****************************************************************************/ 173 ****************************************************************************/
59 174
@@ -101,4 +216,12 @@ void __init orion_init(void)
101 orion_setup_pcie_wins(); 216 orion_setup_pcie_wins();
102 if (dev == MV88F5182_DEV_ID) 217 if (dev == MV88F5182_DEV_ID)
103 orion_setup_sata_wins(); 218 orion_setup_sata_wins();
219
220 /*
221 * REgister devices
222 */
223 platform_device_register(&orion_uart);
224 platform_device_register(&orion_ehci0);
225 if (dev == MV88F5182_DEV_ID)
226 platform_device_register(&orion_ehci1);
104} 227}
diff --git a/include/asm-arm/arch-orion/platform.h b/include/asm-arm/arch-orion/platform.h
new file mode 100644
index 000000000000..143c38e2fa0b
--- /dev/null
+++ b/include/asm-arm/arch-orion/platform.h
@@ -0,0 +1,25 @@
1/*
2 * asm-arm/arch-orion/platform.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARCH_PLATFORM_H__
12#define __ASM_ARCH_PLATFORM_H__
13
14/*
15 * Device bus NAND private data
16 */
17struct orion_nand_data {
18 struct mtd_partition *parts;
19 u32 nr_parts;
20 u8 ale; /* address line number connected to ALE */
21 u8 cle; /* address line number connected to CLE */
22 u8 width; /* buswidth */
23};
24
25#endif