aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r--arch/arm/mach-mx3/Kconfig14
-rw-r--r--arch/arm/mach-mx3/Makefile2
-rw-r--r--arch/arm/mach-mx3/clock.c1
-rw-r--r--arch/arm/mach-mx3/devices.c40
-rw-r--r--arch/arm/mach-mx3/devices.h2
-rw-r--r--arch/arm/mach-mx3/iomux.c9
-rw-r--r--arch/arm/mach-mx3/mx31moboard.c141
-rw-r--r--arch/arm/mach-mx3/mx31pdk.c115
-rw-r--r--arch/arm/mach-mx3/pcm037.c70
9 files changed, 387 insertions, 7 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index db9431dee1b4..e79659e8176e 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -21,5 +21,19 @@ config MACH_MX31LITE
21 Include support for MX31 LITEKIT platform. This includes specific 21 Include support for MX31 LITEKIT platform. This includes specific
22 configurations for the board and its peripherals. 22 configurations for the board and its peripherals.
23 23
24config MACH_MX31_3DS
25 bool "Support MX31PDK (3DS)"
26 default n
27 help
28 Include support for MX31PDK (3DS) platform. This includes specific
29 configurations for the board and its peripherals.
30
31config MACH_MX31MOBOARD
32 bool "Support mx31moboard platforms (EPFL Mobots group)"
33 default n
34 help
35 Include support for mx31moboard platform. This includes specific
36 configurations for the board and its peripherals.
37
24endmenu 38endmenu
25 39
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 8b21abb71fb0..5a151540fe83 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -8,3 +8,5 @@ obj-y := mm.o clock.o devices.o iomux.o
8obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o 8obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
9obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o 9obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o
10obj-$(CONFIG_MACH_PCM037) += pcm037.o 10obj-$(CONFIG_MACH_PCM037) += pcm037.o
11obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
12obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index 9f14a871ee7c..b1746aae1f89 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -24,6 +24,7 @@
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <mach/clock.h> 26#include <mach/clock.h>
27#include <mach/hardware.h>
27#include <asm/div64.h> 28#include <asm/div64.h>
28 29
29#include "crm_regs.h" 30#include "crm_regs.h"
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index a6bdcc07f3c9..1d46cb4adf96 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -125,19 +125,19 @@ static struct mxc_gpio_port imx_gpio_ports[] = {
125 .chip.label = "gpio-0", 125 .chip.label = "gpio-0",
126 .base = IO_ADDRESS(GPIO1_BASE_ADDR), 126 .base = IO_ADDRESS(GPIO1_BASE_ADDR),
127 .irq = MXC_INT_GPIO1, 127 .irq = MXC_INT_GPIO1,
128 .virtual_irq_start = MXC_GPIO_INT_BASE 128 .virtual_irq_start = MXC_GPIO_IRQ_START,
129 }, 129 },
130 [1] = { 130 [1] = {
131 .chip.label = "gpio-1", 131 .chip.label = "gpio-1",
132 .base = IO_ADDRESS(GPIO2_BASE_ADDR), 132 .base = IO_ADDRESS(GPIO2_BASE_ADDR),
133 .irq = MXC_INT_GPIO2, 133 .irq = MXC_INT_GPIO2,
134 .virtual_irq_start = MXC_GPIO_INT_BASE + GPIO_NUM_PIN 134 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
135 }, 135 },
136 [2] = { 136 [2] = {
137 .chip.label = "gpio-2", 137 .chip.label = "gpio-2",
138 .base = IO_ADDRESS(GPIO3_BASE_ADDR), 138 .base = IO_ADDRESS(GPIO3_BASE_ADDR),
139 .irq = MXC_INT_GPIO3, 139 .irq = MXC_INT_GPIO3,
140 .virtual_irq_start = MXC_GPIO_INT_BASE + GPIO_NUM_PIN * 2 140 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
141 } 141 }
142}; 142};
143 143
@@ -145,3 +145,37 @@ int __init mxc_register_gpios(void)
145{ 145{
146 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); 146 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
147} 147}
148
149static struct resource mxc_w1_master_resources[] = {
150 {
151 .start = OWIRE_BASE_ADDR,
152 .end = OWIRE_BASE_ADDR + SZ_4K - 1,
153 .flags = IORESOURCE_MEM,
154 },
155};
156
157struct platform_device mxc_w1_master_device = {
158 .name = "mxc_w1",
159 .id = 0,
160 .num_resources = ARRAY_SIZE(mxc_w1_master_resources),
161 .resource = mxc_w1_master_resources,
162};
163
164static struct resource mxc_nand_resources[] = {
165 {
166 .start = NFC_BASE_ADDR,
167 .end = NFC_BASE_ADDR + 0xfff,
168 .flags = IORESOURCE_MEM
169 }, {
170 .start = MXC_INT_NANDFC,
171 .end = MXC_INT_NANDFC,
172 .flags = IORESOURCE_IRQ
173 },
174};
175
176struct platform_device mxc_nand_device = {
177 .name = "mxc_nand",
178 .id = 0,
179 .num_resources = ARRAY_SIZE(mxc_nand_resources),
180 .resource = mxc_nand_resources,
181};
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index 4dc03f9e6001..9949ef4e0694 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -4,3 +4,5 @@ extern struct platform_device mxc_uart_device1;
4extern struct platform_device mxc_uart_device2; 4extern struct platform_device mxc_uart_device2;
5extern struct platform_device mxc_uart_device3; 5extern struct platform_device mxc_uart_device3;
6extern struct platform_device mxc_uart_device4; 6extern struct platform_device mxc_uart_device4;
7extern struct platform_device mxc_w1_master_device;
8extern struct platform_device mxc_nand_device;
diff --git a/arch/arm/mach-mx3/iomux.c b/arch/arm/mach-mx3/iomux.c
index 6e664be8cc13..7a5088b519a8 100644
--- a/arch/arm/mach-mx3/iomux.c
+++ b/arch/arm/mach-mx3/iomux.c
@@ -74,17 +74,18 @@ void mxc_iomux_set_pad(enum iomux_pins pin, u32 config)
74 u32 field, l; 74 u32 field, l;
75 void __iomem *reg; 75 void __iomem *reg;
76 76
77 reg = IOMUXSW_PAD_CTL + (pin + 2) / 3; 77 pin &= IOMUX_PADNUM_MASK;
78 reg = IOMUXSW_PAD_CTL + (pin + 2) / 3 * 4;
78 field = (pin + 2) % 3; 79 field = (pin + 2) % 3;
79 80
80 pr_debug("%s: reg offset = 0x%x field = %d\n", 81 pr_debug("%s: reg offset = 0x%x, field = %d\n",
81 __func__, (pin + 2) / 3, field); 82 __func__, (pin + 2) / 3, field);
82 83
83 spin_lock(&gpio_mux_lock); 84 spin_lock(&gpio_mux_lock);
84 85
85 l = __raw_readl(reg); 86 l = __raw_readl(reg);
86 l &= ~(0x1ff << (field * 9)); 87 l &= ~(0x1ff << (field * 10));
87 l |= config << (field * 9); 88 l |= config << (field * 10);
88 __raw_writel(l, reg); 89 __raw_writel(l, reg);
89 90
90 spin_unlock(&gpio_mux_lock); 91 spin_unlock(&gpio_mux_lock);
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c
new file mode 100644
index 000000000000..c29098af7394
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31moboard.c
@@ -0,0 +1,141 @@
1/*
2 * Copyright (C) 2008 Valentin Longchamp, EPFL Mobots group
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#include <linux/types.h>
20#include <linux/init.h>
21
22#include <linux/platform_device.h>
23#include <linux/mtd/physmap.h>
24#include <linux/mtd/partitions.h>
25#include <linux/memory.h>
26
27#include <mach/hardware.h>
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/time.h>
31#include <asm/mach/map.h>
32#include <mach/common.h>
33#include <mach/imx-uart.h>
34#include <mach/iomux-mx3.h>
35
36#include "devices.h"
37
38static struct physmap_flash_data mx31moboard_flash_data = {
39 .width = 2,
40};
41
42static struct resource mx31moboard_flash_resource = {
43 .start = 0xa0000000,
44 .end = 0xa1ffffff,
45 .flags = IORESOURCE_MEM,
46};
47
48static struct platform_device mx31moboard_flash = {
49 .name = "physmap-flash",
50 .id = 0,
51 .dev = {
52 .platform_data = &mx31moboard_flash_data,
53 },
54 .resource = &mx31moboard_flash_resource,
55 .num_resources = 1,
56};
57
58static struct imxuart_platform_data uart_pdata = {
59 .flags = IMXUART_HAVE_RTSCTS,
60};
61
62static struct platform_device *devices[] __initdata = {
63 &mx31moboard_flash,
64};
65
66/*
67 * Board specific initialization.
68 */
69static void __init mxc_board_init(void)
70{
71 platform_add_devices(devices, ARRAY_SIZE(devices));
72
73 mxc_iomux_mode(MX31_PIN_CTS1__CTS1);
74 mxc_iomux_mode(MX31_PIN_RTS1__RTS1);
75 mxc_iomux_mode(MX31_PIN_TXD1__TXD1);
76 mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
77
78 mxc_register_device(&mxc_uart_device0, &uart_pdata);
79
80 mxc_iomux_mode(MX31_PIN_CTS2__CTS2);
81 mxc_iomux_mode(MX31_PIN_RTS2__RTS2);
82 mxc_iomux_mode(MX31_PIN_TXD2__TXD2);
83 mxc_iomux_mode(MX31_PIN_RXD2__RXD2);
84
85 mxc_register_device(&mxc_uart_device1, &uart_pdata);
86
87 mxc_iomux_mode(MX31_PIN_PC_RST__CTS5);
88 mxc_iomux_mode(MX31_PIN_PC_VS2__RTS5);
89 mxc_iomux_mode(MX31_PIN_PC_BVD2__TXD5);
90 mxc_iomux_mode(MX31_PIN_PC_BVD1__RXD5);
91
92 mxc_register_device(&mxc_uart_device4, &uart_pdata);
93}
94
95/*
96 * This structure defines static mappings for the mx31moboard.
97 */
98static struct map_desc mx31moboard_io_desc[] __initdata = {
99 {
100 .virtual = AIPS1_BASE_ADDR_VIRT,
101 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
102 .length = AIPS1_SIZE,
103 .type = MT_DEVICE_NONSHARED
104 }, {
105 .virtual = AIPS2_BASE_ADDR_VIRT,
106 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
107 .length = AIPS2_SIZE,
108 .type = MT_DEVICE_NONSHARED
109 },
110};
111
112/*
113 * Set up static virtual mappings.
114 */
115void __init mx31moboard_map_io(void)
116{
117 mxc_map_io();
118 iotable_init(mx31moboard_io_desc, ARRAY_SIZE(mx31moboard_io_desc));
119}
120
121static void __init mx31moboard_timer_init(void)
122{
123 mxc_clocks_init(26000000);
124 mxc_timer_init("ipg_clk.0");
125}
126
127struct sys_timer mx31moboard_timer = {
128 .init = mx31moboard_timer_init,
129};
130
131MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
132 /* Maintainer: Valentin Longchamp, EPFL Mobots group */
133 .phys_io = AIPS1_BASE_ADDR,
134 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
135 .boot_params = PHYS_OFFSET + 0x100,
136 .map_io = mx31moboard_map_io,
137 .init_irq = mxc_init_irq,
138 .init_machine = mxc_board_init,
139 .timer = &mx31moboard_timer,
140MACHINE_END
141
diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c
new file mode 100644
index 000000000000..d464d068a4a6
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31pdk.c
@@ -0,0 +1,115 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#include <linux/types.h>
20#include <linux/init.h>
21#include <linux/clk.h>
22#include <linux/irq.h>
23
24#include <mach/hardware.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/mach/time.h>
28#include <asm/memory.h>
29#include <asm/mach/map.h>
30#include <mach/common.h>
31#include <mach/board-mx31pdk.h>
32#include <mach/imx-uart.h>
33#include <mach/iomux-mx3.h>
34#include "devices.h"
35
36/*!
37 * @file mx31pdk.c
38 *
39 * @brief This file contains the board-specific initialization routines.
40 *
41 * @ingroup System
42 */
43
44static struct imxuart_platform_data uart_pdata = {
45 .flags = IMXUART_HAVE_RTSCTS,
46};
47
48static inline void mxc_init_imx_uart(void)
49{
50 mxc_iomux_mode(MX31_PIN_CTS1__CTS1);
51 mxc_iomux_mode(MX31_PIN_RTS1__RTS1);
52 mxc_iomux_mode(MX31_PIN_TXD1__TXD1);
53 mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
54
55 mxc_register_device(&mxc_uart_device0, &uart_pdata);
56}
57
58/*!
59 * This structure defines static mappings for the i.MX31PDK board.
60 */
61static struct map_desc mx31pdk_io_desc[] __initdata = {
62 {
63 .virtual = AIPS1_BASE_ADDR_VIRT,
64 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
65 .length = AIPS1_SIZE,
66 .type = MT_DEVICE_NONSHARED
67 }, {
68 .virtual = AIPS2_BASE_ADDR_VIRT,
69 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
70 .length = AIPS2_SIZE,
71 .type = MT_DEVICE_NONSHARED
72 },
73};
74
75/*!
76 * Set up static virtual mappings.
77 */
78static void __init mx31pdk_map_io(void)
79{
80 mxc_map_io();
81 iotable_init(mx31pdk_io_desc, ARRAY_SIZE(mx31pdk_io_desc));
82}
83
84/*!
85 * Board specific initialization.
86 */
87static void __init mxc_board_init(void)
88{
89 mxc_init_imx_uart();
90}
91
92static void __init mx31pdk_timer_init(void)
93{
94 mxc_clocks_init(26000000);
95 mxc_timer_init("ipg_clk.0");
96}
97
98static struct sys_timer mx31pdk_timer = {
99 .init = mx31pdk_timer_init,
100};
101
102/*
103 * The following uses standard kernel macros defined in arch.h in order to
104 * initialize __mach_desc_MX31PDK data structure.
105 */
106MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
107 /* Maintainer: Freescale Semiconductor, Inc. */
108 .phys_io = AIPS1_BASE_ADDR,
109 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
110 .boot_params = PHYS_OFFSET + 0x100,
111 .map_io = mx31pdk_map_io,
112 .init_irq = mxc_init_irq,
113 .init_machine = mxc_board_init,
114 .timer = &mx31pdk_timer,
115MACHINE_END
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
index 843f68c8ead1..8cea82587222 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/pcm037.c
@@ -21,7 +21,11 @@
21 21
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/mtd/plat-ram.h>
24#include <linux/memory.h> 25#include <linux/memory.h>
26#include <linux/gpio.h>
27#include <linux/smc911x.h>
28#include <linux/interrupt.h>
25 29
26#include <mach/hardware.h> 30#include <mach/hardware.h>
27#include <asm/mach-types.h> 31#include <asm/mach-types.h>
@@ -32,6 +36,7 @@
32#include <mach/imx-uart.h> 36#include <mach/imx-uart.h>
33#include <mach/iomux-mx3.h> 37#include <mach/iomux-mx3.h>
34#include <mach/board-pcm037.h> 38#include <mach/board-pcm037.h>
39#include <mach/mxc_nand.h>
35 40
36#include "devices.h" 41#include "devices.h"
37 42
@@ -59,8 +64,63 @@ static struct imxuart_platform_data uart_pdata = {
59 .flags = IMXUART_HAVE_RTSCTS, 64 .flags = IMXUART_HAVE_RTSCTS,
60}; 65};
61 66
67static struct resource smc911x_resources[] = {
68 [0] = {
69 .start = CS1_BASE_ADDR + 0x300,
70 .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1,
71 .flags = IORESOURCE_MEM,
72 },
73 [1] = {
74 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
75 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
76 .flags = IORESOURCE_IRQ,
77 },
78};
79
80static struct smc911x_platdata smc911x_info = {
81 .flags = SMC911X_USE_32BIT,
82 .irq_flags = IRQF_SHARED | IRQF_TRIGGER_LOW,
83};
84
85static struct platform_device pcm037_eth = {
86 .name = "smc911x",
87 .id = -1,
88 .num_resources = ARRAY_SIZE(smc911x_resources),
89 .resource = smc911x_resources,
90 .dev = {
91 .platform_data = &smc911x_info,
92 },
93};
94
95static struct platdata_mtd_ram pcm038_sram_data = {
96 .bankwidth = 2,
97};
98
99static struct resource pcm038_sram_resource = {
100 .start = CS4_BASE_ADDR,
101 .end = CS4_BASE_ADDR + 512 * 1024 - 1,
102 .flags = IORESOURCE_MEM,
103};
104
105static struct platform_device pcm037_sram_device = {
106 .name = "mtd-ram",
107 .id = 0,
108 .dev = {
109 .platform_data = &pcm038_sram_data,
110 },
111 .num_resources = 1,
112 .resource = &pcm038_sram_resource,
113};
114
115static struct mxc_nand_platform_data pcm037_nand_board_info = {
116 .width = 1,
117 .hw_ecc = 1,
118};
119
62static struct platform_device *devices[] __initdata = { 120static struct platform_device *devices[] __initdata = {
63 &pcm037_flash, 121 &pcm037_flash,
122 &pcm037_eth,
123 &pcm037_sram_device,
64}; 124};
65 125
66/* 126/*
@@ -81,6 +141,16 @@ static void __init mxc_board_init(void)
81 mxc_iomux_mode(MX31_PIN_CSPI3_MISO__TXD3); 141 mxc_iomux_mode(MX31_PIN_CSPI3_MISO__TXD3);
82 142
83 mxc_register_device(&mxc_uart_device2, &uart_pdata); 143 mxc_register_device(&mxc_uart_device2, &uart_pdata);
144
145 mxc_iomux_mode(MX31_PIN_BATT_LINE__OWIRE);
146 mxc_register_device(&mxc_w1_master_device, NULL);
147
148 /* SMSC9215 IRQ pin */
149 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO));
150 if (!gpio_request(MX31_PIN_GPIO3_1, "pcm037-eth"))
151 gpio_direction_input(MX31_PIN_GPIO3_1);
152
153 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
84} 154}
85 155
86/* 156/*