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 X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA2A6C07E95 for ; Sun, 4 Jul 2021 19:25:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0EF1D61261 for ; Sun, 4 Jul 2021 19:25:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EF1D61261 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9CB3C82B4E; Sun, 4 Jul 2021 21:25:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625426752; bh=LQZpVCEGVWm0uzSpaRFlgH8PClVpgWtRcLtDZl3h27Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ODqOhC4FitHb/0/vV4UXryiIqtuHlp0DEMq0RIrd0I3pqikVCLrmcC9MYFX4uzLHI BjuUvWIN5KcDQmi6w+IsVKL23bXHMgPR9Iv+mNbSTJZS24s0KtkbWjH7m8hBsj+CpF 1sh93y4J1GOWtwVpyOpRlnOIKy9X1pUq1Nl9Yd71RKV9Kjgu3Ypwyc83Dz4I01azm6 mqogsLTxvhX58Uu5rL0WFIAwdqKhm0vNl6cvkFJD4MzHQZM5+W2nEUmD9aCANX1neS yXac7crydVMbx3fVDxPPLkz6i7IHcGZqUw6A82qZhMH9ZztBrLKdh0tST1GED5ltHq 4xUk4q7V+tsjA== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 6CAF882A29; Sun, 4 Jul 2021 21:25:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625426750; bh=LQZpVCEGVWm0uzSpaRFlgH8PClVpgWtRcLtDZl3h27Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Z8+ED4nbP0Ub6jma0oTUQ75GzFf3uXyZSVGbZa5uscNrNdXamjBQMEB/UVFszGfiK 4l+O0MsxZyvvTRrZg/vNl8SUIBhewQmXuwtWrvEUGGOVH+u9TSoAj3qLtGudPmj1KQ CAHHrQYtkzXULnhSPp1Wju3faPJwzU1ig83a0pdKAxlOO0EC9z+Qegfpmu8OLa1SU2 uj8CRTWd9zLGxk37ej797vK5oW8WsJ384SrnAHiQ1XC3pDKknCi4G3DLTOpMO8mrAo DqzGz3g4iZBQ0evsmmJNyNRpyov/ewGL7xOgKuObVRYs1cPgLbmr3PMQjPXduQH05G SR9xZLRJPWw4w== Subject: Re: [PATCH 1/8] imx8mm: Fix USB reg addresses for i.MX8MM To: Fabio Estevam Cc: Fabio Estevam , Stefano Babic , U-Boot-Denx , Schrempf Frieder , Tim Harvey , dl-uboot-imx References: <20210703195837.28153-1-festevam@denx.de> <20210703195837.28153-2-festevam@denx.de> <39d5feea-7390-25a9-e82d-e1a720c0024e@denx.de> From: Marek Vasut Message-ID: <52050ae7-bc10-eeb1-3162-1aa8586042cb@denx.de> Date: Sun, 4 Jul 2021 21:25:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 7/4/21 5:35 PM, Fabio Estevam wrote: > Hi Marek, Hi, > On Sat, Jul 3, 2021 at 10:04 PM Marek Vasut wrote: > >>> Retrieving the USB base addresses from DT would be preferred, yes, but >>> the current code does not do that. >> >> I implemented exactly that in mx6_parse_dt_addrs() , see: >> 4dcfa3bcbcb ("usb: ehci-mx6: Parse USB PHY and MISC offsets from DT") > > We are talking about USB_BASE_ADDR, right? All of the addresses used by the driver, I am trying hard to get rid of all that hard-coding in the driver. They should be parsed out of DT. > imx6/imx7/imxrt provide the USB_BASE_ADDR as define. That's only because they still need to be fully converted, someone needs to write the PHY driver for those. For MX8M, the NOP PHY driver is used. > If we remove the imx6 definition from arch/arm/include/asm/arch-mx6/imx-regs.h > the ehci-mx6: driver fails to build. > > I didn't want to change ehci-mx6 in this aspect, so that's why I used > Frieder's patch that passes > USB_BASE_ADDR via define for i.MX8MM too. > > Is this an acceptable solution? No, let's not do that, because that exactly un-does the attempt to get rid of these hard-coded addresses. Please parse the address out of DT. And if you run into something which might still need hard-coded addresses, please fix it. The ehci-mx6 is bad, let's not make it worse, lets fix it instead. >>> Without providing these defines: >>> >>> drivers/usb/host/ehci-mx6.c:254:62: error: ‘USB_BASE_ADDR’ undeclared >>> (first use in this function); did you mean ‘SRC_BASE_ADDR’? >>> 254 | struct usbnc_regs *usbnc = (struct usbnc_regs >>> *)(uintptr_t)(USB_BASE_ADDR + >> >> I suspect you need CONFIG_PHY for mx8m . > > CONFIG_PHY is already selected by imx8mm_evk_defconfig. USBNC is iMX7 specific , so you cannot hit that error on iMX8M, there is #elif defined(CONFIG_MX7) around it.