From patchwork Mon Oct 15 13:07:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 148845 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3778701lji; Mon, 15 Oct 2018 06:10:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV61XH++N4EGijsQiogiBK71fIjHbr6+sfd9aolVxmnFQmNlrNHc6/cPGf7G6A/ZQ5/WT8TAk X-Received: by 2002:a63:de46:: with SMTP id y6-v6mr15958490pgi.198.1539609049306; Mon, 15 Oct 2018 06:10:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539609049; cv=none; d=google.com; s=arc-20160816; b=TstYkaX/zDh4GYb5AKrXveRSshOMWwz1vim2+Xbd5KnFwJTAGbkrd8heJIY5gvWdkw Er6f1gOEFf73zhKa+kiHfa6ZXrJzYto8SYxJVHH3XqrYGP7VWma48wvQbpr4Ds+0sXc7 7w8yO9hoqDwYHQGRIqwsQ00M+E3pHgEOoTQeUj9tGPdr39q/kdpPNIob/AFdmbC0p9/j ZIfZBPd1JDiUzv+aBmVzxRsex0jPxhRbsXd1+3vv3DQdiVECvp2FLoB6VJ6ckCVc8TRY zfaofLh7hRx91yNFNmtn0+eYQPTLxIzniV6Yufx2qzqUgBCY0m4lkWkGEcELAkq3JXmN ka8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=AByttV0CbD6kHf0vx5L2FAk6NqqlvvyZAgV6B09W4eo=; b=RaBqQi+/cO+Yq87VOJkeIYB6FgYqfB20Gebhe5SdcpOm6mlT2VA2t4i6OFeII9Hn6Z WIKObC0/edsALSsfTyEy/6BjQ8IybJzm/Jr6DRXpjpJleOAPY5deX6urjYnY0HkmLU9K +wz2Rlkkx2tKjCki8L2Mx81v17Alw53RvcjrdKTv93sCUdhJOT+3S8UX4o+rGRAuRZ3/ PeH1nh1OzDLr5TDBvH8zazkrxKaMQMr6KV5V+2yBNCQW+IluXdilbT3thoPCufG4wSSp qqmraDyZvRwCT5qQYcJiXtpl1g1LBkzXpa3b1Fevdx9OUSn8D0uWlh94deYbSYLYnkF9 qeuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VEGYUpZf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3-v6si8169164plb.197.2018.10.15.06.10.49; Mon, 15 Oct 2018 06:10:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VEGYUpZf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbeJOUyr (ORCPT + 32 others); Mon, 15 Oct 2018 16:54:47 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:43470 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726697AbeJOUyq (ORCPT ); Mon, 15 Oct 2018 16:54:46 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9FD8q16089360; Mon, 15 Oct 2018 08:08:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539608932; bh=AByttV0CbD6kHf0vx5L2FAk6NqqlvvyZAgV6B09W4eo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=VEGYUpZfoEa8MicRkv4KD/J5dIz8oIyvoC5vRphyKA0oAGnW6hsqraRtdmcI89dc/ XRGQRUxoHTD82fKD4YNFsEeJvP/Gwg5WgUYvXM1igV4Nx0ENQDxUMWOsnAgrzo8ARJ 3oX9fLuJC7xmAfjIFrgAiM8s4xc3Hb8YAPeE9pkU= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9FD8qZV000957; Mon, 15 Oct 2018 08:08:52 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 15 Oct 2018 08:08:51 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 15 Oct 2018 08:08:51 -0500 Received: from a0393678ub.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9FD7tLI009433; Mon, 15 Oct 2018 08:08:49 -0500 From: Kishon Vijay Abraham I To: Bjorn Helgaas , Lorenzo Pieralisi , Murali Karicheri , Jingoo Han , Gustavo Pimentel CC: Rob Herring , , , , , Kishon Vijay Abraham I Subject: [PATCH 15/19] PCI: keystone: Cleanup set_dbi_mode and get_dbi_mode Date: Mon, 15 Oct 2018 18:37:17 +0530 Message-ID: <20181015130721.5535-16-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181015130721.5535-1-kishon@ti.com> References: <20181015130721.5535-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No functional change. Use BIT() macro for DBI_CS2 and cleanup set_dbimode and get_dbi_mode Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pci-keystone.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index 68b080aef3ac..7015a353a614 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -40,7 +40,7 @@ #define LTSSM_EN_VAL BIT(0) #define LTSSM_STATE_MASK 0x1f #define LTSSM_STATE_L0 0x11 -#define DBI_CS2_EN_VAL 0x20 +#define DBI_CS2 BIT(5) #define OB_XLAT_EN_VAL BIT(1) /* Application registers */ @@ -319,11 +319,12 @@ static void ks_pcie_set_dbi_mode(struct keystone_pcie *ks_pcie) u32 val; val = ks_pcie_app_readl(ks_pcie, CMD_STATUS); - ks_pcie_app_writel(ks_pcie, CMD_STATUS, DBI_CS2_EN_VAL | val); + val |= DBI_CS2; + ks_pcie_app_writel(ks_pcie, CMD_STATUS, val); do { val = ks_pcie_app_readl(ks_pcie, CMD_STATUS); - } while (!(val & DBI_CS2_EN_VAL)); + } while (!(val & DBI_CS2)); } /** @@ -337,11 +338,12 @@ static void ks_pcie_clear_dbi_mode(struct keystone_pcie *ks_pcie) u32 val; val = ks_pcie_app_readl(ks_pcie, CMD_STATUS); - ks_pcie_app_writel(ks_pcie, CMD_STATUS, ~DBI_CS2_EN_VAL & val); + val &= ~DBI_CS2; + ks_pcie_app_writel(ks_pcie, CMD_STATUS, val); do { val = ks_pcie_app_readl(ks_pcie, CMD_STATUS); - } while (val & DBI_CS2_EN_VAL); + } while (val & DBI_CS2); } static void ks_pcie_setup_rc_app_regs(struct keystone_pcie *ks_pcie)