diff options
author | Grygorii Strashko <grygorii.strashko@ti.com> | 2016-04-25 22:21:34 +0300 |
---|---|---|
committer | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2016-11-22 19:03:36 +0000 |
commit | 7ffabe6b01b93546371cae81b7ae16ee82f4f283 (patch) | |
tree | 72b53aaa544632b624ee3b7a56e4e2348ca8e3ea | |
parent | 953c00539f3b0afaccfcce5dea5b31c44878677b (diff) |
FROMLIST: usb: dwc3: host: inherit dma configuration from parent devlegacy/tracking-qcomlt-qmp-phy
Now not all DMA paremters configured properly for "xhci-hcd" platform
device which is created manually. For example: dma_pfn_offset, dam_ops
and iommu configuration will not corresponds "dwc3" devices
configuration. As result, this will cause problems like wrong DMA
addresses translation on platforms with LPAE enabled like Keystone 2.
When platform is using DT boot mode the DMA configuration will be
parsed and applied from DT, so, to fix this issue, reuse
of_dma_configure() API and retrieve DMA configuartion for "xhci-hcd"
from DWC3 device node.
Cc: David Fisher <david.fisher1@synopsys.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: "Thang Q. Nguyen" <tqnguyen@apm.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
[vivek.gautam@codeaurora.org: Splitted of_dma_configure into
of_dma_configure_masks() and,
of_dma_configure_ops()]
-rw-r--r-- | drivers/usb/dwc3/host.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index f6533c68fed1..bcb27ca4fa07 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -16,6 +16,8 @@ */ #include <linux/platform_device.h> +//#include <linux/usb/xhci_pdriver.h> +#include <linux/of_device.h> #include "core.h" @@ -72,12 +74,7 @@ int dwc3_host_init(struct dwc3 *dwc) return -ENOMEM; } - dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask); - xhci->dev.parent = dwc->dev; - xhci->dev.dma_mask = dwc->dev->dma_mask; - xhci->dev.dma_parms = dwc->dev->dma_parms; - dwc->xhci = xhci; ret = platform_device_add_resources(xhci, dwc->xhci_resources, @@ -103,6 +100,15 @@ int dwc3_host_init(struct dwc3 *dwc) phy_create_lookup(dwc->usb3_generic_phy, "usb3-phy", dev_name(&xhci->dev)); + if (IS_ENABLED(CONFIG_OF) && dwc->dev->of_node) { + of_dma_configure(&xhci->dev, dwc->dev->of_node); + } else { + dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask); + + xhci->dev.dma_mask = dwc->dev->dma_mask; + xhci->dev.dma_parms = dwc->dev->dma_parms; + } + ret = platform_device_add(xhci); if (ret) { dev_err(dwc->dev, "failed to register xHCI device\n"); |