From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932487AbdJYJql convert rfc822-to-8bit (ORCPT ); Wed, 25 Oct 2017 05:46:41 -0400 Received: from smtp-out6.electric.net ([192.162.217.184]:60575 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932461AbdJYJqc (ORCPT ); Wed, 25 Oct 2017 05:46:32 -0400 From: David Laight To: "'Jim Quinlan'" , "linux-kernel@vger.kernel.org" , Catalin Marinas , Will Deacon , Rob Herring , "Brian Norris" , Russell King , Robin Murphy , "Christoph Hellwig" , Florian Fainelli CC: "linux-pci@vger.kernel.org" , "bcm-kernel-feedback-list@broadcom.com" , Gregory Fong , Kevin Cernekee , Bjorn Helgaas , Mark Rutland , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mips@linux-mips.org" , Ralf Baechle Subject: RE: [PATCH 4/8] PCI: host: brcmstb: add dma-ranges for inbound traffic Thread-Topic: [PATCH 4/8] PCI: host: brcmstb: add dma-ranges for inbound traffic Thread-Index: AQHTTPRYSkHj8Xy2DUGl7qQXwervlqL0UKUQ Date: Wed, 25 Oct 2017 09:46:45 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD00A252D@AcuExch.aculab.com> References: <1508868949-16652-1-git-send-email-jim2101024@gmail.com> <1508868949-16652-5-git-send-email-jim2101024@gmail.com> In-Reply-To: <1508868949-16652-5-git-send-email-jim2101024@gmail.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jim Quinlan > Sent: 24 October 2017 19:16 > The Broadcom STB PCIe host controller is intimately related to the > memory subsystem. This close relationship adds complexity to how cpu > system memory is mapped to PCIe memory. Ideally, this mapping is an > identity mapping, or an identity mapping off by a constant. Not so in > this case. > > Consider the Broadcom reference board BCM97445LCC_4X8 which has 6 GB > of system memory. Here is how the PCIe controller maps the > system memory to PCIe memory: > > memc0-a@[ 0....3fffffff] <=> pci@[ 0....3fffffff] > memc0-b@[100000000...13fffffff] <=> pci@[ 40000000....7fffffff] > memc1-a@[ 40000000....7fffffff] <=> pci@[ 80000000....bfffffff] > memc1-b@[300000000...33fffffff] <=> pci@[ c0000000....ffffffff] > memc2-a@[ 80000000....bfffffff] <=> pci@[100000000...13fffffff] > memc2-b@[c00000000...c3fffffff] <=> pci@[140000000...17fffffff] I presume the first column is the 'cpu physical address' and the second the 'pci' address? ... Isn't this just the same as having an iommu that converts 'bus' addresses into 'physical' ones? A simple table lookup of the high address bits will do the conversion. David