[POWERPC] 83xx: configure USB clock for MPC8315E
SCCR USB bits are in a different location on the mpc8315. Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
@@ -96,7 +96,7 @@
|
|||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <1>;
|
#size-cells = <1>;
|
||||||
device_type = "soc";
|
device_type = "soc";
|
||||||
compatible = "simple-bus";
|
compatible = "fsl,mpc8315-immr", "simple-bus";
|
||||||
ranges = <0 0xe0000000 0x00100000>;
|
ranges = <0 0xe0000000 0x00100000>;
|
||||||
reg = <0xe0000000 0x00000200>;
|
reg = <0xe0000000 0x00000200>;
|
||||||
bus-frequency = <0>;
|
bus-frequency = <0>;
|
||||||
|
@@ -14,6 +14,8 @@
|
|||||||
#define MPC83XX_SCCR_USB_DRCM_11 0x00300000
|
#define MPC83XX_SCCR_USB_DRCM_11 0x00300000
|
||||||
#define MPC83XX_SCCR_USB_DRCM_01 0x00100000
|
#define MPC83XX_SCCR_USB_DRCM_01 0x00100000
|
||||||
#define MPC83XX_SCCR_USB_DRCM_10 0x00200000
|
#define MPC83XX_SCCR_USB_DRCM_10 0x00200000
|
||||||
|
#define MPC8315_SCCR_USB_MASK 0x00c00000
|
||||||
|
#define MPC8315_SCCR_USB_DRCM_11 0x00c00000
|
||||||
#define MPC837X_SCCR_USB_DRCM_11 0x00c00000
|
#define MPC837X_SCCR_USB_DRCM_11 0x00c00000
|
||||||
|
|
||||||
/* system i/o configuration register low */
|
/* system i/o configuration register low */
|
||||||
|
@@ -104,6 +104,7 @@ int mpc831x_usb_cfg(void)
|
|||||||
u32 temp;
|
u32 temp;
|
||||||
void __iomem *immap, *usb_regs;
|
void __iomem *immap, *usb_regs;
|
||||||
struct device_node *np = NULL;
|
struct device_node *np = NULL;
|
||||||
|
struct device_node *immr_node = NULL;
|
||||||
const void *prop;
|
const void *prop;
|
||||||
struct resource res;
|
struct resource res;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@@ -124,10 +125,15 @@ int mpc831x_usb_cfg(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Configure clock */
|
/* Configure clock */
|
||||||
temp = in_be32(immap + MPC83XX_SCCR_OFFS);
|
immr_node = of_get_parent(np);
|
||||||
temp &= ~MPC83XX_SCCR_USB_MASK;
|
if (immr_node && of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))
|
||||||
temp |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
|
clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
|
||||||
out_be32(immap + MPC83XX_SCCR_OFFS, temp);
|
MPC8315_SCCR_USB_MASK,
|
||||||
|
MPC8315_SCCR_USB_DRCM_11);
|
||||||
|
else
|
||||||
|
clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
|
||||||
|
MPC83XX_SCCR_USB_MASK,
|
||||||
|
MPC83XX_SCCR_USB_DRCM_11);
|
||||||
|
|
||||||
/* Configure pin mux for ULPI. There is no pin mux for UTMI */
|
/* Configure pin mux for ULPI. There is no pin mux for UTMI */
|
||||||
if (prop && !strcmp(prop, "ulpi")) {
|
if (prop && !strcmp(prop, "ulpi")) {
|
||||||
@@ -144,6 +150,9 @@ int mpc831x_usb_cfg(void)
|
|||||||
|
|
||||||
iounmap(immap);
|
iounmap(immap);
|
||||||
|
|
||||||
|
if (immr_node)
|
||||||
|
of_node_put(immr_node);
|
||||||
|
|
||||||
/* Map USB SOC space */
|
/* Map USB SOC space */
|
||||||
ret = of_address_to_resource(np, 0, &res);
|
ret = of_address_to_resource(np, 0, &res);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Reference in New Issue
Block a user