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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 39CE2C07E97 for ; Sat, 3 Jul 2021 19:59:44 +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 7C04661462 for ; Sat, 3 Jul 2021 19:59:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C04661462 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 4E4C582BB2; Sat, 3 Jul 2021 21:59:14 +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=1625342354; bh=ficIidKvXn6GPEZ8fLgJnTfZhmPswjtCzi3Qe617dC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=G52w79Hg2dlcXkFmEyeK5pQf1VLUAqxqYPiNEocAuSLGgOV22WecQLBn1HAqfel5r P+ku921PQR8OX7XqXPOGLg8jhf/VpM38fODn0UbSWG8aaDA1rQFtTMFKlduKWXYMSK +901LlxeqNCT0qmlMVqW+LsDJV5TYTCRSttrDlO6seDVuu+bwRowWeoYnCDQL2+HTx ONHQlENM2w2q8XzN2nbLeOXAFjR8lN6N3xcWt7rYwqL1xZCoJKrCkJlIS2hiZ42g1J AUGIpSsrK/RRLA4L/acv235NOpzCqN3H4r0zERRMABYs0fyb+MY7KKsX/a7VQcgZFR qCl8dnC+SeXQg== Received: from localhost.localdomain (unknown [IPv6:2804:14c:485:504a:abf0:6b86:fce4:4efb]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: festevam@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 36B3382A29; Sat, 3 Jul 2021 21:59:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1625342348; bh=ficIidKvXn6GPEZ8fLgJnTfZhmPswjtCzi3Qe617dC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q0l8WbWSoQaLSyW9985i1wkOSfJC+yLAGsH7B9V3ggbwKnpGqhgiSjh1N6IBWeuZr HAKHUWXV7Qjcm+0TCfyR3NI6mmx4/GIjNKKxAgNyat4BISypIVj4emGI3Ybl0lNN+3 i4haTz3EhDKeB2Pn64XlvcKJNROvhmMtcAMxXFZ7oCu/jPcvGBDtJYr91ZJKbhMCcR WcJ/Ves/OF3z/Z3KBGAnlnTKVd4PdwM2BWTxLveOOVhra79tw8cMMbFvBuYACo44kf aFXF6/7V2UE4irK5w/8Z5YqCrKBTG9EPvG2Notfo9a8NV/PuGvfeeBajcj4a6w2tuK HdXIk/pnuhKlQ== From: Fabio Estevam To: sbabic@denx.de Cc: marex@denx.de, u-boot@lists.denx.de, frieder.schrempf@kontron.de, tharvey@gateworks.com, uboot-imx@nxp.com, Fabio Estevam Subject: [PATCH 5/8] usb: ehci-mx6: Allow building SDP for imx8mm Date: Sat, 3 Jul 2021 16:58:34 -0300 Message-Id: <20210703195837.28153-6-festevam@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210703195837.28153-1-festevam@denx.de> References: <20210703195837.28153-1-festevam@denx.de> MIME-Version: 1.0 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 After selecting USB SDP support for i.MX8MM, there are some build errors and warnings. Make the necessary adjustments for fixing the build. Signed-off-by: Fabio Estevam --- drivers/usb/host/ehci-mx6.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index de53f0c15204..16cd1369aef1 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -141,12 +141,12 @@ static void __maybe_unused usb_power_config_mx6(void *anatop, int anatop_bits_index) { } #endif -#if defined(CONFIG_MX7) && !defined(CONFIG_PHY) +#if (defined(CONFIG_MX7) || defined(CONFIG_IMX8M)) && !defined(CONFIG_PHY) static void usb_power_config_mx7(struct usbnc_regs *usbnc) { void __iomem *phy_cfg2 = (void __iomem *)(&usbnc->phy_cfg2); - if (!is_mx7()) + if (!is_mx7() || !is_imx8mm() || is_imx8mn()) return; /* @@ -248,10 +248,10 @@ int usb_phy_mode(int port) return USB_INIT_HOST; } -#elif defined(CONFIG_MX7) +#elif defined(CONFIG_MX7) || defined(CONFIG_IMX8M) int usb_phy_mode(int port) { - struct usbnc_regs *usbnc = (struct usbnc_regs *)(USB_BASE_ADDR + + struct usbnc_regs *usbnc = (struct usbnc_regs *)(uintptr_t)(USB_BASE_ADDR + (0x10000 * port) + USBNC_OFFSET); void __iomem *status = (void __iomem *)(&usbnc->phy_status); u32 val; @@ -346,9 +346,9 @@ int ehci_hcd_init(int index, enum usb_init_type init, (struct anatop_regs __iomem *)ANATOP_BASE_ADDR; struct usbnc_regs *usbnc = (struct usbnc_regs *)(USB_BASE_ADDR + USB_OTHERREGS_OFFSET); -#elif defined(CONFIG_MX7) +#elif defined(CONFIG_MX7) || defined(CONFIG_IMX8M) u32 controller_spacing = 0x10000; - struct usbnc_regs *usbnc = (struct usbnc_regs *)(USB_BASE_ADDR + + struct usbnc_regs *usbnc = (struct usbnc_regs *)(uintptr_t)(USB_BASE_ADDR + (0x10000 * index) + USBNC_OFFSET); #elif defined(CONFIG_MX7ULP) u32 controller_spacing = 0x10000; @@ -357,7 +357,7 @@ int ehci_hcd_init(int index, enum usb_init_type init, struct usbnc_regs *usbnc = (struct usbnc_regs *)(USB_BASE_ADDR + (0x10000 * index) + USBNC_OFFSET); #endif - struct usb_ehci *ehci = (struct usb_ehci *)(USB_BASE_ADDR + + struct usb_ehci *ehci = (struct usb_ehci *)(uintptr_t)(USB_BASE_ADDR + (controller_spacing * index)); int ret; @@ -384,13 +384,15 @@ int ehci_hcd_init(int index, enum usb_init_type init, #if defined(CONFIG_MX6) || defined(CONFIG_IMXRT) usb_power_config_mx6(anatop, index); -#elif defined (CONFIG_MX7) +#elif defined (CONFIG_MX7) || defined(CONFIG_IMX8M) usb_power_config_mx7(usbnc); #elif defined (CONFIG_MX7ULP) usb_power_config_mx7ulp(usbphy); #endif +#if !defined(CONFIG_PHY) usb_oc_config(usbnc, index); +#endif #if defined(CONFIG_MX6) || defined(CONFIG_MX7ULP) || defined(CONFIG_IMXRT) if (index < ARRAY_SIZE(phy_bases)) { -- 2.25.1