From patchwork Mon Apr 20 16:26:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Becky Bruce X-Patchwork-Id: 26200 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4772DB6F3A for ; Tue, 21 Apr 2009 02:30:45 +1000 (EST) Received: by ozlabs.org (Postfix) id D9F71DEA7B; Tue, 21 Apr 2009 02:28:13 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id D86A3DE420 for ; Tue, 21 Apr 2009 02:28:13 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E36FADDFEC for ; Tue, 21 Apr 2009 02:27:03 +1000 (EST) Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id n3KGQuN0025296; Mon, 20 Apr 2009 11:26:56 -0500 From: Becky Bruce To: linuxppc-dev@ozlabs.org, fujita.tomonori@lab.ntt.co.jp Subject: [PATCH 3/5] powerpc: make dma_window_* in pci_controller struct avail on 32b Date: Mon, 20 Apr 2009 11:26:48 -0500 Message-Id: <1240244810-32193-6-git-send-email-beckyb@kernel.crashing.org> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1240244810-32193-5-git-send-email-beckyb@kernel.crashing.org> References: <1240244810-32193-1-git-send-email-beckyb@kernel.crashing.org> <1240244810-32193-2-git-send-email-beckyb@kernel.crashing.org> <1240244810-32193-3-git-send-email-beckyb@kernel.crashing.org> <1240244810-32193-4-git-send-email-beckyb@kernel.crashing.org> <1240244810-32193-5-git-send-email-beckyb@kernel.crashing.org> X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Also, convert them to resource_size_t (which is unsigned long on 64-bit, so it's not a change there). We will be using these on fsl 32b to indicate the start and size address of memory that the pci controller can actually reach - this is needed to determine if an address requires bounce buffering. For now, initialize them to a standard value; in the near future, the value will be calculated based on how the inbound windows are programmed. Signed-off-by: Becky Bruce --- arch/powerpc/include/asm/pci-bridge.h | 6 ++++-- arch/powerpc/sysdev/fsl_pci.c | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 84007af..9861258 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -140,10 +140,12 @@ struct pci_controller { struct resource io_resource; struct resource mem_resources[3]; int global_number; /* PCI domain number */ + + resource_size_t dma_window_base_cur; + resource_size_t dma_window_size; + #ifdef CONFIG_PPC64 unsigned long buid; - unsigned long dma_window_base_cur; - unsigned long dma_window_size; void *private_data; #endif /* CONFIG_PPC64 */ diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 78021d8..376603d 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -152,6 +152,10 @@ static void __init setup_pci_atmu(struct pci_controller *hose, out_be32(&pci->piw[2].piwbar,0x00000000); out_be32(&pci->piw[2].piwar, PIWAR_2G); + /* Save the base address and size covered by inbound window mappings */ + hose->dma_window_base_cur = 0x00000000; + hose->dma_window_size = 0x80000000; + iounmap(pci); }