diff options
Diffstat (limited to 'arch/powerpc/platforms/83xx/usb.c')
| -rw-r--r-- | arch/powerpc/platforms/83xx/usb.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c index 3ba4bb7d41bb..2c64164722d0 100644 --- a/arch/powerpc/platforms/83xx/usb.c +++ b/arch/powerpc/platforms/83xx/usb.c | |||
| @@ -127,7 +127,8 @@ int mpc831x_usb_cfg(void) | |||
| 127 | 127 | ||
| 128 | /* Configure clock */ | 128 | /* Configure clock */ |
| 129 | immr_node = of_get_parent(np); | 129 | immr_node = of_get_parent(np); |
| 130 | if (immr_node && of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) | 130 | if (immr_node && (of_device_is_compatible(immr_node, "fsl,mpc8315-immr") || |
| 131 | of_device_is_compatible(immr_node, "fsl,mpc8308-immr"))) | ||
| 131 | clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, | 132 | clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, |
| 132 | MPC8315_SCCR_USB_MASK, | 133 | MPC8315_SCCR_USB_MASK, |
| 133 | MPC8315_SCCR_USB_DRCM_01); | 134 | MPC8315_SCCR_USB_DRCM_01); |
| @@ -138,7 +139,11 @@ int mpc831x_usb_cfg(void) | |||
| 138 | 139 | ||
| 139 | /* Configure pin mux for ULPI. There is no pin mux for UTMI */ | 140 | /* Configure pin mux for ULPI. There is no pin mux for UTMI */ |
| 140 | if (prop && !strcmp(prop, "ulpi")) { | 141 | if (prop && !strcmp(prop, "ulpi")) { |
| 141 | if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) { | 142 | if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) { |
| 143 | clrsetbits_be32(immap + MPC83XX_SICRH_OFFS, | ||
| 144 | MPC8308_SICRH_USB_MASK, | ||
| 145 | MPC8308_SICRH_USB_ULPI); | ||
| 146 | } else if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) { | ||
| 142 | clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, | 147 | clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, |
| 143 | MPC8315_SICRL_USB_MASK, | 148 | MPC8315_SICRL_USB_MASK, |
| 144 | MPC8315_SICRL_USB_ULPI); | 149 | MPC8315_SICRL_USB_ULPI); |
| @@ -173,6 +178,9 @@ int mpc831x_usb_cfg(void) | |||
| 173 | !strcmp(prop, "utmi"))) { | 178 | !strcmp(prop, "utmi"))) { |
| 174 | u32 refsel; | 179 | u32 refsel; |
| 175 | 180 | ||
| 181 | if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) | ||
| 182 | goto out; | ||
| 183 | |||
| 176 | if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) | 184 | if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) |
| 177 | refsel = CONTROL_REFSEL_24MHZ; | 185 | refsel = CONTROL_REFSEL_24MHZ; |
| 178 | else | 186 | else |
| @@ -186,9 +194,11 @@ int mpc831x_usb_cfg(void) | |||
| 186 | temp = CONTROL_PHY_CLK_SEL_ULPI; | 194 | temp = CONTROL_PHY_CLK_SEL_ULPI; |
| 187 | #ifdef CONFIG_USB_OTG | 195 | #ifdef CONFIG_USB_OTG |
| 188 | /* Set OTG_PORT */ | 196 | /* Set OTG_PORT */ |
| 189 | dr_mode = of_get_property(np, "dr_mode", NULL); | 197 | if (!of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) { |
| 190 | if (dr_mode && !strcmp(dr_mode, "otg")) | 198 | dr_mode = of_get_property(np, "dr_mode", NULL); |
| 191 | temp |= CONTROL_OTG_PORT; | 199 | if (dr_mode && !strcmp(dr_mode, "otg")) |
| 200 | temp |= CONTROL_OTG_PORT; | ||
| 201 | } | ||
| 192 | #endif /* CONFIG_USB_OTG */ | 202 | #endif /* CONFIG_USB_OTG */ |
| 193 | out_be32(usb_regs + FSL_USB2_CONTROL_OFFS, temp); | 203 | out_be32(usb_regs + FSL_USB2_CONTROL_OFFS, temp); |
| 194 | } else { | 204 | } else { |
| @@ -196,6 +206,7 @@ int mpc831x_usb_cfg(void) | |||
| 196 | ret = -EINVAL; | 206 | ret = -EINVAL; |
| 197 | } | 207 | } |
| 198 | 208 | ||
| 209 | out: | ||
| 199 | iounmap(usb_regs); | 210 | iounmap(usb_regs); |
| 200 | of_node_put(np); | 211 | of_node_put(np); |
| 201 | return ret; | 212 | return ret; |
