From patchwork Mon Dec 9 09:21:42 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: 180998 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4098100ile; Mon, 9 Dec 2019 01:21:23 -0800 (PST) X-Google-Smtp-Source: APXvYqy810xZaUfTl48DF++0MHBYjARkDqJW2ALemKjyh0Sq7GBdkArRS2KOPXJOH95S6KHkk6WW X-Received: by 2002:aca:5708:: with SMTP id l8mr20890937oib.162.1575883283086; Mon, 09 Dec 2019 01:21:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575883283; cv=none; d=google.com; s=arc-20160816; b=i+WQfbPnvV2IW87vHa8VqU0zGV+sAcnnmpRQH2eFVs6iE4Yvceiy+kRtLKIF4LJWzK VjYN1eZGwNdn3WBNNpUujam8A+dH1ubGD9d6dYP38RZasNcbEbB7+ubWAcB+bn8z7IDV NdEQyM9ttX8hRdJOkHvAEjxPC0QfcjgGMoyVBOf4EnSYrko0AEhzmw4NRAjRSyUnMiOV 2HJApGx1ur1YdmMcWQ38YSV3WJltPoZ6sb6OOoxcQTRXe9IwTwI4hzRJh2DD+h8AEF0M DXIZN9IzH3tPk7dFjJd8jFr5g6b6aqAPlC27Fsk53PsZZ4wvzGIYBENW9WQre774BNQb Orjg== 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=/PpQ+RidTBHG04c4iEDkQBvUqEr7xWf2hoOmAhrMbcg=; b=YzuZCWw95fEJi4+lwuxiSjwMwmZSxCBjHuiw+LomZumrB+O48BaKyGsrNrWs6cNdQH QhMWRNpxIKYGv3rNyMAoCz6nDLSyavo6fR6rbxkweG3etGXXawECnLoKmvRiDxbmmwWw 5vHyj9z6ptA3DTXU2HDpTfksia82DRy4pAsfiPx/QPuxenG2a42bYPwL6430HTtiKVNX +DURL7OQQ6c9PEcbAsyiti9jaerk7ZINXUMiYPGmjkqChUIFM8O9sap1ZZURS20d1NcX IKEl8PpKTa5NOTR8w1wDblY9w11Vq7pZBNWsh9teCWT1iTEp3TF3mqGivyvuHBxo5Ufe evow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kPXOQTQe; 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 x7si11420552oia.165.2019.12.09.01.21.22; Mon, 09 Dec 2019 01:21:23 -0800 (PST) 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=kPXOQTQe; 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 S1727669AbfLIJVW (ORCPT + 27 others); Mon, 9 Dec 2019 04:21:22 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:49940 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727645AbfLIJVS (ORCPT ); Mon, 9 Dec 2019 04:21:18 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xB99L9pp080936; Mon, 9 Dec 2019 03:21:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1575883269; bh=/PpQ+RidTBHG04c4iEDkQBvUqEr7xWf2hoOmAhrMbcg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kPXOQTQevNFekDH7vNn15mo/bcHWWNTdezF7k/Ir2ORXjFHIyA3f2I3fbxKVpFTl5 0NxbyBBGgS7P/szYecTWRQsiG09e+JuPucP6RWxyFVAYPGEGxMsJcKAKrCEOaAoESd VF2h2AsSmfNJ48zMUwO11INHcOJyOjDfAPcY/Wi8= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xB99L9s6005863 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Dec 2019 03:21:09 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 9 Dec 2019 03:21:08 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 9 Dec 2019 03:21:08 -0600 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 xB99Kcd6087697; Mon, 9 Dec 2019 03:21:06 -0600 From: Kishon Vijay Abraham I To: Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , Arnd Bergmann , Andrew Murray CC: , , , , Kishon Vijay Abraham I Subject: [PATCH 08/13] PCI: cadence: Use local management register to configure Vendor ID Date: Mon, 9 Dec 2019 14:51:42 +0530 Message-ID: <20191209092147.22901-9-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191209092147.22901-1-kishon@ti.com> References: <20191209092147.22901-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/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 cf817be237af..afb2c96a6538 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-host.c +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c @@ -71,6 +71,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: @@ -90,8 +91,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);