From patchwork Tue Dec 18 04:07:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10734709 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 F1B6213B5 for ; Tue, 18 Dec 2018 04:08:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE3E32A431 for ; Tue, 18 Dec 2018 04:08:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE17C2A76D; Tue, 18 Dec 2018 04:08:12 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D2AA2A431 for ; Tue, 18 Dec 2018 04:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3Wk9k9vbi2UGF5lkK1XM/7z4CZw7frRUK3XZZrZ29PI=; b=SpmvSznH3QAjn+ F/eZQtmPS8xwvJroJOF0m3gSU7AdnecESQL5QuxxGi7iU3JNZxZ7PvvowWATuHRk5+fuINi2GwaoE HRfWlqlFuqo8MkR/ytHIUxD3lm1A21ES06V+9E2lxAL/PFMSVWQ67khsmUaM+B3DiBsR27Uj8lrEV R0FrVzu6ZYVTEiBkRL23BDnA3T4PfOF18oiQfN+vVNIdrTWXRP7+F/lT888ABsgGsgmftfU3KO4jj 4JRnXhJZurnnI35eHFwCEvnFD72VzYpZfo5AFd+i4+Tb7OHW1I7faruuPamMYNuZu7WVpTg7uCprT F4OjvPks1hYdh6XKmm0g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZ6fw-0000lN-5t; Tue, 18 Dec 2018 04:08:08 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gZ6fO-0000D7-Bx for linux-arm-kernel@lists.infradead.org; Tue, 18 Dec 2018 04:07:37 +0000 Received: by mail-pl1-x644.google.com with SMTP id b5so7183483plr.4 for ; Mon, 17 Dec 2018 20:07:24 -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=3LZ1B+w3Ow4FWhJuytlSum7SxBX6UGqso+sY25998rQ=; b=UbtoYbhvv9Eat1kVm+2FjWSgyz0/4weKMUa8yG19BwMQEB4ViL5SFei/0PB7OGQe+Q eCju7Q/j3RbzRgrUzm1BK5qBnH0RXObx4tcDitYhFcKoMoQNdVNwlMFnMArWEjcteH4u Tbx74m5Sw1nCu8g15NgGF0PMG+vXKRTyWg5JDe6bZoy+7YmoNtw48gtSgBlZGcJicETg CTLBUUSCWFJOJ7KUOBGUfYTAkkJl2sxFkriueg+9J8lE/gV3ZFxzmbT7Rz2n27zfh45K YnS1hPdarCGXXuCugwJZpLP7yrsehgy5kmFnPDR1VqSlAq7fxneRroca2Z/JsVab3I2K jWSQ== 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=3LZ1B+w3Ow4FWhJuytlSum7SxBX6UGqso+sY25998rQ=; b=o7dBARsNPCVxRMFP3PSOXIcaN2I0gSYIeWDCf6IhWsvS4UDQ28qQT4pTkKryr2V30v WNS7f9n6Lzh5DfkULEFK/FTk7z4BpCleauH4aLzPst3FEdN7lXEU+1i6AJ0xYk5+HqF8 UCzdrKNkCeO+hu8a3juDaMT5snfymgj8RK8CnNbTISSy86hwWeJbFyv9HfMkVYBI3mz8 v7Xe9i9fBd5AS3OYC8ZSwpBoAcAjzUw7cydPDHc5QXUkDVs3EFxZEXD9TNjPGJbHmsIR iKzfU30CoOvOimamWJCUQyZs4+O+Hia4cWMr+LFedv0+Vfl0MCINqdoaV52W9KlzfVkg 3j5A== X-Gm-Message-State: AA+aEWZYRlVzwDBLnSozJHKkzgxmr6h4rixZyw2fINSEFNBiN3YI+xEJ tEKHJ8o+cSnHDznbDRhdGL2PVI6K X-Google-Smtp-Source: AFSGD/Ua52Z5zAHH8nLUrok70WRVujqXWbh4Jp92bVqx216petiG5KQSvh0IVekhJZf+nIWavAoACw== X-Received: by 2002:a17:902:b592:: with SMTP id a18mr15046487pls.293.1545106043679; Mon, 17 Dec 2018 20:07:23 -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 m67sm18538837pfm.73.2018.12.17.20.07.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 20:07:22 -0800 (PST) From: Andrey Smirnov To: Lorenzo Pieralisi Subject: [PATCH v3 2/3] PCI: imx6: Mark PHY functions as i.MX6 specific Date: Mon, 17 Dec 2018 20:07:01 -0800 Message-Id: <20181218040702.29231-3-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181218040702.29231-1-andrew.smirnov@gmail.com> References: <20181218040702.29231-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181217_200734_683171_3541E6D9 X-CRM114-Status: GOOD ( 14.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "A.s. Dong" , Richard Zhu , linux-arm-kernel@lists.infradead.org, Andrey Smirnov , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Fabio Estevam , linux-imx@nxp.com, Bjorn Helgaas , Leonard Crestez , Chris Healy , Lucas Stach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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() and imx6_pcie_reset_phy() 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 d50ed69e7a57..caa05104b90b 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,