]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/musb/davinci.c
Merge branch 'next' of git://git.denx.de/u-boot-mpc83xx
[u-boot] / drivers / usb / musb / davinci.c
index f56f2df532ec46c98ae2bd48fbca8f25e6abf9dd..a9707a898b570c953bc66ed1688d959aa9a06d84 100644 (file)
@@ -3,20 +3,7 @@
  *
  * Copyright (c) 2008 Texas Instruments
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  *
  * Author: Thomas Abraham t-abraham@ti.com, Texas Instruments
  */
 #include "davinci.h"
 #include <asm/arch/hardware.h>
 
+#if !defined(CONFIG_DV_USBPHY_CTL)
+#define CONFIG_DV_USBPHY_CTL (USBPHY_SESNDEN | USBPHY_VBDTCTEN)
+#endif
+
 /* MUSB platform configuration */
 struct musb_config musb_cfg = {
        .regs           = (struct musb_regs *)MENTOR_USB0_BASE,
@@ -50,7 +41,7 @@ static u8 phy_on(void)
        writel(USBPHY_PHY24MHZ | USBPHY_SESNDEN |
                        USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
 #else
-       writel(USBPHY_SESNDEN | USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
+       writel(CONFIG_DV_USBPHY_CTL, USBPHY_CTL_PADDR);
 #endif
        timeout = musb_cfg.timeout;
 
@@ -78,6 +69,17 @@ static void phy_off(void)
        writel(USBPHY_OSCPDWN | USBPHY_PHYPDWN, USBPHY_CTL_PADDR);
 }
 
+void __enable_vbus(void)
+{
+       /*
+        *  nothing to do, vbus is handled through the cpu.
+        *  Define this function in board code, if it is
+        *  different on your board.
+        */
+}
+void  enable_vbus(void)
+       __attribute__((weak, alias("__enable_vbus")));
+
 /*
  * This function performs Davinci platform specific initialization for usb0.
  */
@@ -86,9 +88,8 @@ int musb_platform_init(void)
        u32  revision;
 
        /* enable USB VBUS */
-#ifndef DAVINCI_DM365EVM
        enable_vbus();
-#endif
+
        /* start the on-chip USB phy and its pll */
        if (!phy_on())
                return -1;