All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 02/12] usb: uniphier: remove UniPhier xHCI driver and select DM_USB
Date: Wed, 14 Sep 2016 01:06:00 +0900	[thread overview]
Message-ID: <1473782770-20130-3-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1473782770-20130-1-git-send-email-yamada.masahiro@socionext.com>

This driver has not been converted to Driver Model, and it is an
obstacle to migrate other block device drivers.  Remove it for now.

The UniPhier SoCs already use a DM-based EHCI driver, so now
ARCH_UNIPHIER can select DM_USB.

These two changes must be done atomically because removing the
legacy driver causes a build error.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Marek Vasut <marex@denx.de>
---

 arch/arm/Kconfig                    |  1 +
 configs/uniphier_ld4_sld8_defconfig |  1 -
 configs/uniphier_sld3_defconfig     |  1 -
 drivers/usb/host/Kconfig            |  7 ---
 drivers/usb/host/Makefile           |  1 -
 drivers/usb/host/xhci-uniphier.c    | 85 -------------------------------------
 include/fdtdec.h                    |  1 -
 lib/fdtdec.c                        |  1 -
 8 files changed, 1 insertion(+), 97 deletions(-)
 delete mode 100644 drivers/usb/host/xhci-uniphier.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f7b6f0d..512e326 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -861,6 +861,7 @@ config ARCH_UNIPHIER
 	select DM_I2C
 	select DM_MMC
 	select DM_SERIAL
+	select DM_USB
 	select OF_CONTROL
 	select OF_LIBFDT
 	select SPL
diff --git a/configs/uniphier_ld4_sld8_defconfig b/configs/uniphier_ld4_sld8_defconfig
index e3ad160..89d3de4 100644
--- a/configs/uniphier_ld4_sld8_defconfig
+++ b/configs/uniphier_ld4_sld8_defconfig
@@ -32,7 +32,6 @@ CONFIG_SPL_NAND_DENALI=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_USB=y
-CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/uniphier_sld3_defconfig b/configs/uniphier_sld3_defconfig
index 1c5cece..8781fe6 100644
--- a/configs/uniphier_sld3_defconfig
+++ b/configs/uniphier_sld3_defconfig
@@ -30,7 +30,6 @@ CONFIG_SYS_NAND_DENALI_64BIT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
 CONFIG_SPL_NAND_DENALI=y
 CONFIG_USB=y
-CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index e0699d4..42e8a9f 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -15,13 +15,6 @@ config USB_XHCI_HCD
 
 if USB_XHCI_HCD
 
-config USB_XHCI_UNIPHIER
-	bool "Support for UniPhier on-chip xHCI USB controller"
-	depends on ARCH_UNIPHIER
-	default y
-	---help---
-	  Enables support for the on-chip xHCI controller on UniPhier SoCs.
-
 config USB_XHCI_DWC3
 	bool "DesignWare USB3 DRD Core Support"
 	help
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 620d114..55190bb 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -62,7 +62,6 @@ obj-$(CONFIG_USB_XHCI_EXYNOS) += xhci-exynos5.o
 obj-$(CONFIG_USB_XHCI_FSL) += xhci-fsl.o
 obj-$(CONFIG_USB_XHCI_OMAP) += xhci-omap.o
 obj-$(CONFIG_USB_XHCI_PCI) += xhci-pci.o
-obj-$(CONFIG_USB_XHCI_UNIPHIER) += xhci-uniphier.o
 
 # designware
 obj-$(CONFIG_USB_DWC2) += dwc2.o
diff --git a/drivers/usb/host/xhci-uniphier.c b/drivers/usb/host/xhci-uniphier.c
deleted file mode 100644
index 1b3f3d2..0000000
--- a/drivers/usb/host/xhci-uniphier.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#include <common.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <usb.h>
-#include <fdtdec.h>
-#include "xhci.h"
-
-static int get_uniphier_xhci_base(int index, struct xhci_hccr **base)
-{
-	DECLARE_GLOBAL_DATA_PTR;
-	int node_list[2];
-	fdt_addr_t addr;
-	int count;
-
-	count = fdtdec_find_aliases_for_id(gd->fdt_blob, "usb",
-					   COMPAT_SOCIONEXT_XHCI, node_list,
-					   ARRAY_SIZE(node_list));
-
-	if (index >= count)
-		return -ENODEV;
-
-	addr = fdtdec_get_addr(gd->fdt_blob, node_list[index], "reg");
-	if (addr == FDT_ADDR_T_NONE)
-		return -ENODEV;
-
-	*base = (struct xhci_hccr *)addr;
-
-	return 0;
-}
-
-#define USB3_RST_CTRL		0x00100040
-#define IOMMU_RST_N		(1 << 5)
-#define LINK_RST_N		(1 << 4)
-
-static void uniphier_xhci_reset(void __iomem *base, int on)
-{
-	u32 tmp;
-
-	tmp = readl(base + USB3_RST_CTRL);
-
-	if (on)
-		tmp &= ~(IOMMU_RST_N | LINK_RST_N);
-	else
-		tmp |= IOMMU_RST_N | LINK_RST_N;
-
-	writel(tmp, base + USB3_RST_CTRL);
-}
-
-int xhci_hcd_init(int index, struct xhci_hccr **hccr, struct xhci_hcor **hcor)
-{
-	int ret;
-	struct xhci_hccr *cr;
-	struct xhci_hcor *or;
-
-	ret = get_uniphier_xhci_base(index, &cr);
-	if (ret < 0)
-		return ret;
-
-	uniphier_xhci_reset(cr, 0);
-
-	or = (void *)cr + HC_LENGTH(xhci_readl(&cr->cr_capbase));
-
-	*hccr = cr;
-	*hcor = or;
-
-	return 0;
-}
-
-void xhci_hcd_stop(int index)
-{
-	int ret;
-	struct xhci_hccr *cr;
-
-	ret = get_uniphier_xhci_base(index, &cr);
-	if (ret < 0)
-		return;
-
-	uniphier_xhci_reset(cr, 1);
-}
diff --git a/include/fdtdec.h b/include/fdtdec.h
index aeb6bab..27887c8 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -148,7 +148,6 @@ enum fdt_compat_id {
 	COMPAT_INTEL_MICROCODE,		/* Intel microcode update */
 	COMPAT_AMS_AS3722,		/* AMS AS3722 PMIC */
 	COMPAT_INTEL_QRK_MRC,		/* Intel Quark MRC */
-	COMPAT_SOCIONEXT_XHCI,		/* Socionext UniPhier xHCI */
 	COMPAT_ALTERA_SOCFPGA_DWMAC,	/* SoCFPGA Ethernet controller */
 	COMPAT_ALTERA_SOCFPGA_DWMMC,	/* SoCFPGA DWMMC controller */
 	COMPAT_ALTERA_SOCFPGA_DWC2USB,	/* SoCFPGA DWC2 USB controller */
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index e638ca5..4defb90 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -59,7 +59,6 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(INTEL_MICROCODE, "intel,microcode"),
 	COMPAT(AMS_AS3722, "ams,as3722"),
 	COMPAT(INTEL_QRK_MRC, "intel,quark-mrc"),
-	COMPAT(SOCIONEXT_XHCI, "socionext,uniphier-xhci"),
 	COMPAT(ALTERA_SOCFPGA_DWMAC, "altr,socfpga-stmmac"),
 	COMPAT(ALTERA_SOCFPGA_DWMMC, "altr,socfpga-dw-mshc"),
 	COMPAT(ALTERA_SOCFPGA_DWC2USB, "snps,dwc2"),
-- 
1.9.1

  parent reply	other threads:[~2016-09-13 16:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 16:05 [U-Boot] [PATCH 00/12] ARM: uniphier: UniPhier SoC updates for v2016.11-rc1 Masahiro Yamada
2016-09-13 16:05 ` [U-Boot] [PATCH 01/12] ARM: uniphier: sort select:s alphabetically Masahiro Yamada
2016-09-13 16:06 ` Masahiro Yamada [this message]
2016-09-13 16:06 ` [U-Boot] [PATCH 03/12] ARM: uniphier: delete unnecessary xHCI pin-mux settings Masahiro Yamada
2016-09-13 16:06 ` [U-Boot] [PATCH 04/12] ARM: uniphier: enable Generic EHCI driver for Pro4 SoC Masahiro Yamada
2016-09-13 16:06 ` [U-Boot] [PATCH 05/12] mmc: uniphier-sd: migrate to CONFIG_BLK Masahiro Yamada
2016-09-13 16:06 ` [U-Boot] [PATCH 06/12] pinctrl: uniphier: add System Bus pin-mux settings Masahiro Yamada
2016-09-13 16:06 ` [U-Boot] [PATCH 07/12] pinctrl: uniphier: move register base macros from header to .c file Masahiro Yamada
2016-09-13 16:06 ` [U-Boot] [PATCH 08/12] ARM: uniphier: remove IECTRL setup code of LD4 SoC Masahiro Yamada
2016-09-13 16:06 ` [U-Boot] [PATCH 09/12] ARM: uniphier: use checkboard() instead of misc_init_f() Masahiro Yamada
2016-09-13 16:06 ` [U-Boot] [PATCH 10/12] ARM: uniphier: merge board init functions into board_init() Masahiro Yamada
2016-09-13 16:06 ` [U-Boot] [PATCH 11/12] ARM: uniphier: fix DRAM size of LD21 SoC package Masahiro Yamada
2016-09-13 16:06 ` [U-Boot] [PATCH 12/12] ARM: uniphier: introduce flags to adjust DRAM timing for LD20/LD21 Masahiro Yamada
2016-09-14 14:04 ` [U-Boot] [PATCH 00/12] ARM: uniphier: UniPhier SoC updates for v2016.11-rc1 Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473782770-20130-3-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.