From patchwork Tue Jun 4 13:14:59 2019 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: 165779 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5843924ili; Tue, 4 Jun 2019 06:18:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9C7OD5wNqq4ou2rDijx+Akdb+n89tyWDpCG2oV5vdKGovx5prmJmG0C8y99yMuxrqueMR X-Received: by 2002:a65:5203:: with SMTP id o3mr35002366pgp.379.1559654329329; Tue, 04 Jun 2019 06:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559654329; cv=none; d=google.com; s=arc-20160816; b=s1RQOGxthHI1XE9tJzAlqd8Ry/q7z/bvUre1cU8rAKzCCwjxidijs6BmUCXsPsd2sc 7wvu1W9wDOPIMdsNJnMjx/6LEtyrW/9M1EOT3VrNe7/mUMye4pYRBLwCZ3QrjK2rsiuR LKNuEnrNtcbPANrelcz1btBfzFHFHsgJ9l9Ac5wpgtbcD9CGgNlK3IPCaBqRiVyH0VRr y6K55xXqT6OZ8cg7tsjFv/6zvndUAa7QQ0eHH9YlLWscwm5ga9ii6WSwOuvR6dcuTbED Gk7BHKAxav6C+JvR0aKoOEzNEtM4+XqbXy/UA9jnkBlqu+SgG5exsSYd2Ewju8RbHw2I OWYg== 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=hQ9HPR/YNox9fBqati4GtPS+LZvZ2MYHAw9Ko10HNPY=; b=U17sIjP2wU1rkfIlGIFLcNPrnsQhz8iTDt13+sKqWbd9IqN/ttGQxsBDmvCjRluxyt /crqtIZgBy0NSN0lqSfMyS8rQwnSI3zG90ptsLRxKDe9RbDsZDDA3ctpfWlvW84IlQM3 NY8eC+kwo59ZFdwKvn8AkUb8gVDy3BHEbamvtijEav7sWTJTtUvX1fMizQLmJQELtb5c AQJFVq60L6KzYP46HpLO+F0UpfzgJvH8v7kI+Z91A5rzqcthRZMEcQ1jP41mi0Xwm/ER xWiEAPDWarUK14pRRWRNXfcdzTjI9Vu4eMOesANUM/Rwr1iBX3yEQ3xhXeHnx7JPgSmV WHXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=k8e6kTrr; 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 s17si10657627pfc.237.2019.06.04.06.18.48; Tue, 04 Jun 2019 06:18: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=k8e6kTrr; 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 S1727828AbfFDNSs (ORCPT + 30 others); Tue, 4 Jun 2019 09:18:48 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:50526 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727182AbfFDNSp (ORCPT ); Tue, 4 Jun 2019 09:18:45 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x54DHvTf082410; Tue, 4 Jun 2019 08:17:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559654277; bh=hQ9HPR/YNox9fBqati4GtPS+LZvZ2MYHAw9Ko10HNPY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=k8e6kTrrmF72/kBZGQIod8qTZwihPV4aZ7b6UParflsTqEHLhIBBgqfKgXbiSKFfT /2nMeOosqgIMPvkzcYTcW/rWAfjjpkmYtSt1+zNJ+EQ2m0uBvLHNU0PvwdaklQMnxG VR4Y7UOIGYZdHCVyepenhJQNIhP+ZJJlHm9Rf7v4= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x54DHvkL001773 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 4 Jun 2019 08:17:57 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 4 Jun 2019 08:17:57 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) 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.1713.5 via Frontend Transport; Tue, 4 Jun 2019 08:17:57 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x54DGdGT098972; Tue, 4 Jun 2019 08:17:52 -0500 From: Kishon Vijay Abraham I To: Tom Joseph , Bjorn Helgaas , Rob Herring , Mark Rutland , Lorenzo Pieralisi , Arnd Bergmann , Gustavo Pimentel CC: Greg Kroah-Hartman , Frank Rowand , Jingoo Han , , , , , , , Kishon Vijay Abraham I Subject: [RFC PATCH 13/30] PCI: cadence: Use local management register to configure Vendor ID Date: Tue, 4 Jun 2019 18:44:59 +0530 Message-ID: <20190604131516.13596-14-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604131516.13596-1-kishon@ti.com> References: <20190604131516.13596-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 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. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/pcie-cadence-host.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/pci/controller/pcie-cadence-host.c b/drivers/pci/controller/pcie-cadence-host.c index 14a54f6a11de..dcecf47805ad 100644 --- a/drivers/pci/controller/pcie-cadence-host.c +++ b/drivers/pci/controller/pcie-cadence-host.c @@ -148,6 +148,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: @@ -167,8 +168,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);