diff options
| author | Amit Kucheria <amit.kucheria@linaro.org> | 2010-10-06 20:58:25 -0400 |
|---|---|---|
| committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-11 10:29:17 -0400 |
| commit | 81490fcdf406f42fff9d9f57d541788f90242885 (patch) | |
| tree | bbbac6868c331ad367d7bc263e14d4f4e4ac240d | |
| parent | 088d01b00e335230bc51be6ae396babb9767e9ea (diff) | |
mx51: efikamx: add otg support
Ethernet hangs off OTG
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| -rw-r--r-- | arch/arm/mach-mx5/board-mx51_efikamx.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c index 4c921fc31816..b00502acdc15 100644 --- a/arch/arm/mach-mx5/board-mx51_efikamx.c +++ b/arch/arm/mach-mx5/board-mx51_efikamx.c | |||
| @@ -37,6 +37,8 @@ | |||
| 37 | #include "devices-imx51.h" | 37 | #include "devices-imx51.h" |
| 38 | #include "devices.h" | 38 | #include "devices.h" |
| 39 | 39 | ||
| 40 | #define MX51_USB_PLL_DIV_24_MHZ 0x01 | ||
| 41 | |||
| 40 | static struct pad_desc mx51efikamx_pads[] = { | 42 | static struct pad_desc mx51efikamx_pads[] = { |
| 41 | /* UART1 */ | 43 | /* UART1 */ |
| 42 | MX51_PAD_UART1_RXD__UART1_RXD, | 44 | MX51_PAD_UART1_RXD__UART1_RXD, |
| @@ -63,10 +65,38 @@ static inline void mxc_init_imx_uart(void) | |||
| 63 | } | 65 | } |
| 64 | #endif /* SERIAL_IMX */ | 66 | #endif /* SERIAL_IMX */ |
| 65 | 67 | ||
| 68 | /* This function is board specific as the bit mask for the plldiv will also | ||
| 69 | * be different for other Freescale SoCs, thus a common bitmask is not | ||
| 70 | * possible and cannot get place in /plat-mxc/ehci.c. | ||
| 71 | */ | ||
| 72 | static int initialize_otg_port(struct platform_device *pdev) | ||
| 73 | { | ||
| 74 | u32 v; | ||
| 75 | void __iomem *usb_base; | ||
| 76 | void __iomem *usbother_base; | ||
| 77 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | ||
| 78 | usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET); | ||
| 79 | |||
| 80 | /* Set the PHY clock to 19.2MHz */ | ||
| 81 | v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); | ||
| 82 | v &= ~MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK; | ||
| 83 | v |= MX51_USB_PLL_DIV_24_MHZ; | ||
| 84 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); | ||
| 85 | iounmap(usb_base); | ||
| 86 | return 0; | ||
| 87 | } | ||
| 88 | |||
| 89 | static struct mxc_usbh_platform_data dr_utmi_config = { | ||
| 90 | .init = initialize_otg_port, | ||
| 91 | .portsc = MXC_EHCI_UTMI_16BIT, | ||
| 92 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
| 93 | }; | ||
| 94 | |||
| 66 | static void __init mxc_board_init(void) | 95 | static void __init mxc_board_init(void) |
| 67 | { | 96 | { |
| 68 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, | 97 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, |
| 69 | ARRAY_SIZE(mx51efikamx_pads)); | 98 | ARRAY_SIZE(mx51efikamx_pads)); |
| 99 | mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); | ||
| 70 | mxc_init_imx_uart(); | 100 | mxc_init_imx_uart(); |
| 71 | } | 101 | } |
| 72 | 102 | ||
