Commit d4f97711 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'sunxi-rework-mbus' of...

Merge tag 'sunxi-rework-mbus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mripard/linux into arm/drivers

Allwinner MBUS and DMA-ops rework

The Allwinner SoCs have a number of high-bandwidth devices connected to
a memory bus with a different RAM mapping than the CPU.

This was addressed before through drivers setting the DMA offsets
directly, and subsequently changed to calls to dma_direct_set_offset.
However that wasn't really meant to be exported to modules (and thus
drivers). The duplicated code also led to small inconsistencies across
drivers in how we dealt with DT backward compatibility.

Move all that DMA setup code into a platform bus notifier to share that
code and remove the export on dma_direct_set_offset.

* tag 'sunxi-rework-mbus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mripard/linux

:
  dma-mapping: remove the dma_direct_set_offset export
  media: sun8i-di: Remove the call to of_dma_configure
  media: cedrus: Remove the MBUS quirks
  media: sun6i: Remove the MBUS quirks
  media: sun4i: Remove the MBUS quirks
  drm/sun4i: backend: Remove the MBUS quirks
  soc: sunxi: Deal with the MBUS DMA offsets in a central place
  drm/sun4i: backend: Fix probe failure with multiple backends

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents ec565b0e 16fee29b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
 */
#include <linux/io.h>
#include <linux/of.h>
#include <linux/dma-mapping.h>
#include <linux/dma-map-ops.h>
#include <linux/init.h>
#include <linux/of_platform.h>
#include <linux/of_address.h>
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/dma-map-ops.h>
#include <linux/io.h>

#include <asm/irq.h>
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
#include <linux/io.h>
#include <linux/async.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/dma-map-ops.h>
#include <linux/slab.h>
#include <linux/clk.h>
#include <linux/sh_clk.h>
+2 −1
Original line number Diff line number Diff line
@@ -11,7 +11,8 @@
#include <linux/pci_ids.h>
#include <linux/export.h>
#include <linux/list.h>
#include <linux/dma-direct.h>
#include <linux/dma-map-ops.h>
#include <linux/swiotlb.h>
#include <asm/iommu.h>

#define STA2X11_SWIOTLB_SIZE (4*1024*1024)
+0 −13
Original line number Diff line number Diff line
@@ -805,19 +805,6 @@ static int sun4i_backend_bind(struct device *dev, struct device *master,
		ret = of_dma_configure(drm->dev, dev->of_node, true);
		if (ret)
			return ret;
	} else {
		/*
		 * If we don't have the interconnect property, most likely
		 * because of an old DT, we need to set the DMA offset by hand
		 * on our device since the RAM mapping is at 0 for the DMA bus,
		 * unlike the CPU.
		 *
		 * XXX(hch): this has no business in a driver and needs to move
		 * to the device tree.
		 */
		ret = dma_direct_set_offset(drm->dev, PHYS_OFFSET, 0, SZ_4G);
		if (ret)
			return ret;
	}

	backend->engine.node = dev->of_node;
Loading