All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mehmet Fide <mehmet.fide@gmail.com>
To: Marek Vasut <marek.vasut+usb@mailbox.org>
Cc: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Fabio Estevam <festevam@gmail.com>,
	Stefan Agner <stefan@agner.ch>,
	Francesco Dolcini <francesco@dolcini.it>,
	u-boot@lists.u-boot-project.org, mehmet.fide@screeningeagle.com
Subject: [PATCH v8 03/10] usb: ehci-vf: remove the code path for a build without DM_USB
Date: Thu, 22 Oct 2026 09:08:53 +0200	[thread overview]
Message-ID: <20261022070900.616265-4-mehmet.fide@gmail.com> (raw)
In-Reply-To: <20261022070900.616265-1-mehmet.fide@gmail.com>

From: Mehmet Fide <mehmet.fide@screeningeagle.com>

USB_EHCI_HCD selects USB_HOST, and USB_HOST selects DM_USB, so the
!CONFIG_IS_ENABLED(DM_USB) branch of this driver can never be selected.
It also cannot compile: ehci_hcd_init() calls ehci_vf_common_init() with
one argument while the function takes two, so the branch has been dead
since the controller was added as a second parameter.

Remove it, together with the board_usb_phy_mode() hook that no board
implements and nothing else calls.

Reviewed-by: Marek Vasut <marek.vasut+usb@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
---

Notes:
    Changes in v8:
    - none, rebased on main
    
    Changes in v7:
    - Reviewed-by from Marek and Simon
    
    Changes in v6:
    - the commit message names USB_HOST as the option that selects DM_USB
    
    Changes in v5:
    - none
    
    Changes in v4:
    - none, rebased on next

 drivers/usb/host/ehci-vf.c | 49 --------------------------------------
 1 file changed, 49 deletions(-)

diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c
index 32fe05920d0..5d27318de62 100644
--- a/drivers/usb/host/ehci-vf.c
+++ b/drivers/usb/host/ehci-vf.c
@@ -128,11 +128,6 @@ static void usb_oc_config(int index)
 	setbits_le32(ctrl, UCTRL_OVER_CUR_DIS);
 }
 
-int __weak board_usb_phy_mode(int port)
-{
-	return 0;
-}
-
 int __weak board_ehci_hcd_init(int port)
 {
 	return 0;
@@ -155,49 +150,6 @@ int ehci_vf_common_init(struct usb_ehci *ehci, int index)
 	return 0;
 }
 
-#if !CONFIG_IS_ENABLED(DM_USB)
-int ehci_hcd_init(int index, enum usb_init_type init,
-		struct ehci_hccr **hccr, struct ehci_hcor **hcor)
-{
-	struct usb_ehci *ehci;
-	enum usb_init_type type;
-	int ret;
-
-	if (index >= ARRAY_SIZE(nc_reg_bases))
-		return -EINVAL;
-
-	ehci = (struct usb_ehci *)nc_reg_bases[index];
-
-	ret = ehci_vf_common_init(index);
-	if (ret)
-		return ret;
-
-	*hccr = (struct ehci_hccr *)((uint32_t)&ehci->caplength);
-	*hcor = (struct ehci_hcor *)((uint32_t)*hccr +
-			HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
-
-	type = board_usb_phy_mode(index);
-	if (type != init)
-		return -ENODEV;
-
-	if (init == USB_INIT_DEVICE) {
-		setbits_le32(&ehci->usbmode, CM_DEVICE);
-		writel((PORT_PTS_UTMI | PORT_PTS_PTW), &ehci->portsc);
-		setbits_le32(&ehci->portsc, USB_EN);
-	} else if (init == USB_INIT_HOST) {
-		setbits_le32(&ehci->usbmode, CM_HOST);
-		writel((PORT_PTS_UTMI | PORT_PTS_PTW), &ehci->portsc);
-		setbits_le32(&ehci->portsc, USB_EN);
-	}
-
-	return 0;
-}
-
-int ehci_hcd_stop(int index)
-{
-	return 0;
-}
-#else
 /* Possible port types (dual role mode) */
 enum dr_mode {
 	DR_MODE_NONE = 0,
@@ -372,4 +324,3 @@ U_BOOT_DRIVER(ehci_vf) = {
 	.priv_auto	= sizeof(struct ehci_vf_priv_data),
 	.flags = DM_FLAG_ALLOC_PRIV_DMA,
 };
-#endif
-- 
2.55.0


  parent reply	other threads:[~2026-10-22  7:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22  7:08 [PATCH v8 00/10] usb: ehci-vf: make the USB host port usable Mehmet Fide
2026-10-22  7:08 ` [PATCH v8 01/10] fdtdec: match an alias to its stem only when the number follows it Mehmet Fide
2026-10-22  7:08 ` [PATCH v8 02/10] usb: ehci-vf: take the controller index from the device tree Mehmet Fide
2026-10-22  7:08 ` Mehmet Fide [this message]
2026-10-22  7:08 ` [PATCH v8 04/10] usb: ehci-vf: drop the empty bind hook Mehmet Fide
2026-10-22  7:08 ` [PATCH v8 05/10] dm: core: add ofnode_get_alias_seq() Mehmet Fide
2026-10-22  7:08 ` [PATCH v8 06/10] usb: ehci-vf: use usb_get_dr_mode() Mehmet Fide
2026-10-22  8:38   ` Marek Vasut
2026-10-22  7:08 ` [PATCH v8 07/10] usb: ehci-vf: request the ID detect gpio through the device Mehmet Fide
2026-10-22  7:08 ` [PATCH v8 08/10] usb: ehci-vf: take the register bases from the device tree Mehmet Fide
2026-10-22 10:52   ` Krzysztof Kozlowski
2026-10-22 11:51     ` Marek Vasut
2026-10-22 12:20       ` Mehmet Fide
2026-10-22 12:52         ` Marek Vasut
2026-10-22 12:07     ` Mehmet Fide
2026-10-22  7:08 ` [PATCH v8 09/10] usb: ehci-vf: sort the includes Mehmet Fide
2026-10-22  8:38   ` Marek Vasut
2026-10-22  7:09 ` [PATCH v8 10/10] usb: ehci-vf: enable the vbus supply of the port Mehmet Fide
2026-10-22  8:39   ` Marek Vasut
2026-10-22 13:31     ` Mehmet Fide

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=20261022070900.616265-4-mehmet.fide@gmail.com \
    --to=mehmet.fide@gmail.com \
    --cc=festevam@gmail.com \
    --cc=francesco@dolcini.it \
    --cc=marek.vasut+usb@mailbox.org \
    --cc=mehmet.fide@screeningeagle.com \
    --cc=sjg@chromium.org \
    --cc=stefan@agner.ch \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    /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.