Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198464
b: refs/heads/master
c: 3a47b1a
h: refs/heads/master
v: v3
  • Loading branch information
Philippe Rétornaz authored and Sascha Hauer committed May 17, 2010
1 parent b818db8 commit 826da06
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66c202ad9a58905e0e6a0fa3976020a7ab0fa6df
refs/heads/master: 3a47b1a4f16285bc1b96941782a896afc4711e97
3 changes: 2 additions & 1 deletion trunk/arch/arm/mach-mx3/mach-mx31moboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ static void __init mxc_board_init(void)
mx31moboard_marxbot_init();
break;
case MX31SMARTBOT:
mx31moboard_smartbot_init();
case MX31EYEBOT:
mx31moboard_smartbot_init(mx31moboard_baseboard);
break;
default:
printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n",
Expand Down
39 changes: 37 additions & 2 deletions trunk/arch/arm/mach-mx3/mx31moboard-smartbot.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@
#include <linux/types.h>
#include <linux/fsl_devices.h>

#include <linux/usb/otg.h>
#include <linux/usb/ulpi.h>

#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/imx-uart.h>
#include <mach/iomux-mx3.h>
#include <mach/board-mx31moboard.h>
#include <mach/mxc_ehci.h>
#include <mach/ulpi.h>

#include <media/soc_camera.h>

Expand Down Expand Up @@ -122,6 +128,24 @@ static struct fsl_usb2_platform_data usb_pdata = {
.phy_mode = FSL_USB2_PHY_ULPI,
};

#if defined(CONFIG_USB_ULPI)

static struct mxc_usbh_platform_data otg_host_pdata = {
.portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
.flags = MXC_EHCI_POWER_PINS_ENABLED,
};

static int __init smartbot_otg_host_init(void)
{
otg_host_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);

return mxc_register_device(&mxc_otg_host, &otg_host_pdata);
}
#else
static inline int smartbot_otg_host_init(void) { return 0; }
#endif

#define POWER_EN IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
#define DSPIC_RST_B IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
#define TRSLAT_RST_B IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
Expand Down Expand Up @@ -152,7 +176,7 @@ static void smartbot_resets_init(void)
/*
* system init for baseboard usage. Will be called by mx31moboard init.
*/
void __init mx31moboard_smartbot_init(void)
void __init mx31moboard_smartbot_init(int board)
{
printk(KERN_INFO "Initializing mx31smartbot peripherals\n");

Expand All @@ -161,7 +185,18 @@ void __init mx31moboard_smartbot_init(void)

mxc_register_device(&mxc_uart_device1, &uart_pdata);

mxc_register_device(&mxc_otg_udc_device, &usb_pdata);

switch (board) {
case MX31SMARTBOT:
mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
break;
case MX31EYEBOT:
smartbot_otg_host_init();
break;
default:
printk(KERN_WARNING "Unknown board %d, USB OTG not initialized",
board);
}

smartbot_resets_init();

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ enum mx31moboard_boards {
MX31DEVBOARD = 1,
MX31MARXBOT = 2,
MX31SMARTBOT = 3,
MX31EYEBOT = 4,
};

/*
Expand All @@ -35,7 +36,7 @@ enum mx31moboard_boards {

extern void mx31moboard_devboard_init(void);
extern void mx31moboard_marxbot_init(void);
extern void mx31moboard_smartbot_init(void);
extern void mx31moboard_smartbot_init(int board);

#endif

Expand Down

0 comments on commit 826da06

Please sign in to comment.