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 6FACCC433F5 for ; Fri, 1 Apr 2022 17:53:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 019E5842F0; Fri, 1 Apr 2022 19:53:35 +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.20210112.gappssmtp.com header.i=@gateworks-com.20210112.gappssmtp.com header.b="Jriqsk/U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 369F7842EC; Fri, 1 Apr 2022 19:53:33 +0200 (CEST) Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (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 E86AF842F0 for ; Fri, 1 Apr 2022 19:53:26 +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-pj1-x1035.google.com with SMTP id cm17so3078758pjb.2 for ; Fri, 01 Apr 2022 10:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gateworks-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lARjkzVdRs9AY84lX4Vlc38G/EPaithDauDB06UQzmY=; b=Jriqsk/UKesfVyE0HQgBXgO6V7d2SH5G7oMLbPivVgwvf+Beo1qAZ9rUT3pooA6MMx lyNo1x5EjchYAW+Ygl68mBRO2Eh8XeI2lKmnAvkdBeek5TSdUAFEF9oxqiV19jKcQqIO wn+cV0mD2kOkeklV9RPr1tesKRg66yD9P0S2fFbCpXM5jp2dFVrqJo6EIjO5csPjQ/g7 hmNHSlS77aMGnVWtKOsPXQV4nnHRsalPMOHr/svK8zWL1+VOxXtVdq19nSehUxcNYLv+ jTCicssyE2WH57nYq0AxsALgPzT74NLjj3xoHv+3Wn5guQbmJ7wT9nXFLMnIReKDHnF3 Z9VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lARjkzVdRs9AY84lX4Vlc38G/EPaithDauDB06UQzmY=; b=08SmllhLVA740tKTPOUxl4FeypwPx3zV1NbaRW3waseNYzh8ONFyouAoIhJ+y2YJ4v doa/JeMAwlUV7xVAl7xi9aTIcqPAfthl/AlH8k4hN1y4mAEYubF/cCm9fRFzW3uBv/+q 1uz5ypah+t0xm+szMP4czaLoGJViB8Qs0X1/b99xEjGL0C3MMGkpHd/f6Io6MBPy2X7z Fo7lDYMYOHjo1JHJMV+jQmPq+JrbXE6eaSB98iZSFRLttZFnAMYo69rSOcn2K5IbLeta 2fhmkUjiecWU9rEIgmpSg9Qna4yULELgKkUOFumd2xQXp7XdjhXCqhoTChvp9gCwDrJR a/4A== X-Gm-Message-State: AOAM533sREfUJC+ActObAp+oo1YFK81kaaog76HAlrjluTqiU/yfVasr e9S8YEcrPJjNhHj3oGQvbhllGaFyv/qOtwJ+1K6TPw== X-Google-Smtp-Source: ABdhPJx9zL49hSXoTLzcuzzY8o1SfPSqqfxOEQs7S6Zoj2T+uGr/YjpRZjj7yqCGVvwbd6mafgdO8muug3f2dywF6L0= X-Received: by 2002:a17:90b:4f86:b0:1c6:b3eb:99a3 with SMTP id qe6-20020a17090b4f8600b001c6b3eb99a3mr13291803pjb.66.1648835605161; Fri, 01 Apr 2022 10:53:25 -0700 (PDT) MIME-Version: 1.0 References: <20220329225240.1416-1-tharvey@gateworks.com> <20220329225240.1416-5-tharvey@gateworks.com> <20220331170131.lbl6scb4xj4kl5lv@skbuf> <20220331193618.2ehdmjkgfa67y27j@skbuf> In-Reply-To: <20220331193618.2ehdmjkgfa67y27j@skbuf> From: Tim Harvey Date: Fri, 1 Apr 2022 10:53:14 -0700 Message-ID: Subject: Re: [PATCH 4/6] net: fec: add support for DM_MDIO To: Vladimir Oltean , Peng Fan , Ye Li Cc: Joe Hershberger , Ramon Fried , "u-boot@lists.denx.de" , Stefano Babic , Fabio Estevam , dl-uboot-imx Content-Type: text/plain; charset="UTF-8" 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.5 at phobos.denx.de X-Virus-Status: Clean On Thu, Mar 31, 2022 at 12:36 PM Vladimir Oltean wrote: > > On Thu, Mar 31, 2022 at 10:48:55AM -0700, Tim Harvey wrote: > > > On which branch does this apply? The context above fecmxc_read_rom_hwaddr() > > > is different in the branches I've checked: > > > https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/net/fec_mxc.c#L1276 > > > https://source.denx.de/u-boot/custodians/u-boot-net/-/blob/next/drivers/net/fec_mxc.c#L1276 > > > > > > > Sorry, I should have specified in my cover letter that this is on top > > of next which removes the non dm-eth support from the driver which is > > quite the cleanup. > > Ok, but now the next patch fails to apply to the 'next' branch: I based on top of origin/next, specifically: 34d2b7f20369 (origin/next) Merge tag 'v2022.04-rc5' into next > > Applying: net: dsa: move cpu port probe to dsa_post_probe > Applying: net: mdio-uclass: add wrappers for read/write/reset operations > Applying: net: fec: add support for DM_MDIO > Applying: net: add MV88E61xx DSA driver > error: patch failed: drivers/net/Kconfig:428 > error: drivers/net/Kconfig: patch does not apply > error: patch failed: drivers/net/Makefile:66 > error: drivers/net/Makefile: patch does not apply > Patch failed at 0005 net: add MV88E61xx DSA driver > > > Also, after more testing I believe the dm-mdio driver code 'above' is > > correct but the business of trying to use it and fallback 'below' is > > wrong and needs work. It doesn't break current users of fec_mxc from > > what I can tell but it also doesn't properly connect the dm_mdio > > driver. > > Can you spell out what is wrong about the fallback logic? > Let me revisit later today and see if I can better explain the issue here and/or come up with a proper fix. Can you review 'net: add MV88E61xx DSA driver' for me? > The whole thing with eth_phy_get_mdio_bus()/eth_phy_set_mdio_bus() has > me so confused that I am not really following along anymore. > I'm pretty confused at CONFIG_DM_ETH_PHY as well. I think that got added where dm_mdio should have been added instead. see commit 5fe419ef2a61 ("net: Add eth phy generic driver for shared MDIO"). I've added Ye and Peng to the list... maybe they could comment on why dm_mdio wasn't a viable solution for sharing an mdio bus? Its only used in for fec_mxc dwc_eth_qos which are only on IMX boards and believe it was added for IMX8M boards. It's enabled in a whole slew of imx defconfigs where most of them are likely not needed. Tim What I'm trying to accomplish here vs just simply using dm_fec_bind_mdio(dev) and dm_eth_phy_connect(dev) is to provide a fallback for the many users of fec_mxc that do not have a dt that works with dm-mdio yet still have defconfig's that enable DM_MDIO. Most of the users would not currently have an mdio subnode in the fec node, nor have the required phy-mode 'and' phy-handle prop or fixed-link subnode which would cause the dm_eth_phy_connect to fail. Best Regards, Tim