From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57A51C77B7E for ; Fri, 28 Apr 2023 17:59:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B16EB85F72; Fri, 28 Apr 2023 19:59:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gateworks-com.20221208.gappssmtp.com header.i=@gateworks-com.20221208.gappssmtp.com header.b="z53NpnL9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C35BC85F9F; Fri, 28 Apr 2023 19:59:31 +0200 (CEST) Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A1B8F85F72 for ; Fri, 28 Apr 2023 19:59:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tharvey@gateworks.com Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-54fe2e39156so2129497b3.2 for ; Fri, 28 Apr 2023 10:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20221208.gappssmtp.com; s=20221208; t=1682704767; x=1685296767; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dsIun2iDS35BdBi2WmmHp4+1JHk9QWVPlspCCGNewEw=; b=z53NpnL9NAi6PU/p7Ho9xHIgJruWljqfa0v7gp25JAIatyfOrJEMFvlRnS60qYT+Hp xtcUIoU51yZjoidoaJGno1XFrSHrvF+TC/Yt9VderM3W2cjKP97XZJvkbVLyKNQ+4U3I 5oXBCWGpbiF4eybNufRrP+dGEoAnxc2rTVZ3MoVXH0aXMH7FCXjrpS5G+6+6qAbwE8Vh mfx7MTQTPaKDEGojgHTo70kxldQGZ7vRXMlgznGYL1v5mRytheNa/uGVxKNCDdIbn3cR /BA8n/nuPKaXu2gONCwKsN6LyCql+FPBlN/lOfY7GkQWPIejVXqGKUI6Nu500ns5KBXl vMOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682704767; x=1685296767; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dsIun2iDS35BdBi2WmmHp4+1JHk9QWVPlspCCGNewEw=; b=LzTfETxxxkwzncuHUlR3p/yhKetqVBiKNv3hdLW7xz9Feh0HZOw+zRAyN/ufx3ETGp 2smhje1XODogcR+Gb85ev0o9uqUqwEqAWSINbguIH90KEhppZH6/rE1Lu/LeKmcsOULP gKDJKLf9tKslFVVeM6kHbIRt/6i8KoOiwagI93Iy80CFd1+bf7tZzVb4JOmHtnr+O5x1 pRjItTokzpOuG3JyXYz63kzOPRDf0F+hQGUtlCsc6Zk9WdXjLyRFYs7wH2t9apSPrpTy dwrttFhqtqeQoj7QAsi9u0t2mlvHXj/HjTlfjBe1Z7vrWpoc0FLQzkl/wIlyc48sM+1p 50UQ== X-Gm-Message-State: AC+VfDwONadI6TpXi6D8leR/bsmgMq6yPsCYwCZMH4JW/repV6dC1gjz FtOGPHfOMjdLtuuaJWIetyfQsSHhvD6UqlGH2Bsc1w== X-Google-Smtp-Source: ACHHUZ7fbCm3Y/UHeA4zuWhjRpbFcM07Ukuv9b5/b6q7GGrTJacaZz86Zc/hKyr9Xng0Kil5ZSO9R7wwStM0Gur3uqg= X-Received: by 2002:a81:86c7:0:b0:54f:e7cd:bb1d with SMTP id w190-20020a8186c7000000b0054fe7cdbb1dmr4784981ywf.12.1682704767186; Fri, 28 Apr 2023 10:59:27 -0700 (PDT) MIME-Version: 1.0 References: <20230427180845.127439-1-festevam@gmail.com> In-Reply-To: From: Tim Harvey Date: Fri, 28 Apr 2023 10:59:15 -0700 Message-ID: Subject: Re: [PATCH 1/3] arm: dts: imx8mm: Sync with Linux 6.3 To: Adam Ford , Marek Vasut , Fabio Estevam Cc: Ye Li , Peng Fan , Li Jun , sbabic@denx.de, u-boot@lists.denx.de, Fabio Estevam Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Fri, Apr 28, 2023 at 9:44=E2=80=AFAM Adam Ford wrot= e: > > On Fri, Apr 28, 2023 at 11:26=E2=80=AFAM Fabio Estevam wrote: > > > > Hi Tim, > > > > On Fri, Apr 28, 2023 at 12:48=E2=80=AFPM Tim Harvey wrote: > > > > > Yes I think that is similar enough to test. In my experience simply > > > enabling otg2 via dt on imx8mm-evk shows the issue I see here but > > > Fabio says he sees a hang on 'usb start' even before this dt sync and > > > I don't know why my results on an imx8mm-evk differ. > > > > I started from scratch today and now our results match. > > > > Applied the following change against U-Boot master: > > > > diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dts= i > > index 7d6317d95b13..898639e33d5e 100644 > > --- a/arch/arm/dts/imx8mm-evk.dtsi > > +++ b/arch/arm/dts/imx8mm-evk.dtsi > > @@ -417,6 +417,10 @@ > > }; > > }; > > > > +&usbotg2 { > > + status =3D "okay"; > > +}; > > + > > &usdhc2 { > > assigned-clocks =3D <&clk IMX8MM_CLK_USDHC2>; > > assigned-clock-rates =3D <200000000>; > > diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfi= g > > index ab9ad41b4548..70c7a21f2d9f 100644 > > --- a/configs/imx8mm_evk_defconfig > > +++ b/configs/imx8mm_evk_defconfig > > @@ -119,3 +119,4 @@ CONFIG_CI_UDC=3Dy > > CONFIG_SDP_LOADADDR=3D0x40400000 > > CONFIG_USB_GADGET_DOWNLOAD=3Dy > > CONFIG_IMX_WATCHDOG=3Dy > > +CONFIG_CMD_USB=3Dy > > -- > > 2.34.1 > > > > Running "usb start" does not hang. > > > > Running "ums 0 mmc 1", CTRL+C and then "ums 0 mmc 1" does not work (SD > > card is not mounted on PC on the second time). > > > > After applying the imx8mm.dtsi sync with kernel 6.3: > > > > Running "ums 0 mmc 1", CTRL+C and then "ums 0 mmc 1" works fine. > > > > "usb start" hangs. > > > > So, yes, I agree we cannot do the imx8mm.dtsi sync with 6.3 right now > > as we need to fix the USB hang first. > > > > If anyone has any ideas as to why syncing the commit below: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm= it/arch/arm64/boot/dts/freescale/imx8mm.dtsi?h=3Dv6.3&id=3D4585c79ff477f951= 7b7f384a4fce351417e8fa36 > > > > causes issues in U-Boot, please let us know. > > I am not in a place to test this as I am traveling, but I thought I'd > throw out an idea. The power-domain looks like it moved to the > usbphynop2 driver which has the compatible name of "usb-nop-xceiv" > Is there a a driver for this? Does it get enabled? > If not, maybe we could update the imx8mm-u-u-boot.dtsi to restore the > power-domains to a driver that is present. > Adam, Ya, I think you were on the right track here. There is a driver (driver/phy/nop-phy.c) which does get enabled but with the dt sync the phy's power domain gets enabled after EHCI registers are accessed. I believe the fix we need is the following which moves phy setup before the register access (where it should have been along with the case for !defined(CONFIG_PHY): diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index 91633f013a55..fae20838c60a 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -703,6 +703,10 @@ static int ehci_usb_probe(struct udevice *dev) usb_internal_phy_clock_gate(priv->phy_addr, 1); usb_phy_enable(ehci, priv->phy_addr); #endif +#else + ret =3D generic_setup_phy(dev, &priv->phy, 0); + if (ret) + goto err_regulator; #endif #if CONFIG_IS_ENABLED(DM_REGULATOR) @@ -725,12 +729,6 @@ static int ehci_usb_probe(struct udevice *dev) mdelay(10); -#if defined(CONFIG_PHY) - ret =3D generic_setup_phy(dev, &priv->phy, 0); - if (ret) - goto err_regulator; -#endif - hccr =3D (struct ehci_hccr *)((uintptr_t)&ehci->caplength); hcor =3D (struct ehci_hcor *)((uintptr_t)hccr + HC_LENGTH(ehci_readl(&(hccr)->cr_capbase))); If everyone agrees here I'll submit a formal patch which should get applied through Marek via the usb tree before the dt sync. Best Regards, Tim