Skip to content

Commit 9bfe99a

Browse files
author
Russell King
committed
Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel-stable
2 parents f72caf7 + 54c1f63 commit 9bfe99a

35 files changed

+1097
-199
lines changed

arch/arm/configs/mx51_defconfig

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,22 @@ CONFIG_SSB_POSSIBLE=y
809809
CONFIG_DUMMY_CONSOLE=y
810810
# CONFIG_SOUND is not set
811811
# CONFIG_HID_SUPPORT is not set
812-
# CONFIG_USB_SUPPORT is not set
812+
CONFIG_USB_SUPPORT=y
813+
CONFIG_USB_ARCH_HAS_HCD=y
814+
# CONFIG_USB_ARCH_HAS_OHCI is not set
815+
CONFIG_USB_ARCH_HAS_EHCI=y
816+
CONFIG_USB=y
817+
818+
#
819+
# USB Host Controller Drivers
820+
#
821+
# CONFIG_USB_C67X00_HCD is not set
822+
CONFIG_USB_EHCI_HCD=y
823+
CONFIG_USB_EHCI_ROOT_HUB_TT=y
824+
# CONFIG_USB_EHCI_TT_NEWSCHED is not set
825+
CONFIG_USB_EHCI_MXC=y
826+
827+
813828
CONFIG_MMC=y
814829
# CONFIG_MMC_DEBUG is not set
815830
# CONFIG_MMC_UNSAFE_RESUME is not set

arch/arm/mach-mx2/devices.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,7 @@ DEFINE_IMX_GPT_DEVICE(4, MX27_GPT5_BASE_ADDR, MX27_INT_GPT5);
109109
DEFINE_IMX_GPT_DEVICE(5, MX27_GPT6_BASE_ADDR, MX27_INT_GPT6);
110110
#endif
111111

112-
/*
113-
* Watchdog:
114-
* - i.MX1
115-
* - i.MX21
116-
* - i.MX27
117-
*/
112+
/* Watchdog: i.MX1 has seperate driver, i.MX21 and i.MX27 are equal */
118113
static struct resource mxc_wdt_resources[] = {
119114
{
120115
.start = MX2x_WDOG_BASE_ADDR,
@@ -124,7 +119,7 @@ static struct resource mxc_wdt_resources[] = {
124119
};
125120

126121
struct platform_device mxc_wdt = {
127-
.name = "mxc_wdt",
122+
.name = "imx2-wdt",
128123
.id = 0,
129124
.num_resources = ARRAY_SIZE(mxc_wdt_resources),
130125
.resource = mxc_wdt_resources,

arch/arm/mach-mx2/mach-pca100.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ static struct mxc_nand_platform_data pca100_nand_board_info = {
145145
static struct platform_device *platform_devices[] __initdata = {
146146
&mxc_w1_master_device,
147147
&mxc_fec_device,
148+
&mxc_wdt,
148149
};
149150

150151
static struct imxi2c_platform_data pca100_i2c_1_data = {

arch/arm/mach-mx2/mach-pcm038.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ static struct platform_device *platform_devices[] __initdata = {
182182
&mxc_w1_master_device,
183183
&mxc_fec_device,
184184
&pcm038_sram_mtd_device,
185+
&mxc_wdt,
185186
};
186187

187188
/* On pcm038 there's a sram attached to CS1, we enable the chipselect here and

arch/arm/mach-mx25/devices.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,3 +500,18 @@ struct platform_device mx25_fb_device = {
500500
.coherent_dma_mask = 0xFFFFFFFF,
501501
},
502502
};
503+
504+
static struct resource mxc_wdt_resources[] = {
505+
{
506+
.start = MX25_WDOG_BASE_ADDR,
507+
.end = MX25_WDOG_BASE_ADDR + SZ_16K - 1,
508+
.flags = IORESOURCE_MEM,
509+
},
510+
};
511+
512+
struct platform_device mxc_wdt = {
513+
.name = "imx2-wdt",
514+
.id = 0,
515+
.num_resources = ARRAY_SIZE(mxc_wdt_resources),
516+
.resource = mxc_wdt_resources,
517+
};

arch/arm/mach-mx25/devices.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ extern struct platform_device mx25_fec_device;
2121
extern struct platform_device mxc_nand_device;
2222
extern struct platform_device mx25_rtc_device;
2323
extern struct platform_device mx25_fb_device;
24+
extern struct platform_device mxc_wdt;

arch/arm/mach-mx3/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ config MACH_MX31MOBOARD
8282
config MACH_MX31LILLY
8383
bool "Support MX31 LILLY-1131 platforms (INCO startec)"
8484
select ARCH_MX31
85+
select MXC_ULPI if USB_ULPI
8586
help
8687
Include support for mx31 based LILLY1131 modules. This includes
8788
specific configurations for the board and its peripherals.

arch/arm/mach-mx3/devices.c

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,50 @@ static struct resource imx_wdt_resources[] = {
582582
};
583583

584584
struct platform_device imx_wdt_device0 = {
585-
.name = "imx-wdt",
585+
.name = "imx2-wdt",
586586
.id = 0,
587587
.num_resources = ARRAY_SIZE(imx_wdt_resources),
588588
.resource = imx_wdt_resources,
589589
};
590590

591+
static struct resource imx_rtc_resources[] = {
592+
{
593+
.start = MX31_RTC_BASE_ADDR,
594+
.end = MX31_RTC_BASE_ADDR + 0x3fff,
595+
.flags = IORESOURCE_MEM,
596+
},
597+
{
598+
.start = MX31_INT_RTC,
599+
.flags = IORESOURCE_IRQ,
600+
},
601+
};
602+
603+
struct platform_device imx_rtc_device0 = {
604+
.name = "mxc_rtc",
605+
.id = -1,
606+
.num_resources = ARRAY_SIZE(imx_rtc_resources),
607+
.resource = imx_rtc_resources,
608+
};
609+
610+
static struct resource imx_kpp_resources[] = {
611+
{
612+
.start = MX3x_KPP_BASE_ADDR,
613+
.end = MX3x_KPP_BASE_ADDR + 0xf,
614+
.flags = IORESOURCE_MEM
615+
}, {
616+
.start = MX3x_INT_KPP,
617+
.end = MX3x_INT_KPP,
618+
.flags = IORESOURCE_IRQ,
619+
},
620+
};
621+
622+
struct platform_device imx_kpp_device = {
623+
.name = "imx-keypad",
624+
.id = -1,
625+
.num_resources = ARRAY_SIZE(imx_kpp_resources),
626+
.resource = imx_kpp_resources,
627+
};
628+
591629
static int __init mx3_devices_init(void)
592630
{
593631
if (cpu_is_mx31()) {

arch/arm/mach-mx3/devices.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ extern struct platform_device imx_ssi_device0;
2727
extern struct platform_device imx_ssi_device1;
2828
extern struct platform_device imx_ssi_device1;
2929
extern struct platform_device imx_wdt_device0;
30+
extern struct platform_device imx_rtc_device0;
31+
extern struct platform_device imx_kpp_device;

arch/arm/mach-mx3/mach-mx31_3ds.c

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1717
*/
1818

19+
#include <linux/delay.h>
1920
#include <linux/types.h>
2021
#include <linux/init.h>
2122
#include <linux/clk.h>
@@ -26,6 +27,8 @@
2627
#include <linux/mfd/mc13783.h>
2728
#include <linux/spi/spi.h>
2829
#include <linux/regulator/machine.h>
30+
#include <linux/fsl_devices.h>
31+
#include <linux/input/matrix_keypad.h>
2932

3033
#include <mach/hardware.h>
3134
#include <asm/mach-types.h>
@@ -65,6 +68,50 @@ static int mx31_3ds_pins[] = {
6568
MX31_PIN_CSPI2_SS2__SS2, /*CS for MC13783 */
6669
/* MC13783 IRQ */
6770
IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO),
71+
/* USB OTG reset */
72+
IOMUX_MODE(MX31_PIN_USB_PWR, IOMUX_CONFIG_GPIO),
73+
/* USB OTG */
74+
MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
75+
MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
76+
MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
77+
MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
78+
MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
79+
MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
80+
MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
81+
MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
82+
MX31_PIN_USBOTG_CLK__USBOTG_CLK,
83+
MX31_PIN_USBOTG_DIR__USBOTG_DIR,
84+
MX31_PIN_USBOTG_NXT__USBOTG_NXT,
85+
MX31_PIN_USBOTG_STP__USBOTG_STP,
86+
/*Keyboard*/
87+
MX31_PIN_KEY_ROW0_KEY_ROW0,
88+
MX31_PIN_KEY_ROW1_KEY_ROW1,
89+
MX31_PIN_KEY_ROW2_KEY_ROW2,
90+
MX31_PIN_KEY_COL0_KEY_COL0,
91+
MX31_PIN_KEY_COL1_KEY_COL1,
92+
MX31_PIN_KEY_COL2_KEY_COL2,
93+
MX31_PIN_KEY_COL3_KEY_COL3,
94+
};
95+
96+
/*
97+
* Matrix keyboard
98+
*/
99+
100+
static const uint32_t mx31_3ds_keymap[] = {
101+
KEY(0, 0, KEY_UP),
102+
KEY(0, 1, KEY_DOWN),
103+
KEY(1, 0, KEY_RIGHT),
104+
KEY(1, 1, KEY_LEFT),
105+
KEY(1, 2, KEY_ENTER),
106+
KEY(2, 0, KEY_F6),
107+
KEY(2, 1, KEY_F8),
108+
KEY(2, 2, KEY_F9),
109+
KEY(2, 3, KEY_F10),
110+
};
111+
112+
static struct matrix_keymap_data mx31_3ds_keymap_data = {
113+
.keymap = mx31_3ds_keymap,
114+
.keymap_size = ARRAY_SIZE(mx31_3ds_keymap),
68115
};
69116

70117
/* Regulators */
@@ -126,6 +173,41 @@ static struct mxc_nand_platform_data imx31_3ds_nand_flash_pdata = {
126173
#endif
127174
};
128175

176+
/*
177+
* USB OTG
178+
*/
179+
180+
#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
181+
PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
182+
183+
#define USBOTG_RST_B IOMUX_TO_GPIO(MX31_PIN_USB_PWR)
184+
185+
static void mx31_3ds_usbotg_init(void)
186+
{
187+
mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG);
188+
mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG);
189+
mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG);
190+
mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG);
191+
mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG);
192+
mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG);
193+
mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG);
194+
mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG);
195+
mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG);
196+
mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG);
197+
mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG);
198+
mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG);
199+
200+
gpio_request(USBOTG_RST_B, "otgusb-reset");
201+
gpio_direction_output(USBOTG_RST_B, 0);
202+
mdelay(1);
203+
gpio_set_value(USBOTG_RST_B, 1);
204+
}
205+
206+
static struct fsl_usb2_platform_data usbotg_pdata = {
207+
.operating_mode = FSL_USB2_DR_DEVICE,
208+
.phy_mode = FSL_USB2_PHY_ULPI,
209+
};
210+
129211
static struct imxuart_platform_data uart_pdata = {
130212
.flags = IMXUART_HAVE_RTSCTS,
131213
};
@@ -315,6 +397,11 @@ static void __init mxc_board_init(void)
315397
spi_register_board_info(mx31_3ds_spi_devs,
316398
ARRAY_SIZE(mx31_3ds_spi_devs));
317399

400+
mxc_register_device(&imx_kpp_device, &mx31_3ds_keymap_data);
401+
402+
mx31_3ds_usbotg_init();
403+
mxc_register_device(&mxc_otg_udc_device, &usbotg_pdata);
404+
318405
if (!mx31_3ds_init_expio())
319406
platform_device_register(&smsc911x_device);
320407
}

0 commit comments

Comments
 (0)