2 * Copyright 2009 Sascha Hauer, <kernel@pengutronix.de>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
20 * This machine is known as:
21 * - i.MX25 3-Stack Development System
22 * - i.MX25 Platform Development Kit (i.MX25 PDK)
25 #include <linux/types.h>
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/clk.h>
29 #include <linux/irq.h>
30 #include <linux/gpio.h>
31 #include <linux/platform_device.h>
32 #include <linux/input/matrix_keypad.h>
34 #include <mach/hardware.h>
35 #include <asm/mach-types.h>
36 #include <asm/mach/arch.h>
37 #include <asm/mach/time.h>
38 #include <asm/memory.h>
39 #include <asm/mach/map.h>
40 #include <mach/common.h>
41 #include <mach/mx25.h>
42 #include <mach/imxfb.h>
43 #include <mach/iomux-mx25.h>
45 #include "devices-imx25.h"
48 static const struct imxuart_platform_data uart_pdata __initconst = {
49 .flags = IMXUART_HAVE_RTSCTS,
52 static struct pad_desc mx25pdk_pads[] = {
53 MX25_PAD_FEC_MDC__FEC_MDC,
54 MX25_PAD_FEC_MDIO__FEC_MDIO,
55 MX25_PAD_FEC_TDATA0__FEC_TDATA0,
56 MX25_PAD_FEC_TDATA1__FEC_TDATA1,
57 MX25_PAD_FEC_TX_EN__FEC_TX_EN,
58 MX25_PAD_FEC_RDATA0__FEC_RDATA0,
59 MX25_PAD_FEC_RDATA1__FEC_RDATA1,
60 MX25_PAD_FEC_RX_DV__FEC_RX_DV,
61 MX25_PAD_FEC_TX_CLK__FEC_TX_CLK,
62 MX25_PAD_A17__GPIO_2_3, /* FEC_EN, GPIO 35 */
63 MX25_PAD_D12__GPIO_4_8, /* FEC_RESET_B, GPIO 104 */
82 MX25_PAD_GPIO_E__LD16,
83 MX25_PAD_GPIO_F__LD17,
84 MX25_PAD_HSYNC__HSYNC,
85 MX25_PAD_VSYNC__VSYNC,
86 MX25_PAD_LSCLK__LSCLK,
87 MX25_PAD_OE_ACD__OE_ACD,
88 MX25_PAD_CONTRAST__CONTRAST,
91 MX25_PAD_KPP_ROW0__KPP_ROW0,
92 MX25_PAD_KPP_ROW1__KPP_ROW1,
93 MX25_PAD_KPP_ROW2__KPP_ROW2,
94 MX25_PAD_KPP_ROW3__KPP_ROW3,
95 MX25_PAD_KPP_COL0__KPP_COL0,
96 MX25_PAD_KPP_COL1__KPP_COL1,
97 MX25_PAD_KPP_COL2__KPP_COL2,
98 MX25_PAD_KPP_COL3__KPP_COL3,
101 static const struct fec_platform_data mx25_fec_pdata __initconst = {
102 .phy = PHY_INTERFACE_MODE_RMII,
105 #define FEC_ENABLE_GPIO 35
106 #define FEC_RESET_B_GPIO 104
108 static void __init mx25pdk_fec_reset(void)
110 gpio_request(FEC_ENABLE_GPIO, "FEC PHY enable");
111 gpio_request(FEC_RESET_B_GPIO, "FEC PHY reset");
113 gpio_direction_output(FEC_ENABLE_GPIO, 0); /* drop PHY power */
114 gpio_direction_output(FEC_RESET_B_GPIO, 0); /* assert reset */
117 /* turn on PHY power and lift reset */
118 gpio_set_value(FEC_ENABLE_GPIO, 1);
119 gpio_set_value(FEC_RESET_B_GPIO, 1);
122 static const struct mxc_nand_platform_data
123 mx25pdk_nand_board_info __initconst = {
129 static struct imx_fb_videomode mx25pdk_modes[] = {
149 static struct imx_fb_platform_data mx25pdk_fb_pdata = {
150 .mode = mx25pdk_modes,
151 .num_modes = ARRAY_SIZE(mx25pdk_modes),
157 static const uint32_t mx25pdk_keymap[] = {
160 KEY(0, 2, KEY_VOLUMEDOWN),
162 KEY(1, 0, KEY_RIGHT),
164 KEY(1, 2, KEY_ENTER),
165 KEY(1, 3, KEY_VOLUMEUP),
173 KEY(3, 3, KEY_POWER),
176 static struct matrix_keymap_data mx25pdk_keymap_data = {
177 .keymap = mx25pdk_keymap,
178 .keymap_size = ARRAY_SIZE(mx25pdk_keymap),
181 static void __init mx25pdk_init(void)
183 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
184 ARRAY_SIZE(mx25pdk_pads));
186 imx25_add_imx_uart0(&uart_pdata);
187 mxc_register_device(&mxc_usbh2, NULL);
188 imx25_add_mxc_nand(&mx25pdk_nand_board_info);
189 mxc_register_device(&mx25_rtc_device, NULL);
190 mxc_register_device(&mx25_fb_device, &mx25pdk_fb_pdata);
191 mxc_register_device(&mxc_wdt, NULL);
194 imx25_add_fec(&mx25_fec_pdata);
195 mxc_register_device(&mx25_kpp_device, &mx25pdk_keymap_data);
198 static void __init mx25pdk_timer_init(void)
203 static struct sys_timer mx25pdk_timer = {
204 .init = mx25pdk_timer_init,
207 MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
208 /* Maintainer: Freescale Semiconductor, Inc. */
209 .boot_params = MX25_PHYS_OFFSET + 0x100,
210 .map_io = mx25_map_io,
211 .init_irq = mx25_init_irq,
212 .init_machine = mx25pdk_init,
213 .timer = &mx25pdk_timer,