Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198461
b: refs/heads/master
c: 2ba5a2c
h: refs/heads/master
i:
  198459: c9431d1
v: v3
  • Loading branch information
Dinh Nguyen authored and Sascha Hauer committed May 11, 2010
1 parent cdd04e6 commit 1fd396b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 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: c79504e73a0e84c4db7a2315dcdd6987b0c52566
refs/heads/master: 2ba5a2c0d8e0f62916a885170f28786141f08f76
28 changes: 27 additions & 1 deletion trunk/arch/arm/mach-mx5/board-mx51_babbage.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/gpio.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/fsl_devices.h>

#include <mach/common.h>
#include <mach/hardware.h>
Expand Down Expand Up @@ -179,12 +180,32 @@ static struct mxc_usbh_platform_data dr_utmi_config = {
.flags = MXC_EHCI_INTERNAL_PHY,
};

static struct fsl_usb2_platform_data usb_pdata = {
.operating_mode = FSL_USB2_DR_DEVICE,
.phy_mode = FSL_USB2_PHY_UTMI_WIDE,
};

static struct mxc_usbh_platform_data usbh1_config = {
.init = initialize_usbh1_port,
.portsc = MXC_EHCI_MODE_ULPI,
.flags = (MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_ITC_NO_THRESHOLD),
};

static int otg_mode_host;

static int __init babbage_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=", babbage_otg_mode);

/*
* Board specific initialization.
*/
Expand All @@ -197,7 +218,12 @@ static void __init mxc_board_init(void)
mxc_init_imx_uart();
platform_add_devices(devices, ARRAY_SIZE(devices));

mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
if (otg_mode_host)
mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
else {
initialize_otg_port(NULL);
mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
}

gpio_usbh1_active();
mxc_register_device(&mxc_usbh1_device, &usbh1_config);
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-mx5/clock-mx51.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", ahb_clk)
_REGISTER_CLOCK("mxc-ehci.1", "usb", usboh3_clk)
_REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", ahb_clk)
_REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk)
_REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk)
};

static void clk_tree_init(void)
Expand Down
12 changes: 12 additions & 0 deletions trunk/arch/arm/mach-mx5/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ static struct resource usbotg_resources[] = {
},
};

/* OTG gadget device */
struct platform_device mxc_usbdr_udc_device = {
.name = "fsl-usb2-udc",
.id = -1,
.num_resources = ARRAY_SIZE(usbotg_resources),
.resource = usbotg_resources,
.dev = {
.dma_mask = &usb_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};

struct platform_device mxc_usbdr_host_device = {
.name = "mxc-ehci",
.id = 0,
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-mx5/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ extern struct platform_device mxc_uart_device2;
extern struct platform_device mxc_fec_device;
extern struct platform_device mxc_usbdr_host_device;
extern struct platform_device mxc_usbh1_device;
extern struct platform_device mxc_usbdr_udc_device;

0 comments on commit 1fd396b

Please sign in to comment.