From patchwork Fri May 20 08:26:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 1971 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 93F6C3F039 for ; Fri, 20 May 2022 10:26:31 +0200 (CEST) Received: by mail-ej1-f71.google.com with SMTP id x2-20020a1709065ac200b006d9b316257fsf3693915ejs.12 for ; Fri, 20 May 2022 01:26:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1653035191; cv=pass; d=google.com; s=arc-20160816; b=keYuAFckGj8rZyjJqMWkCAxGK0xaOJCIaXmhwoCmxVNZ5ADnTsQoqRxh3aNEz01Kxn LDD3qpu/ffnPhFAkUBjK+kUS+WMLeNRAvAb+c/fMEOI7rAp1wJNyYGwuzZsB33x0B1z0 zAMpMn06EDGjNB8HzJyW5hzIF2znpkmPlpRBsSL8dQZ6m8v7X1Ej+8irR6s2VbyzN3FL k/QWNm70Kh8cmMoSqgaUUDqCFAUFfZJhn/cbXcmZDYD9ud5eXvo7xnq/tSDKjSlFhLmT RalQd8lFO/GkNpnaVJ5sPAsBSGCeqLM3D4+QqYvSQYCct9Z7hYBECSz9uKEUGpm6xiBN B81g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=XurY2olXpplXLAlYH2lzJMgDpooMqNGtKq/IyCFDtyQ=; b=ZDCBJoSG+sHsB94xeS+duInvTVZxbU5thxZs8Uu85d9Ea9nON2CiKpoDCzkKzhCZte N8pSYUKAvWLm7w0aErB06LkFviBTHOk1r9Jjk5CJkz8mXFXs97rLzO4+t42I8uH5kvez Wj/5iob7ps6OpeM7xNi7F74CZ43KfVFKYOsOwy9CPeDeCSRZZ7GF+2hl9Ra/VyEb/BzB MfvPoyUt8a3QkhMoOZTwO7YqUAD3bZkWqisL9Wokdr7NV94BMgVPmhd28wNa2UQldxc8 CQrmE9E/MO4mOfgwK5SwwGl75Xf8Vucd4CZZYLAlHksD0Xjyid3Yr7VyiraOgeTUZjmP v0rA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Bf/ET2bR"; spf=pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=tommaso.merciai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=XurY2olXpplXLAlYH2lzJMgDpooMqNGtKq/IyCFDtyQ=; b=SLmon01BpYee3Ul0xsJCXmgsSKsPDgLeIVS6huR+uhalg+YFqBf4pxe1OB+zwIJG1x ZTwcVmMMgzUqyP7JxrLKNnme0EBDRiOJgrOh7tI//D7l5Om7OzWIHlZBlA/vYusuKcV0 IlT4iXZY5BUiOwReV65g99o3zasA2uzvYGf3Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=XurY2olXpplXLAlYH2lzJMgDpooMqNGtKq/IyCFDtyQ=; b=KiajzuQScwcLNV2gViUXgrvQx0r95OuJz56QsCtB9fHOg0HBazyQqHP1pOqXteXLX/ xoJOGLHLmN9Rv8O1g3lWVrFctNnTgCl9sz2RIOmTW0Dhte3y+fJUVDfp4zRVBbcAA5PS RxCJXeuKpQ2uaSt2kOsOtTUfxoDtt1I23rducG9oBItQ7bPZT8zML0HHGeD3uIgvWCpK mTRIb5eRinuMqCwBmeLZssa55LgrzjH8AiqeY2kK1jqzTljZ59TdIFHv/Acee1NX4qE9 wsx7s63ZVXKe4Ir6bBSQaGyWMdXC8O70m35l/jAPECj6m2jxmAsHmvJIzttE+Z5QgpVK l+zg== X-Gm-Message-State: AOAM532MuToMFFSROwdJm6k3m1RmQq51Hf81kp1cKuPbX+t/VAovPOlV 23dxZZFFUxRZg2OaD2YHP6vws9q7 X-Google-Smtp-Source: ABdhPJwktLIuvytuNOyzUJhmu8Ssf/eS1Acm7dxHbebmGFyEFicRl5BwU7GMGj4kdw4besvDZcE4Lw== X-Received: by 2002:a17:907:7f91:b0:6f3:d6bc:cd5b with SMTP id qk17-20020a1709077f9100b006f3d6bccd5bmr8103830ejc.460.1653035191416; Fri, 20 May 2022 01:26:31 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2741:b0:41f:7eee:e393 with SMTP id z1-20020a056402274100b0041f7eeee393ls388149edd.3.gmail; Fri, 20 May 2022 01:26:30 -0700 (PDT) X-Received: by 2002:a05:6402:190e:b0:427:bb26:7337 with SMTP id e14-20020a056402190e00b00427bb267337mr9644847edz.294.1653035190365; Fri, 20 May 2022 01:26:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653035190; cv=none; d=google.com; s=arc-20160816; b=H/vmOW6VIHynRPO6BNS0+m2ZzCGrClE3LYpuiC8ygpWdIeEVqg5/yivW4jS4GAdRnP UVf1rL5nxkoG8qL/4T7ABTGnJFtjSMvsJmoxFKoHzhAi1Dp3LAUuFhL5I8gBlgB0FpQF yolqJjsDuApo6pPACpz4WoaTWhE4HngeLr9FowXuA6ZXcxfY+ogegi7lYyy0MXK/qET5 9TtFFNmd+T7fCa7SX2SrMncutJgaS67+4gCVS2gGk9ncCF7n8WxGi6je7hCxhujOTGDw jTWJOr9lvupOg4OLf4+D6KwWNkXsii0U0N8yLx4sSJxhGJ6Hij5Te/RysS5XSAV/SPnS gdcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=GvpNPYdiD58z5hTIGYwCYt/TzYk6ZgMCQ6KEeP26wTA=; b=cCNKyQdPTQDQbdR2tC+o2Sqopw5KyIU5KAmQd03xM7e1kc2Hwrq9mYdir+x6W5q8Ni KFCaRAqLr+OpxhBdXVwFXLxtPnybq5e4W3S0D6FVhxt+nJ2YePvZWGts5H1y9Jw46bqf sKIYkyXtquCDNBKgzKm+BAiY+cBC0f5+oK67qCy4ghZ6l7G4LwinG0oRtboE0WJHwXlN Z5ncK4W9jmbYiWxzw+wiCVfrLeSszOleK7bQgtgQCiNDu3GOssTvJQ5jGaT5k8yjP/ln tIUuBUAED3+r/tb9s1Uzs22GpTY4k+UqSSVPm2nVLl69JCfu9C+K8H3TYrJwR9BtFD/F Opvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Bf/ET2bR"; spf=pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=tommaso.merciai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id bo4-20020a0564020b2400b0042aa9bfa654sor4404590edb.43.2022.05.20.01.26.30 for (Google Transport Security); Fri, 20 May 2022 01:26:30 -0700 (PDT) Received-SPF: pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6402:4410:b0:427:ab6f:a39a with SMTP id y16-20020a056402441000b00427ab6fa39amr9769423eda.120.1653035189960; Fri, 20 May 2022 01:26:29 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-53-154.cust.vodafonedsl.it. [188.217.53.154]) by smtp.gmail.com with ESMTPSA id el9-20020a170907284900b006f3ef214e55sm2896544ejc.187.2022.05.20.01.26.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 01:26:29 -0700 (PDT) From: Tommaso Merciai To: Cc: linux-amarula@amarulasolutions.com, Tommaso Merciai , Fabio Estevam Subject: [PATCH 5/8] usb: ehci-mx6: Allow building SDP for imx8mm Date: Fri, 20 May 2022 10:26:20 +0200 Message-Id: <20220520082623.1788887-6-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220520082623.1788887-1-tommaso.merciai@amarulasolutions.com> References: <20220520082623.1788887-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: tommaso.merciai@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Bf/ET2bR"; spf=pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=tommaso.merciai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Signed-off-by: Tommaso Merciai --- 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 1b6dc19a01..09bd2e0236 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -142,12 +142,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; /* @@ -249,10 +249,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; @@ -347,9 +347,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; @@ -358,7 +358,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; @@ -385,13 +385,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)) {