1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Freescale 83xx USB SOC setup code
5 * Copyright (C) 2007 Freescale Semiconductor, Inc.
9 #include <linux/stddef.h>
10 #include <linux/kernel.h>
11 #include <linux/errno.h>
13 #include <linux/of_address.h>
16 #include <sysdev/fsl_soc.h>
20 int __init mpc837x_usb_cfg(void)
23 struct device_node *np = NULL;
27 np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
28 if (!np || !of_device_is_available(np)) {
32 prop = of_get_property(np, "phy_type", NULL);
34 if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) {
35 pr_warn("837x USB PHY type not supported\n");
40 /* Map IMMR space for pin and clock settings */
41 immap = ioremap(get_immrbase(), 0x1000);
48 clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, MPC837X_SCCR_USB_DRCM_11,
49 MPC837X_SCCR_USB_DRCM_11);
51 /* Configure pin mux for ULPI/serial */
52 clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USB_MASK,
53 MPC837X_SICRL_USB_ULPI);