[PATCH v7 2/3] PCI: Add support for PCI inbound windows resources

2017-05-22 Thread Oza Pawandeep via iommu
This patch adds support for inbound memory window for PCI RC drivers. It defines new function pci_create_root_bus2 which takes inbound resources as an argument and fills in the memory resource to PCI internal host bridge structure as inbound_windows. Legacy RC driver could continue to use pci_cre

[PATCH v7 0/3] PCI/IOMMU: Reserve IOVAs for PCI inbound memory

2017-05-22 Thread Oza Pawandeep via iommu
iproc based PCI RC and Stingray SOC has limitaiton of addressing only 512GB memory at once. IOVA allocation honors device's coherent_dma_mask/dma_mask. In PCI case, current code honors DMA mask set by EP, there is no concept of PCI host bridge dma-mask, should be there and hence could truly refle

[PATCH v7 3/3] IOMMU/PCI: Reserve IOVA for inbound memory for PCI masters

2017-05-22 Thread Oza Pawandeep via iommu
This patch reserves the inbound memory holes for PCI masters. ARM64 based SOCs may have scattered memory banks. For e.g as iproc based SOC has <0x 0x8000 0x0 0x8000>, /* 2G @ 2G */ <0x0008 0x8000 0x3 0x8000>, /* 14G @ 34G */ <0x0090 0x 0x4 0x>, /* 16

[PATCH v7 1/3] OF/PCI: Export inbound memory interface to PCI RC drivers.

2017-05-22 Thread Oza Pawandeep via iommu
The patch exports interface to PCIe RC drivers so that, Drivers can get their inbound memory configuration. It provides basis for IOVA reservations for inbound memory holes, if RC is not capable of addressing all the host memory, Specifically when IOMMU is enabled and on ARMv8 where 64bit IOVA cou

[PATCH v6 2/3] iommu/pci: reserve IOVA for PCI masters

2017-05-15 Thread Oza Pawandeep via iommu
this patch reserves the IOVA for PCI masters. ARM64 based SOCs may have scattered memory banks. such as iproc based SOC has <0x 0x8000 0x0 0x8000>, /* 2G @ 2G */ <0x0008 0x8000 0x3 0x8000>, /* 14G @ 34G */ <0x0090 0x 0x4 0x>, /* 16G @ 576G */ <0x

[PATCH v6 3/3] PCI/of fix of_dma_get_range; get PCI specific dma-ranges

2017-05-15 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v6 1/3] of/pci/dma: fix DMA configuration for PCI masters

2017-05-15 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v6 0/3] OF/PCI address PCI inbound memory limitations

2017-05-15 Thread Oza Pawandeep via iommu
It is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. This is particularly problematic on ARM/ARM64 SOCs where the IOMMU (i.e. SMMU) trans

[PATCH v5 3/3] PCI/of fix of_dma_get_range; get PCI specific dma-ranges

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v5 2/3] iommu/pci: reserve IOVA for PCI masters

2017-05-05 Thread Oza Pawandeep via iommu
this patch reserves the IOVA for PCI masters. ARM64 based SOCs may have scattered memory banks. such as iproc based SOC has <0x 0x8000 0x0 0x8000>, /* 2G @ 2G */ <0x0008 0x8000 0x3 0x8000>, /* 14G @ 34G */ <0x0090 0x 0x4 0x>, /* 16G @ 576G */ <0x

[PATCH v5 0/3] OF/PCI address PCI inbound memory limitations

2017-05-05 Thread Oza Pawandeep via iommu
It is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. This is particularly problematic on ARM/ARM64 SOCs where the IOMMU (i.e. SMMU) trans

[PATCH v5 1/3] of/pci/dma: fix DMA configuration for PCI masters

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v4 3/3] PCI/of fix of_dma_get_range; get PCI specific dma-ranges

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v4 2/3] iommu/pci: reserve IOVA for PCI masters

2017-05-05 Thread Oza Pawandeep via iommu
this patch reserves the IOVA for PCI masters. ARM64 based SOCs may have scattered memory banks. such as iproc based SOC has <0x 0x8000 0x0 0x8000>, /* 2G @ 2G */ <0x0008 0x8000 0x3 0x8000>, /* 14G @ 34G */ <0x0090 0x 0x4 0x>, /* 16G @ 576G */ <0x

[PATCH v4 0/3] OF/PCI address PCI inbound memory limitations

2017-05-05 Thread Oza Pawandeep via iommu
It is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. This is particularly problematic on ARM/ARM64 SOCs where the IOMMU (i.e. SMMU) trans

[PATCH v4 1/3] of/pci/dma: fix DMA configuration for PCI masters

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v3 0/3] OF/PCI address PCI inbound memory limitations

2017-05-05 Thread Oza Pawandeep via iommu
It is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. This is particularly problematic on ARM/ARM64 SOCs where the IOMMU (i.e. SMMU) trans

[PATCH v2 0/3] OF/PCI address PCI inbound memory limitations

2017-05-05 Thread Oza Pawandeep via iommu
It is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. This is particularly problematic on ARM/ARM64 SOCs where the IOMMU (i.e. SMMU) trans

[PATCH v3 1/3] of/pci/dma: fix DMA configuration for PCI masters

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v3 3/3] PCI/of fix of_dma_get_range; get PCI specific dma-ranges

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v2 0/3] OF/PCI address PCI inbound memory limitations

2017-05-05 Thread Oza Pawandeep via iommu
It is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. This is particularly problematic on ARM/ARM64 SOCs where the IOMMU (i.e. SMMU) trans

[PATCH v2 3/3] PCI/of fix of_dma_get_range; get PCI specific dma-ranges

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v2 1/3] of/pci/dma: fix DMA configuration for PCI masters

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v2 0/3] OF/PCI address PCI inbound memory limitations

2017-05-05 Thread Oza Pawandeep via iommu
It is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. This is particularly problematic on ARM/ARM64 SOCs where the IOMMU (i.e. SMMU) trans

[PATCH v2 3/3] PCI/of fix of_dma_get_range; get PCI specific dma-ranges

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH v2 1/3] of/pci/dma: fix DMA configuration for PCI masters

2017-05-05 Thread Oza Pawandeep via iommu
current device framework and OF framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH 1/3] of/pci/dma: fix DMA configuration for PCI masters

2017-05-02 Thread Oza Pawandeep via iommu
current device framework and of framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH 3/3] PCI/of fix of_dma_get_range; get PCI specific dma-ranges

2017-05-02 Thread Oza Pawandeep via iommu
current device framework and of framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. (child-bus-address, parent-bus-address, length). of_dma_configure is specifically written to take care of memory mapped devices. but no implementation exists for p

[PATCH 2/3] iommu/pci: reserve iova for PCI masters

2017-05-02 Thread Oza Pawandeep via iommu
this patch reserves the iova for PCI masters. ARM64 based SOCs may have scattered memory banks. such as iproc based SOC has <0x 0x8000 0x0 0x8000>, /* 2G @ 2G */ <0x0008 0x8000 0x3 0x8000>, /* 14G @ 34G */ <0x0090 0x 0x4 0x>, /* 16G @ 576G */ <0x

[RFC PATH] of/pci/dma: fix DMA configruation for PCI masters

2017-04-22 Thread Oza Pawandeep via iommu
current device frmework and of framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. dma-ranges: (child-bus-address, parent-bus-address, length). but iproc based SOCs and other SOCs(suc as rcar) have PCI world dma-ranges. dma-ranges = <0x4300 0x

[RFC PATCH 1/2] of/pci: implement inbound dma-ranges for PCI

2017-03-30 Thread Oza Pawandeep via iommu
current device frmework and of framework integration assumes dma-ranges in a way where memory-mapped devices define their dma-ranges. dma-ranges: (child-bus-address, parent-bus-address, length). but iproc based SOCs and other SOCs(rcar) have PCI world dma-ranges. dma-ranges = <0x4300 0x00 0x00

[RFC PATCH 2/2] of/pci: call pci specific dma-ranges instead of memory-mapped.

2017-03-30 Thread Oza Pawandeep via iommu
it is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. As an example, consider NVME SSD device connected to iproc-PCIe controller. Currently,

[RFC PATCH 1/3] of/pci: dma-ranges to account highest possible host bridge dma_mask

2017-03-24 Thread Oza Pawandeep via iommu
it is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. As an example, consider NVME SSD device connected to iproc-PCIe controller. Currently,

[RFC PATCH 3/3] of: fix node traversing in of_dma_get_range

2017-03-24 Thread Oza Pawandeep via iommu
it jumps to the parent node without examining the child node. also with that, it throws "no dma-ranges found for node" for pci dma-ranges. this patch fixes device node traversing for dma-ranges. Reviewed-by: Anup Patel Signed-off-by: Oza Pawandeep diff --git a/drivers/of/address.c b/drivers/of

[RFC PATCH 2/3] iommu/dma: account pci host bridge dma_mask for IOVA allocation

2017-03-24 Thread Oza Pawandeep via iommu
it is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. As an example, consider NVME SSD device connected to iproc-PCIe controller. Currently,

[RFC PATCH] iommu/dma: account pci host bridge dma_mask for IOVA allocation

2017-03-16 Thread Oza Pawandeep via iommu
It is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. As an example, consider NVME SSD device connected to iproc-PCIe controller. Currently,

[RFC PATCH] iommu/dma: check pci host bridge dma_mask for IOVA allocation

2017-03-14 Thread Oza Pawandeep via iommu
It is possible that PCI device supports 64-bit DMA addressing, and thus it's driver sets device's dma_mask to DMA_BIT_MASK(64), however PCI host bridge may have limitations on the inbound transaction addressing. As an example, consider NVME SSD device connected to iproc-PCIe controller. Currently,