Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8DE2606A322 for ; Fri, 4 Dec 2026 15:16:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=zNTuaNiV; dkim=pass (2048-bit key, unprotected) header.d=mechasystems.com header.i=@mechasystems.com header.a=rsa-sha256 header.s=google header.b=pvgODxx5 Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7D3B440EBB; Fri, 4 Dec 2026 15:16:25 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id x_kpRr8XZI4M; Fri, 4 Dec 2026 15:16:24 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp4.osuosl.org 944C540EB8 Authentication-Results: smtp4.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796397384; b=fuhOyH5Kr/Qz0PsBlmsM/ukf8TxVGkhgEX1vl6wFWApoAApv4jzmcHgbsPivXAEzkAAG h9eiUnPYrZobS8DQDN0zPuj38mYGmWac+kwDAkd0Y6HwGgARGKwY3lKA/29EYuycep6sM hJazpXAxaGlt/frO4yv2T6CXt2PE0Mvc2FyK/F3yiOJhpjkug1Kv8QgrgrcJMUYfNMxoO SHv3v7Sd16OMfyv2VkoHTEknYxwk5AuONpV86WCabSOUGPb9vZRmz8YD23jMyRlkPGVtZ 26IjUBCNUkkbisAp70LdZ4KSrsNFp6i2yQ6xD36ZrqEnsGCd/be+0ZlZNfzU8goQ7Qg== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796397384; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-BeenThere:X-Mailman-Version:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:Errors-To; bh=E1xD6wSlXaGTzRavPKPvh7PxozqC2GDjX53kY11mq7g=; b=ljWm4pgMhGJmW2gd3XclIOgvD/kuT6xgWgwbrWqe2JlqfT+N5kdWikQN8OCHCn5N6lBt Pg3hMe9B11+mGFG4bbyDQncQvIofjsX+8KD5BWDAVWcgY9yaW4gkGFaZ2jlNDqhBOwoNa o/ADFAeE4vnZ2YPFlJ5SWvNVnhbqav/g6GonporQfaGeY5e224SM6YlLxdjD7h+FEhf3o YiURHFGD4chYAUoweHqSwOyoUk6yyl3gkGCjbKwLk/SvERH6gPPt504VaNs/wqdlcf3H0 ctFOsH2O2xFaQB8XqXovw6bjkn9iZpjBelvcCRy98N2fFmTWMjYd8m0g0uiqo1DdmSQ== ARC-Authentication-Results: i=1; smtp4.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1796397384; bh=E1xD6wSlXaGTzRavPKPvh7PxozqC2GDjX53kY11mq7g=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=zNTuaNiV4qFTql8n2w7+TkODEZcjf161j4rJttPfzKr2YRyBWVfH/w2HkNhBepL3m 7uTJ/bvGmWEGxl+BWKGgBbI7LSftQ2PsRWN3I19HNrIAvvZzVHFQ5+HXpESyy50yoa GVctgC1RgiKTJVpxxSQm/hK0oqeINF2ExDjOMw/LK5PLEYitUsp0eb+mjTidzX7err 5jnOZUYgqhlpltXAEg2nVa2RyTJc9gfTRZHGKc6KGMSyNCCKx36z5AXH1NaOqtiZ2J 9mwcI+6dGwsvX6Va+Vw52X8LQZmF+/18Dx+x3i+DrPZmUsoJdIcC0czoVqIFkWpZ0G 3vqMoGq8SA5rg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 944C540EB8; Fri, 4 Dec 2026 15:16:24 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists1.osuosl.org (Postfix) with ESMTP id 3EDD6932 for ; Fri, 4 Dec 2026 15:16:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 250B161B32 for ; Fri, 4 Dec 2026 15:16:23 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id RM_ZH27t-OTN for ; Fri, 4 Dec 2026 15:16:22 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 2A0FF615F8 Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip="2607:f8b0:4864:31::1" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:31::1; helo=mail-oo2-x01.google.com; envelope-from=advaitd@mechasystems.com; receiver= Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=mechasystems.com Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=mechasystems.com header.i=@mechasystems.com header.a=rsa-sha256 header.s=google header.b=pvgODxx5 Received: from mail-oo2-x01.google.com (mail-oo2-x01.google.com [IPv6:2607:f8b0:4864:31::1]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2A0FF615F8 for ; Fri, 4 Dec 2026 15:16:21 +0000 (UTC) Received: by mail-oo2-x01.google.com with SMTP id 006d021491bc7-71ae201f60eso47768eaf.1 for ; Fri, 04 Dec 2026 07:16:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mechasystems.com; s=google; t=1796397380; x=1797002180; darn=lists.u-boot-project.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=E1xD6wSlXaGTzRavPKPvh7PxozqC2GDjX53kY11mq7g=; b=pvgODxx5TLqdh21/L0JdIEhqbcCqUtWr7nBbXBT/M7J3HG5IustpgV+rli0tl4tWvj dSuEyV4UbpzqJJV3TY9mF/46a6mOvwzMe5vOfLzK07fF7cmH+HrsXrtrH1v5ztqCFhG/ I7CrWgoia0oziRdWiTIXZc1OTq+zbjmdyabCiyqmUhZdTB+MTMcZ5+lCREtFcDJ4DRej zukD9RxPbGdjuw7TYbdukCYjGRjXHP+S2ZeC0iyz2w3qcXAkJfCEiTT0at3ZjdffC3ki VcmLFkDcTEcZnBPdqU532xqmDVqZpvQGebg967Y+6miZUMs8Q6IYKSHABCeswgDveEN8 VsXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796397380; x=1797002180; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=E1xD6wSlXaGTzRavPKPvh7PxozqC2GDjX53kY11mq7g=; b=RSnFUGPULTFcOFt+yz1Q8MBvbw27YvmhdOkBq7/Kykf0gtQinmBBUDuicHPcx1lSYz U3Kwh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ZwUJqCoBbJXllMCaE70rD4yMRbRpsYtMnxYH5eal59+UH2afT2yDVTZ6eWx 5JdG617/AoQ= X-Received: by 2002:a05:6820:221c:b0:6cd:3fdc:2668 with SMTP id 006d021491bc7-71bf209553bmr1350259eaf.41.1796397380376; Fri, 04 Dec 2026 07:16:20 -0800 (PST) Received: from fedora ([2001:df0:e1c0:3414::dde]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-71bef1552dbsm2665060eaf.14.2026.12.04.07.16.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 07:16:19 -0800 (PST) From: Advait Dhamorikar To: Marek Vasut , u-boot@lists.u-boot-project.org Cc: Stefan Eichenberger , Xu Yang , Fabio Estevam , Stefano Babic , "NXP i . MX U-Boot Team" , Advait Dhamorikar Subject: [PATCH] usb: dwc3-generic: support i.MX flattened DT Date: Fri, 4 Dec 2026 20:45:37 +0530 Message-ID: <20261204151537.333228-1-advaitd@mechasystems.com> X-Mailer: git-send-email 2.56.1 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The i.MX95 devicetree doesn't use a glue node with dwc3 as a subnode and now has a single flattened "nxp,imx95-dwc3/imx8mp-dwc3" node, with the register regions described by reg-names. The i.MX8MP devicetree too is expected to move to the same binding. Reuse the existing glue_get_ctrl_dev op to bind dwc3 to the glue node itself, and look up the glue registers by name when using the new binding. Tested on the i.MX95 Mecha Comet. Link: https://lore.kernel.org/all/20260427082728.3641872-2-xu.yang_2@nxp.com/ Signed-off-by: Advait Dhamorikar --- drivers/usb/dwc3/dwc3-generic.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index 2406f844617..aba69681ba2 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -325,10 +325,22 @@ void dwc3_imx8mp_glue_configure(struct udevice *dev, int index, #define USB_CTRL1_OC_POLARITY BIT(16) /* 0 - HIGH / 1 - LOW */ #define USB_CTRL1_PWR_POLARITY BIT(17) /* 0 - HIGH / 1 - LOW */ - fdt_addr_t regs = dev_read_addr_index(dev, 1); - void *base = map_physmem(regs, 0x8, MAP_NOCACHE); + fdt_addr_t regs; + void *base; u32 value; + if (device_is_compatible(dev, "nxp,imx8mp-dwc3")) + regs = dev_read_addr_name(dev, "glue"); + else + regs = dev_read_addr_index(dev, 1); + + if (regs == FDT_ADDR_T_NONE) { + dev_err(dev, "missing glue registers\n"); + return; + } + + base = map_physmem(regs, 0x8, MAP_NOCACHE); + value = readl(base + USB_CTRL0); if (dev_read_bool(dev, "fsl,permanently-attached")) @@ -548,6 +560,11 @@ static const struct dwc3_glue_ops rk_ops = { .glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev, }; +static const struct dwc3_glue_ops imx8mp_flat_dt_ops = { + .glue_configure = dwc3_imx8mp_glue_configure, + .glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev, +}; + static int dwc3_glue_bind_common(struct udevice *parent, ofnode node) { const char *name = ofnode_get_name(node); @@ -758,6 +775,7 @@ static const struct udevice_id dwc3_glue_ids[] = { { .compatible = "qcom,dwc3", .data = (ulong)&qcom_ops }, { .compatible = "qcom,snps-dwc3", .data = (ulong)&qcom_flat_dt_ops }, { .compatible = "fsl,imx8mp-dwc3", .data = (ulong)&imx8mp_ops }, + { .compatible = "nxp,imx8mp-dwc3", .data = (ulong)&imx8mp_flat_dt_ops }, { .compatible = "fsl,imx8mq-dwc3" }, { .compatible = "intel,tangier-dwc3" }, { .compatible = "samsung,exynos7870-dwusb3" }, -- 2.56.1