From patchwork Thu Sep 10 23:43:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 7156321 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A971BBEEC1 for ; Thu, 10 Sep 2015 23:43:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D88FB206F2 for ; Thu, 10 Sep 2015 23:43:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A3252083C for ; Thu, 10 Sep 2015 23:43:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751114AbbIJXnt (ORCPT ); Thu, 10 Sep 2015 19:43:49 -0400 Received: from mail-yk0-f170.google.com ([209.85.160.170]:36174 "EHLO mail-yk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbbIJXnt (ORCPT ); Thu, 10 Sep 2015 19:43:49 -0400 Received: by ykdt18 with SMTP id t18so54898373ykd.3 for ; Thu, 10 Sep 2015 16:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ekoUZoFw7j2DXODR0HLYLJT8Azepk1l/YzSeKumoH08=; b=jTPIlDDEXSvqagk7avyeC6d0dcfOjZaOcTJE6wLwzvUYU4bQ47Oqw3uujh30DuKUpG +AqcOw/WBMYSmBPHMVIE+/TsoRQrGvt27okrYwIcuEE0EOxG9oIFKqW1MMK37R4QplpH 1T8qF7+OhYlOZFH/cHMuxgG2Zbd7fN1ISE1Flwbfa12PSDQrO/3YLIxg35LeiHRYaAax 7afluKK+AzQsuCIaaMZE/HM0NyChouRtx7i/f6I/B+pPdi71MtFgrSMGCt50VdgsA9O4 rPYt8nnSmF6c1l5wH+ndVZV1A3FJ1P5rrWa4rF8jXZSC4ZpOjcHhYTSV18AREyYqjYBI 18mg== X-Received: by 10.13.246.70 with SMTP id g67mr3959825ywf.116.1441928628603; Thu, 10 Sep 2015 16:43:48 -0700 (PDT) Received: from localhost.localdomain ([179.159.191.85]) by smtp.gmail.com with ESMTPSA id u184sm10998953ywd.23.2015.09.10.16.43.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Sep 2015 16:43:48 -0700 (PDT) From: Fabio Estevam To: bhelgaas@google.com Cc: l.stach@pengutronix.de, linux-pci@vger.kernel.org, Fabio Estevam Subject: [PATCH 2/2] PCI: imx6: Add some defines for improving code readability Date: Thu, 10 Sep 2015 20:43:29 -0300 Message-Id: <1441928609-21921-2-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441928609-21921-1-git-send-email-festevam@gmail.com> References: <1441928609-21921-1-git-send-email-festevam@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam Instead of having some hardcoded values, it is preferred to use defines when possible. Signed-off-by: Fabio Estevam --- drivers/pci/host/pci-imx6.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index 2d0d0fe..f7a3951 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -55,6 +55,7 @@ struct imx6_pcie { #define PCIE_PL_PFLR_LINK_STATE_MASK (0x3f << 16) #define PCIE_PL_PFLR_FORCE_LINK (1 << 15) #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) +#define PCIE_PHY_DEBUG_R0_LTSSM_MASK 0x3f #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29) #define PCIE_PHY_DEBUG_R1_XMLH_LINK_UP (1 << 4) @@ -74,6 +75,7 @@ struct imx6_pcie { /* PHY registers (not memory-mapped) */ #define PCIE_PHY_RX_ASIC_OUT 0x100D +#define PCIE_PHY_RX_ASIC_OUT_VALID 1 #define PHY_RX_OVRD_IN_LO 0x1005 #define PHY_RX_OVRD_IN_LO_RX_DATA_EN (1 << 5) @@ -503,10 +505,10 @@ static int imx6_pcie_link_up(struct pcie_port *pp) pcie_phy_read(pp->dbi_base, PCIE_PHY_RX_ASIC_OUT, &rx_valid); debug_r0 = readl(pp->dbi_base + PCIE_PHY_DEBUG_R0); - if (rx_valid & 0x01) + if (rx_valid & PCIE_PHY_RX_ASIC_OUT_VALID) return 0; - if ((debug_r0 & 0x3f) != 0x0d) + if ((debug_r0 & PCIE_PHY_DEBUG_R0_LTSSM_MASK) != 0x0d) return 0; dev_err(pp->dev, "transition to gen2 is stuck, reset PHY!\n");