From patchwork Thu Jan 24 20:15:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10780023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CA71139A for ; Thu, 24 Jan 2019 20:15:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0BE8301C8 for ; Thu, 24 Jan 2019 20:15:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4169301ED; Thu, 24 Jan 2019 20:15:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76AA5301C8 for ; Thu, 24 Jan 2019 20:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730807AbfAXUPp (ORCPT ); Thu, 24 Jan 2019 15:15:45 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46208 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730800AbfAXUPp (ORCPT ); Thu, 24 Jan 2019 15:15:45 -0500 Received: by mail-pg1-f195.google.com with SMTP id w7so3129941pgp.13; Thu, 24 Jan 2019 12:15:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4NEECKxkIUpvSN6zGsm7tNAQxLgNjozzJMg2Nudc0PU=; b=RJqcCvBgMG0Q/XC6PGvQ5QszTlMA+suu93hO/bhOexDj7OObXbuQBG1QtGs8qZ7MvZ F8uK+BGzNl9gAXprVwm/loJ1VoU5Dz0cXAKH2RCQ1wb5wGaL7tnHDV1JLxE9CBmrBFlH mXI1DjJvzF/Nu21A9+/z/c5u9diWHThTyqvNd+qFC2m/2qcmhyzQ5T4T0gM0pnnjfVgj +lZOUQtX32ve4QlT1ge9HMwF7VYW8KlCeXNSVrHfpBgYTwfZG0kv9ExHPVvMrC0lu3Mr b+3+oXybnrnIYaHqShSRRvl0XUPipWbEtYiYh50HuOQ9H3WPcQrWaVflOtK602xCqlqk +LMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4NEECKxkIUpvSN6zGsm7tNAQxLgNjozzJMg2Nudc0PU=; b=HLFYHjj0xU45Ld+BYootPquCB5V7rUCct4jTCJO9vKZS+j9IcAUTbe28elky1wjg/F tdp8CF64c5VoIsuu7Coq+ph4d76WBSQrZ0fw+n5MBy/K+gw8wAv9nFPQcb78yeeIfM4q HcVCuzMaNvpOVcnAzecaiSDX93Y1vTRgd2QiVMjvvh3fqzE4uqZLf0svcwE6XkKux/n5 ejtLf3ZIWgB9JhvozEw6iksLmMyFJR2mmY7NwkdYQKBEewwTxZ2Cfthx7F+7odK1RA6W IX//zS2siJig0n688TOwiwrZZCVAkKGJR5IPL/0s0POpX7MLUJ8J42kNN0J3zbtCozh3 Mn9w== X-Gm-Message-State: AJcUukeCKyoUIJnCrtoGlXfE6+lXrSOyvewfahcckEdtBMfxyUWjqDEx jELCE76SLTq7CnXfDmCZXmc= X-Google-Smtp-Source: ALg8bN5wc8PK4BpLsVxaYdb1/pXiP2on/lOSfG0Pg5rcjdSUgjFpchPBfotz7EQbS5vfcc0YXdhbmg== X-Received: by 2002:a63:6506:: with SMTP id z6mr707698pgb.334.1548360944257; Thu, 24 Jan 2019 12:15:44 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id m65sm53062646pfg.180.2019.01.24.12.15.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 12:15:43 -0800 (PST) From: Andrey Smirnov To: Lorenzo Pieralisi Cc: Andrey Smirnov , Trent Piepho , Lucas Stach , Bjorn Helgaas , Fabio Estevam , Chris Healy , Leonard Crestez , "A.s. Dong" , Richard Zhu , linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v6 2/4] PCI: imx6: Mark PHY functions as i.MX6 specific Date: Thu, 24 Jan 2019 12:15:20 -0800 Message-Id: <20190124201522.8973-3-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190124201522.8973-1-andrew.smirnov@gmail.com> References: <20190124201522.8973-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP PCIE PHY IP block on i.MX7D differs from the one used on i.MX6 family, so none of the code in current implementation of imx6_setup_phy_mpll() is applicable. Tested-by: Trent Piepho Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Cc: Bjorn Helgaas Cc: Fabio Estevam Cc: Chris Healy Cc: Lucas Stach Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-pci@vger.kernel.org --- drivers/pci/controller/dwc/pci-imx6.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index efff3d5e9162..c55d93c1187d 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -41,8 +41,11 @@ enum imx6_pcie_variants { IMX7D, }; +#define IMX6_PCIE_FLAG_IMX6_PHY BIT(0) + struct imx6_pcie_drvdata { enum imx6_pcie_variants variant; + u32 flags; }; struct imx6_pcie { @@ -256,6 +259,9 @@ static void imx6_pcie_reset_phy(struct imx6_pcie *imx6_pcie) { u32 tmp; + if (!(imx6_pcie->drvdata->flags & IMX6_PCIE_FLAG_IMX6_PHY)) + return; + pcie_phy_read(imx6_pcie, PHY_RX_OVRD_IN_LO, &tmp); tmp |= (PHY_RX_OVRD_IN_LO_RX_DATA_EN | PHY_RX_OVRD_IN_LO_RX_PLL_EN); @@ -573,6 +579,9 @@ static int imx6_setup_phy_mpll(struct imx6_pcie *imx6_pcie) int mult, div; u32 val; + if (!(imx6_pcie->drvdata->flags & IMX6_PCIE_FLAG_IMX6_PHY)) + return 0; + switch (phy_rate) { case 125000000: /* @@ -1088,12 +1097,15 @@ static void imx6_pcie_shutdown(struct platform_device *pdev) static const struct imx6_pcie_drvdata drvdata[] = { [IMX6Q] = { .variant = IMX6Q, + .flags = IMX6_PCIE_FLAG_IMX6_PHY, }, [IMX6SX] = { .variant = IMX6SX, + .flags = IMX6_PCIE_FLAG_IMX6_PHY, }, [IMX6QP] = { .variant = IMX6QP, + .flags = IMX6_PCIE_FLAG_IMX6_PHY, }, [IMX7D] = { .variant = IMX7D,