aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx1/devices.c
diff options
context:
space:
mode:
authorPaulius Zaleckas <paulius.zaleckas@teltonika.lt>2008-11-14 05:01:38 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2008-12-16 08:58:40 -0500
commitcfca8b539f53114fb6a6de091987a984c8013d96 (patch)
tree7ba5516e465164bb330f1e8965f1be91337f966a /arch/arm/mach-mx1/devices.c
parentd133d6a89340b7438038ed0407221c5277cb8a0e (diff)
patch-mxc-add-ARCH_MX1
Adds MX1 architecture to platform MXC. It will supersede mach-imx and let it die. Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Signed-off-by: Darius Augulis <augulis.darius@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx1/devices.c')
-rw-r--r--arch/arm/mach-mx1/devices.c118
1 files changed, 118 insertions, 0 deletions
diff --git a/arch/arm/mach-mx1/devices.c b/arch/arm/mach-mx1/devices.c
new file mode 100644
index 000000000000..aa7b0b08dfca
--- /dev/null
+++ b/arch/arm/mach-mx1/devices.c
@@ -0,0 +1,118 @@
1/*
2 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Sascha Hauer, kernel@pengutronix.de
4 * Copyright (c) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/platform_device.h>
24#include <linux/gpio.h>
25#include <mach/hardware.h>
26
27static struct resource imx_uart1_resources[] = {
28 [0] = {
29 .start = UART1_BASE_ADDR,
30 .end = UART1_BASE_ADDR + 0xD0,
31 .flags = IORESOURCE_MEM,
32 },
33 [1] = {
34 .start = UART1_MINT_RX,
35 .end = UART1_MINT_RX,
36 .flags = IORESOURCE_IRQ,
37 },
38 [2] = {
39 .start = UART1_MINT_TX,
40 .end = UART1_MINT_TX,
41 .flags = IORESOURCE_IRQ,
42 },
43 [3] = {
44 .start = UART1_MINT_RTS,
45 .end = UART1_MINT_RTS,
46 .flags = IORESOURCE_IRQ,
47 },
48};
49
50struct platform_device imx_uart1_device = {
51 .name = "imx-uart",
52 .id = 0,
53 .num_resources = ARRAY_SIZE(imx_uart1_resources),
54 .resource = imx_uart1_resources,
55};
56
57static struct resource imx_uart2_resources[] = {
58 [0] = {
59 .start = UART2_BASE_ADDR,
60 .end = UART2_BASE_ADDR + 0xD0,
61 .flags = IORESOURCE_MEM,
62 },
63 [1] = {
64 .start = UART2_MINT_RX,
65 .end = UART2_MINT_RX,
66 .flags = IORESOURCE_IRQ,
67 },
68 [2] = {
69 .start = UART2_MINT_TX,
70 .end = UART2_MINT_TX,
71 .flags = IORESOURCE_IRQ,
72 },
73 [3] = {
74 .start = UART2_MINT_RTS,
75 .end = UART2_MINT_RTS,
76 .flags = IORESOURCE_IRQ,
77 },
78};
79
80struct platform_device imx_uart2_device = {
81 .name = "imx-uart",
82 .id = 1,
83 .num_resources = ARRAY_SIZE(imx_uart2_resources),
84 .resource = imx_uart2_resources,
85};
86
87/* GPIO port description */
88static struct mxc_gpio_port imx_gpio_ports[] = {
89 [0] = {
90 .chip.label = "gpio-0",
91 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR),
92 .irq = GPIO_INT_PORTA,
93 .virtual_irq_start = MXC_MAX_INT_LINES
94 },
95 [1] = {
96 .chip.label = "gpio-1",
97 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x100),
98 .irq = GPIO_INT_PORTB,
99 .virtual_irq_start = MXC_MAX_INT_LINES + 32
100 },
101 [2] = {
102 .chip.label = "gpio-2",
103 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x200),
104 .irq = GPIO_INT_PORTC,
105 .virtual_irq_start = MXC_MAX_INT_LINES + 64
106 },
107 [3] = {
108 .chip.label = "gpio-3",
109 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x300),
110 .irq = GPIO_INT_PORTD,
111 .virtual_irq_start = MXC_MAX_INT_LINES + 96
112 }
113};
114
115int __init mxc_register_gpios(void)
116{
117 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
118}