aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r--arch/arm/plat-mxc/Kconfig2
-rw-r--r--arch/arm/plat-mxc/devices.c53
-rw-r--r--arch/arm/plat-mxc/include/mach/debug-macro.S38
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h16
-rw-r--r--arch/arm/plat-mxc/include/mach/gpio.h33
-rw-r--r--arch/arm/plat-mxc/include/mach/i2c.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v3.h10
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h14
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h14
9 files changed, 27 insertions, 157 deletions
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 502e45f03178..4bdc975581eb 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -26,7 +26,7 @@ config ARCH_MX5
26 select AUTO_ZRELADDR 26 select AUTO_ZRELADDR
27 select ARM_PATCH_PHYS_VIRT 27 select ARM_PATCH_PHYS_VIRT
28 help 28 help
29 This enables support for machines using Freescale's i.MX50 and i.MX51 29 This enables support for machines using Freescale's i.MX50 and i.MX53
30 processors. 30 processors.
31 31
32endchoice 32endchoice
diff --git a/arch/arm/plat-mxc/devices.c b/arch/arm/plat-mxc/devices.c
index 5aaa8c5f3420..4d55a7a26e98 100644
--- a/arch/arm/plat-mxc/devices.c
+++ b/arch/arm/plat-mxc/devices.c
@@ -23,59 +23,6 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <mach/common.h> 24#include <mach/common.h>
25 25
26struct platform_device *__init imx_add_platform_device_dmamask(
27 const char *name, int id,
28 const struct resource *res, unsigned int num_resources,
29 const void *data, size_t size_data, u64 dmamask)
30{
31 int ret = -ENOMEM;
32 struct platform_device *pdev;
33
34 pdev = platform_device_alloc(name, id);
35 if (!pdev)
36 goto err;
37
38 if (dmamask) {
39 /*
40 * This memory isn't freed when the device is put,
41 * I don't have a nice idea for that though. Conceptually
42 * dma_mask in struct device should not be a pointer.
43 * See http://thread.gmane.org/gmane.linux.kernel.pci/9081
44 */
45 pdev->dev.dma_mask =
46 kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
47 if (!pdev->dev.dma_mask)
48 /* ret is still -ENOMEM; */
49 goto err;
50
51 *pdev->dev.dma_mask = dmamask;
52 pdev->dev.coherent_dma_mask = dmamask;
53 }
54
55 if (res) {
56 ret = platform_device_add_resources(pdev, res, num_resources);
57 if (ret)
58 goto err;
59 }
60
61 if (data) {
62 ret = platform_device_add_data(pdev, data, size_data);
63 if (ret)
64 goto err;
65 }
66
67 ret = platform_device_add(pdev);
68 if (ret) {
69err:
70 if (dmamask)
71 kfree(pdev->dev.dma_mask);
72 platform_device_put(pdev);
73 return ERR_PTR(ret);
74 }
75
76 return pdev;
77}
78
79struct device mxc_aips_bus = { 26struct device mxc_aips_bus = {
80 .init_name = "mxc_aips", 27 .init_name = "mxc_aips",
81 .parent = &platform_bus, 28 .parent = &platform_bus,
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S
index a3045937fc2f..72986013c1fb 100644
--- a/arch/arm/plat-mxc/include/mach/debug-macro.S
+++ b/arch/arm/plat-mxc/include/mach/debug-macro.S
@@ -12,43 +12,17 @@
12 */ 12 */
13#include <mach/hardware.h> 13#include <mach/hardware.h>
14 14
15#ifdef CONFIG_SOC_IMX1 15#ifdef CONFIG_DEBUG_IMX1_UART
16#define UART_PADDR MX1_UART1_BASE_ADDR 16#define UART_PADDR MX1_UART1_BASE_ADDR
17#endif 17#elif defined (CONFIG_DEBUG_IMX25_UART)
18
19#ifdef CONFIG_SOC_IMX25
20#ifdef UART_PADDR
21#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
22#endif
23#define UART_PADDR MX25_UART1_BASE_ADDR 18#define UART_PADDR MX25_UART1_BASE_ADDR
24#endif 19#elif defined (CONFIG_DEBUG_IMX21_IMX27_UART)
25
26#if defined(CONFIG_SOC_IMX21) || defined (CONFIG_SOC_IMX27)
27#ifdef UART_PADDR
28#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
29#endif
30#define UART_PADDR MX2x_UART1_BASE_ADDR 20#define UART_PADDR MX2x_UART1_BASE_ADDR
31#endif 21#elif defined (CONFIG_DEBUG_IMX31_IMX35_UART)
32
33#if defined(CONFIG_SOC_IMX31) || defined(CONFIG_SOC_IMX35)
34#ifdef UART_PADDR
35#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
36#endif
37#define UART_PADDR MX3x_UART1_BASE_ADDR 22#define UART_PADDR MX3x_UART1_BASE_ADDR
38#endif 23#elif defined (CONFIG_DEBUG_IMX51_UART)
39
40#ifdef CONFIG_SOC_IMX51
41#ifdef UART_PADDR
42#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
43#endif
44#define UART_PADDR MX51_UART1_BASE_ADDR 24#define UART_PADDR MX51_UART1_BASE_ADDR
45#endif 25#elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
46
47/* iMX50/53 have same addresses, but not iMX51 */
48#if defined(CONFIG_SOC_IMX50) || defined(CONFIG_SOC_IMX53)
49#ifdef UART_PADDR
50#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
51#endif
52#define UART_PADDR MX53_UART1_BASE_ADDR 26#define UART_PADDR MX53_UART1_BASE_ADDR
53#endif 27#endif
54 28
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 117a381fe3d5..def9ba53e23a 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -14,10 +14,22 @@
14extern struct device mxc_aips_bus; 14extern struct device mxc_aips_bus;
15extern struct device mxc_ahb_bus; 15extern struct device mxc_ahb_bus;
16 16
17struct platform_device *imx_add_platform_device_dmamask( 17static inline struct platform_device *imx_add_platform_device_dmamask(
18 const char *name, int id, 18 const char *name, int id,
19 const struct resource *res, unsigned int num_resources, 19 const struct resource *res, unsigned int num_resources,
20 const void *data, size_t size_data, u64 dmamask); 20 const void *data, size_t size_data, u64 dmamask)
21{
22 struct platform_device_info pdevinfo = {
23 .name = name,
24 .id = id,
25 .res = res,
26 .num_res = num_resources,
27 .data = data,
28 .size_data = size_data,
29 .dma_mask = dmamask,
30 };
31 return platform_device_register_full(&pdevinfo);
32}
21 33
22static inline struct platform_device *imx_add_platform_device( 34static inline struct platform_device *imx_add_platform_device(
23 const char *name, int id, 35 const char *name, int id,
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index 44af0064ba1a..40a8c178f10d 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -1,32 +1 @@
1/* /* empty */
2 * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.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, MA 02110-1301, USA.
17 */
18
19#ifndef __ASM_ARCH_MXC_GPIO_H__
20#define __ASM_ARCH_MXC_GPIO_H__
21
22#include <linux/spinlock.h>
23#include <mach/hardware.h>
24#include <asm-generic/gpio.h>
25
26/* use gpiolib dispatchers */
27#define gpio_get_value __gpio_get_value
28#define gpio_set_value __gpio_set_value
29#define gpio_cansleep __gpio_cansleep
30#define gpio_to_irq __gpio_to_irq
31
32#endif
diff --git a/arch/arm/plat-mxc/include/mach/i2c.h b/arch/arm/plat-mxc/include/mach/i2c.h
index 4a5dc5c6d8e8..375cdd0cf876 100644
--- a/arch/arm/plat-mxc/include/mach/i2c.h
+++ b/arch/arm/plat-mxc/include/mach/i2c.h
@@ -11,14 +11,10 @@
11 11
12/** 12/**
13 * struct imxi2c_platform_data - structure of platform data for MXC I2C driver 13 * struct imxi2c_platform_data - structure of platform data for MXC I2C driver
14 * @init: Initialise gpio's and other board specific things
15 * @exit: Free everything initialised by @init
16 * @bitrate: Bus speed measured in Hz 14 * @bitrate: Bus speed measured in Hz
17 * 15 *
18 **/ 16 **/
19struct imxi2c_platform_data { 17struct imxi2c_platform_data {
20 int (*init)(struct device *dev);
21 void (*exit)(struct device *dev);
22 int bitrate; 18 int bitrate;
23}; 19};
24 20
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
index 35e0df224caa..2fa3b5430102 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
@@ -90,11 +90,11 @@ typedef u64 iomux_v3_cfg_t;
90#define PAD_CTL_HYS (1 << 8) 90#define PAD_CTL_HYS (1 << 8)
91 91
92#define PAD_CTL_PKE (1 << 7) 92#define PAD_CTL_PKE (1 << 7)
93#define PAD_CTL_PUE (1 << 6) 93#define PAD_CTL_PUE (1 << 6 | PAD_CTL_PKE)
94#define PAD_CTL_PUS_100K_DOWN (0 << 4) 94#define PAD_CTL_PUS_100K_DOWN (0 << 4 | PAD_CTL_PUE)
95#define PAD_CTL_PUS_47K_UP (1 << 4) 95#define PAD_CTL_PUS_47K_UP (1 << 4 | PAD_CTL_PUE)
96#define PAD_CTL_PUS_100K_UP (2 << 4) 96#define PAD_CTL_PUS_100K_UP (2 << 4 | PAD_CTL_PUE)
97#define PAD_CTL_PUS_22K_UP (3 << 4) 97#define PAD_CTL_PUS_22K_UP (3 << 4 | PAD_CTL_PUE)
98 98
99#define PAD_CTL_ODE (1 << 3) 99#define PAD_CTL_ODE (1 << 3)
100 100
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index 1dc1c522601b..6265357284d7 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -24,10 +24,6 @@
24#ifndef __MACH_MX27_H__ 24#ifndef __MACH_MX27_H__
25#define __MACH_MX27_H__ 25#define __MACH_MX27_H__
26 26
27#ifndef __ASSEMBLER__
28#include <linux/io.h>
29#endif
30
31#define MX27_AIPI_BASE_ADDR 0x10000000 27#define MX27_AIPI_BASE_ADDR 0x10000000
32#define MX27_AIPI_SIZE SZ_1M 28#define MX27_AIPI_SIZE SZ_1M
33#define MX27_DMA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x01000) 29#define MX27_DMA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x01000)
@@ -131,16 +127,6 @@
131#define MX27_IO_P2V(x) IMX_IO_P2V(x) 127#define MX27_IO_P2V(x) IMX_IO_P2V(x)
132#define MX27_IO_ADDRESS(x) IOMEM(MX27_IO_P2V(x)) 128#define MX27_IO_ADDRESS(x) IOMEM(MX27_IO_P2V(x))
133 129
134#ifndef __ASSEMBLER__
135static inline void mx27_setup_weimcs(size_t cs,
136 unsigned upper, unsigned lower, unsigned addional)
137{
138 __raw_writel(upper, MX27_IO_ADDRESS(MX27_WEIM_CSCRxU(cs)));
139 __raw_writel(lower, MX27_IO_ADDRESS(MX27_WEIM_CSCRxL(cs)));
140 __raw_writel(addional, MX27_IO_ADDRESS(MX27_WEIM_CSCRxA(cs)));
141}
142#endif
143
144/* fixed interrupt numbers */ 130/* fixed interrupt numbers */
145#define MX27_INT_I2C2 1 131#define MX27_INT_I2C2 1
146#define MX27_INT_GPT6 2 132#define MX27_INT_GPT6 2
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index 79e7fc01bb59..e27619e442c0 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -1,10 +1,6 @@
1#ifndef __MACH_MX31_H__ 1#ifndef __MACH_MX31_H__
2#define __MACH_MX31_H__ 2#define __MACH_MX31_H__
3 3
4#ifndef __ASSEMBLER__
5#include <linux/io.h>
6#endif
7
8/* 4/*
9 * IRAM 5 * IRAM
10 */ 6 */
@@ -122,16 +118,6 @@
122#define MX31_IO_P2V(x) IMX_IO_P2V(x) 118#define MX31_IO_P2V(x) IMX_IO_P2V(x)
123#define MX31_IO_ADDRESS(x) IOMEM(MX31_IO_P2V(x)) 119#define MX31_IO_ADDRESS(x) IOMEM(MX31_IO_P2V(x))
124 120
125#ifndef __ASSEMBLER__
126static inline void mx31_setup_weimcs(size_t cs,
127 unsigned upper, unsigned lower, unsigned addional)
128{
129 __raw_writel(upper, MX31_IO_ADDRESS(MX31_WEIM_CSCRxU(cs)));
130 __raw_writel(lower, MX31_IO_ADDRESS(MX31_WEIM_CSCRxL(cs)));
131 __raw_writel(addional, MX31_IO_ADDRESS(MX31_WEIM_CSCRxA(cs)));
132}
133#endif
134
135#define MX31_INT_I2C3 3 121#define MX31_INT_I2C3 3
136#define MX31_INT_I2C2 4 122#define MX31_INT_I2C2 4
137#define MX31_INT_MPEG4_ENCODER 5 123#define MX31_INT_MPEG4_ENCODER 5