aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/83xx/usb.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2008-04-09 17:59:25 +0400
committerKumar Gala <galak@kernel.crashing.org>2008-04-17 09:52:50 -0500
commit1a9ebc0cd2b3bb4450834e564722630fbc40611b (patch)
treeaac465b379b894c736a7016c2ba625b5ec0b10b6 /arch/powerpc/platforms/83xx/usb.c
parent8bdf573334102f44c7ad191422baf851fecf25e8 (diff)
[POWERPC] 83xx: mpc8315 - fix USB UTMI Host setup
Currently USB Host isn't functional on the MPC8315E boards, for two reasons as described below. MPC8315 Reference Manual says: "The USB DR unit must have the same clock ratio as the encryption core unit, unless one of them has its clock disabled." The encryption core also drives I2C clock, so it is enabled and is equal to 01. That means USBDRCM should be 01 here. Plus, according to MPC8315E-RDB schematics, USB unit consumes CLK_IN clock from the 24.00MHz oscillator, which means we must adjust REFSEL bits as well. p.s. Idially we should rework whole 83xx/usb.c code, in two steps: 1. Move SCCR code to the U-Boot; 2. Implement fsl,usb-clock property in the device tree, so usb.c could decide what clock exactly to use on per-board basis. Though, today we're not in a hurry since there is just one 8315e board out there. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.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.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index 471fdd8f410..64bcf0a33c7 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -129,7 +129,7 @@ int mpc831x_usb_cfg(void)
if (immr_node && of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))
clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
MPC8315_SCCR_USB_MASK,
- MPC8315_SCCR_USB_DRCM_11);
+ MPC8315_SCCR_USB_DRCM_01);
else
clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
MPC83XX_SCCR_USB_MASK,
@@ -164,9 +164,15 @@ int mpc831x_usb_cfg(void)
/* Using on-chip PHY */
if (prop && (!strcmp(prop, "utmi_wide") ||
!strcmp(prop, "utmi"))) {
- /* Set UTMI_PHY_EN, REFSEL to 48MHZ */
+ u32 refsel;
+
+ if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))
+ refsel = CONTROL_REFSEL_24MHZ;
+ else
+ refsel = CONTROL_REFSEL_48MHZ;
+ /* Set UTMI_PHY_EN and REFSEL */
out_be32(usb_regs + FSL_USB2_CONTROL_OFFS,
- CONTROL_UTMI_PHY_EN | CONTROL_REFSEL_48MHZ);
+ CONTROL_UTMI_PHY_EN | refsel);
/* Using external UPLI PHY */
} else if (prop && !strcmp(prop, "ulpi")) {
/* Set PHY_CLK_SEL to ULPI */