aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-02-15 15:52:34 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-02-24 04:07:15 -0500
commit111588f8304b7e13f107bd4c590e8d3939ad907d (patch)
tree3219b13ca6f3fcad6e79ad32c645af84facb2300 /arch/arm/plat-mxc
parent261f6f681ced65de82a619f6802ebe82fd9af080 (diff)
arm/imx/iomux-v1: rename header file
Addionally make iomux-mx*.h headers stand-alone and similar to iomux-v3 platform files should include their platform iomux header from now on. For now iomux.h simply includes all iomux-v1 platform headers and so provides compatibility until all files are converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx1.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx21.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx27.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx2x.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v1.h110
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux.h123
-rw-r--r--arch/arm/plat-mxc/iomux-v1.c2
7 files changed, 126 insertions, 127 deletions
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1.h b/arch/arm/plat-mxc/include/mach/iomux-mx1.h
index d29a7b38975a..6b1507cf378e 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx1.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx1.h
@@ -18,9 +18,7 @@
18#ifndef __MACH_IOMUX_MX1_H__ 18#ifndef __MACH_IOMUX_MX1_H__
19#define __MACH_IOMUX_MX1_H__ 19#define __MACH_IOMUX_MX1_H__
20 20
21#ifndef GPIO_PORTA 21#include <mach/iomux-v1.h>
22#error Please include mach/iomux.h
23#endif
24 22
25#define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0) 23#define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0)
26#define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0) 24#define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx21.h b/arch/arm/plat-mxc/include/mach/iomux-mx21.h
index 4cede3220bee..1495dfda7834 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx21.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx21.h
@@ -18,9 +18,8 @@
18#ifndef __MACH_IOMUX_MX21_H__ 18#ifndef __MACH_IOMUX_MX21_H__
19#define __MACH_IOMUX_MX21_H__ 19#define __MACH_IOMUX_MX21_H__
20 20
21#ifndef GPIO_PORTA 21#include <mach/iomux-mx2x.h>
22#error Please include mach/iomux.h 22#include <mach/iomux-v1.h>
23#endif
24 23
25/* Primary GPIO pin functions */ 24/* Primary GPIO pin functions */
26 25
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx27.h b/arch/arm/plat-mxc/include/mach/iomux-mx27.h
index abec94d3f214..d9f9a6e32d80 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx27.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx27.h
@@ -19,9 +19,8 @@
19#ifndef __MACH_IOMUX_MX27_H__ 19#ifndef __MACH_IOMUX_MX27_H__
20#define __MACH_IOMUX_MX27_H__ 20#define __MACH_IOMUX_MX27_H__
21 21
22#ifndef GPIO_PORTA 22#include <mach/iomux-mx2x.h>
23#error Please include mach/iomux.h 23#include <mach/iomux-v1.h>
24#endif
25 24
26/* Primary GPIO pin functions */ 25/* Primary GPIO pin functions */
27 26
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx2x.h b/arch/arm/plat-mxc/include/mach/iomux-mx2x.h
index 522e83a570f2..c4f116d214f2 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx2x.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx2x.h
@@ -19,10 +19,6 @@
19#ifndef __MACH_IOMUX_MX2x_H__ 19#ifndef __MACH_IOMUX_MX2x_H__
20#define __MACH_IOMUX_MX2x_H__ 20#define __MACH_IOMUX_MX2x_H__
21 21
22#ifndef GPIO_PORTA
23#error Please include mach/iomux.h
24#endif
25
26/* Primary GPIO pin functions */ 22/* Primary GPIO pin functions */
27 23
28#define PA5_PF_LSCLK (GPIO_PORTA | GPIO_PF | GPIO_OUT | 5) 24#define PA5_PF_LSCLK (GPIO_PORTA | GPIO_PF | GPIO_OUT | 5)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v1.h b/arch/arm/plat-mxc/include/mach/iomux-v1.h
new file mode 100644
index 000000000000..54abfc051b72
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-v1.h
@@ -0,0 +1,110 @@
1/*
2 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3 * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19#ifndef __MACH_IOMUX_V1_H__
20#define __MACH_IOMUX_V1_H__
21
22/*
23* GPIO Module and I/O Multiplexer
24* x = 0..3 for reg_A, reg_B, reg_C, reg_D
25*/
26#define MXC_DDIR(x) (0x00 + ((x) << 8))
27#define MXC_OCR1(x) (0x04 + ((x) << 8))
28#define MXC_OCR2(x) (0x08 + ((x) << 8))
29#define MXC_ICONFA1(x) (0x0c + ((x) << 8))
30#define MXC_ICONFA2(x) (0x10 + ((x) << 8))
31#define MXC_ICONFB1(x) (0x14 + ((x) << 8))
32#define MXC_ICONFB2(x) (0x18 + ((x) << 8))
33#define MXC_DR(x) (0x1c + ((x) << 8))
34#define MXC_GIUS(x) (0x20 + ((x) << 8))
35#define MXC_SSR(x) (0x24 + ((x) << 8))
36#define MXC_ICR1(x) (0x28 + ((x) << 8))
37#define MXC_ICR2(x) (0x2c + ((x) << 8))
38#define MXC_IMR(x) (0x30 + ((x) << 8))
39#define MXC_ISR(x) (0x34 + ((x) << 8))
40#define MXC_GPR(x) (0x38 + ((x) << 8))
41#define MXC_SWR(x) (0x3c + ((x) << 8))
42#define MXC_PUEN(x) (0x40 + ((x) << 8))
43
44#ifdef CONFIG_ARCH_MX1
45# define GPIO_PORT_MAX 3
46#endif
47#ifdef CONFIG_ARCH_MX2
48# define GPIO_PORT_MAX 5
49#endif
50
51#ifndef GPIO_PORT_MAX
52# error "GPIO config port count unknown!"
53#endif
54
55#define GPIO_PIN_MASK 0x1f
56
57#define GPIO_PORT_SHIFT 5
58#define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT)
59
60#define GPIO_PORTA (0 << GPIO_PORT_SHIFT)
61#define GPIO_PORTB (1 << GPIO_PORT_SHIFT)
62#define GPIO_PORTC (2 << GPIO_PORT_SHIFT)
63#define GPIO_PORTD (3 << GPIO_PORT_SHIFT)
64#define GPIO_PORTE (4 << GPIO_PORT_SHIFT)
65#define GPIO_PORTF (5 << GPIO_PORT_SHIFT)
66
67#define GPIO_OUT (1 << 8)
68#define GPIO_IN (0 << 8)
69#define GPIO_PUEN (1 << 9)
70
71#define GPIO_PF (1 << 10)
72#define GPIO_AF (1 << 11)
73
74#define GPIO_OCR_SHIFT 12
75#define GPIO_OCR_MASK (3 << GPIO_OCR_SHIFT)
76#define GPIO_AIN (0 << GPIO_OCR_SHIFT)
77#define GPIO_BIN (1 << GPIO_OCR_SHIFT)
78#define GPIO_CIN (2 << GPIO_OCR_SHIFT)
79#define GPIO_GPIO (3 << GPIO_OCR_SHIFT)
80
81#define GPIO_AOUT_SHIFT 14
82#define GPIO_AOUT_MASK (3 << GPIO_AOUT_SHIFT)
83#define GPIO_AOUT (0 << GPIO_AOUT_SHIFT)
84#define GPIO_AOUT_ISR (1 << GPIO_AOUT_SHIFT)
85#define GPIO_AOUT_0 (2 << GPIO_AOUT_SHIFT)
86#define GPIO_AOUT_1 (3 << GPIO_AOUT_SHIFT)
87
88#define GPIO_BOUT_SHIFT 16
89#define GPIO_BOUT_MASK (3 << GPIO_BOUT_SHIFT)
90#define GPIO_BOUT (0 << GPIO_BOUT_SHIFT)
91#define GPIO_BOUT_ISR (1 << GPIO_BOUT_SHIFT)
92#define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT)
93#define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT)
94
95/* decode irq number to use with IMR(x), ISR(x) and friends */
96#define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5)
97
98#define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x)
99#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
100#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
101#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
102#define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x)
103#define IRQ_GPIOF(x) (IRQ_GPIOE(32) + x)
104
105extern void mxc_gpio_mode(int gpio_mode);
106extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
107 const char *label);
108extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
109
110#endif /* __MACH_IOMUX_V1_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux.h b/arch/arm/plat-mxc/include/mach/iomux.h
index 8b2467f300b0..3d226d7e7be2 100644
--- a/arch/arm/plat-mxc/include/mach/iomux.h
+++ b/arch/arm/plat-mxc/include/mach/iomux.h
@@ -1,101 +1,14 @@
1/* 1/*
2* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> 2 * Copyright (C) 2010 Uwe Kleine-Koenig, Pengutronix
3* Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de> 3 *
4* 4 * This program is free software; you can redistribute it and/or modify it
5* This program is free software; you can redistribute it and/or 5 * under the terms of the GNU General Public License version 2 as published by
6* modify it under the terms of the GNU General Public License 6 * the Free Software Foundation.
7* as published by the Free Software Foundation; either version 2 7 */
8* of the License, or (at your option) any later version. 8#ifndef __MACH_IOMUX_H__
9* This program is distributed in the hope that it will be useful, 9#define __MACH_IOMUX_H__
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with this program; if not, write to the Free Software
16* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301, USA.
18*/
19
20#ifndef _MXC_IOMUX_H
21#define _MXC_IOMUX_H
22
23/*
24* GPIO Module and I/O Multiplexer
25* x = 0..3 for reg_A, reg_B, reg_C, reg_D
26*/
27#define MXC_DDIR(x) (0x00 + ((x) << 8))
28#define MXC_OCR1(x) (0x04 + ((x) << 8))
29#define MXC_OCR2(x) (0x08 + ((x) << 8))
30#define MXC_ICONFA1(x) (0x0c + ((x) << 8))
31#define MXC_ICONFA2(x) (0x10 + ((x) << 8))
32#define MXC_ICONFB1(x) (0x14 + ((x) << 8))
33#define MXC_ICONFB2(x) (0x18 + ((x) << 8))
34#define MXC_DR(x) (0x1c + ((x) << 8))
35#define MXC_GIUS(x) (0x20 + ((x) << 8))
36#define MXC_SSR(x) (0x24 + ((x) << 8))
37#define MXC_ICR1(x) (0x28 + ((x) << 8))
38#define MXC_ICR2(x) (0x2c + ((x) << 8))
39#define MXC_IMR(x) (0x30 + ((x) << 8))
40#define MXC_ISR(x) (0x34 + ((x) << 8))
41#define MXC_GPR(x) (0x38 + ((x) << 8))
42#define MXC_SWR(x) (0x3c + ((x) << 8))
43#define MXC_PUEN(x) (0x40 + ((x) << 8))
44
45#ifdef CONFIG_ARCH_MX1
46# define GPIO_PORT_MAX 3
47#endif
48#ifdef CONFIG_ARCH_MX2
49# define GPIO_PORT_MAX 5
50#endif
51#ifdef CONFIG_ARCH_MX25
52# define GPIO_PORT_MAX 3
53#endif
54
55#ifndef GPIO_PORT_MAX
56# error "GPIO config port count unknown!"
57#endif
58
59#define GPIO_PIN_MASK 0x1f
60
61#define GPIO_PORT_SHIFT 5
62#define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT)
63
64#define GPIO_PORTA (0 << GPIO_PORT_SHIFT)
65#define GPIO_PORTB (1 << GPIO_PORT_SHIFT)
66#define GPIO_PORTC (2 << GPIO_PORT_SHIFT)
67#define GPIO_PORTD (3 << GPIO_PORT_SHIFT)
68#define GPIO_PORTE (4 << GPIO_PORT_SHIFT)
69#define GPIO_PORTF (5 << GPIO_PORT_SHIFT)
70
71#define GPIO_OUT (1 << 8)
72#define GPIO_IN (0 << 8)
73#define GPIO_PUEN (1 << 9)
74
75#define GPIO_PF (1 << 10)
76#define GPIO_AF (1 << 11)
77
78#define GPIO_OCR_SHIFT 12
79#define GPIO_OCR_MASK (3 << GPIO_OCR_SHIFT)
80#define GPIO_AIN (0 << GPIO_OCR_SHIFT)
81#define GPIO_BIN (1 << GPIO_OCR_SHIFT)
82#define GPIO_CIN (2 << GPIO_OCR_SHIFT)
83#define GPIO_GPIO (3 << GPIO_OCR_SHIFT)
84
85#define GPIO_AOUT_SHIFT 14
86#define GPIO_AOUT_MASK (3 << GPIO_AOUT_SHIFT)
87#define GPIO_AOUT (0 << GPIO_AOUT_SHIFT)
88#define GPIO_AOUT_ISR (1 << GPIO_AOUT_SHIFT)
89#define GPIO_AOUT_0 (2 << GPIO_AOUT_SHIFT)
90#define GPIO_AOUT_1 (3 << GPIO_AOUT_SHIFT)
91
92#define GPIO_BOUT_SHIFT 16
93#define GPIO_BOUT_MASK (3 << GPIO_BOUT_SHIFT)
94#define GPIO_BOUT (0 << GPIO_BOUT_SHIFT)
95#define GPIO_BOUT_ISR (1 << GPIO_BOUT_SHIFT)
96#define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT)
97#define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT)
98 10
11/* This file will go away, please include mach/iomux-mx... directly */
99 12
100#ifdef CONFIG_ARCH_MX1 13#ifdef CONFIG_ARCH_MX1
101#include <mach/iomux-mx1.h> 14#include <mach/iomux-mx1.h>
@@ -110,20 +23,4 @@
110#endif 23#endif
111#endif 24#endif
112 25
113/* decode irq number to use with IMR(x), ISR(x) and friends */ 26#endif /* __MACH_IOMUX_H__ */
114#define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5)
115
116#define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x)
117#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
118#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
119#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
120#define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x)
121#define IRQ_GPIOF(x) (IRQ_GPIOE(32) + x)
122
123
124extern void mxc_gpio_mode(int gpio_mode);
125extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
126 const char *label);
127extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
128
129#endif
diff --git a/arch/arm/plat-mxc/iomux-v1.c b/arch/arm/plat-mxc/iomux-v1.c
index aeaf2951579a..5798b35b6cb9 100644
--- a/arch/arm/plat-mxc/iomux-v1.c
+++ b/arch/arm/plat-mxc/iomux-v1.c
@@ -30,7 +30,7 @@
30 30
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <asm/mach/map.h> 32#include <asm/mach/map.h>
33#include <mach/iomux.h> 33#include <mach/iomux-v1.h>
34 34
35static void __iomem *imx_iomuxv1_baseaddr; 35static void __iomem *imx_iomuxv1_baseaddr;
36 36