]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: phy: ti: Remove non-DM PHY code
authorTom Rini <trini@konsulko.com>
Mon, 13 Sep 2021 00:32:21 +0000 (20:32 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 28 Sep 2021 01:38:34 +0000 (21:38 -0400)
At this point in time, all platforms that had previously used
drivers/usb/phy/omap_usb_phy.c have been migrated to DM and related
options.  Remove this now unused code and some related unused defines.

Signed-off-by: Tom Rini <trini@konsulko.com>
13 files changed:
configs/am43xx_evm_defconfig
configs/am43xx_evm_qspiboot_defconfig
configs/am43xx_evm_rtconly_defconfig
configs/am43xx_evm_usbhost_boot_defconfig
configs/am43xx_hs_evm_defconfig
configs/cm_t43_defconfig
drivers/usb/phy/Kconfig
drivers/usb/phy/Makefile
drivers/usb/phy/omap_usb_phy.c [deleted file]
include/configs/am43xx_evm.h
include/configs/am57xx_evm.h
include/configs/cm_t43.h
include/configs/dra7xx_evm.h

index 4960ec2168f38f01e2bf7f70bf3f0cb5ada2fe94..d7b12f2c7b9bc633a01226321f43b8d5e7a823e2 100644 (file)
@@ -82,7 +82,6 @@ CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_DWC3_PHY_OMAP=y
-CONFIG_OMAP_USB_PHY=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0403
index ebb46d412f232b8923a0b0679ab7ed5efa2c6ab2..6e593ef8f0c25bd17d0ee5a0bd8638e782e0914b 100644 (file)
@@ -60,7 +60,6 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
-CONFIG_OMAP_USB_PHY=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0403
index 5a170455878deaf23a996873d00e555c492fbc37..8b1792bd30284d35f8a391e9ab981a42c8561641 100644 (file)
@@ -63,7 +63,6 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
-CONFIG_OMAP_USB_PHY=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0403
index 14148b209402b64cedb00e179e8ca36238ffe5e4..8ee16a2572b974d9e52e3b58f329697447505efc 100644 (file)
@@ -83,7 +83,6 @@ CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_DWC3_PHY_OMAP=y
-CONFIG_OMAP_USB_PHY=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0403
index 820fc07547070d9e4cd96e5b2c5ba4af5b5a0699..7e4bb34a0a49922d27b83cb528bca1c7f122e913 100644 (file)
@@ -87,7 +87,6 @@ CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_DWC3_PHY_OMAP=y
-CONFIG_OMAP_USB_PHY=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0403
index 18fbcf0e5821ad966809ebfac8327a3949ab4b08..eea9a74d34864196edd4e721188e97b6a176883a 100644 (file)
@@ -91,4 +91,3 @@ CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_OMAP_USB_PHY=y
index 8741553d09b2f8c2b746c8771cf694a980b72cb5..c505862f1e15ed1285fff8595e24508f70ccb575 100644 (file)
@@ -8,8 +8,5 @@ comment "USB Phy"
 config TWL4030_USB
        bool "TWL4030 PHY"
 
-config OMAP_USB_PHY
-       bool "OMAP PHY"
-
 config ROCKCHIP_USB2_PHY
        bool "Rockchip USB2 PHY"
index 20f7edf48d74baa7b20a19c61cc7ae39c195294a..b67a70bbe8ed47b93f15d76caac09c504003bf0b 100644 (file)
@@ -4,5 +4,4 @@
 # Tom Rix <Tom.Rix@windriver.com>
 
 obj-$(CONFIG_TWL4030_USB) += twl4030.o
-obj-$(CONFIG_OMAP_USB_PHY) += omap_usb_phy.o
 obj-$(CONFIG_ROCKCHIP_USB2_PHY) += rockchip_usb2_phy.o
diff --git a/drivers/usb/phy/omap_usb_phy.c b/drivers/usb/phy/omap_usb_phy.c
deleted file mode 100644 (file)
index be733f3..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * OMAP USB PHY Support
- *
- * (C) Copyright 2013
- * Texas Instruments, <www.ti.com>
- *
- * Author: Dan Murphy <dmurphy@ti.com>
- */
-
-#include <common.h>
-#include <usb.h>
-#include <dm/device_compat.h>
-#include <linux/delay.h>
-#include <linux/errno.h>
-#include <asm/omap_common.h>
-#include <asm/arch/cpu.h>
-#include <asm/arch/sys_proto.h>
-
-#include <linux/compat.h>
-#include <linux/usb/dwc3.h>
-#include <linux/usb/xhci-omap.h>
-
-#include <usb/xhci.h>
-
-#ifdef CONFIG_OMAP_USB3PHY1_HOST
-struct usb3_dpll_params {
-       u16     m;
-       u8      n;
-       u8      freq:3;
-       u8      sd;
-       u32     mf;
-};
-
-struct usb3_dpll_map {
-       unsigned long rate;
-       struct usb3_dpll_params params;
-       struct usb3_dpll_map *dpll_map;
-};
-
-static struct usb3_dpll_map dpll_map_usb[] = {
-       {12000000, {1250, 5, 4, 20, 0} },       /* 12 MHz */
-       {16800000, {3125, 20, 4, 20, 0} },      /* 16.8 MHz */
-       {19200000, {1172, 8, 4, 20, 65537} },   /* 19.2 MHz */
-       {20000000, {1000, 7, 4, 10, 0} },       /* 20 MHz */
-       {26000000, {1250, 12, 4, 20, 0} },      /* 26 MHz */
-       {38400000, {3125, 47, 4, 20, 92843} },  /* 38.4 MHz */
-       { },                                    /* Terminator */
-};
-
-static struct usb3_dpll_params *omap_usb3_get_dpll_params(void)
-{
-       unsigned long rate;
-       struct usb3_dpll_map *dpll_map = dpll_map_usb;
-
-       rate = get_sys_clk_freq();
-
-       for (; dpll_map->rate; dpll_map++) {
-               if (rate == dpll_map->rate)
-                       return &dpll_map->params;
-       }
-
-       dev_err(phy->dev, "No DPLL configuration for %lu Hz SYS CLK\n", rate);
-
-       return NULL;
-}
-
-static void omap_usb_dpll_relock(struct omap_usb3_phy *phy_regs)
-{
-       u32 val;
-
-       writel(SET_PLL_GO, &phy_regs->pll_go);
-       do {
-               val = readl(&phy_regs->pll_status);
-                       if (val & PLL_LOCK)
-                               break;
-       } while (1);
-}
-
-static void omap_usb_dpll_lock(struct omap_usb3_phy *phy_regs)
-{
-       struct usb3_dpll_params *dpll_params;
-       u32 val;
-
-       dpll_params = omap_usb3_get_dpll_params();
-       if (!dpll_params)
-               return;
-
-       val = readl(&phy_regs->pll_config_1);
-       val &= ~PLL_REGN_MASK;
-       val |= dpll_params->n << PLL_REGN_SHIFT;
-       writel(val, &phy_regs->pll_config_1);
-
-       val = readl(&phy_regs->pll_config_2);
-       val &= ~PLL_SELFREQDCO_MASK;
-       val |= dpll_params->freq << PLL_SELFREQDCO_SHIFT;
-       writel(val, &phy_regs->pll_config_2);
-
-       val = readl(&phy_regs->pll_config_1);
-       val &= ~PLL_REGM_MASK;
-       val |= dpll_params->m << PLL_REGM_SHIFT;
-       writel(val, &phy_regs->pll_config_1);
-
-       val = readl(&phy_regs->pll_config_4);
-       val &= ~PLL_REGM_F_MASK;
-       val |= dpll_params->mf << PLL_REGM_F_SHIFT;
-       writel(val, &phy_regs->pll_config_4);
-
-       val = readl(&phy_regs->pll_config_3);
-       val &= ~PLL_SD_MASK;
-       val |= dpll_params->sd << PLL_SD_SHIFT;
-       writel(val, &phy_regs->pll_config_3);
-
-       omap_usb_dpll_relock(phy_regs);
-}
-
-static void usb3_phy_partial_powerup(struct omap_usb3_phy *phy_regs)
-{
-       u32 rate = get_sys_clk_freq()/1000000;
-       u32 val;
-
-       val = readl((*ctrl)->control_phy_power_usb);
-       val &= ~(USB3_PWRCTL_CLK_CMD_MASK | USB3_PWRCTL_CLK_FREQ_MASK);
-       val |= (USB3_PHY_PARTIAL_RX_POWERON | USB3_PHY_TX_RX_POWERON);
-       val |= rate << USB3_PWRCTL_CLK_FREQ_SHIFT;
-
-       writel(val, (*ctrl)->control_phy_power_usb);
-}
-
-void usb_phy_power(int on)
-{
-       u32 val;
-
-       val = readl((*ctrl)->control_phy_power_usb);
-       if (on) {
-               val &= ~USB3_PWRCTL_CLK_CMD_MASK;
-               val |= USB3_PHY_TX_RX_POWERON;
-       } else {
-               val &= (~USB3_PWRCTL_CLK_CMD_MASK & ~USB3_PHY_TX_RX_POWERON);
-       }
-
-       writel(val, (*ctrl)->control_phy_power_usb);
-}
-
-void omap_usb3_phy_init(struct omap_usb3_phy *phy_regs)
-{
-       omap_usb_dpll_lock(phy_regs);
-       usb3_phy_partial_powerup(phy_regs);
-       /*
-        * Give enough time for the PHY to partially power-up before
-        * powering it up completely. delay value suggested by the HW
-        * team.
-        */
-       mdelay(100);
-}
-
-static void omap_enable_usb3_phy(struct omap_xhci *omap)
-{
-       u32     val;
-
-       val = (USBOTGSS_DMADISABLE |
-                       USBOTGSS_STANDBYMODE_SMRT_WKUP |
-                       USBOTGSS_IDLEMODE_NOIDLE);
-       writel(val, &omap->otg_wrapper->sysconfig);
-
-       /* Clear the utmi OTG status */
-       val = readl(&omap->otg_wrapper->utmi_otg_status);
-       writel(val, &omap->otg_wrapper->utmi_otg_status);
-
-       /* Enable interrupts */
-       writel(USBOTGSS_COREIRQ_EN, &omap->otg_wrapper->irqenable_set_0);
-       val = (USBOTGSS_IRQ_SET_1_IDPULLUP_FALL_EN |
-                       USBOTGSS_IRQ_SET_1_DISCHRGVBUS_FALL_EN |
-                       USBOTGSS_IRQ_SET_1_CHRGVBUS_FALL_EN     |
-                       USBOTGSS_IRQ_SET_1_DRVVBUS_FALL_EN      |
-                       USBOTGSS_IRQ_SET_1_IDPULLUP_RISE_EN     |
-                       USBOTGSS_IRQ_SET_1_DISCHRGVBUS_RISE_EN  |
-                       USBOTGSS_IRQ_SET_1_CHRGVBUS_RISE_EN |
-                       USBOTGSS_IRQ_SET_1_DRVVBUS_RISE_EN |
-                       USBOTGSS_IRQ_SET_1_OEVT_EN);
-       writel(val, &omap->otg_wrapper->irqenable_set_1);
-
-       /* Clear the IRQ status */
-       val = readl(&omap->otg_wrapper->irqstatus_1);
-       writel(val, &omap->otg_wrapper->irqstatus_1);
-       val = readl(&omap->otg_wrapper->irqstatus_0);
-       writel(val, &omap->otg_wrapper->irqstatus_0);
-};
-#endif /* CONFIG_OMAP_USB3PHY1_HOST */
-
-#ifdef CONFIG_OMAP_USB2PHY2_HOST
-static void omap_enable_usb2_phy2(struct omap_xhci *omap)
-{
-       u32 reg, val;
-
-       val = (~USB2PHY_AUTORESUME_EN & USB2PHY_DISCHGDET);
-       writel(val, (*ctrl)->control_srcomp_north_side);
-
-       setbits_le32((*prcm)->cm_coreaon_usb_phy2_core_clkctrl,
-                       USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K);
-
-       setbits_le32((*prcm)->cm_l3init_hsusbhost_clkctrl,
-                                       (USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K |
-                                        OTG_SS_CLKCTRL_MODULEMODE_HW));
-
-       /* This is an undocumented Reserved register */
-       reg = 0x4a0086c0;
-       val = readl(reg);
-       val |= 0x100;
-       setbits_le32(reg, val);
-}
-
-void usb_phy_power(int on)
-{
-       return;
-}
-#endif /* CONFIG_OMAP_USB2PHY2_HOST */
-
-#ifdef CONFIG_AM437X_USB2PHY2_HOST
-static void am437x_enable_usb2_phy2(struct omap_xhci *omap)
-{
-       const u32 usb_otg_ss_clk_val = (USBOTGSSX_CLKCTRL_MODULE_EN |
-                               USBOTGSSX_CLKCTRL_OPTFCLKEN_REFCLK960);
-
-       writel(usb_otg_ss_clk_val, PRM_PER_USB_OTG_SS0_CLKCTRL);
-       writel(usb_otg_ss_clk_val, PRM_PER_USB_OTG_SS1_CLKCTRL);
-
-       writel(USBPHYOCPSCP_MODULE_EN, PRM_PER_USBPHYOCP2SCP0_CLKCTRL);
-       writel(USBPHYOCPSCP_MODULE_EN, PRM_PER_USBPHYOCP2SCP1_CLKCTRL);
-}
-
-void usb_phy_power(int on)
-{
-       u32 val;
-
-       /* USB1_CTRL */
-       val = readl(USB1_CTRL);
-       if (on) {
-               /*
-                * these bits are re-used on AM437x to power up/down the USB
-                * CM and OTG PHYs, if we don't toggle them, USB will not be
-                * functional on newer silicon revisions
-                */
-               val &= ~(USB1_CTRL_CM_PWRDN | USB1_CTRL_OTG_PWRDN);
-       } else {
-               val |= USB1_CTRL_CM_PWRDN | USB1_CTRL_OTG_PWRDN;
-       }
-
-       writel(val, USB1_CTRL);
-}
-#endif /* CONFIG_AM437X_USB2PHY2_HOST */
-
-void omap_enable_phy(struct omap_xhci *omap)
-{
-#ifdef CONFIG_OMAP_USB2PHY2_HOST
-       omap_enable_usb2_phy2(omap);
-#endif
-
-#ifdef CONFIG_AM437X_USB2PHY2_HOST
-       am437x_enable_usb2_phy2(omap);
-#endif
-
-#ifdef CONFIG_OMAP_USB3PHY1_HOST
-       omap_enable_usb3_phy(omap);
-       omap_usb3_phy_init(omap->usb3_phy);
-#endif
-}
index ff1949e7e00826f885c070cc57d9f1f98e6f61c3..a52b476976f2e04d25d55fa4b2c57ea84dad0275 100644 (file)
@@ -55,8 +55,6 @@
 #if defined(CONFIG_SPL_USB_HOST) || !defined(CONFIG_SPL_BUILD)
 #define CONFIG_SYS_USB_FAT_BOOT_PARTITION              1
 #define CONFIG_USB_XHCI_OMAP
-
-#define CONFIG_AM437X_USB2PHY2_HOST
 #endif
 
 #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_USB_GADGET)
index 5396586d87ba0d724722a973b149b9ac7829dd38..b8099995d74b1ee8c433aff884ff30b5ed45c599 100644 (file)
@@ -51,8 +51,6 @@
 /* USB xHCI HOST */
 #define CONFIG_USB_XHCI_OMAP
 
-#define CONFIG_OMAP_USB3PHY1_HOST
-
 /* SATA */
 #define CONFIG_SCSI_AHCI_PLAT
 #define CONFIG_SYS_SCSI_MAX_SCSI_ID    1
index a290cf0cbcc7e6d0ebe22a9449396402b26da173..cd21c8de1f2f57aa220f27a1836220dd29563ff2 100644 (file)
@@ -47,7 +47,6 @@
 
 /* USB support */
 #define CONFIG_USB_XHCI_OMAP
-#define CONFIG_AM437X_USB2PHY2_HOST
 
 /* Power */
 #define CONFIG_POWER_TPS65218
index 46138348a300f3bfece8076f0c15d62ffdecdcfb..42583e75761854054b6b4f934696c29bd6cf3245 100644 (file)
@@ -77,8 +77,6 @@
 /* USB xHCI HOST */
 #define CONFIG_USB_XHCI_OMAP
 
-#define CONFIG_OMAP_USB2PHY2_HOST
-
 /* SATA */
 #define CONFIG_SCSI_AHCI_PLAT