From: Mehmet Fide <mehmet.fide@gmail.com>
To: Marek Vasut <marek.vasut+usb@mailbox.org>,
Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
u-boot@lists.u-boot-project.org,
Mehmet Fide <mehmet.fide@screeningeagle.com>
Subject: [PATCH v2 1/4] usb: ehci-vf: remove the code path for a build without DM_USB
Date: Thu, 20 Aug 2026 09:15:08 +0200 [thread overview]
Message-ID: <20260820071511.1036506-2-mehmet.fide@gmail.com> (raw)
In-Reply-To: <20260820071511.1036506-1-mehmet.fide@gmail.com>
From: Mehmet Fide <mehmet.fide@screeningeagle.com>
USB_EHCI_HCD 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.
Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
---
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.54.0
next prev parent reply other threads:[~2026-08-20 7:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 7:15 [PATCH v2 0/4] usb: ehci-vf: take the register bases from the device tree Mehmet Fide
2026-08-20 7:15 ` Mehmet Fide [this message]
2026-08-20 7:15 ` [PATCH v2 2/4] usb: ehci-vf: drop the empty bind hook Mehmet Fide
2026-08-20 7:15 ` [PATCH v2 3/4] dm: core: add ofnode_get_alias_seq() Mehmet Fide
2026-08-20 7:15 ` [PATCH v2 4/4] usb: ehci-vf: take the register bases from the device tree Mehmet Fide
2026-08-21 0:29 ` [PATCH v2 0/4] " Marek Vasut
2026-08-21 5:56 ` 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=20260820071511.1036506-2-mehmet.fide@gmail.com \
--to=mehmet.fide@gmail.com \
--cc=marek.vasut+usb@mailbox.org \
--cc=mehmet.fide@screeningeagle.com \
--cc=sjg@chromium.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox