From patchwork Wed Oct 17 07:41:09 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: 149038 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp328074lji; Wed, 17 Oct 2018 00:43:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV62iRoKg+N7LpYALFGNUYsE37ke7oR9ex74jiltLoP674w+rBHQAVlPR4eR7O5+43lv3+9di X-Received: by 2002:a17:902:286b:: with SMTP id e98-v6mr24710926plb.110.1539762182004; Wed, 17 Oct 2018 00:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539762181; cv=none; d=google.com; s=arc-20160816; b=zoPgZwDaXnQqS5JAq1snUeYW8iQnEVAnndmLtrfxwoP8sG9KbA+rikUsy6m16UveNL JO4z9GudlIHZFsN4t+Y5FYU6+R1sREAwDhedW7iezOfSzmhPQT7c7/CaJ7gbypoqoeFo koKsY+vbAzwrlOJgPJUNM4ix14KmCcnZSpFMoUrPqamNcx+suLMUPiJNu5mNfE9Bv2ZQ i5DMfwAujpuZTjIK4LZIIQi6AieIcbfg1mKZgkmykUJy75LXNo0NEU6CAGD4m9m00Q+j suQOPOEaa+rF62di/75AwHh5K7Dor1c1VpSmi3W0tosv6FPGyzam9u3Auxk6L4UyCG/1 GLBw== 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=TJTKFDSXgapb2zFN4WzS4ePydA0M0F3UQ+j0dbzHS1Q=; b=vhZVxgHQ6e9GyMHi6sn4chCBcJ6tlNMX7j2CdoT9lSGZhvTWtHX1gZYmz0Lj5XCKsP xmKy7A8GN9HEzQdOTLCV4Da6J973XAbl9LkWz5ZpbVD/m6f5ITzR9BGSDXqa7tnarCjV d3U0MaJyjfCQEtUM9Isl5KrKxhPVVwPsFNe2oTLjafaYETnleXOM+KQtJd0Pq1tmuY+N Uw35ocUDBjTQ6mOKP0kjiif8Gh+vaXAOdwFFhNadkU5yZHzkRCSwLelBqdnLqUckq9QY vkfCw6LaawcJJomJiUyxXcBmfBIpSHiPbV0qZXIv55tyUAOaRwLn41pmqiMxbLM86lwE Q0Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NaDmmUrG; 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 m7-v6si17291663pgb.466.2018.10.17.00.43.01; Wed, 17 Oct 2018 00:43:01 -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=NaDmmUrG; 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 S1727650AbeJQPhX (ORCPT + 32 others); Wed, 17 Oct 2018 11:37:23 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56662 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727257AbeJQPhS (ORCPT ); Wed, 17 Oct 2018 11:37:18 -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 w9H7gdO2023149; Wed, 17 Oct 2018 02:42:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539762159; bh=TJTKFDSXgapb2zFN4WzS4ePydA0M0F3UQ+j0dbzHS1Q=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NaDmmUrGsuN6+/FTceZnZveXi0OJRSpLwvSrwmnJRb8jqWkNydLJ9gibE0dS45cBx AbLMBJkXWVdPSbTWJTCajYes9utlZxSdsUKWuMsJoQ1E+aCgAX+AttmrH6DvUwAPUT 298oCYDm9cb7MUaOeseUFGfwLbpO7Err6oO9QoeI= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9H7gd2q025329; Wed, 17 Oct 2018 02:42:39 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 17 Oct 2018 02:42:40 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 17 Oct 2018 02:42:39 -0500 Received: from a0393678ub.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9H7fgSb009413; Wed, 17 Oct 2018 02:42:36 -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 v2 16/21] PCI: keystone: Cleanup set_dbi_mode and get_dbi_mode Date: Wed, 17 Oct 2018 13:11:09 +0530 Message-ID: <20181017074114.28239-17-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181017074114.28239-1-kishon@ti.com> References: <20181017074114.28239-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 3576a184b9eb..2decbaec81a3 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 */ @@ -315,11 +315,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)); } /** @@ -333,11 +334,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)