[U-Boot] [PATCH V2] Drivers: USB: Remove Legacy CONFIG_USB_DAVINCI

Adam Ford aford173 at gmail.com
Wed Dec 12 14:17:22 UTC 2018


This patch removes CONFIG_USB_DAVINCI.  It's a legacy option
that isn't defined anywhere, and there is a newer MUSB driver.

Signed-off-by: Adam Ford <aford173 at gmail.com>
Reviewed-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
---
V2:  Rebase on origin/master
     Remove drivers/usb/musb/davinci.c
     Remove drivers/usb/musb/davinci.h

diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index dd42f69a6b..7e6be03f4a 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -11,9 +11,6 @@ config USB_MUSB_HCD
 config USB_MUSB_UDC
 	bool "Legacy USB Device Controller"
 
-config USB_DAVINCI
-	bool "Legacy MUSB DaVinci"
-	
 config USB_OMAP3
 	bool "Legacy MUSB OMAP3 / OMAP4"
 	depends on ARCH_OMAP2PLUS
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index bdb3cd87f6..1242ce1c8c 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -5,7 +5,6 @@
 
 obj-$(CONFIG_USB_MUSB_HCD) += musb_hcd.o musb_core.o
 obj-$(CONFIG_USB_MUSB_UDC) += musb_udc.o musb_core.o
-obj-$(CONFIG_USB_DAVINCI) += davinci.o
 obj-$(CONFIG_USB_OMAP3) += omap3.o
 obj-$(CONFIG_USB_DA8XX) += da8xx.o
 obj-$(CONFIG_USB_AM35X) += am35x.o
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
deleted file mode 100644
index 46cdb5ad1f..0000000000
--- a/drivers/usb/musb/davinci.c
+++ /dev/null
@@ -1,123 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * TI's Davinci platform specific USB wrapper functions.
- *
- * Copyright (c) 2008 Texas Instruments
- *
- * Author: Thomas Abraham t-abraham at ti.com, Texas Instruments
- */
-
-#include <common.h>
-#include <asm/io.h>
-#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,
-	.timeout	= DAVINCI_USB_TIMEOUT,
-	.musb_speed	= 0,
-};
-
-/* MUSB module register overlay */
-struct davinci_usb_regs *dregs;
-
-/*
- * Enable the USB phy
- */
-static u8 phy_on(void)
-{
-	u32 timeout;
-#ifdef DAVINCI_DM365EVM
-	u32 val;
-#endif
-	/* Wait until the USB phy is turned on */
-#ifdef DAVINCI_DM365EVM
-	writel(USBPHY_PHY24MHZ | USBPHY_SESNDEN |
-			USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
-#else
-	writel(CONFIG_DV_USBPHY_CTL, USBPHY_CTL_PADDR);
-#endif
-	timeout = musb_cfg.timeout;
-
-#ifdef DAVINCI_DM365EVM
-	/* Set the ownership of GIO33 to USB */
-	val = readl(PINMUX4);
-	val &= ~(PINMUX4_USBDRVBUS_BITCLEAR);
-	val |= PINMUX4_USBDRVBUS_BITSET;
-	writel(val, PINMUX4);
-#endif
-	while (timeout--)
-		if (readl(USBPHY_CTL_PADDR) & USBPHY_PHYCLKGD)
-			return 1;
-
-	/* USB phy was not turned on */
-	return 0;
-}
-
-/*
- * Disable the USB phy
- */
-static void phy_off(void)
-{
-	/* powerdown the on-chip PHY and its oscillator */
-	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.
- */
-int musb_platform_init(void)
-{
-	u32  revision;
-
-	/* enable USB VBUS */
-	enable_vbus();
-
-	/* start the on-chip USB phy and its pll */
-	if (!phy_on())
-		return -1;
-
-	/* reset the controller */
-	dregs = (struct davinci_usb_regs *)DAVINCI_USB0_BASE;
-	writel(1, &dregs->ctrlr);
-	udelay(5000);
-
-	/* Returns zero if e.g. not clocked */
-	revision = readl(&dregs->version);
-	if (!revision)
-		return -1;
-
-	/* Disable all interrupts */
-	writel(DAVINCI_USB_USBINT_MASK | DAVINCI_USB_RXINT_MASK |
-			DAVINCI_USB_TXINT_MASK , &dregs->intmsksetr);
-	return 0;
-}
-
-/*
- * This function performs Davinci platform specific deinitialization for usb0.
- */
-void musb_platform_deinit(void)
-{
-	/* Turn of the phy */
-	phy_off();
-
-	/* flush any interrupts */
-	writel(DAVINCI_USB_USBINT_MASK | DAVINCI_USB_TXINT_MASK |
-			DAVINCI_USB_RXINT_MASK , &dregs->intclrr);
-}
diff --git a/drivers/usb/musb/davinci.h b/drivers/usb/musb/davinci.h
deleted file mode 100644
index 29bb08c307..0000000000
--- a/drivers/usb/musb/davinci.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * TI's Davinci platform specific USB wrapper functions.
- *
- * Copyright (c) 2008 Texas Instruments
- *
- * Author: Thomas Abraham t-abraham at ti.com, Texas Instruments
- */
-
-#ifndef __DAVINCI_USB_H__
-#define __DAVINCI_USB_H__
-
-#include <asm/arch/hardware.h>
-#include "musb_core.h"
-
-/* Base address of DAVINCI usb0 wrapper */
-#define DAVINCI_USB0_BASE 0x01C64000
-
-/* Base address of DAVINCI musb core */
-#define MENTOR_USB0_BASE (DAVINCI_USB0_BASE+0x400)
-
-/*
- * Davinci platform USB wrapper register overlay. Note: Only the required
- * registers are included in this structure. It can be expanded as required.
- */
-struct davinci_usb_regs {
-	u32	version;
-	u32	ctrlr;
-	u32	reserved[0x20];
-	u32	intclrr;
-	u32 	intmskr;
-	u32 	intmsksetr;
-};
-
-#define DAVINCI_USB_TX_ENDPTS_MASK	0x1f /* ep0 + 4 tx */
-#define DAVINCI_USB_RX_ENDPTS_MASK	0x1e /* 4 rx */
-#define DAVINCI_USB_USBINT_SHIFT	16
-#define DAVINCI_USB_TXINT_SHIFT 	0
-#define DAVINCI_USB_RXINT_SHIFT 	8
-#define DAVINCI_INTR_DRVVBUS		0x0100
-
-#define DAVINCI_USB_USBINT_MASK 	0x01ff0000	/* 8 Mentor, DRVVBUS */
-#define DAVINCI_USB_TXINT_MASK \
-		(DAVINCI_USB_TX_ENDPTS_MASK << DAVINCI_USB_TXINT_SHIFT)
-#define DAVINCI_USB_RXINT_MASK \
-		(DAVINCI_USB_RX_ENDPTS_MASK << DAVINCI_USB_RXINT_SHIFT)
-#define MGC_BUSCTL_OFFSET(_bEnd, _bOffset) \
-		(0x80 + (8*(_bEnd)) + (_bOffset))
-
-/* Integrated highspeed/otg PHY */
-#define USBPHY_CTL_PADDR	(DAVINCI_SYSTEM_MODULE_BASE + 0x34)
-#define USBPHY_PHY24MHZ 	(1 << 13)
-#define USBPHY_PHYCLKGD 	(1 << 8)
-#define USBPHY_SESNDEN		(1 << 7)	/* v(sess_end) comparator */
-#define USBPHY_VBDTCTEN 	(1 << 6)	/* v(bus) comparator */
-#define USBPHY_PHYPLLON 	(1 << 4)	/* override pll suspend */
-#define USBPHY_CLKO1SEL 	(1 << 3)
-#define USBPHY_OSCPDWN		(1 << 2)
-#define USBPHY_PHYPDWN		(1 << 0)
-
-/* Timeout for Davinci USB module */
-#define DAVINCI_USB_TIMEOUT 0x3FFFFFF
-
-/* IO Expander I2C address and VBUS enable mask */
-#define IOEXP_I2C_ADDR 0x3A
-#define IOEXP_VBUSEN_MASK 1
-
-/* extern functions */
-extern void lpsc_on(unsigned int id);
-extern int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len);
-extern int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len);
-extern void enable_vbus(void);
-#endif	/* __DAVINCI_USB_H__ */
diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index f1d6d85862..7620114bec 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -46,8 +46,6 @@
 #include "omap3.h"
 #elif defined(CONFIG_USB_AM35X)
 #include "am35x.h"
-#elif defined(CONFIG_USB_DAVINCI)
-#include "davinci.h"
 #endif
 
 /* Define MUSB_DEBUG for debugging */
-- 
2.17.1



More information about the U-Boot mailing list