Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp417527ybh; Wed, 22 Jul 2020 04:05:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywa+dCRuoUpt8u/uNMtbyWrlfMXRumjo75gy9gAkCGWuA7X+MUX2uMKsupaBdBHXUPMEb8 X-Received: by 2002:aa7:db11:: with SMTP id t17mr28942106eds.365.1595415920064; Wed, 22 Jul 2020 04:05:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595415920; cv=none; d=google.com; s=arc-20160816; b=yTDPyScEtkS3c4/fbMNCMR2PDLOhzrEkzN/3Mamr8VKPvGNCcYjXticf0MnOeYW2Ir SW2ZSLwqtLQYyMGQIsCYftyWfYqQxkjqMiCPuC+/2qjSlSW1gGvp3mal3XVt0oiVM7L3 itZaqvO68KKdP47OUPM3/EKhjcc0BXAC5T4P7NV/41F93Ecgni+qtjnpy6Ogaj4trH/K s/po7pm3GVxr46W7vQNm3+3tTf6L72sjqaQch2JRDQN9n0getEy/+IDPMQwKdeIUFrK1 MwOyMimReVLpVcyCBh+gotoxW64i177tz7xBP5Ex7hMVGcSVej2Ff/tk21CxbIbUsWM7 nDvQ== 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=S+aq7SzITJmm0aIfI/taPm8kc4pDFp65TESuHqdi6WCp4teC2RukeVAYQQcC6CNGzG zj1ACJNFTdJ0gLXsN1M4WFkzOVShkOkaAeKH7WvB75dnAfSiPrU2zMT8pYzYewzg5TU5 n4iA5x7RF9Vd7Z6qrRd/3Rtsm0utALwY8uRo9g/FSmRAehE5OQazIR53nhm/ed2RoL/m YIasQgNjcWZyi1kx7OkxbiEf9GJDQZ965rdChDXPcGD9tn25DPnFvA0BBmMHM01l5y35 /T6505sljD5l/Gv6F++inLi8Gs9W1NNtymi89ACwZwDAtL2Rs6MzK1rbKexAGv38sF4u +EBg== 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-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id t14si14426021ejb.435.2020.07.22.04.04.54; Wed, 22 Jul 2020 04:05:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1732189AbgGVLEN (ORCPT + 99 others); Wed, 22 Jul 2020 07:04:13 -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 Content-Type: text/plain 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 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(-) 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); -- 2.17.1