From patchwork Mon Sep 3 09:22:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zang Roy-R61911 X-Patchwork-Id: 181316 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 3DE892C00A5 for ; Mon, 3 Sep 2012 18:22:51 +1000 (EST) Received: from db3outboundpool.messaging.microsoft.com (db3ehsobe002.messaging.microsoft.com [213.199.154.140]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8C2CD2C039A for ; Mon, 3 Sep 2012 18:22:19 +1000 (EST) Received: from mail13-db3-R.bigfish.com (10.3.81.227) by DB3EHSOBE005.bigfish.com (10.3.84.25) with Microsoft SMTP Server id 14.1.225.23; Mon, 3 Sep 2012 08:22:12 +0000 Received: from mail13-db3 (localhost [127.0.0.1]) by mail13-db3-R.bigfish.com (Postfix) with ESMTP id 8024C300292; Mon, 3 Sep 2012 08:22:12 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839hd24he5bhf0ah107ah1155h) Received: from mail13-db3 (localhost.localdomain [127.0.0.1]) by mail13-db3 (MessageSwitch) id 134666053121494_27338; Mon, 3 Sep 2012 08:22:11 +0000 (UTC) Received: from DB3EHSMHS003.bigfish.com (unknown [10.3.81.251]) by mail13-db3.bigfish.com (Postfix) with ESMTP id F055F26004E; Mon, 3 Sep 2012 08:22:10 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS003.bigfish.com (10.3.87.103) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 3 Sep 2012 08:22:09 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.2.309.3; Mon, 3 Sep 2012 03:22:07 -0500 Received: from royamd64.ap.freescale.net (royamd64.ap.freescale.net [10.193.20.39]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id q838Lcdv028380; Mon, 3 Sep 2012 01:22:05 -0700 From: Roy Zang To: Subject: [PATCH 2/2] powerpc/pci: Use PCIe IP block revision register instead of compatible Date: Mon, 3 Sep 2012 17:22:10 +0800 Message-ID: <1346664130-7896-2-git-send-email-tie-fei.zang@freescale.com> X-Mailer: git-send-email 1.7.8.1 In-Reply-To: <1346664130-7896-1-git-send-email-tie-fei.zang@freescale.com> References: <1346664130-7896-1-git-send-email-tie-fei.zang@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Freescale PCIe IP block revision bigger than rev2.2 will also need redefine the sequence of inbound windows. So change to use IP block revision instead of compatible for the judgment. Signed-off-by: Roy Zang --- arch/powerpc/sysdev/fsl_pci.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index a7b2a60..bce48e6 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -143,18 +143,20 @@ static void __init setup_pci_atmu(struct pci_controller *hose, pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", (u64)rsrc->start, (u64)resource_size(rsrc)); - if (of_device_is_compatible(hose->dn, "fsl,qoriq-pcie-v2.2")) { - win_idx = 2; - start_idx = 0; - end_idx = 3; - } - pci = ioremap(rsrc->start, resource_size(rsrc)); if (!pci) { dev_err(hose->parent, "Unable to map ATMU registers\n"); return; } + if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) { + if (in_be32(&pci->block_rev1) >= PCIE_IP_REV_2_2) { + win_idx = 2; + start_idx = 0; + end_idx = 3; + } + } + /* Disable all windows (except powar0 since it's ignored) */ for(i = 1; i < 5; i++) out_be32(&pci->pow[i].powar, 0);