From patchwork Wed Jul 22 11:03:11 2020 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: 247003 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp427335ilg; Wed, 22 Jul 2020 04:04:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXC8hTopN909LOnF+SY2XQS7/fcv+dt12p17BVtMceFuMInOOn+pdEPxh8vj1dLPW8RbKw X-Received: by 2002:a17:906:7855:: with SMTP id p21mr29607565ejm.492.1595415852387; Wed, 22 Jul 2020 04:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595415852; cv=none; d=google.com; s=arc-20160816; b=H/Ywgdg8wj47SniELYm1IlT1PTn4DjDzl1XP85TtupITEpcIxTto3dw7PUJJ/+KKo7 g1PUQx7V+jvrCidmdCWfgR+oThSOpcmAGOzMrly8G3V8jBCi6m04CIUTYhg1hh7PLwT9 KFvbiUmWLNJxq72d7k4EPYLFMSHlhln59GB2bmO7zSixq4jXH8Qd3ZWztsXoE1Q6uGxh fgdlp473pxW4cVS2ojJZXWNhom0VAj6vFmlAbQojITy7TDyDl3cLIkFy32j0nMBRFG3e 9M/M+yxAXnbVyFzH9dGH3drFEI/0bgwnwxj4cMbln/s0eZv8+k9nKs9S4O3Q+wN30H4j A+JA== 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=oDHixXQpSiTZez44a8+8lE4nJpgDYDjM303UR0TQSis=; b=e1oOPPV+XpoIkpD+18D/jDZ2NEiKJ91/d4Jgn3QaLwhfRDEPpoBDyM5+rsvhGjLcsu e3H9DhOEJXi1XuuPDDnPE6FEjrRE+PmkDoON5chiEgcmi1P+prvi5b7wZaUGhmGaZ0it RmhG3p7571A89MnEH4C1Rs1rVlTNMG4VoL4idNYBw7X2O4aFq9MY1wh6ePHX8AQLCUYL xaXLTz53PMvzKurzIXcv8fq+FlzMO3DpBIKxfCOEdYUFJKVXAaELw5llj5WEjxyZ92TB ZIfABvlQ2PKZ/ikosiEkkBeB+/YL9Ny7rTndrfjUk8bld34HpFNGOFx2jvQCFfhqOYQQ uj8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=PthZYZz4; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-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. [23.128.96.18]) by mx.google.com with ESMTP id bv17si13446278ejb.263.2020.07.22.04.04.12; Wed, 22 Jul 2020 04:04:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=PthZYZz4; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-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 S1732166AbgGVLEL (ORCPT + 4 others); Wed, 22 Jul 2020 07:04:11 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:56282 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726462AbgGVLEK (ORCPT ); Wed, 22 Jul 2020 07:04:10 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 06MB3wtr072627; Wed, 22 Jul 2020 06:03:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1595415838; bh=oDHixXQpSiTZez44a8+8lE4nJpgDYDjM303UR0TQSis=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=PthZYZz4663EZg3MgdClyUesNmv2la6ijyyHyrbUJkIatw7U0lMFOc/5NPpWG3UKA THlBMUhmHPz0Y+/BxF2WMi9J4YYfr833HxcDHHPUC7oX1wZNNg6vdkCBwdBpmaStke A007rbEuOe+CgjeqbbBUQsS7xcuU+U4wMtpZOr+Y= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 06MB3wnM020133 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 22 Jul 2020 06:03:58 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 22 Jul 2020 06:03:57 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 22 Jul 2020 06:03:57 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 06MB3IFh078616; Wed, 22 Jul 2020 06:03:54 -0500 From: Kishon Vijay Abraham I To: Tom Joseph , Bjorn Helgaas , Rob Herring , Kishon Vijay Abraham I , Lorenzo Pieralisi , Arnd Bergmann CC: Greg Kroah-Hartman , , , , , Subject: [PATCH v8 09/15] PCI: cadence: Fix updating Vendor ID and Subsystem Vendor ID register Date: Wed, 22 Jul 2020 16:33:11 +0530 Message-ID: <20200722110317.4744-10-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200722110317.4744-1-kishon@ti.com> References: <20200722110317.4744-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Commit 1b79c5284439 ("PCI: cadence: Add host driver for Cadence PCIe controller") in order to update Vendor ID, directly wrote to PCI_VENDOR_ID register. However PCI_VENDOR_ID in root port configuration space is read-only register and writing to it will have no effect. Use local management register to configure Vendor ID and Subsystem Vendor ID. Fixes: 1b79c5284439 ("PCI: cadence: Add host driver for Cadence PCIe controller") Reviewed-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/cadence/pcie-cadence-host.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c index 10127ea71b83..8935f7a37e5a 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-host.c +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c @@ -82,6 +82,7 @@ static int cdns_pcie_host_init_root_port(struct cdns_pcie_rc *rc) { struct cdns_pcie *pcie = &rc->pcie; u32 value, ctrl; + u32 id; /* * Set the root complex BAR configuration register: @@ -101,8 +102,12 @@ static int cdns_pcie_host_init_root_port(struct cdns_pcie_rc *rc) cdns_pcie_writel(pcie, CDNS_PCIE_LM_RC_BAR_CFG, value); /* Set root port configuration space */ - if (rc->vendor_id != 0xffff) - cdns_pcie_rp_writew(pcie, PCI_VENDOR_ID, rc->vendor_id); + if (rc->vendor_id != 0xffff) { + id = CDNS_PCIE_LM_ID_VENDOR(rc->vendor_id) | + CDNS_PCIE_LM_ID_SUBSYS(rc->vendor_id); + cdns_pcie_writel(pcie, CDNS_PCIE_LM_ID, id); + } + if (rc->device_id != 0xffff) cdns_pcie_rp_writew(pcie, PCI_DEVICE_ID, rc->device_id);