diff options
author | Li Yang <leoli@freescale.com> | 2008-01-08 15:18:45 +0800 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-01-23 19:33:03 -0600 |
commit | e10241d8a1a68955e2f3e74befd9fa6ce61ba2bc (patch) | |
tree | b213f00dbbb0e8a7cb744aae4764d59dc7a04cfc /arch/powerpc/platforms/83xx/usb.c | |
parent | 5761bc5dae656b96e4bb22fd05480e5beddab24c (diff) | |
download | kernel_samsung_smdk4412-e10241d8a1a68955e2f3e74befd9fa6ce61ba2bc.zip kernel_samsung_smdk4412-e10241d8a1a68955e2f3e74befd9fa6ce61ba2bc.tar.gz kernel_samsung_smdk4412-e10241d8a1a68955e2f3e74befd9fa6ce61ba2bc.tar.bz2 |
[POWERPC] 83xx: Add MPC837x USB platform support
Add chip specific and board specific initialization for MPC837x USB.
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/83xx/usb.c')
-rw-r--r-- | arch/powerpc/platforms/83xx/usb.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c index b45160f..b1de453 100644 --- a/arch/powerpc/platforms/83xx/usb.c +++ b/arch/powerpc/platforms/83xx/usb.c @@ -179,3 +179,43 @@ int mpc831x_usb_cfg(void) return ret; } #endif /* CONFIG_PPC_MPC831x */ + +#ifdef CONFIG_PPC_MPC837x +int mpc837x_usb_cfg(void) +{ + void __iomem *immap; + struct device_node *np = NULL; + const void *prop; + int ret = 0; + + np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr"); + if (!np) + return -ENODEV; + prop = of_get_property(np, "phy_type", NULL); + + if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) { + printk(KERN_WARNING "837x USB PHY type not supported\n"); + of_node_put(np); + return -EINVAL; + } + + /* Map IMMR space for pin and clock settings */ + immap = ioremap(get_immrbase(), 0x1000); + if (!immap) { + of_node_put(np); + return -ENOMEM; + } + + /* Configure clock */ + clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, MPC837X_SCCR_USB_DRCM_11, + MPC837X_SCCR_USB_DRCM_11); + + /* Configure pin mux for ULPI/serial */ + clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USB_MASK, + MPC837X_SICRL_USB_ULPI); + + iounmap(immap); + of_node_put(np); + return ret; +} +#endif /* CONFIG_PPC_MPC837x */ |