Skip to contentSkip to conversation

Drivers: USB: MUSB: Remove legacy CONFIG_USB_DA8XX

PATCH New Adam Ford 3 participants 7 messages Dec 10, 2018 – Dec 12, 2018

Subsystems (2)
lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/1 Drivers: USB: MUSB: Remove legacy CONFIG_USB_DA8XX

There don't appear to be any boards enabling CONFIG_USB_DA8XX, and there is a newer version of the MUSB driver, so let's remove the legacy version of it.

drivers/usb/musb/Kconfig +0 -4
index 7e6be03f4a..2508b6ed0d 100644
@@ -15,10 +15,6 @@ config USB_OMAP3
 	bool "Legacy MUSB OMAP3 / OMAP4"
 	depends on ARCH_OMAP2PLUS
 
-config USB_DA8XX
-	bool "Legacy MUSB DA8xx/OMAP-L1x"
-	depends on ARCH_DAVINCI
-
 config USB_AM35X
 	bool"Legacy MUSB AM35x"
 	depends on ARCH_OMAP2PLUS && !USB_OMAP3
drivers/usb/musb/Makefile +0 -1
index 1242ce1c8c..744f2cfaa2 100644
@@ -6,5 +6,4 @@
 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_OMAP3) += omap3.o
-obj-$(CONFIG_USB_DA8XX) += da8xx.o
 obj-$(CONFIG_USB_AM35X) += am35x.o
drivers/usb/musb/da8xx.c deleted +0 -127

127 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 Drivers: USB: MUSB: Remove legacy CONFIG_USB_DA8XX

Quoted 5 lines · Adam Ford

There don't appear to be any boards enabling CONFIG_USB_DA8XX, and there is a newer version of the MUSB driver, so let's remove the legacy version of it.

CCing Jean, I'd like his A-B/R-B.
Looks good to me, so I'll pick it once I have it, thanks!

Quoted 160 lines
drivers/usb/musb/Kconfig +0 -4
index 7e6be03f4a..2508b6ed0d 100644
@@ -15,10 +15,6 @@ config USB_OMAP3
 	bool "Legacy MUSB OMAP3 / OMAP4"
 	depends on ARCH_OMAP2PLUS
 
-config USB_DA8XX
-	bool "Legacy MUSB DA8xx/OMAP-L1x"
-	depends on ARCH_DAVINCI
-
 config USB_AM35X
 	bool"Legacy MUSB AM35x"
 	depends on ARCH_OMAP2PLUS && !USB_OMAP3
drivers/usb/musb/Makefile +0 -1
index 1242ce1c8c..744f2cfaa2 100644
@@ -6,5 +6,4 @@
 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_OMAP3) += omap3.o
-obj-$(CONFIG_USB_DA8XX) += da8xx.o
 obj-$(CONFIG_USB_AM35X) += am35x.o
drivers/usb/musb/da8xx.c deleted +0 -127
deleted file mode 100644
index a652a7c3c1..0000000000
@@ -1,127 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
- *
- * Author: Ajay Kumar Gupta <[email protected]>
- *
- * Based on drivers/usb/musb/davinci.c
- *
- * Copyright (C) 2009 Texas Instruments Incorporated
- */
-#include <common.h>
-
-#include "musb_core.h"
-#include <asm/arch/da8xx-usb.h>
-
-/* MUSB platform configuration */
-struct musb_config musb_cfg = {
-	.regs		= (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
-	.timeout	= DA8XX_USB_OTG_TIMEOUT,
-	.musb_speed	= 0,
-};
-
-/*
- * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
- */
-static void enable_vbus(void)
-{
-	u32 value;
-
-	/* configure GPIO bank4 pin 15 in output direction */
-	value = readl(&davinci_gpio_bank45->dir);
-	writel((value & (~DA8XX_USB_VBUS_GPIO)), &davinci_gpio_bank45->dir);
-
-	/* set GPIO bank4 pin 15 high to drive VBUS */
-	value = readl(&davinci_gpio_bank45->set_data);
-	writel((value | DA8XX_USB_VBUS_GPIO), &davinci_gpio_bank45->set_data);
-}
-
-/*
- * Enable the usb0 phy. This initialization procedure is explained in
- * the DA8xx USB user guide document.
- */
-static u8 phy_on(void)
-{
-	u32 timeout;
-	u32 cfgchip2;
-
-	cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-
-	cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN |
-		      CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
-	cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON |
-		    CFGCHIP2_REFFREQ_24MHZ;
-
-	writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-
-	/* wait until the usb phy pll locks */
-	timeout = musb_cfg.timeout;
-	while (timeout--)
-		if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
-			return 1;
-
-	/* USB phy was not turned on */
-	return 0;
-}
-
-/*
- * Disable the usb phy
- */
-static void phy_off(void)
-{
-	u32 cfgchip2;
-
-	/*
-	 * Power down the on-chip PHY.
-	 */
-	cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-	cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
-	cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
-	writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-}
-
-/*
- * This function performs DA8xx platform specific initialization for usb0.
- */
-int musb_platform_init(void)
-{
-	u32  revision;
-
-	/* enable psc for usb2.0 */
-	lpsc_on(33);
-
-	/* enable usb vbus */
-	enable_vbus();
-
-	/* reset the controller */
-	writel(0x1, &da8xx_usb_regs->control);
-	udelay(5000);
-
-	/* start the on-chip usb phy and its pll */
-	if (phy_on() == 0)
-		return -1;
-
-	/* Returns zero if e.g. not clocked */
-	revision = readl(&da8xx_usb_regs->revision);
-	if (revision == 0)
-		return -1;
-
-	/* Disable all interrupts */
-	writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-		DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_set);
-	return 0;
-}
-
-/*
- * This function performs DA8xx platform specific deinitialization for usb0.
- */
-void musb_platform_deinit(void)
-{
-	/* Turn of the phy */
-	phy_off();
-
-	/* flush any interrupts */
-	writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-		DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_clr);
-	writel(0, &da8xx_usb_regs->eoi);
-}
Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH 1/1 Drivers: USB: MUSB: Remove legacy CONFIG_USB_DA8XX

Quoted 8 lines · Marek Vasut
Quoted 5 lines · Adam Ford

There don't appear to be any boards enabling CONFIG_USB_DA8XX, and there is a newer version of the MUSB driver, so let's remove the legacy version of it.

CCing Jean, I'd like his A-B/R-B.
Looks good to me, so I'll pick it once I have it, thanks!

This is good to see some code removal

Thanks

Quoted 160 lines
Quoted 160 lines
drivers/usb/musb/Kconfig +0 -4
index 7e6be03f4a..2508b6ed0d 100644
@@ -15,10 +15,6 @@ config USB_OMAP3
  	bool "Legacy MUSB OMAP3 / OMAP4"
  	depends on ARCH_OMAP2PLUS
 
-config USB_DA8XX
-	bool "Legacy MUSB DA8xx/OMAP-L1x"
-	depends on ARCH_DAVINCI
-
  config USB_AM35X
  	bool"Legacy MUSB AM35x"
  	depends on ARCH_OMAP2PLUS && !USB_OMAP3
drivers/usb/musb/Makefile +0 -1
index 1242ce1c8c..744f2cfaa2 100644
@@ -6,5 +6,4 @@
  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_OMAP3) += omap3.o
-obj-$(CONFIG_USB_DA8XX) += da8xx.o
  obj-$(CONFIG_USB_AM35X) += am35x.o
drivers/usb/musb/da8xx.c deleted +0 -127
deleted file mode 100644
index a652a7c3c1..0000000000
@@ -1,127 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
- *
- * Author: Ajay Kumar Gupta <[email protected]>
- *
- * Based on drivers/usb/musb/davinci.c
- *
- * Copyright (C) 2009 Texas Instruments Incorporated
- */
-#include <common.h>
-
-#include "musb_core.h"
-#include <asm/arch/da8xx-usb.h>
-
-/* MUSB platform configuration */
-struct musb_config musb_cfg = {
-	.regs		= (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
-	.timeout	= DA8XX_USB_OTG_TIMEOUT,
-	.musb_speed	= 0,
-};
-
-/*
- * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
- */
-static void enable_vbus(void)
-{
-	u32 value;
-
-	/* configure GPIO bank4 pin 15 in output direction */
-	value = readl(&davinci_gpio_bank45->dir);
-	writel((value & (~DA8XX_USB_VBUS_GPIO)), &davinci_gpio_bank45->dir);
-
-	/* set GPIO bank4 pin 15 high to drive VBUS */
-	value = readl(&davinci_gpio_bank45->set_data);
-	writel((value | DA8XX_USB_VBUS_GPIO), &davinci_gpio_bank45->set_data);
-}
-
-/*
- * Enable the usb0 phy. This initialization procedure is explained in
- * the DA8xx USB user guide document.
- */
-static u8 phy_on(void)
-{
-	u32 timeout;
-	u32 cfgchip2;
-
-	cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-
-	cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN |
-		      CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
-	cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON |
-		    CFGCHIP2_REFFREQ_24MHZ;
-
-	writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-
-	/* wait until the usb phy pll locks */
-	timeout = musb_cfg.timeout;
-	while (timeout--)
-		if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
-			return 1;
-
-	/* USB phy was not turned on */
-	return 0;
-}
-
-/*
- * Disable the usb phy
- */
-static void phy_off(void)
-{
-	u32 cfgchip2;
-
-	/*
-	 * Power down the on-chip PHY.
-	 */
-	cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-	cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
-	cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
-	writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-}
-
-/*
- * This function performs DA8xx platform specific initialization for usb0.
- */
-int musb_platform_init(void)
-{
-	u32  revision;
-
-	/* enable psc for usb2.0 */
-	lpsc_on(33);
-
-	/* enable usb vbus */
-	enable_vbus();
-
-	/* reset the controller */
-	writel(0x1, &da8xx_usb_regs->control);
-	udelay(5000);
-
-	/* start the on-chip usb phy and its pll */
-	if (phy_on() == 0)
-		return -1;
-
-	/* Returns zero if e.g. not clocked */
-	revision = readl(&da8xx_usb_regs->revision);
-	if (revision == 0)
-		return -1;
-
-	/* Disable all interrupts */
-	writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-		DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_set);
-	return 0;
-}
-
-/*
- * This function performs DA8xx platform specific deinitialization for usb0.
- */
-void musb_platform_deinit(void)
-{
-	/* Turn of the phy */
-	phy_off();
-
-	/* flush any interrupts */
-	writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-		DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_clr);
-	writel(0, &da8xx_usb_regs->eoi);
-}
#3 lore raw

PATCH 1/1 Drivers: USB: MUSB: Remove legacy CONFIG_USB_DA8XX

Quoted 7 lines · Jean-Jacques Hiblot
Quoted 5 lines · Marek Vasut
Quoted 4 lines · Adam Ford

There don't appear to be any boards enabling CONFIG_USB_DA8XX, and there is a newer version of the MUSB driver, so let's remove the legacy version of it.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

CCing Jean, I'd like his A-B/R-B.
Looks good to me, so I'll pick it once I have it, thanks!

This is good to see some code removal

This could even go a bit further and remove:

- drivers/usb/host/ohci-da8xx.c

- arch/arm/mach-davinci/include/mach/da8xx-usb.h

Quoted 173 lines

Thanks

Quoted 165 lines
Quoted 165 lines
drivers/usb/musb/Kconfig +0 -0
index 7e6be03f4a..2508b6ed0d 100644
@@ -15,10 +15,6 @@ config USB_OMAP3

      bool "Legacy MUSB OMAP3 / OMAP4"
      depends on ARCH_OMAP2PLUS
  -config USB_DA8XX
-    bool "Legacy MUSB DA8xx/OMAP-L1x"
-    depends on ARCH_DAVINCI
-
  config USB_AM35X
      bool"Legacy MUSB AM35x"
      depends on ARCH_OMAP2PLUS && !USB_OMAP3

drivers/usb/musb/Makefile +0 -0
index 1242ce1c8c..744f2cfaa2 100644
@@ -6,5 +6,4 @@

  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_OMAP3) += omap3.o -obj-$(CONFIG_USB_DA8XX) += da8xx.o obj-$(CONFIG_USB_AM35X) += am35x.o

drivers/usb/musb/da8xx.c deleted +0 -32
deleted file mode 100644
index a652a7c3c1..0000000000
@@ -1,127 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
- *
- * Author: Ajay Kumar Gupta <[email protected]>
- *
- * Based on drivers/usb/musb/davinci.c
- *
- * Copyright (C) 2009 Texas Instruments Incorporated
- */
-#include <common.h>
-
-#include "musb_core.h"
-#include <asm/arch/da8xx-usb.h>
-
-/* MUSB platform configuration */
-struct musb_config musb_cfg = {
-    .regs        = (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
-    .timeout    = DA8XX_USB_OTG_TIMEOUT,
-    .musb_speed    = 0,
-};
-
-/*
- * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
- */
-static void enable_vbus(void)
-{
-    u32 value;
-
-    /* configure GPIO bank4 pin 15 in output direction */
-    value = readl(&davinci_gpio_bank45->dir);
-    writel((value & (~DA8XX_USB_VBUS_GPIO)), 

&davinci_gpio_bank45->dir);
-
-    /* set GPIO bank4 pin 15 high to drive VBUS */ -    value = readl(&davinci_gpio_bank45->set_data); -    writel((value | DA8XX_USB_VBUS_GPIO), &davinci_gpio_bank45->set_data);

drivers/usb/musb/da8xx.c deleted +0 -14
-}
-
-/*
- * Enable the usb0 phy. This initialization procedure is explained in
- * the DA8xx USB user guide document.
- */
-static u8 phy_on(void)
-{
-    u32 timeout;
-    u32 cfgchip2;
-
-    cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-
-    cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | 

CFGCHIP2_OTGPWRDN |
-              CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ); -    cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON |
-            CFGCHIP2_REFFREQ_24MHZ;

drivers/usb/musb/da8xx.c deleted +0 -31
-
-    writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-
-    /* wait until the usb phy pll locks */
-    timeout = musb_cfg.timeout;
-    while (timeout--)
-        if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
-            return 1;
-
-    /* USB phy was not turned on */
-    return 0;
-}
-
-/*
- * Disable the usb phy
- */
-static void phy_off(void)
-{
-    u32 cfgchip2;
-
-    /*
-     * Power down the on-chip PHY.
-     */
-    cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-    cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
-    cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
-    writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-}
-
-/*
- * This function performs DA8xx platform specific initialization 

for usb0.
- */

drivers/usb/musb/da8xx.c deleted +0 -31
-int musb_platform_init(void)
-{
-    u32  revision;
-
-    /* enable psc for usb2.0 */
-    lpsc_on(33);
-
-    /* enable usb vbus */
-    enable_vbus();
-
-    /* reset the controller */
-    writel(0x1, &da8xx_usb_regs->control);
-    udelay(5000);
-
-    /* start the on-chip usb phy and its pll */
-    if (phy_on() == 0)
-        return -1;
-
-    /* Returns zero if e.g. not clocked */
-    revision = readl(&da8xx_usb_regs->revision);
-    if (revision == 0)
-        return -1;
-
-    /* Disable all interrupts */
-    writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-        DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_set);
-    return 0;
-}
-
-/*
- * This function performs DA8xx platform specific deinitialization 

for usb0.
- */

drivers/usb/musb/da8xx.c deleted +0 -10
-void musb_platform_deinit(void)
-{
-    /* Turn of the phy */
-    phy_off();
-
-    /* flush any interrupts */
-    writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-        DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_clr);
-    writel(0, &da8xx_usb_regs->eoi);
-}
author
#4 lore raw

PATCH 1/1 Drivers: USB: MUSB: Remove legacy CONFIG_USB_DA8XX

Quoted 14 lines · Jean-Jacques Hiblot
Quoted 11 lines · Jean-Jacques Hiblot
Quoted 8 lines · Marek Vasut
Quoted 5 lines · Adam Ford

There don't appear to be any boards enabling CONFIG_USB_DA8XX, and there is a newer version of the MUSB driver, so let's remove the legacy version of it.

CCing Jean, I'd like his A-B/R-B.
Looks good to me, so I'll pick it once I have it, thanks!

Quoted 8 lines
Quoted 1 line

This is good to see some code removal

This could even go a bit further and remove:

- drivers/usb/host/ohci-da8xx.c

- arch/arm/mach-davinci/include/mach/da8xx-usb.h

I want to investigate these a bit. I might have a use for these two files on the da850evm yet. I know the musb was replaced by musb-new, so my hope is to make the legacy musb drivers go away first. In my ideal word, I'd like to keep the da850-evm around for a bit longer, at least until Logic PD discontinues the L138 and AM1808 system on module. If I can reuse these drivers to bring back USB host functionality, I'd like to keep them.

adam

Quoted 174 lines
Quoted 174 lines

Thanks

Quoted 165 lines
Quoted 165 lines
drivers/usb/musb/Kconfig +0 -3
index 7e6be03f4a..2508b6ed0d 100644
@@ -15,10 +15,6 @@ config USB_OMAP3
      bool "Legacy MUSB OMAP3 / OMAP4"
      depends on ARCH_OMAP2PLUS
  -config USB_DA8XX
-    bool "Legacy MUSB DA8xx/OMAP-L1x"
-    depends on ARCH_DAVINCI
-
  config USB_AM35X
      bool"Legacy MUSB AM35x"
      depends on ARCH_OMAP2PLUS && !USB_OMAP3
drivers/usb/musb/Makefile +0 -1
index 1242ce1c8c..744f2cfaa2 100644
@@ -6,5 +6,4 @@
  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_OMAP3) += omap3.o
-obj-$(CONFIG_USB_DA8XX) += da8xx.o
  obj-$(CONFIG_USB_AM35X) += am35x.o
drivers/usb/musb/da8xx.c deleted +0 -32
deleted file mode 100644
index a652a7c3c1..0000000000
@@ -1,127 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
- *
- * Author: Ajay Kumar Gupta <[email protected]>
- *
- * Based on drivers/usb/musb/davinci.c
- *
- * Copyright (C) 2009 Texas Instruments Incorporated
- */
-#include <common.h>
-
-#include "musb_core.h"
-#include <asm/arch/da8xx-usb.h>
-
-/* MUSB platform configuration */
-struct musb_config musb_cfg = {
-    .regs        = (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
-    .timeout    = DA8XX_USB_OTG_TIMEOUT,
-    .musb_speed    = 0,
-};
-
-/*
- * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
- */
-static void enable_vbus(void)
-{
-    u32 value;
-
-    /* configure GPIO bank4 pin 15 in output direction */
-    value = readl(&davinci_gpio_bank45->dir);
-    writel((value & (~DA8XX_USB_VBUS_GPIO)),

&davinci_gpio_bank45->dir);

drivers/usb/musb/da8xx.c deleted +0 -4
-
-    /* set GPIO bank4 pin 15 high to drive VBUS */
-    value = readl(&davinci_gpio_bank45->set_data);
-    writel((value | DA8XX_USB_VBUS_GPIO),

&davinci_gpio_bank45->set_data);

drivers/usb/musb/da8xx.c deleted +0 -14
-}
-
-/*
- * Enable the usb0 phy. This initialization procedure is explained in
- * the DA8xx USB user guide document.
- */
-static u8 phy_on(void)
-{
-    u32 timeout;
-    u32 cfgchip2;
-
-    cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-
-    cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN |

CFGCHIP2_OTGPWRDN |

drivers/usb/musb/da8xx.c deleted +0 -2
-              CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
-    cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN |

CFGCHIP2_PHY_PLLON |

drivers/usb/musb/da8xx.c deleted +0 -32
-            CFGCHIP2_REFFREQ_24MHZ;
-
-    writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-
-    /* wait until the usb phy pll locks */
-    timeout = musb_cfg.timeout;
-    while (timeout--)
-        if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
-            return 1;
-
-    /* USB phy was not turned on */
-    return 0;
-}
-
-/*
- * Disable the usb phy
- */
-static void phy_off(void)
-{
-    u32 cfgchip2;
-
-    /*
-     * Power down the on-chip PHY.
-     */
-    cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-    cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
-    cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
-    writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-}
-
-/*
- * This function performs DA8xx platform specific initialization

for usb0.
- */

drivers/usb/musb/da8xx.c deleted +0 -31
-int musb_platform_init(void)
-{
-    u32  revision;
-
-    /* enable psc for usb2.0 */
-    lpsc_on(33);
-
-    /* enable usb vbus */
-    enable_vbus();
-
-    /* reset the controller */
-    writel(0x1, &da8xx_usb_regs->control);
-    udelay(5000);
-
-    /* start the on-chip usb phy and its pll */
-    if (phy_on() == 0)
-        return -1;
-
-    /* Returns zero if e.g. not clocked */
-    revision = readl(&da8xx_usb_regs->revision);
-    if (revision == 0)
-        return -1;
-
-    /* Disable all interrupts */
-    writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-        DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_set);
-    return 0;
-}
-
-/*
- * This function performs DA8xx platform specific deinitialization

for usb0.
- */

drivers/usb/musb/da8xx.c deleted +0 -10
-void musb_platform_deinit(void)
-{
-    /* Turn of the phy */
-    phy_off();
-
-    /* flush any interrupts */
-    writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-        DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_clr);
-    writel(0, &da8xx_usb_regs->eoi);
-}
#5 lore raw

PATCH 1/1 Drivers: USB: MUSB: Remove legacy CONFIG_USB_DA8XX

Quoted 19 lines · Adam Ford
Quoted 9 lines · Jean-Jacques Hiblot
Quoted 7 lines · Jean-Jacques Hiblot
Quoted 6 lines · Marek Vasut
Quoted 5 lines · Adam Ford

There don't appear to be any boards enabling CONFIG_USB_DA8XX, and there is a newer version of the MUSB driver, so let's remove the legacy version of it.

Quoted 9 lines
Quoted 3 lines
Quoted 2 lines

CCing Jean, I'd like his A-B/R-B.
Looks good to me, so I'll pick it once I have it, thanks!

This is good to see some code removal

This could even go a bit further and remove:

- drivers/usb/host/ohci-da8xx.c

- arch/arm/mach-davinci/include/mach/da8xx-usb.h

Quoted 7 lines

I want to investigate these a bit. I might have a use for these two files on the da850evm yet. I know the musb was replaced by musb-new, so my hope is to make the legacy musb drivers go away first. In my ideal word, I'd like to keep the da850-evm around for a bit longer, at least until Logic PD discontinues the L138 and AM1808 system on module. If I can reuse these drivers to bring back USB host functionality, I'd like to keep them.

It's fine by me. I just thought that those files might have been overlooked.

JJ

Quoted 172 lines

adam

Quoted 170 lines
Quoted 170 lines

Thanks

Quoted 164 lines
Quoted 164 lines
drivers/usb/musb/Kconfig +0 -3
index 7e6be03f4a..2508b6ed0d 100644
@@ -15,10 +15,6 @@ config USB_OMAP3
       bool "Legacy MUSB OMAP3 / OMAP4"
       depends on ARCH_OMAP2PLUS
   -config USB_DA8XX
-    bool "Legacy MUSB DA8xx/OMAP-L1x"
-    depends on ARCH_DAVINCI
-
   config USB_AM35X
       bool"Legacy MUSB AM35x"
       depends on ARCH_OMAP2PLUS && !USB_OMAP3
drivers/usb/musb/Makefile +0 -1
index 1242ce1c8c..744f2cfaa2 100644
@@ -6,5 +6,4 @@
   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_OMAP3) += omap3.o
-obj-$(CONFIG_USB_DA8XX) += da8xx.o
   obj-$(CONFIG_USB_AM35X) += am35x.o
drivers/usb/musb/da8xx.c deleted +0 -32
deleted file mode 100644
index a652a7c3c1..0000000000
@@ -1,127 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * da8xx.c - TI's DA8xx platform specific usb wrapper functions.
- *
- * Author: Ajay Kumar Gupta <[email protected]>
- *
- * Based on drivers/usb/musb/davinci.c
- *
- * Copyright (C) 2009 Texas Instruments Incorporated
- */
-#include <common.h>
-
-#include "musb_core.h"
-#include <asm/arch/da8xx-usb.h>
-
-/* MUSB platform configuration */
-struct musb_config musb_cfg = {
-    .regs        = (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE,
-    .timeout    = DA8XX_USB_OTG_TIMEOUT,
-    .musb_speed    = 0,
-};
-
-/*
- * This function enables VBUS by driving the GPIO Bank4 Pin 15 high.
- */
-static void enable_vbus(void)
-{
-    u32 value;
-
-    /* configure GPIO bank4 pin 15 in output direction */
-    value = readl(&davinci_gpio_bank45->dir);
-    writel((value & (~DA8XX_USB_VBUS_GPIO)),

&davinci_gpio_bank45->dir);

drivers/usb/musb/da8xx.c deleted +0 -4
-
-    /* set GPIO bank4 pin 15 high to drive VBUS */
-    value = readl(&davinci_gpio_bank45->set_data);
-    writel((value | DA8XX_USB_VBUS_GPIO),

&davinci_gpio_bank45->set_data);

drivers/usb/musb/da8xx.c deleted +0 -14
-}
-
-/*
- * Enable the usb0 phy. This initialization procedure is explained in
- * the DA8xx USB user guide document.
- */
-static u8 phy_on(void)
-{
-    u32 timeout;
-    u32 cfgchip2;
-
-    cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-
-    cfgchip2 &= ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN |

CFGCHIP2_OTGPWRDN |

drivers/usb/musb/da8xx.c deleted +0 -2
-              CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ);
-    cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN |

CFGCHIP2_PHY_PLLON |

drivers/usb/musb/da8xx.c deleted +0 -32
-            CFGCHIP2_REFFREQ_24MHZ;
-
-    writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-
-    /* wait until the usb phy pll locks */
-    timeout = musb_cfg.timeout;
-    while (timeout--)
-        if (readl(&davinci_syscfg_regs->cfgchip2) & CFGCHIP2_PHYCLKGD)
-            return 1;
-
-    /* USB phy was not turned on */
-    return 0;
-}
-
-/*
- * Disable the usb phy
- */
-static void phy_off(void)
-{
-    u32 cfgchip2;
-
-    /*
-     * Power down the on-chip PHY.
-     */
-    cfgchip2 = readl(&davinci_syscfg_regs->cfgchip2);
-    cfgchip2 &= ~CFGCHIP2_PHY_PLLON;
-    cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN;
-    writel(cfgchip2, &davinci_syscfg_regs->cfgchip2);
-}
-
-/*
- * This function performs DA8xx platform specific initialization

for usb0.
- */

drivers/usb/musb/da8xx.c deleted +0 -31
-int musb_platform_init(void)
-{
-    u32  revision;
-
-    /* enable psc for usb2.0 */
-    lpsc_on(33);
-
-    /* enable usb vbus */
-    enable_vbus();
-
-    /* reset the controller */
-    writel(0x1, &da8xx_usb_regs->control);
-    udelay(5000);
-
-    /* start the on-chip usb phy and its pll */
-    if (phy_on() == 0)
-        return -1;
-
-    /* Returns zero if e.g. not clocked */
-    revision = readl(&da8xx_usb_regs->revision);
-    if (revision == 0)
-        return -1;
-
-    /* Disable all interrupts */
-    writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-        DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_set);
-    return 0;
-}
-
-/*
- * This function performs DA8xx platform specific deinitialization

for usb0.
- */

drivers/usb/musb/da8xx.c deleted +0 -10
-void musb_platform_deinit(void)
-{
-    /* Turn of the phy */
-    phy_off();
-
-    /* flush any interrupts */
-    writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK |
-        DA8XX_USB_RXINT_MASK), &da8xx_usb_regs->intmsk_clr);
-    writel(0, &da8xx_usb_regs->eoi);
-}
#6 lore raw

PATCH 1/1 Drivers: USB: MUSB: Remove legacy CONFIG_USB_DA8XX

In reply to Adam Ford
Quoted 5 lines · Adam Ford

There don't appear to be any boards enabling CONFIG_USB_DA8XX, and there is a newer version of the MUSB driver, so let's remove the legacy version of it.

It doesn't apply to u-boot-usb/master, can you rebase and repost please?

Signature · 2 lines
Best regards,
Marek Vasut