mirror of
https://github.com/torvalds/linux.git
synced 2024-11-08 05:01:48 +00:00
ARM i.MX Eukrea Patches for 3.5
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABCAAGBQJPqhmiAAoJEPFlmONMx+ezPSMQAJ/giKwtW2bEhMG//ZeOdl8D /FFT/EBb/5up9b/apq36uPnAP6Sq+Gis0etf0B5u8hmhYE3ZMud/AarVVv303rx1 uk0aJhQaA2gz6ExzGloy/DPjfTeKada5p+gWNLG1JlQ1HHjjJWG/65d9KQx5J60g SmpwFbCI5FO+Q+jf4o5FrsPlx2wVPlSw0Vl8OnTVE0Q4EGLTrr4vvRk/oGGgeaZC lLN24NgF1ySXX4w0MWPlV/zGXMvzdPKE1o5aMrLWcObIfWDzZnH/LcHu3KGDnhyq N8hArLPkLIpvUsWi0baHVNnJGJNf48TXDOe+7NS72AADu6E/wJAkBU4p//WS8FZT blv/sZZJUG1NXsAr2Cez2cCEf6A5Bh4IG3EQOlcffKqiGxjXT/AtyTz+VIGtEoVU fqu/bI2DZdbw+7Up207L8ES6wEl/BsOoMuOkoeEmXlJyphYtgh88A+uLOZXh9q8n W5J+CvKMTtwKkRtEODPYWIEF9uBej6P3qROhSwLtihhId6/zCJaIjKNSX0h1+iON m0z4fBWxqcHTaZoP7E3Nw9uahxFniiIAncX+LF7tmloh+1eCouCM2W3jMbyA4p0Q f9yhXyMJC6yKeX5cv3UYNOAEM2S0DhM2VpJa0xm2xyl7gyaeBmgW3vGPT4Gy6cZ/ EDno7W1JdA6n2Y3F2HaP =luRc -----END PGP SIGNATURE----- Merge tag 'imx-eukrea' of git://git.pengutronix.de/git/imx/linux-2.6 into next/boards ARM i.MX Eukrea Patches for 3.5 By Eric Bénard (11) and Denis Carikli (1) via Sascha Hauer * tag 'imx-eukrea' of git://git.pengutronix.de/git/imx/linux-2.6: ARM: imx: eukrea_mbimxsd rename to eukrea_mbimxsd51 ARM: imx: eukrea_mbimxsd25: use IMX_GPIO_NR ARM: imx: eukrea_mbimxsd25: don't free twice GPIO_SWITCH1 ARM: imx: eukrea_mbimxsd: add backlight and lcd support ARM: imx: eukrea_cpuimx51sd: support rev2 PCB ARM: imx: eukrea_mbimxsd: add audio support ARM: imx: eukrea_cpuimx51sd: add watchdog support ARM: imx: eukrea-cpuimx51: remove board ARM: imx: eukrea_mbimxsd35: add spi controler and spidev support ARM: imx: eukrea_cpuimx25: add watchdog support ARM: imx: eukrea_mbimxsd25: add spi controler and spidev support ARM: imx: eukrea_cpuimx25: enable workaround ENGcm09152
This commit is contained in:
commit
afeb36f128
@ -163,6 +163,7 @@ config MACH_EUKREA_CPUIMX25SD
|
||||
select SOC_IMX25
|
||||
select IMX_HAVE_PLATFORM_FLEXCAN
|
||||
select IMX_HAVE_PLATFORM_FSL_USB2_UDC
|
||||
select IMX_HAVE_PLATFORM_IMX2_WDT
|
||||
select IMX_HAVE_PLATFORM_IMXDI_RTC
|
||||
select IMX_HAVE_PLATFORM_IMX_FB
|
||||
select IMX_HAVE_PLATFORM_IMX_I2C
|
||||
@ -181,6 +182,7 @@ config MACH_EUKREA_MBIMXSD25_BASEBOARD
|
||||
bool "Eukrea MBIMXSD development board"
|
||||
select IMX_HAVE_PLATFORM_GPIO_KEYS
|
||||
select IMX_HAVE_PLATFORM_IMX_SSI
|
||||
select IMX_HAVE_PLATFORM_SPI_IMX
|
||||
select LEDS_GPIO_REGISTER
|
||||
help
|
||||
This adds board specific devices that can be found on Eukrea's
|
||||
@ -606,6 +608,7 @@ config MACH_EUKREA_MBIMXSD35_BASEBOARD
|
||||
select IMX_HAVE_PLATFORM_GPIO_KEYS
|
||||
select IMX_HAVE_PLATFORM_IMX_SSI
|
||||
select IMX_HAVE_PLATFORM_IPU_CORE
|
||||
select IMX_HAVE_PLATFORM_SPI_IMX
|
||||
select LEDS_GPIO_REGISTER
|
||||
help
|
||||
This adds board specific devices that can be found on Eukrea's
|
||||
@ -682,42 +685,13 @@ config MACH_MX51_3DS
|
||||
Include support for MX51PDK (3DS) platform. This includes specific
|
||||
configurations for the board and its peripherals.
|
||||
|
||||
config MACH_EUKREA_CPUIMX51
|
||||
bool "Support Eukrea CPUIMX51 module"
|
||||
select SOC_IMX51
|
||||
select IMX_HAVE_PLATFORM_FSL_USB2_UDC
|
||||
select IMX_HAVE_PLATFORM_IMX_I2C
|
||||
select IMX_HAVE_PLATFORM_IMX_UART
|
||||
select IMX_HAVE_PLATFORM_MXC_EHCI
|
||||
select IMX_HAVE_PLATFORM_MXC_NAND
|
||||
select IMX_HAVE_PLATFORM_SPI_IMX
|
||||
help
|
||||
Include support for Eukrea CPUIMX51 platform. This includes
|
||||
specific configurations for the module and its peripherals.
|
||||
|
||||
choice
|
||||
prompt "Baseboard"
|
||||
depends on MACH_EUKREA_CPUIMX51
|
||||
default MACH_EUKREA_MBIMX51_BASEBOARD
|
||||
|
||||
config MACH_EUKREA_MBIMX51_BASEBOARD
|
||||
prompt "Eukrea MBIMX51 development board"
|
||||
bool
|
||||
select IMX_HAVE_PLATFORM_IMX_KEYPAD
|
||||
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
|
||||
select LEDS_GPIO_REGISTER
|
||||
help
|
||||
This adds board specific devices that can be found on Eukrea's
|
||||
MBIMX51 evaluation board.
|
||||
|
||||
endchoice
|
||||
|
||||
config MACH_EUKREA_CPUIMX51SD
|
||||
bool "Support Eukrea CPUIMX51SD module"
|
||||
select SOC_IMX51
|
||||
select IMX_HAVE_PLATFORM_FSL_USB2_UDC
|
||||
select IMX_HAVE_PLATFORM_IMX_I2C
|
||||
select IMX_HAVE_PLATFORM_IMX_UART
|
||||
select IMX_HAVE_PLATFORM_IMX2_WDT
|
||||
select IMX_HAVE_PLATFORM_MXC_EHCI
|
||||
select IMX_HAVE_PLATFORM_MXC_NAND
|
||||
select IMX_HAVE_PLATFORM_SPI_IMX
|
||||
@ -733,6 +707,7 @@ choice
|
||||
config MACH_EUKREA_MBIMXSD51_BASEBOARD
|
||||
prompt "Eukrea MBIMXSD development board"
|
||||
bool
|
||||
select IMX_HAVE_PLATFORM_IMX_SSI
|
||||
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
|
||||
select LEDS_GPIO_REGISTER
|
||||
help
|
||||
|
@ -83,10 +83,8 @@ obj-$(CONFIG_MACH_MX53_EVK) += mach-mx53_evk.o
|
||||
obj-$(CONFIG_MACH_MX53_SMD) += mach-mx53_smd.o
|
||||
obj-$(CONFIG_MACH_MX53_LOCO) += mach-mx53_loco.o
|
||||
obj-$(CONFIG_MACH_MX53_ARD) += mach-mx53_ard.o
|
||||
obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += mach-cpuimx51.o
|
||||
obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
|
||||
obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o
|
||||
obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o
|
||||
obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd51-baseboard.o
|
||||
obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o
|
||||
obj-$(CONFIG_MACH_MX51_EFIKAMX) += mach-mx51_efikamx.o
|
||||
obj-$(CONFIG_MACH_MX51_EFIKASB) += mach-mx51_efikasb.o
|
||||
|
@ -1,206 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2010 Eric Bénard <eric@eukrea.com>
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/i2c/tsc2007.h>
|
||||
#include <linux/leds.h>
|
||||
|
||||
#include <mach/common.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/iomux-mx51.h>
|
||||
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
#include "devices-imx51.h"
|
||||
|
||||
#define MBIMX51_TSC2007_GPIO IMX_GPIO_NR(3, 30)
|
||||
#define MBIMX51_LED0 IMX_GPIO_NR(3, 5)
|
||||
#define MBIMX51_LED1 IMX_GPIO_NR(3, 6)
|
||||
#define MBIMX51_LED2 IMX_GPIO_NR(3, 7)
|
||||
#define MBIMX51_LED3 IMX_GPIO_NR(3, 8)
|
||||
|
||||
static const struct gpio_led mbimx51_leds[] __initconst = {
|
||||
{
|
||||
.name = "led0",
|
||||
.default_trigger = "heartbeat",
|
||||
.active_low = 1,
|
||||
.gpio = MBIMX51_LED0,
|
||||
},
|
||||
{
|
||||
.name = "led1",
|
||||
.default_trigger = "nand-disk",
|
||||
.active_low = 1,
|
||||
.gpio = MBIMX51_LED1,
|
||||
},
|
||||
{
|
||||
.name = "led2",
|
||||
.default_trigger = "mmc0",
|
||||
.active_low = 1,
|
||||
.gpio = MBIMX51_LED2,
|
||||
},
|
||||
{
|
||||
.name = "led3",
|
||||
.default_trigger = "default-on",
|
||||
.active_low = 1,
|
||||
.gpio = MBIMX51_LED3,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct gpio_led_platform_data mbimx51_leds_info __initconst = {
|
||||
.leds = mbimx51_leds,
|
||||
.num_leds = ARRAY_SIZE(mbimx51_leds),
|
||||
};
|
||||
|
||||
static iomux_v3_cfg_t mbimx51_pads[] = {
|
||||
/* UART2 */
|
||||
MX51_PAD_UART2_RXD__UART2_RXD,
|
||||
MX51_PAD_UART2_TXD__UART2_TXD,
|
||||
|
||||
/* UART3 */
|
||||
MX51_PAD_UART3_RXD__UART3_RXD,
|
||||
MX51_PAD_UART3_TXD__UART3_TXD,
|
||||
MX51_PAD_KEY_COL4__UART3_RTS,
|
||||
MX51_PAD_KEY_COL5__UART3_CTS,
|
||||
|
||||
/* TSC2007 IRQ */
|
||||
MX51_PAD_NANDF_D10__GPIO3_30,
|
||||
|
||||
/* LEDS */
|
||||
MX51_PAD_DISPB2_SER_DIN__GPIO3_5,
|
||||
MX51_PAD_DISPB2_SER_DIO__GPIO3_6,
|
||||
MX51_PAD_DISPB2_SER_CLK__GPIO3_7,
|
||||
MX51_PAD_DISPB2_SER_RS__GPIO3_8,
|
||||
|
||||
/* KPP */
|
||||
MX51_PAD_KEY_ROW0__KEY_ROW0,
|
||||
MX51_PAD_KEY_ROW1__KEY_ROW1,
|
||||
MX51_PAD_KEY_ROW2__KEY_ROW2,
|
||||
MX51_PAD_KEY_ROW3__KEY_ROW3,
|
||||
MX51_PAD_KEY_COL0__KEY_COL0,
|
||||
MX51_PAD_KEY_COL1__KEY_COL1,
|
||||
MX51_PAD_KEY_COL2__KEY_COL2,
|
||||
MX51_PAD_KEY_COL3__KEY_COL3,
|
||||
|
||||
/* SD 1 */
|
||||
MX51_PAD_SD1_CMD__SD1_CMD,
|
||||
MX51_PAD_SD1_CLK__SD1_CLK,
|
||||
MX51_PAD_SD1_DATA0__SD1_DATA0,
|
||||
MX51_PAD_SD1_DATA1__SD1_DATA1,
|
||||
MX51_PAD_SD1_DATA2__SD1_DATA2,
|
||||
MX51_PAD_SD1_DATA3__SD1_DATA3,
|
||||
|
||||
/* SD 2 */
|
||||
MX51_PAD_SD2_CMD__SD2_CMD,
|
||||
MX51_PAD_SD2_CLK__SD2_CLK,
|
||||
MX51_PAD_SD2_DATA0__SD2_DATA0,
|
||||
MX51_PAD_SD2_DATA1__SD2_DATA1,
|
||||
MX51_PAD_SD2_DATA2__SD2_DATA2,
|
||||
MX51_PAD_SD2_DATA3__SD2_DATA3,
|
||||
};
|
||||
|
||||
static const struct imxuart_platform_data uart_pdata __initconst = {
|
||||
.flags = IMXUART_HAVE_RTSCTS,
|
||||
};
|
||||
|
||||
static int mbimx51_keymap[] = {
|
||||
KEY(0, 0, KEY_1),
|
||||
KEY(0, 1, KEY_2),
|
||||
KEY(0, 2, KEY_3),
|
||||
KEY(0, 3, KEY_UP),
|
||||
|
||||
KEY(1, 0, KEY_4),
|
||||
KEY(1, 1, KEY_5),
|
||||
KEY(1, 2, KEY_6),
|
||||
KEY(1, 3, KEY_LEFT),
|
||||
|
||||
KEY(2, 0, KEY_7),
|
||||
KEY(2, 1, KEY_8),
|
||||
KEY(2, 2, KEY_9),
|
||||
KEY(2, 3, KEY_RIGHT),
|
||||
|
||||
KEY(3, 0, KEY_0),
|
||||
KEY(3, 1, KEY_DOWN),
|
||||
KEY(3, 2, KEY_ESC),
|
||||
KEY(3, 3, KEY_ENTER),
|
||||
};
|
||||
|
||||
static const struct matrix_keymap_data mbimx51_map_data __initconst = {
|
||||
.keymap = mbimx51_keymap,
|
||||
.keymap_size = ARRAY_SIZE(mbimx51_keymap),
|
||||
};
|
||||
|
||||
static int tsc2007_get_pendown_state(void)
|
||||
{
|
||||
return !gpio_get_value(MBIMX51_TSC2007_GPIO);
|
||||
}
|
||||
|
||||
struct tsc2007_platform_data tsc2007_data = {
|
||||
.model = 2007,
|
||||
.x_plate_ohms = 180,
|
||||
.get_pendown_state = tsc2007_get_pendown_state,
|
||||
};
|
||||
|
||||
static struct i2c_board_info mbimx51_i2c_devices[] = {
|
||||
{
|
||||
I2C_BOARD_INFO("tsc2007", 0x49),
|
||||
.irq = IMX_GPIO_TO_IRQ(MBIMX51_TSC2007_GPIO),
|
||||
.platform_data = &tsc2007_data,
|
||||
}, {
|
||||
I2C_BOARD_INFO("tlv320aic23", 0x1a),
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* baseboard initialization.
|
||||
*/
|
||||
void __init eukrea_mbimx51_baseboard_init(void)
|
||||
{
|
||||
mxc_iomux_v3_setup_multiple_pads(mbimx51_pads,
|
||||
ARRAY_SIZE(mbimx51_pads));
|
||||
|
||||
imx51_add_imx_uart(1, NULL);
|
||||
imx51_add_imx_uart(2, &uart_pdata);
|
||||
|
||||
gpio_request(MBIMX51_LED0, "LED0");
|
||||
gpio_direction_output(MBIMX51_LED0, 1);
|
||||
gpio_free(MBIMX51_LED0);
|
||||
gpio_request(MBIMX51_LED1, "LED1");
|
||||
gpio_direction_output(MBIMX51_LED1, 1);
|
||||
gpio_free(MBIMX51_LED1);
|
||||
gpio_request(MBIMX51_LED2, "LED2");
|
||||
gpio_direction_output(MBIMX51_LED2, 1);
|
||||
gpio_free(MBIMX51_LED2);
|
||||
gpio_request(MBIMX51_LED3, "LED3");
|
||||
gpio_direction_output(MBIMX51_LED3, 1);
|
||||
gpio_free(MBIMX51_LED3);
|
||||
|
||||
gpio_led_register_device(-1, &mbimx51_leds_info);
|
||||
|
||||
imx51_add_imx_keypad(&mbimx51_map_data);
|
||||
|
||||
gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq");
|
||||
gpio_direction_input(MBIMX51_TSC2007_GPIO);
|
||||
irq_set_irq_type(gpio_to_irq(MBIMX51_TSC2007_GPIO),
|
||||
IRQF_TRIGGER_FALLING);
|
||||
i2c_register_board_info(1, mbimx51_i2c_devices,
|
||||
ARRAY_SIZE(mbimx51_i2c_devices));
|
||||
|
||||
imx51_add_sdhci_esdhc_imx(0, NULL);
|
||||
imx51_add_sdhci_esdhc_imx(1, NULL);
|
||||
}
|
@ -23,6 +23,7 @@
|
||||
#include <linux/leds.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <video/platform_lcd.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
@ -87,12 +88,22 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
|
||||
/* CAN */
|
||||
MX25_PAD_GPIO_D__CAN2_RX,
|
||||
MX25_PAD_GPIO_C__CAN2_TX,
|
||||
/* SPI1 */
|
||||
MX25_PAD_CSPI1_MOSI__CSPI1_MOSI,
|
||||
MX25_PAD_CSPI1_MISO__CSPI1_MISO,
|
||||
MX25_PAD_CSPI1_SS0__GPIO_1_16,
|
||||
MX25_PAD_CSPI1_SS1__GPIO_1_17,
|
||||
MX25_PAD_CSPI1_SCLK__CSPI1_SCLK,
|
||||
MX25_PAD_CSPI1_RDY__GPIO_2_22,
|
||||
};
|
||||
|
||||
#define GPIO_LED1 83
|
||||
#define GPIO_SWITCH1 82
|
||||
#define GPIO_SD1CD 52
|
||||
#define GPIO_LCDPWR 26
|
||||
#define GPIO_LED1 IMX_GPIO_NR(3, 19)
|
||||
#define GPIO_SWITCH1 IMX_GPIO_NR(3, 18)
|
||||
#define GPIO_SD1CD IMX_GPIO_NR(2, 20)
|
||||
#define GPIO_LCDPWR IMX_GPIO_NR(1, 26)
|
||||
#define GPIO_SPI1_SS0 IMX_GPIO_NR(1, 16)
|
||||
#define GPIO_SPI1_SS1 IMX_GPIO_NR(1, 17)
|
||||
#define GPIO_SPI1_IRQ IMX_GPIO_NR(2, 22)
|
||||
|
||||
static struct imx_fb_videomode eukrea_mximxsd_modes[] = {
|
||||
{
|
||||
@ -228,6 +239,30 @@ static struct esdhc_platform_data sd1_pdata = {
|
||||
.wp_type = ESDHC_WP_NONE,
|
||||
};
|
||||
|
||||
static struct spi_board_info eukrea_mbimxsd25_spi_board_info[] __initdata = {
|
||||
{
|
||||
.modalias = "spidev",
|
||||
.max_speed_hz = 20000000,
|
||||
.bus_num = 0,
|
||||
.chip_select = 0,
|
||||
.mode = SPI_MODE_0,
|
||||
},
|
||||
{
|
||||
.modalias = "spidev",
|
||||
.max_speed_hz = 20000000,
|
||||
.bus_num = 0,
|
||||
.chip_select = 1,
|
||||
.mode = SPI_MODE_0,
|
||||
},
|
||||
};
|
||||
|
||||
static int eukrea_mbimxsd25_spi_cs[] = {GPIO_SPI1_SS0, GPIO_SPI1_SS1};
|
||||
|
||||
static const struct spi_imx_master eukrea_mbimxsd25_spi0_data __initconst = {
|
||||
.chipselect = eukrea_mbimxsd25_spi_cs,
|
||||
.num_chipselect = ARRAY_SIZE(eukrea_mbimxsd25_spi_cs),
|
||||
};
|
||||
|
||||
/*
|
||||
* system init for baseboard usage. Will be called by cpuimx25 init.
|
||||
*
|
||||
@ -257,11 +292,17 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
|
||||
|
||||
gpio_request(GPIO_LCDPWR, "LCDPWR");
|
||||
gpio_direction_output(GPIO_LCDPWR, 1);
|
||||
gpio_free(GPIO_SWITCH1);
|
||||
|
||||
i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
|
||||
ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
|
||||
|
||||
gpio_request(GPIO_SPI1_IRQ, "SPI1_IRQ");
|
||||
gpio_direction_input(GPIO_SPI1_IRQ);
|
||||
gpio_free(GPIO_SPI1_IRQ);
|
||||
imx25_add_spi_imx0(&eukrea_mbimxsd25_spi0_data);
|
||||
spi_register_board_info(eukrea_mbimxsd25_spi_board_info,
|
||||
ARRAY_SIZE(eukrea_mbimxsd25_spi_board_info));
|
||||
|
||||
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
||||
gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
|
||||
imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <linux/leds.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <video/platform_lcd.h>
|
||||
#include <linux/i2c.h>
|
||||
|
||||
@ -158,12 +159,22 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
|
||||
MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
|
||||
/* SD1 CD */
|
||||
MX35_PAD_LD18__GPIO3_24,
|
||||
/* SPI */
|
||||
MX35_PAD_CSPI1_MOSI__CSPI1_MOSI,
|
||||
MX35_PAD_CSPI1_MISO__CSPI1_MISO,
|
||||
MX35_PAD_CSPI1_SS0__GPIO1_18,
|
||||
MX35_PAD_CSPI1_SS1__GPIO1_19,
|
||||
MX35_PAD_CSPI1_SCLK__CSPI1_SCLK,
|
||||
MX35_PAD_CSPI1_SPI_RDY__GPIO3_5,
|
||||
};
|
||||
|
||||
#define GPIO_LED1 IMX_GPIO_NR(3, 29)
|
||||
#define GPIO_SWITCH1 IMX_GPIO_NR(3, 25)
|
||||
#define GPIO_LCDPWR IMX_GPIO_NR(1, 4)
|
||||
#define GPIO_SD1CD IMX_GPIO_NR(3, 24)
|
||||
#define GPIO_SPI1_SS0 IMX_GPIO_NR(1, 18)
|
||||
#define GPIO_SPI1_SS1 IMX_GPIO_NR(1, 19)
|
||||
#define GPIO_SPI1_IRQ IMX_GPIO_NR(3, 5)
|
||||
|
||||
static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd,
|
||||
unsigned int power)
|
||||
@ -239,6 +250,30 @@ static struct esdhc_platform_data sd1_pdata = {
|
||||
.wp_type = ESDHC_WP_NONE,
|
||||
};
|
||||
|
||||
static struct spi_board_info eukrea_mbimxsd35_spi_board_info[] __initdata = {
|
||||
{
|
||||
.modalias = "spidev",
|
||||
.max_speed_hz = 20000000,
|
||||
.bus_num = 0,
|
||||
.chip_select = 0,
|
||||
.mode = SPI_MODE_0,
|
||||
},
|
||||
{
|
||||
.modalias = "spidev",
|
||||
.max_speed_hz = 20000000,
|
||||
.bus_num = 0,
|
||||
.chip_select = 1,
|
||||
.mode = SPI_MODE_0,
|
||||
},
|
||||
};
|
||||
|
||||
static int eukrea_mbimxsd35_spi_cs[] = {GPIO_SPI1_SS0, GPIO_SPI1_SS1};
|
||||
|
||||
static const struct spi_imx_master eukrea_mbimxsd35_spi0_data __initconst = {
|
||||
.chipselect = eukrea_mbimxsd35_spi_cs,
|
||||
.num_chipselect = ARRAY_SIZE(eukrea_mbimxsd35_spi_cs),
|
||||
};
|
||||
|
||||
/*
|
||||
* system init for baseboard usage. Will be called by cpuimx35 init.
|
||||
*
|
||||
@ -274,6 +309,13 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
|
||||
i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
|
||||
ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
|
||||
|
||||
gpio_request(GPIO_SPI1_IRQ, "SPI1_IRQ");
|
||||
gpio_direction_input(GPIO_SPI1_IRQ);
|
||||
gpio_free(GPIO_SPI1_IRQ);
|
||||
imx35_add_spi_imx0(&eukrea_mbimxsd35_spi0_data);
|
||||
spi_register_board_info(eukrea_mbimxsd35_spi_board_info,
|
||||
ARRAY_SIZE(eukrea_mbimxsd35_spi_board_info));
|
||||
|
||||
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
||||
gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
|
||||
imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <video/platform_lcd.h>
|
||||
#include <linux/backlight.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
@ -40,7 +42,7 @@
|
||||
|
||||
#include "devices-imx51.h"
|
||||
|
||||
static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
|
||||
static iomux_v3_cfg_t eukrea_mbimxsd51_pads[] = {
|
||||
/* LED */
|
||||
MX51_PAD_NANDF_D10__GPIO3_30,
|
||||
/* SWITCH */
|
||||
@ -66,12 +68,64 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
|
||||
NEW_PAD_CTRL(MX51_PAD_GPIO1_0__SD1_CD, PAD_CTL_PUS_22K_UP |
|
||||
PAD_CTL_PKE | PAD_CTL_SRE_FAST |
|
||||
PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
|
||||
/* SSI */
|
||||
MX51_PAD_AUD3_BB_TXD__AUD3_TXD,
|
||||
MX51_PAD_AUD3_BB_RXD__AUD3_RXD,
|
||||
MX51_PAD_AUD3_BB_CK__AUD3_TXC,
|
||||
MX51_PAD_AUD3_BB_FS__AUD3_TXFS,
|
||||
/* LCD Backlight */
|
||||
MX51_PAD_DI1_D1_CS__GPIO3_4,
|
||||
/* LCD RST */
|
||||
MX51_PAD_CSI1_D9__GPIO3_13,
|
||||
};
|
||||
|
||||
#define GPIO_LED1 IMX_GPIO_NR(3, 30)
|
||||
#define GPIO_SWITCH1 IMX_GPIO_NR(3, 31)
|
||||
#define GPIO_LCDRST IMX_GPIO_NR(3, 13)
|
||||
#define GPIO_LCDBL IMX_GPIO_NR(3, 4)
|
||||
|
||||
static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = {
|
||||
static void eukrea_mbimxsd51_lcd_power_set(struct plat_lcd_data *pd,
|
||||
unsigned int power)
|
||||
{
|
||||
if (power)
|
||||
gpio_direction_output(GPIO_LCDRST, 1);
|
||||
else
|
||||
gpio_direction_output(GPIO_LCDRST, 0);
|
||||
}
|
||||
|
||||
static struct plat_lcd_data eukrea_mbimxsd51_lcd_power_data = {
|
||||
.set_power = eukrea_mbimxsd51_lcd_power_set,
|
||||
};
|
||||
|
||||
static struct platform_device eukrea_mbimxsd51_lcd_powerdev = {
|
||||
.name = "platform-lcd",
|
||||
.dev.platform_data = &eukrea_mbimxsd51_lcd_power_data,
|
||||
};
|
||||
|
||||
static void eukrea_mbimxsd51_bl_set_intensity(int intensity)
|
||||
{
|
||||
if (intensity)
|
||||
gpio_direction_output(GPIO_LCDBL, 1);
|
||||
else
|
||||
gpio_direction_output(GPIO_LCDBL, 0);
|
||||
}
|
||||
|
||||
static struct generic_bl_info eukrea_mbimxsd51_bl_info = {
|
||||
.name = "eukrea_mbimxsd51-bl",
|
||||
.max_intensity = 0xff,
|
||||
.default_intensity = 0xff,
|
||||
.set_bl_intensity = eukrea_mbimxsd51_bl_set_intensity,
|
||||
};
|
||||
|
||||
static struct platform_device eukrea_mbimxsd51_bl_dev = {
|
||||
.name = "generic-bl",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &eukrea_mbimxsd51_bl_info,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct gpio_led eukrea_mbimxsd51_leds[] __initconst = {
|
||||
{
|
||||
.name = "led1",
|
||||
.default_trigger = "heartbeat",
|
||||
@ -81,12 +135,12 @@ static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = {
|
||||
};
|
||||
|
||||
static const struct gpio_led_platform_data
|
||||
eukrea_mbimxsd_led_info __initconst = {
|
||||
.leds = eukrea_mbimxsd_leds,
|
||||
.num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds),
|
||||
eukrea_mbimxsd51_led_info __initconst = {
|
||||
.leds = eukrea_mbimxsd51_leds,
|
||||
.num_leds = ARRAY_SIZE(eukrea_mbimxsd51_leds),
|
||||
};
|
||||
|
||||
static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
|
||||
static struct gpio_keys_button eukrea_mbimxsd51_gpio_buttons[] = {
|
||||
{
|
||||
.gpio = GPIO_SWITCH1,
|
||||
.code = BTN_0,
|
||||
@ -97,21 +151,39 @@ static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
|
||||
};
|
||||
|
||||
static const struct gpio_keys_platform_data
|
||||
eukrea_mbimxsd_button_data __initconst = {
|
||||
.buttons = eukrea_mbimxsd_gpio_buttons,
|
||||
.nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons),
|
||||
eukrea_mbimxsd51_button_data __initconst = {
|
||||
.buttons = eukrea_mbimxsd51_gpio_buttons,
|
||||
.nbuttons = ARRAY_SIZE(eukrea_mbimxsd51_gpio_buttons),
|
||||
};
|
||||
|
||||
static const struct imxuart_platform_data uart_pdata __initconst = {
|
||||
.flags = IMXUART_HAVE_RTSCTS,
|
||||
};
|
||||
|
||||
static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = {
|
||||
static struct i2c_board_info eukrea_mbimxsd51_i2c_devices[] = {
|
||||
{
|
||||
I2C_BOARD_INFO("tlv320aic23", 0x1a),
|
||||
},
|
||||
};
|
||||
|
||||
static const
|
||||
struct imx_ssi_platform_data eukrea_mbimxsd51_ssi_pdata __initconst = {
|
||||
.flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE,
|
||||
};
|
||||
|
||||
static int screen_type;
|
||||
|
||||
static int __init eukrea_mbimxsd51_screen_type(char *options)
|
||||
{
|
||||
if (!strcmp(options, "dvi"))
|
||||
screen_type = 1;
|
||||
else if (!strcmp(options, "tft"))
|
||||
screen_type = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
__setup("screen_type=", eukrea_mbimxsd51_screen_type);
|
||||
|
||||
/*
|
||||
* system init for baseboard usage. Will be called by cpuimx51sd init.
|
||||
*
|
||||
@ -120,8 +192,8 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = {
|
||||
*/
|
||||
void __init eukrea_mbimxsd51_baseboard_init(void)
|
||||
{
|
||||
if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd_pads,
|
||||
ARRAY_SIZE(eukrea_mbimxsd_pads)))
|
||||
if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd51_pads,
|
||||
ARRAY_SIZE(eukrea_mbimxsd51_pads)))
|
||||
printk(KERN_ERR "error setting mbimxsd pads !\n");
|
||||
|
||||
imx51_add_imx_uart(1, NULL);
|
||||
@ -129,6 +201,8 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
|
||||
|
||||
imx51_add_sdhci_esdhc_imx(0, NULL);
|
||||
|
||||
imx51_add_imx_ssi(0, &eukrea_mbimxsd51_ssi_pdata);
|
||||
|
||||
gpio_request(GPIO_LED1, "LED1");
|
||||
gpio_direction_output(GPIO_LED1, 1);
|
||||
gpio_free(GPIO_LED1);
|
||||
@ -137,9 +211,21 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
|
||||
gpio_direction_input(GPIO_SWITCH1);
|
||||
gpio_free(GPIO_SWITCH1);
|
||||
|
||||
i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
|
||||
ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
|
||||
gpio_request(GPIO_LCDRST, "LCDRST");
|
||||
gpio_direction_output(GPIO_LCDRST, 0);
|
||||
gpio_request(GPIO_LCDBL, "LCDBL");
|
||||
gpio_direction_output(GPIO_LCDBL, 0);
|
||||
if (!screen_type) {
|
||||
platform_device_register(&eukrea_mbimxsd51_bl_dev);
|
||||
platform_device_register(&eukrea_mbimxsd51_lcd_powerdev);
|
||||
} else {
|
||||
gpio_free(GPIO_LCDRST);
|
||||
gpio_free(GPIO_LCDBL);
|
||||
}
|
||||
|
||||
gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
|
||||
imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
|
||||
i2c_register_board_info(0, eukrea_mbimxsd51_i2c_devices,
|
||||
ARRAY_SIZE(eukrea_mbimxsd51_i2c_devices));
|
||||
|
||||
gpio_led_register_device(-1, &eukrea_mbimxsd51_led_info);
|
||||
imx_add_gpio_keys(&eukrea_mbimxsd51_button_data);
|
||||
}
|
@ -1,301 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2010 Eric Bénard <eric@eukrea.com>
|
||||
*
|
||||
* based on board-mx51_babbage.c which is
|
||||
* Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
* Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
|
||||
*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
#include <mach/eukrea-baseboards.h>
|
||||
#include <mach/common.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/iomux-mx51.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/time.h>
|
||||
|
||||
#include "devices-imx51.h"
|
||||
|
||||
#define CPUIMX51_USBH1_STP IMX_GPIO_NR(1, 27)
|
||||
#define CPUIMX51_QUARTA_GPIO IMX_GPIO_NR(3, 28)
|
||||
#define CPUIMX51_QUARTB_GPIO IMX_GPIO_NR(3, 25)
|
||||
#define CPUIMX51_QUARTC_GPIO IMX_GPIO_NR(3, 26)
|
||||
#define CPUIMX51_QUARTD_GPIO IMX_GPIO_NR(3, 27)
|
||||
#define CPUIMX51_QUART_XTAL 14745600
|
||||
#define CPUIMX51_QUART_REGSHIFT 17
|
||||
|
||||
/* USB_CTRL_1 */
|
||||
#define MX51_USB_CTRL_1_OFFSET 0x10
|
||||
#define MX51_USB_CTRL_UH1_EXT_CLK_EN (1 << 25)
|
||||
|
||||
#define MX51_USB_PLLDIV_12_MHZ 0x00
|
||||
#define MX51_USB_PLL_DIV_19_2_MHZ 0x01
|
||||
#define MX51_USB_PLL_DIV_24_MHZ 0x02
|
||||
|
||||
static struct plat_serial8250_port serial_platform_data[] = {
|
||||
{
|
||||
.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000),
|
||||
.irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTA_GPIO),
|
||||
.irqflags = IRQF_TRIGGER_HIGH,
|
||||
.uartclk = CPUIMX51_QUART_XTAL,
|
||||
.regshift = CPUIMX51_QUART_REGSHIFT,
|
||||
.iotype = UPIO_MEM,
|
||||
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
|
||||
}, {
|
||||
.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x800000),
|
||||
.irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTB_GPIO),
|
||||
.irqflags = IRQF_TRIGGER_HIGH,
|
||||
.uartclk = CPUIMX51_QUART_XTAL,
|
||||
.regshift = CPUIMX51_QUART_REGSHIFT,
|
||||
.iotype = UPIO_MEM,
|
||||
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
|
||||
}, {
|
||||
.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x1000000),
|
||||
.irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTC_GPIO),
|
||||
.irqflags = IRQF_TRIGGER_HIGH,
|
||||
.uartclk = CPUIMX51_QUART_XTAL,
|
||||
.regshift = CPUIMX51_QUART_REGSHIFT,
|
||||
.iotype = UPIO_MEM,
|
||||
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
|
||||
}, {
|
||||
.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
|
||||
.irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTD_GPIO),
|
||||
.irqflags = IRQF_TRIGGER_HIGH,
|
||||
.uartclk = CPUIMX51_QUART_XTAL,
|
||||
.regshift = CPUIMX51_QUART_REGSHIFT,
|
||||
.iotype = UPIO_MEM,
|
||||
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
|
||||
}, {
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device serial_device = {
|
||||
.name = "serial8250",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = serial_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *devices[] __initdata = {
|
||||
&serial_device,
|
||||
};
|
||||
|
||||
static iomux_v3_cfg_t eukrea_cpuimx51_pads[] = {
|
||||
/* UART1 */
|
||||
MX51_PAD_UART1_RXD__UART1_RXD,
|
||||
MX51_PAD_UART1_TXD__UART1_TXD,
|
||||
MX51_PAD_UART1_RTS__UART1_RTS,
|
||||
MX51_PAD_UART1_CTS__UART1_CTS,
|
||||
|
||||
/* I2C2 */
|
||||
MX51_PAD_GPIO1_2__I2C2_SCL,
|
||||
MX51_PAD_GPIO1_3__I2C2_SDA,
|
||||
MX51_PAD_NANDF_D10__GPIO3_30,
|
||||
|
||||
/* QUART IRQ */
|
||||
MX51_PAD_NANDF_D15__GPIO3_25,
|
||||
MX51_PAD_NANDF_D14__GPIO3_26,
|
||||
MX51_PAD_NANDF_D13__GPIO3_27,
|
||||
MX51_PAD_NANDF_D12__GPIO3_28,
|
||||
|
||||
/* USB HOST1 */
|
||||
MX51_PAD_USBH1_CLK__USBH1_CLK,
|
||||
MX51_PAD_USBH1_DIR__USBH1_DIR,
|
||||
MX51_PAD_USBH1_NXT__USBH1_NXT,
|
||||
MX51_PAD_USBH1_DATA0__USBH1_DATA0,
|
||||
MX51_PAD_USBH1_DATA1__USBH1_DATA1,
|
||||
MX51_PAD_USBH1_DATA2__USBH1_DATA2,
|
||||
MX51_PAD_USBH1_DATA3__USBH1_DATA3,
|
||||
MX51_PAD_USBH1_DATA4__USBH1_DATA4,
|
||||
MX51_PAD_USBH1_DATA5__USBH1_DATA5,
|
||||
MX51_PAD_USBH1_DATA6__USBH1_DATA6,
|
||||
MX51_PAD_USBH1_DATA7__USBH1_DATA7,
|
||||
MX51_PAD_USBH1_STP__USBH1_STP,
|
||||
};
|
||||
|
||||
static const struct mxc_nand_platform_data
|
||||
eukrea_cpuimx51_nand_board_info __initconst = {
|
||||
.width = 1,
|
||||
.hw_ecc = 1,
|
||||
.flash_bbt = 1,
|
||||
};
|
||||
|
||||
static const struct imxuart_platform_data uart_pdata __initconst = {
|
||||
.flags = IMXUART_HAVE_RTSCTS,
|
||||
};
|
||||
|
||||
static const
|
||||
struct imxi2c_platform_data eukrea_cpuimx51_i2c_data __initconst = {
|
||||
.bitrate = 100000,
|
||||
};
|
||||
|
||||
static struct i2c_board_info eukrea_cpuimx51_i2c_devices[] = {
|
||||
{
|
||||
I2C_BOARD_INFO("pcf8563", 0x51),
|
||||
},
|
||||
};
|
||||
|
||||
/* This function is board specific as the bit mask for the plldiv will also
|
||||
be different for other Freescale SoCs, thus a common bitmask is not
|
||||
possible and cannot get place in /plat-mxc/ehci.c.*/
|
||||
static int initialize_otg_port(struct platform_device *pdev)
|
||||
{
|
||||
u32 v;
|
||||
void __iomem *usb_base;
|
||||
void __iomem *usbother_base;
|
||||
|
||||
usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
|
||||
if (!usb_base)
|
||||
return -ENOMEM;
|
||||
usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
|
||||
|
||||
/* Set the PHY clock to 19.2MHz */
|
||||
v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
|
||||
v &= ~MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK;
|
||||
v |= MX51_USB_PLL_DIV_19_2_MHZ;
|
||||
__raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
|
||||
iounmap(usb_base);
|
||||
|
||||
mdelay(10);
|
||||
|
||||
return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY);
|
||||
}
|
||||
|
||||
static int initialize_usbh1_port(struct platform_device *pdev)
|
||||
{
|
||||
u32 v;
|
||||
void __iomem *usb_base;
|
||||
void __iomem *usbother_base;
|
||||
|
||||
usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
|
||||
if (!usb_base)
|
||||
return -ENOMEM;
|
||||
usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
|
||||
|
||||
/* The clock for the USBH1 ULPI port will come externally from the PHY. */
|
||||
v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET);
|
||||
__raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET);
|
||||
iounmap(usb_base);
|
||||
|
||||
mdelay(10);
|
||||
|
||||
return mx51_initialize_usb_hw(1, MXC_EHCI_POWER_PINS_ENABLED |
|
||||
MXC_EHCI_ITC_NO_THRESHOLD);
|
||||
}
|
||||
|
||||
static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
|
||||
.init = initialize_otg_port,
|
||||
.portsc = MXC_EHCI_UTMI_16BIT,
|
||||
};
|
||||
|
||||
static const struct fsl_usb2_platform_data usb_pdata __initconst = {
|
||||
.operating_mode = FSL_USB2_DR_DEVICE,
|
||||
.phy_mode = FSL_USB2_PHY_UTMI_WIDE,
|
||||
};
|
||||
|
||||
static const struct mxc_usbh_platform_data usbh1_config __initconst = {
|
||||
.init = initialize_usbh1_port,
|
||||
.portsc = MXC_EHCI_MODE_ULPI,
|
||||
};
|
||||
|
||||
static int otg_mode_host;
|
||||
|
||||
static int __init eukrea_cpuimx51_otg_mode(char *options)
|
||||
{
|
||||
if (!strcmp(options, "host"))
|
||||
otg_mode_host = 1;
|
||||
else if (!strcmp(options, "device"))
|
||||
otg_mode_host = 0;
|
||||
else
|
||||
pr_info("otg_mode neither \"host\" nor \"device\". "
|
||||
"Defaulting to device\n");
|
||||
return 0;
|
||||
}
|
||||
__setup("otg_mode=", eukrea_cpuimx51_otg_mode);
|
||||
|
||||
/*
|
||||
* Board specific initialization.
|
||||
*/
|
||||
static void __init eukrea_cpuimx51_init(void)
|
||||
{
|
||||
imx51_soc_init();
|
||||
|
||||
mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads,
|
||||
ARRAY_SIZE(eukrea_cpuimx51_pads));
|
||||
|
||||
imx51_add_imx_uart(0, &uart_pdata);
|
||||
imx51_add_mxc_nand(&eukrea_cpuimx51_nand_board_info);
|
||||
|
||||
gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq");
|
||||
gpio_direction_input(CPUIMX51_QUARTA_GPIO);
|
||||
gpio_free(CPUIMX51_QUARTA_GPIO);
|
||||
gpio_request(CPUIMX51_QUARTB_GPIO, "quartb_irq");
|
||||
gpio_direction_input(CPUIMX51_QUARTB_GPIO);
|
||||
gpio_free(CPUIMX51_QUARTB_GPIO);
|
||||
gpio_request(CPUIMX51_QUARTC_GPIO, "quartc_irq");
|
||||
gpio_direction_input(CPUIMX51_QUARTC_GPIO);
|
||||
gpio_free(CPUIMX51_QUARTC_GPIO);
|
||||
gpio_request(CPUIMX51_QUARTD_GPIO, "quartd_irq");
|
||||
gpio_direction_input(CPUIMX51_QUARTD_GPIO);
|
||||
gpio_free(CPUIMX51_QUARTD_GPIO);
|
||||
|
||||
imx51_add_fec(NULL);
|
||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||
|
||||
imx51_add_imx_i2c(1, &eukrea_cpuimx51_i2c_data);
|
||||
i2c_register_board_info(1, eukrea_cpuimx51_i2c_devices,
|
||||
ARRAY_SIZE(eukrea_cpuimx51_i2c_devices));
|
||||
|
||||
if (otg_mode_host)
|
||||
imx51_add_mxc_ehci_otg(&dr_utmi_config);
|
||||
else {
|
||||
initialize_otg_port(NULL);
|
||||
imx51_add_fsl_usb2_udc(&usb_pdata);
|
||||
}
|
||||
imx51_add_mxc_ehci_hs(1, &usbh1_config);
|
||||
|
||||
#ifdef CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD
|
||||
eukrea_mbimx51_baseboard_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __init eukrea_cpuimx51_timer_init(void)
|
||||
{
|
||||
mx51_clocks_init(32768, 24000000, 22579200, 0);
|
||||
}
|
||||
|
||||
static struct sys_timer mxc_timer = {
|
||||
.init = eukrea_cpuimx51_timer_init,
|
||||
};
|
||||
|
||||
MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module")
|
||||
/* Maintainer: Eric Bénard <eric@eukrea.com> */
|
||||
.atag_offset = 0x100,
|
||||
.map_io = mx51_map_io,
|
||||
.init_early = imx51_init_early,
|
||||
.init_irq = mx51_init_irq,
|
||||
.handle_irq = imx51_handle_irq,
|
||||
.timer = &mxc_timer,
|
||||
.init_machine = eukrea_cpuimx51_init,
|
||||
.restart = mxc_restart,
|
||||
MACHINE_END
|
@ -41,11 +41,13 @@
|
||||
|
||||
#define USBH1_RST IMX_GPIO_NR(2, 28)
|
||||
#define ETH_RST IMX_GPIO_NR(2, 31)
|
||||
#define TSC2007_IRQGPIO IMX_GPIO_NR(3, 12)
|
||||
#define TSC2007_IRQGPIO_REV2 IMX_GPIO_NR(3, 12)
|
||||
#define TSC2007_IRQGPIO_REV3 IMX_GPIO_NR(4, 0)
|
||||
#define CAN_IRQGPIO IMX_GPIO_NR(1, 1)
|
||||
#define CAN_RST IMX_GPIO_NR(4, 15)
|
||||
#define CAN_NCS IMX_GPIO_NR(4, 24)
|
||||
#define CAN_RXOBF IMX_GPIO_NR(1, 4)
|
||||
#define CAN_RXOBF_REV2 IMX_GPIO_NR(1, 4)
|
||||
#define CAN_RXOBF_REV3 IMX_GPIO_NR(3, 12)
|
||||
#define CAN_RX1BF IMX_GPIO_NR(1, 6)
|
||||
#define CAN_TXORTS IMX_GPIO_NR(1, 7)
|
||||
#define CAN_TX1RTS IMX_GPIO_NR(1, 8)
|
||||
@ -90,6 +92,10 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
|
||||
MX51_PAD_I2C1_CLK__GPIO4_16,
|
||||
MX51_PAD_I2C1_DAT__GPIO4_17,
|
||||
|
||||
/* I2C1 */
|
||||
MX51_PAD_SD2_CMD__I2C1_SCL,
|
||||
MX51_PAD_SD2_CLK__I2C1_SDA,
|
||||
|
||||
/* CAN */
|
||||
MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
|
||||
MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
|
||||
@ -108,15 +114,27 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
|
||||
NEW_PAD_CTRL(MX51_PAD_GPIO_NAND__GPIO_NAND, PAD_CTL_PUS_22K_UP |
|
||||
PAD_CTL_PKE | PAD_CTL_SRE_FAST |
|
||||
PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
|
||||
NEW_PAD_CTRL(MX51_PAD_NANDF_D8__GPIO4_0, PAD_CTL_PUS_22K_UP |
|
||||
PAD_CTL_PKE | PAD_CTL_SRE_FAST |
|
||||
PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
|
||||
};
|
||||
|
||||
static const struct imxuart_platform_data uart_pdata __initconst = {
|
||||
.flags = IMXUART_HAVE_RTSCTS,
|
||||
};
|
||||
|
||||
static int tsc2007_get_pendown_state(void)
|
||||
{
|
||||
if (mx51_revision() < IMX_CHIP_REVISION_3_0)
|
||||
return !gpio_get_value(TSC2007_IRQGPIO_REV2);
|
||||
else
|
||||
return !gpio_get_value(TSC2007_IRQGPIO_REV3);
|
||||
}
|
||||
|
||||
static struct tsc2007_platform_data tsc2007_info = {
|
||||
.model = 2007,
|
||||
.x_plate_ohms = 180,
|
||||
.get_pendown_state = tsc2007_get_pendown_state,
|
||||
};
|
||||
|
||||
static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = {
|
||||
@ -126,7 +144,6 @@ static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = {
|
||||
I2C_BOARD_INFO("tsc2007", 0x49),
|
||||
.type = "tsc2007",
|
||||
.platform_data = &tsc2007_info,
|
||||
.irq = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
|
||||
},
|
||||
};
|
||||
|
||||
@ -255,10 +272,14 @@ static const struct spi_imx_master cpuimx51sd_ecspi1_pdata __initconst = {
|
||||
.num_chipselect = ARRAY_SIZE(cpuimx51sd_spi1_cs),
|
||||
};
|
||||
|
||||
static struct platform_device *platform_devices[] __initdata = {
|
||||
static struct platform_device *rev2_platform_devices[] __initdata = {
|
||||
&hsi2c_gpio_device,
|
||||
};
|
||||
|
||||
static const struct imxi2c_platform_data cpuimx51sd_i2c_data __initconst = {
|
||||
.bitrate = 100000,
|
||||
};
|
||||
|
||||
static void __init eukrea_cpuimx51sd_init(void)
|
||||
{
|
||||
imx51_soc_init();
|
||||
@ -272,6 +293,7 @@ static void __init eukrea_cpuimx51sd_init(void)
|
||||
|
||||
imx51_add_imx_uart(0, &uart_pdata);
|
||||
imx51_add_mxc_nand(&eukrea_cpuimx51sd_nand_board_info);
|
||||
imx51_add_imx2_wdt(0, NULL);
|
||||
|
||||
gpio_request(ETH_RST, "eth_rst");
|
||||
gpio_set_value(ETH_RST, 1);
|
||||
@ -291,13 +313,25 @@ static void __init eukrea_cpuimx51sd_init(void)
|
||||
spi_register_board_info(cpuimx51sd_spi_device,
|
||||
ARRAY_SIZE(cpuimx51sd_spi_device));
|
||||
|
||||
gpio_request(TSC2007_IRQGPIO, "tsc2007_irq");
|
||||
gpio_direction_input(TSC2007_IRQGPIO);
|
||||
gpio_free(TSC2007_IRQGPIO);
|
||||
if (mx51_revision() < IMX_CHIP_REVISION_3_0) {
|
||||
eukrea_cpuimx51sd_i2c_devices[1].irq =
|
||||
gpio_to_irq(TSC2007_IRQGPIO_REV2),
|
||||
platform_add_devices(rev2_platform_devices,
|
||||
ARRAY_SIZE(rev2_platform_devices));
|
||||
gpio_request(TSC2007_IRQGPIO_REV2, "tsc2007_irq");
|
||||
gpio_direction_input(TSC2007_IRQGPIO_REV2);
|
||||
gpio_free(TSC2007_IRQGPIO_REV2);
|
||||
} else {
|
||||
eukrea_cpuimx51sd_i2c_devices[1].irq =
|
||||
gpio_to_irq(TSC2007_IRQGPIO_REV3),
|
||||
imx51_add_imx_i2c(0, &cpuimx51sd_i2c_data);
|
||||
gpio_request(TSC2007_IRQGPIO_REV3, "tsc2007_irq");
|
||||
gpio_direction_input(TSC2007_IRQGPIO_REV3);
|
||||
gpio_free(TSC2007_IRQGPIO_REV3);
|
||||
}
|
||||
|
||||
i2c_register_board_info(0, eukrea_cpuimx51sd_i2c_devices,
|
||||
ARRAY_SIZE(eukrea_cpuimx51sd_i2c_devices));
|
||||
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
||||
|
||||
if (otg_mode_host)
|
||||
imx51_add_mxc_ehci_otg(&dr_utmi_config);
|
||||
|
@ -106,6 +106,7 @@ static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
|
||||
static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
|
||||
.operating_mode = FSL_USB2_DR_DEVICE,
|
||||
.phy_mode = FSL_USB2_PHY_UTMI,
|
||||
.workaround = FLS_USB2_WORKAROUND_ENGCM09152,
|
||||
};
|
||||
|
||||
static int otg_mode_host;
|
||||
@ -135,6 +136,7 @@ static void __init eukrea_cpuimx25_init(void)
|
||||
imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info);
|
||||
imx25_add_imxdi_rtc(NULL);
|
||||
imx25_add_fec(&mx25_fec_pdata);
|
||||
imx25_add_imx2_wdt(NULL);
|
||||
|
||||
i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices,
|
||||
ARRAY_SIZE(eukrea_cpuimx25_i2c_devices));
|
||||
|
Loading…
Reference in New Issue
Block a user