From patchwork Fri Oct 28 05:52:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongtao Jia X-Patchwork-Id: 122370 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 C4DE5B70BC for ; Fri, 28 Oct 2011 20:30:18 +1100 (EST) Received: from DB3EHSOBE003.bigfish.com (db3ehsobe003.messaging.microsoft.com [213.199.154.141]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 6CFA11007DB for ; Fri, 28 Oct 2011 18:04:12 +1100 (EST) Received: from mail102-db3-R.bigfish.com (10.3.81.241) by DB3EHSOBE003.bigfish.com (10.3.84.23) with Microsoft SMTP Server id 14.1.225.22; Fri, 28 Oct 2011 07:03:57 +0000 Received: from mail102-db3 (localhost.localdomain [127.0.0.1]) by mail102-db3-R.bigfish.com (Postfix) with ESMTP id C30175400CF for ; Fri, 28 Oct 2011 07:04:01 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-SS: 0,13, Received: from mail102-db3 (localhost.localdomain [127.0.0.1]) by mail102-db3 (MessageSwitch) id 1319785441658140_27506; Fri, 28 Oct 2011 07:04:01 +0000 (UTC) Received: from DB3EHSMHS016.bigfish.com (unknown [10.3.81.244]) by mail102-db3.bigfish.com (Postfix) with ESMTP id 9B86217C0050 for ; Fri, 28 Oct 2011 07:04:01 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS016.bigfish.com (10.3.87.116) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 28 Oct 2011 07:03:56 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.339.2; Fri, 28 Oct 2011 02:03:54 -0500 Received: from rock.ap.freescale.net (rock.ap.freescale.net [10.193.20.106]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p9S73qTu028017; Fri, 28 Oct 2011 02:03:53 -0500 (CDT) From: Jia Hongtao To: Subject: [PATCH SDK1.1 ] Do not hide resource for pci/pcie when configured as Agent/EP Date: Fri, 28 Oct 2011 13:52:18 +0800 Message-ID: <1319781138-16051-1-git-send-email-B38951@freescale.com> X-Mailer: git-send-email 1.7.5.1 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Mailman-Approved-At: Fri, 28 Oct 2011 20:30:11 +1100 Cc: B11780@freescale.com, b38951@freescale.com X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 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-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org From: Jason Jin Current pci/pcie init code will hide the pci/pcie host resource. But did not judge it is host/RC or agent/EP. If configured as agent/EP, we should avoid hiding its resource in the host side. In PCI system, the Programing Interface can be used to judge the host/agent status: Programing Interface = 0: host Programing Interface = 1: Agent In PCIE system, both the Programing Interface and Header type can be used to judge the RC/EP status. Header Type = 0: EP Header Type = 1: RC Signed-off-by: Jason Jin Signed-off-by: Mingkai Hu Signed-off-by: Jia Hongtao Signed-off-by: Li Yang --- arch/powerpc/kernel/pci-common.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 4f134132c..bc61a69 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -1732,10 +1732,13 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose) static void fixup_hide_host_resource_fsl(struct pci_dev *dev) { int i, class = dev->class >> 8; + /* When configured as agent, programing interface = 1 */ + int prog_if = dev->class & 0xf; if ((class == PCI_CLASS_PROCESSOR_POWERPC || class == PCI_CLASS_BRIDGE_OTHER) && (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) && + (prog_if == 0) && (dev->bus->parent == NULL)) { for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { dev->resource[i].start = 0;