- Jul 25, 2008
-
-
Robert Jennings authored
To support Cooperative Memory Overcommitment (CMO), we need to check for failure from some of the tce hcalls. These changes for the pseries platform affect the powerpc architecture; patches for the other affected platforms are included in this patch. pSeries platform IOMMU code changes: * platform TCE functions must handle H_NOT_ENOUGH_RESOURCES errors and return an error. Architecture IOMMU code changes: * Calls to ppc_md.tce_build need to check return values and return DMA_MAPPING_ERROR for transient errors. Architecture changes: * struct machdep_calls for tce_build*_pSeriesLP functions need to change to indicate failure. * all other platforms will need updates to iommu functions to match the new calling semantics; they will return 0 on success. The other platforms default configs have been built, but no further testing was performed. Signed-off-by:
Robert Jennings <rcj@linux.vnet.ibm.com> Acked-by:
Olof Johansson <olof@lixom.net> Acked-by:
Paul Mackerras <paulus@samba.org> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
Mark Nelson authored
At the moment the fixed mapping is by default strongly ordered (the iommu_fixed=weak boot option must be used to make the fixed mapping weakly ordered). If we're on a setup where the southbridge is being used in endpoint mode (triblade and CAB boards) the default should be a weakly ordered fixed mapping. This adds a check so that if a node of type pcie-endpoint can be found in the device tree the fixed mapping is set to be weak by default (but can be overridden using iommu_fixed=strong). Signed-off-by:
Mark Nelson <markn@au1.ibm.com> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
- Jul 22, 2008
-
-
Mark Nelson authored
Introduce a new dma attriblue DMA_ATTR_WEAK_ORDERING to use weak ordering on DMA mappings in the Cell processor. Add the code to the Cell's IOMMU implementation to use this code. Dynamic mappings can be weakly or strongly ordered on an individual basis but the fixed mapping has to be either completely strong or completely weak. This is currently decided by a kernel boot option (pass iommu_fixed=weak for a weakly ordered fixed linear mapping, strongly ordered is the default). Signed-off-by:
Mark Nelson <markn@au1.ibm.com> Signed-off-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
Mark Nelson authored
Update iommu_alloc() to take the struct dma_attrs and pass them on to tce_build(). This change propagates down to the tce_build functions of all the platforms. Signed-off-by:
Mark Nelson <markn@au1.ibm.com> Signed-off-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
- Jul 09, 2008
-
-
Mark Nelson authored
Make cell_dma_dev_setup_iommu() return a pointer to the struct iommu_table (or NULL if no table can be found) rather than putting this pointer into dev->archdata.dma_data (let the caller do that), and rename this function to cell_get_iommu_table() to reflect this change. This will allow us to get the iommu table for a device that doesn't have the table in the archdata. Signed-off-by:
Mark Nelson <markn@au1.ibm.com> Signed-off-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
- Apr 01, 2008
-
-
Harvey Harrison authored
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by:
Harvey Harrison <harvey.harrison@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Mar 19, 2008
-
-
Michael Ellerman authored
The cell IOMMU code to parse the dma-ranges properties, used for the fixed mapping, was broken in two ways for some devices. Firstly it didn't cope with empty dma-ranges properties. An empty property implies no translation so can be safely skipped. The code also wrongly assumed it would be looking at PCI devices, and hard coded the number of address and size cells. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Mar 03, 2008
-
-
Michael Ellerman authored
The only tricky part is we need to adjust the PTE insertion loop to cater for holes in the page table. The PTEs for each segment start on a 4K boundary, so with 16M pages we have 16 PTEs per segment and then a gap to the next 4K page boundary. It might be possible to allocate the PTEs for each segment separately, saving the memory currently filling the gaps. However we'd need to check that's OK with the hardware, and that it actually saves memory. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
Michael Ellerman authored
Make some preliminary changes to cell_iommu_alloc_ptab() to allow it to take the page size as a parameter rather than assuming IOMMU_PAGE_SIZE. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
Michael Ellerman authored
We use n_pte_pages to calculate the stride through the page tables, but we also use it to set the NPPT value in the segment table entry. That is defined as the number of 4K pages per segment, so we should calculate it as such regardless of the IOMMU page size. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
Michael Ellerman authored
Currently the cell IOMMU code allocates the entire IOMMU page table in a contiguous chunk. This is nice and tidy, but for machines with larger amounts of RAM the page table allocation can fail due to it simply being too large. So split the segment table and page table setup routine, and arrange to have the dynamic and fixed page tables allocated separately. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
Michael Ellerman authored
There's no need to allocate the pad page unless we're going to actually use it - so move the allocation to where we know we're going to use it. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
Michael Ellerman authored
The cell IOMMU code no longer needs to save the pte_offset variable separately, it is incorporated into tbl->it_offset. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
Michael Ellerman authored
The cell IOMMU tce build and free routines use pte_offset to convert the index passed from the generic IOMMU code into a page table offset. This takes into account the SPIDER_DMA_OFFSET which sets the top bit of every DMA address. However it doesn't cater for the IOMMU window starting at a non-zero address, as the base of the window is not incorporated into pte_offset at all. As it turns out tbl->it_offset already contains the value we need, it takes into account the base of the window and also pte_offset. So use it instead! Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
Michael Ellerman authored
It's called the fixed mapping, not the static mapping. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
- Feb 14, 2008
-
-
David S. Miller authored
Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Feb 08, 2008
-
-
Michael Ellerman authored
Currently the cell IOMMU fixed mapping just printks that it's been setup, which is not particularly useful. Much more interesting is the address ranges for the different windows. This adds one line to dmesg on a blade. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
If we get a 64-bit dma mask we switch to the fixed ops and call cell_dma_dev_setup(). If the driver then switches back to a 32-bit dma mask for any reason we don't call cell_dma_dev_setup() again, which has the potential to leave bogus data in dev->archdata.dma_data. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
In order for the cell IOMMU fixed mapping to work we need "dma-ranges" properties in the device tree. If there are none then there's no point enabling the fixed mapping support. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
The cell IOMMU fixed mapping support has a null pointer bug if you run it on older firmwares that don't contain the "dma-ranges" properties. Fix it and convert to using of_get_next_parent() while we're there. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Jan 31, 2008
-
-
Michael Ellerman authored
This patch adds support for setting up a fixed IOMMU mapping on certain cell machines. For 64-bit devices this avoids the performance overhead of mapping and unmapping pages at runtime. 32-bit devices are unable to use the fixed mapping. The fixed mapping is established at boot, and maps all of physical memory 1:1 into device space at some offset. On machines with < 30 GB of memory we setup the fixed mapping immediately above the normal IOMMU window. For example a machine with 4GB of memory would end up with the normal IOMMU window from 0-2GB and the fixed mapping window from 2GB to 6GB. In this case a 64-bit device wishing to DMA to 1GB would be told to DMA to 3GB, plus any offset required by firmware. The firmware offset is encoded in the "dma-ranges" property. On machines with 30GB or more of memory, we are unable to place the fixed mapping above the normal IOMMU window as we would run out of address space. Instead we move the normal IOMMU window to coincide with the hash page table, this region does not need to be part of the fixed mapping as no device should ever be DMA'ing to it. We then setup the fixed mapping from 0 to 32GB. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
Split out the ioid fetching and checking logic so we can use it elsewhere in a subsequent patch. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
Add support to cell_iommu_setup_page_tables() for handling two windows, the dynamic window and the fixed window. A fixed window size of 0 indicates that there is no fixed window at all. Currently there are no callers who pass a non-zero fixed window, but the upcoming fixed IOMMU mapping patch will change that. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
Split the IOMMU logic out from cell_dma_dev_setup() into a separate function. If we're not using dma_direct_ops or dma_iommu_ops we don't know what the hell's going on, so BUG. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
Split cell_iommu_setup_hardware() into two parts. Split the page table setup into cell_iommu_setup_page_tables() and the bits that kick the hardware into cell_iommu_enable_hardware(). Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
Split out the logic that allocates a struct iommu into a separate function. This can fail however the calling code has never cared - so just return if we can't allocate an iommu. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Jan 25, 2008
-
-
Michael Ellerman authored
Currently the IOMMU code allocates one page for the segment table, that isn't safe if we have more than 132 GB of RAM. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Acked-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
Rather than using the global variable, have cell use its own variable to store the direct DMA offset. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Acked-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Michael Ellerman authored
Store the direct_dma_offset in each device's dma_data in the case where we're using the direct DMA ops. We need to make sure we setup the ppc_md.pci_dma_dev_setup() callback if we're using a non-zero offset. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Acked-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Jan 17, 2008
-
-
Grant Likely authored
Signed-off-by:
Grant Likely <grant.likely@secretlab.ca> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Dec 20, 2007
-
-
Ishizaki Kou authored
This splits the machine definition for celleb into two definitions, one for celleb_beat, and the other for celleb_native. Though this looks complex because of sorting some functions, there are no more semantic changes than that for the splitting. Signed-off-by:
Kou Ishizaki <Kou.Ishizaki@toshiba.co.jp> Acked-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Dec 19, 2007
-
-
Jon Loeliger authored
Signed-off-by:
Jon Loeliger <jdl@freescale.com> Acked-by:
Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
- Dec 11, 2007
-
-
Ishizaki Kou authored
This adds support for native CBE on Celleb, that is, without the BEAT hypervisor. Many codes in platforms/cell/ are used in native CBE environment. Signed-off-by:
Kou Ishizaki <Kou.Ishizaki@toshiba.co.jp> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Oct 09, 2007
-
-
Benjamin Herrenschmidt authored
The new Cell EDAC driver needs that file, oprofile also does ugly path tricks to get to it, it's time to move it to asm-powerpc. While at it, rename it to be consistent with cell-pmu.h (and dashes look nicer than underscores anyway). Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Apr 12, 2007
-
-
Stephen Rothwell authored
Signed-off-by:
Stephen Rothwell <sfr@canb.auug.org.au> Acked-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Mar 09, 2007
-
-
Stephen Rothwell authored
This allows us to hide pci_dma_ops. Signed-off-by:
Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Stephen Rothwell authored
This will allow us to build without PCI easier. Signed-off-by:
Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Feb 09, 2007
-
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Dec 04, 2006
-
-
Jeremy Kerr authored
This patch adds full cell iommu support (and iommu disabled mode). It implements mapping/unmapping of iommu pages on demand using the standard powerpc iommu framework. It also supports running with iommu disabled for machines with less than 2GB of memory. (The default is off in that case, though it can be forced on with the kernel command line option iommu=force). Signed-off-by:
Jeremy Kerr <jk@ozlabs.org> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
Benjamin Herrenschmidt authored
Now that the direct DMA ops supports an offset, we use that instead of defining our own. Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-