aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2011-04-29 09:06:39 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-02 14:08:54 -0400
commita98253e8006a016bcb49c2d9c77041266ea3c5f5 (patch)
treeeebefac0691fe220f3dfb3af4ce4028017de1ab6 /arch/arm/mach-mxs
parent3fd9952df4964fac7d5868ba48eadcc9dae3ba46 (diff)
ARM: mach-mxs: add stmp378x-devb
STMP378x and MX23 are the same and just relabeled. There is a mach-stmp378x, however, it has a lot of reinvented interfaces, leaking all sorts of mach-specific functions into the drivers. One example is the dmaengine which does not use the linux dmaengine-API but some privately exported symbols. This makes generic use of the drivers impossible. mach-mxs does it better, so convert the board to mach-mxs. After that, it is possible to delete all stmp-specific code which should ease further ARM-consolidation. Compile tested only due to no hardware (seems not available anymore). Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r--arch/arm/mach-mxs/Kconfig10
-rw-r--r--arch/arm/mach-mxs/Makefile1
-rw-r--r--arch/arm/mach-mxs/mach-stmp378x_devb.c120
3 files changed, 131 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 4522fbb235d5..edacefac2270 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -17,6 +17,16 @@ config SOC_IMX28
17 17
18comment "MXS platforms:" 18comment "MXS platforms:"
19 19
20config MACH_STMP378X_DEVB
21 bool "Support STMP378x_devb Platform"
22 select SOC_IMX23
23 select MXS_HAVE_AMBA_DUART
24 select MXS_HAVE_PLATFORM_AUART
25 select MXS_HAVE_PLATFORM_MXS_MMC
26 help
27 Include support for STMP378x-devb platform. This includes specific
28 configurations for the board and its peripherals.
29
20config MACH_MX23EVK 30config MACH_MX23EVK
21 bool "Support MX23EVK Platform" 31 bool "Support MX23EVK Platform"
22 select SOC_IMX23 32 select SOC_IMX23
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
index 2f1f6141ca71..58e892376bf2 100644
--- a/arch/arm/mach-mxs/Makefile
+++ b/arch/arm/mach-mxs/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_PM) += pm.o
7obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o 7obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o
8obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o 8obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o
9 9
10obj-$(CONFIG_MACH_STMP378X_DEVB) += mach-stmp378x_devb.o
10obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o 11obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o
11obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o 12obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o
12obj-$(CONFIG_MODULE_TX28) += module-tx28.o 13obj-$(CONFIG_MODULE_TX28) += module-tx28.o
diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c b/arch/arm/mach-mxs/mach-stmp378x_devb.c
new file mode 100644
index 000000000000..7f38d82b69af
--- /dev/null
+++ b/arch/arm/mach-mxs/mach-stmp378x_devb.c
@@ -0,0 +1,120 @@
1/*
2 * board setup for STMP378x-Development-Board
3 *
4 * based on mx23evk board setup and information gained form the original
5 * plat-stmp based board setup, now converted to mach-mxs.
6 *
7 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
8 * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20#include <linux/platform_device.h>
21#include <linux/gpio.h>
22#include <linux/irq.h>
23#include <linux/spi/spi.h>
24
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/mach/time.h>
28
29#include <mach/common.h>
30#include <mach/iomux-mx23.h>
31
32#include "devices-mx23.h"
33
34#define STMP378X_DEVB_MMC0_WRITE_PROTECT MXS_GPIO_NR(1, 30)
35#define STMP378X_DEVB_MMC0_SLOT_POWER MXS_GPIO_NR(1, 29)
36
37#define STMP378X_DEVB_PAD_AUART (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL)
38
39static const iomux_cfg_t stmp378x_dvb_pads[] __initconst = {
40 /* duart (extended setup missing in old boardcode, too */
41 MX23_PAD_PWM0__DUART_RX,
42 MX23_PAD_PWM1__DUART_TX,
43
44 /* auart */
45 MX23_PAD_AUART1_RX__AUART1_RX | STMP378X_DEVB_PAD_AUART,
46 MX23_PAD_AUART1_TX__AUART1_TX | STMP378X_DEVB_PAD_AUART,
47 MX23_PAD_AUART1_CTS__AUART1_CTS | STMP378X_DEVB_PAD_AUART,
48 MX23_PAD_AUART1_RTS__AUART1_RTS | STMP378X_DEVB_PAD_AUART,
49
50 /* mmc */
51 MX23_PAD_SSP1_DATA0__SSP1_DATA0 |
52 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
53 MX23_PAD_SSP1_DATA1__SSP1_DATA1 |
54 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
55 MX23_PAD_SSP1_DATA2__SSP1_DATA2 |
56 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
57 MX23_PAD_SSP1_DATA3__SSP1_DATA3 |
58 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
59 MX23_PAD_SSP1_CMD__SSP1_CMD |
60 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
61 MX23_PAD_SSP1_DETECT__SSP1_DETECT |
62 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
63 MX23_PAD_SSP1_SCK__SSP1_SCK |
64 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
65 MX23_PAD_PWM4__GPIO_1_30 | MXS_PAD_CTRL, /* write protect */
66 MX23_PAD_PWM3__GPIO_1_29 | MXS_PAD_CTRL, /* power enable */
67};
68
69static struct mxs_mmc_platform_data stmp378x_dvb_mmc_pdata __initdata = {
70 .wp_gpio = STMP378X_DEVB_MMC0_WRITE_PROTECT,
71};
72
73static struct spi_board_info spi_board_info[] __initdata = {
74#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
75 {
76 .modalias = "enc28j60",
77 .max_speed_hz = 6 * 1000 * 1000,
78 .bus_num = 1,
79 .chip_select = 0,
80 .platform_data = NULL,
81 },
82#endif
83};
84
85static void __init stmp378x_dvb_init(void)
86{
87 int ret;
88
89 mxs_iomux_setup_multiple_pads(stmp378x_dvb_pads,
90 ARRAY_SIZE(stmp378x_dvb_pads));
91
92 mx23_add_duart();
93 mx23_add_auart0();
94
95 /* power on mmc slot */
96 ret = gpio_request_one(STMP378X_DEVB_MMC0_SLOT_POWER,
97 GPIOF_OUT_INIT_LOW, "mmc0-slot-power");
98 if (ret)
99 pr_warn("could not power mmc (%d)\n", ret);
100
101 mx23_add_mxs_mmc(0, &stmp378x_dvb_mmc_pdata);
102
103 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
104}
105
106static void __init stmp378x_dvb_timer_init(void)
107{
108 mx23_clocks_init();
109}
110
111static struct sys_timer stmp378x_dvb_timer = {
112 .init = stmp378x_dvb_timer_init,
113};
114
115MACHINE_START(STMP378X, "STMP378X")
116 .map_io = mx23_map_io,
117 .init_irq = mx23_init_irq,
118 .init_machine = stmp378x_dvb_init,
119 .timer = &stmp378x_dvb_timer,
120MACHINE_END