2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
4 * Author: Fabio Estevam <fabio.estevam@freescale.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 * This machine is known as:
19 * - i.MX27 3-Stack Development System
20 * - i.MX27 Platform Development Kit (i.MX27 PDK)
23 #include <linux/platform_device.h>
24 #include <linux/gpio.h>
25 #include <linux/input/matrix_keypad.h>
26 #include <linux/irq.h>
27 #include <asm/mach-types.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/time.h>
30 #include <mach/hardware.h>
31 #include <mach/common.h>
32 #include <mach/iomux-mx27.h>
35 #include "devices-imx27.h"
38 #define SD1_EN_GPIO (GPIO_PORTB + 25)
40 static const int mx27pdk_pins
[] __initconst
= {
72 SD1_EN_GPIO
| GPIO_GPIO
| GPIO_OUT
,
75 static const struct imxuart_platform_data uart_pdata __initconst
= {
76 .flags
= IMXUART_HAVE_RTSCTS
,
83 static const uint32_t mx27_3ds_keymap
[] = {
95 static struct matrix_keymap_data mx27_3ds_keymap_data
= {
96 .keymap
= mx27_3ds_keymap
,
97 .keymap_size
= ARRAY_SIZE(mx27_3ds_keymap
),
100 static int mx27_3ds_sdhc1_init(struct device
*dev
, irq_handler_t detect_irq
,
103 return request_irq(IRQ_GPIOB(26), detect_irq
, IRQF_TRIGGER_FALLING
|
104 IRQF_TRIGGER_RISING
, "sdhc1-card-detect", data
);
107 static void mx27_3ds_sdhc1_exit(struct device
*dev
, void *data
)
109 free_irq(IRQ_GPIOB(26), data
);
112 static struct imxmmc_platform_data sdhc1_pdata
= {
113 .init
= mx27_3ds_sdhc1_init
,
114 .exit
= mx27_3ds_sdhc1_exit
,
117 static void mx27_3ds_sdhc1_enable_level_translator(void)
119 /* Turn on TXB0108 OE pin */
120 gpio_request(SD1_EN_GPIO
, "sd1_enable");
121 gpio_direction_output(SD1_EN_GPIO
, 1);
124 static void __init
mx27pdk_init(void)
126 mxc_gpio_setup_multiple_pins(mx27pdk_pins
, ARRAY_SIZE(mx27pdk_pins
),
128 mx27_3ds_sdhc1_enable_level_translator();
129 imx27_add_imx_uart0(&uart_pdata
);
131 mxc_register_device(&imx_kpp_device
, &mx27_3ds_keymap_data
);
132 mxc_register_device(&mxc_sdhc_device0
, &sdhc1_pdata
);
135 static void __init
mx27pdk_timer_init(void)
137 mx27_clocks_init(26000000);
140 static struct sys_timer mx27pdk_timer
= {
141 .init
= mx27pdk_timer_init
,
144 MACHINE_START(MX27_3DS
, "Freescale MX27PDK")
145 /* maintainer: Freescale Semiconductor, Inc. */
146 .boot_params
= MX27_PHYS_OFFSET
+ 0x100,
147 .map_io
= mx27_map_io
,
148 .init_irq
= mx27_init_irq
,
149 .init_machine
= mx27pdk_init
,
150 .timer
= &mx27pdk_timer
,