linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: iommu@lists.linux-foundation.org,
	linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	linaro-mm-sig@lists.linaro.org, Arnd Bergmann <arnd@arndb.de>,
	Shaik Ameer Basha <shaik.ameer@samsung.com>,
	Cho KyongHo <pullip.cho@samsung.com>,
	Joerg Roedel <joro@8bytes.org>,
	Thierry Reding <treding@nvidia.com>,
	Olof Johansson <olof@lixom.net>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Rob Herring <robh@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Inki Dae <inki.dae@samsung.com>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: [PATCH 14/29] devicetree: Update Exynos SYSMMU device tree bindings
Date: Tue, 05 Aug 2014 12:47:42 +0200	[thread overview]
Message-ID: <1407235677-26324-15-git-send-email-m.szyprowski@samsung.com> (raw)
In-Reply-To: <1407235677-26324-1-git-send-email-m.szyprowski@samsung.com>

This patch describes how generic iommu bindings are implemented by
Exynos SYSMMU driver.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 .../devicetree/bindings/iommu/samsung,sysmmu.txt   | 93 +++++++++++++++++++---
 1 file changed, 84 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/iommu/samsung,sysmmu.txt b/Documentation/devicetree/bindings/iommu/samsung,sysmmu.txt
index 6fa4c73..999ba6d 100644
--- a/Documentation/devicetree/bindings/iommu/samsung,sysmmu.txt
+++ b/Documentation/devicetree/bindings/iommu/samsung,sysmmu.txt
@@ -23,16 +23,33 @@ MMUs.
   for window 1, 2 and 3.
 * M2M Scalers and G2D in Exynos5420 has one System MMU on the read channel and
   the other System MMU on the write channel.
-The drivers must consider how to handle those System MMUs. One of the idea is
-to implement child devices or sub-devices which are the client devices of the
-System MMU.
 
-Note:
-The current DT binding for the Exynos System MMU is incomplete.
-The following properties can be removed or changed, if found incompatible with
-the "Generic IOMMU Binding" support for attaching devices to the IOMMU.
+The drivers must consider how to handle those System MMUs. When device
+have more than one SYSMMU controller it is neccessary to add
+"iommu-names" property, which specifies which SYSMMU controller operates
+on which bus or memory channel.
 
-Required properties:
+It is up to the master device driver to decide how such case will be
+handled. It is possible to create separate IO address spaces for each
+SYSMMU or to bind them together to one common IO address space. It is
+also possible to bind more than one device to one IO address space. All
+this has to be handled by master device driver in its initialization
+procedure or flags and no changes to device tree nodes are needed.
+
+In Linux kernel, the general idea is that presence of the SYSMMU
+controllers is transparent to master drivers if they use standard DMA
+API. When driver wants to use IO separate address spaces for each bus or
+memory channel (each SYSMMU) or to bind more than one device to one IO
+address space, it has to specify this to SYSMMU driver by
+DRIVER_HAS_OWN_IOMMU_MANAGER flag. To get access to each SYSMMU bound to
+the given device, additional child devices with special names (matching
+"parent:bus" scheme) have to be registered. Once then, all standard
+IOMMU operations can be performed on such child devices, what will
+result in respective operations done on IO address space managed by
+SYSMMU of the given name. Other operating systems might implement those
+features differently.
+
+Required properties for SYSMMU controller node:
 - compatible: Should be "samsung,exynos-sysmmu"
 - reg: A tuple of base address and size of System MMU registers.
 - interrupt-parent: The phandle of the interrupt controller of System MMU
@@ -45,11 +62,27 @@ Required properties:
 	       Exynos4 SoCs, there needs no "master" clock.
 	       Exynos5 SoCs, some System MMUs must have "master" clocks.
 - clocks: Required if the System MMU is needed to gate its clock.
+- #iommu-cells: Specify number of cells describing IO address space parameters,
+		can be: 0 (zero), meaning all 32bit address space is available,
+		or 2, if address space is limited, first cell then stores
+		base IO address, second cell contains IO window size in bytes.
 - samsung,power-domain: Required if the System MMU is needed to gate its power.
 	  Please refer to the following document:
 	  Documentation/devicetree/bindings/arm/exynos/power_domain.txt
 
-Examples:
+Required properties for master device:
+- iommus: one or more phandles to the SYSMMU controller node, with optionally
+	  specified IO address space (see #iommu-cells property above)
+- iommu-names: if more than one SYSMMU controller is specified, this property
+	       must contain names for each of them. Those names are defined by
+	       the bindings for a particular master device.
+
+For more information, please refer to generic iommu bindings defined in
+iommu.txt file.
+
+Example 1:
+GScaller device with one SYSMMU controller
+
 	gsc_0: gsc@13e00000 {
 		compatible = "samsung,exynos5-gsc";
 		reg = <0x13e00000 0x1000>;
@@ -57,6 +90,7 @@ Examples:
 		samsung,power-domain = <&pd_gsc>;
 		clocks = <&clock CLK_GSCL0>;
 		clock-names = "gscl";
+		iommus = <&sysmmu_gsc0>;
 	};
 
 	sysmmu_gsc0: sysmmu@13E80000 {
@@ -67,4 +101,45 @@ Examples:
 		clock-names = "sysmmu", "master";
 		clocks = <&clock CLK_SMMU_GSCL0>, <&clock CLK_GSCL0>;
 		samsung,power-domain = <&pd_gsc>;
+		#iommu-cells = <0>;
+	};
+
+Example 2:
+MFC Codec with two SYSMMU controllers (on "left" and "right" bus), with address
+space limited to 256MiB each, left bus starts IO address space at 0x20000000,
+while right bus at 0x30000000
+
+	mfc: codec@13400000 {
+		compatible = "samsung,mfc-v5";
+		reg = <0x13400000 0x10000>;
+		interrupts = <0 94 0>;
+		samsung,power-domain = <&pd_mfc>;
+		clocks = <&clock CLK_MFC>;
+		clock-names = "mfc";
+		status = "disabled";
+		iommus = <&sysmmu_mfc_l 0x20000000 0x10000000>,
+			 <&sysmmu_mfc_r 0x30000000 0x10000000>;
+		iommu-names = "left", "right";
+	};
+
+	sysmmu_mfc_l: sysmmu@13620000 {
+		compatible = "samsung,exynos-sysmmu";
+		reg = <0x13620000 0x1000>;
+		interrupt-parent = <&combiner>;
+		interrupts = <5 5>;
+		clock-names = "sysmmu", "master";
+		clocks = <&clock CLK_SMMU_MFCL>, <&clock CLK_MFC>;
+		samsung,power-domain = <&pd_mfc>;
+		#iommu-cells = <2>;
+	};
+
+	sysmmu_mfc_r: sysmmu@13630000 {
+		compatible = "samsung,exynos-sysmmu";
+		reg = <0x13630000 0x1000>;
+		interrupt-parent = <&combiner>;
+		interrupts = <5 6>;
+		clock-names = "sysmmu", "master";
+		clocks = <&clock CLK_SMMU_MFCR>, <&clock CLK_MFC>;
+		samsung,power-domain = <&pd_mfc>;
+		#iommu-cells = <2>;
 	};
-- 
1.9.2


  parent reply	other threads:[~2014-08-05 10:49 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05 10:47 [PATCH 00/29] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem Marek Szyprowski
2014-08-05 10:47 ` [PATCH 01/29] pm: Add PM domain notifications Marek Szyprowski
2014-08-05 10:47 ` [PATCH 02/29] ARM: Exynos: bind power domains earlier, on device creation Marek Szyprowski
2014-08-05 10:47 ` [PATCH 03/29] clk: exynos: add missing smmu_g2d clock and update comments Marek Szyprowski
2014-08-18 11:26   ` Tomasz Figa
2014-08-05 10:47 ` [PATCH 04/29] drivers: base: add notifier for failed driver bind Marek Szyprowski
2014-08-21 19:46   ` Laurent Pinchart
2014-08-25 20:05   ` Greg Kroah-Hartman
2014-08-26  6:23     ` Marek Szyprowski
2014-08-25 21:18   ` Joerg Roedel
2014-08-26  6:30     ` Marek Szyprowski
2014-08-05 10:47 ` [PATCH 05/29] drivers: convert suppress_bind_attrs parameter into flags Marek Szyprowski
2014-08-05 10:47 ` [PATCH 06/29] drivers: iommu: add notify about failed bind Marek Szyprowski
2014-08-05 10:47 ` [PATCH 07/29] ARM: dma-mapping: arm_iommu_attach_device: automatically set max_seg_size Marek Szyprowski
2014-08-05 10:47 ` [PATCH 08/29] ARM: dma-mapping: add helpers for managing default per-device dma mappings Marek Szyprowski
2014-08-05 10:47 ` [PATCH 09/29] ARM: dma-mapping: provide stubs if no ARM_DMA_USE_IOMMU has been selected Marek Szyprowski
2014-08-05 10:47 ` [PATCH 10/29] drivers: add DRIVER_HAS_OWN_IOMMU_MANAGER flag Marek Szyprowski
2014-09-01  5:22   ` Marek Szyprowski
2014-09-01  7:07     ` Thierry Reding
2014-09-01  7:53       ` Marek Szyprowski
2014-09-01  9:38         ` Arnd Bergmann
2014-09-01 10:47           ` Marek Szyprowski
2014-09-01 11:56             ` Arnd Bergmann
2014-09-01 12:07               ` Marek Szyprowski
2014-09-01 13:14                 ` [Linaro-mm-sig] " Arnd Bergmann
2014-08-05 10:47 ` [PATCH 11/29] DRM: exynos: add DRIVER_HAS_OWN_IOMMU_MANAGER flag to all sub-drivers Marek Szyprowski
2014-08-05 10:47 ` [PATCH 12/29] DRM: Exynos: fix window clear code Marek Szyprowski
2014-09-01 13:37   ` Inki Dae
2014-08-05 10:47 ` [PATCH 13/29] temporary: media: s5p-mfc: remove DT hacks & initialization custom memory init code Marek Szyprowski
2014-08-05 10:47 ` Marek Szyprowski [this message]
2014-08-05 10:47 ` [PATCH 15/29] ARM: DTS: Exynos4: add System MMU nodes Marek Szyprowski
2014-08-05 10:47 ` [PATCH 16/29] iommu: exynos: make driver multiarch friendly Marek Szyprowski
2014-08-05 10:47 ` [PATCH 17/29] iommu: exynos: don't read version register on every tlb operation Marek Szyprowski
2014-08-05 10:47 ` [PATCH 18/29] iommu: exynos: remove unused functions Marek Szyprowski
2014-08-05 10:47 ` [PATCH 19/29] iommu: exynos: remove useless spinlock Marek Szyprowski
2014-08-05 10:47 ` [PATCH 20/29] iommu: exynos: refactor function parameters to simplify code Marek Szyprowski
2014-08-05 10:47 ` [PATCH 21/29] iommu: exynos: remove unused functions, part 2 Marek Szyprowski
2014-08-05 10:47 ` [PATCH 22/29] iommu: exynos: add support for binding more than one sysmmu to master device Marek Szyprowski
2014-08-05 10:47 ` [PATCH 23/29] iommu: exynos: init iommu controllers from device tree Marek Szyprowski
2014-08-05 10:47 ` [PATCH 24/29] iommu: exynos: create default iommu-based dma-mapping for master devices Marek Szyprowski
2014-08-05 10:47 ` [PATCH 25/29] iommu: exynos: add support for runtime_pm Marek Szyprowski
2014-08-05 10:47 ` [PATCH 26/29] iommu: exynos: rename variables to reflect their purpose Marek Szyprowski
2014-08-05 10:47 ` [PATCH 27/29] iommu: exynos: document internal structures Marek Szyprowski
2014-08-05 10:47 ` [PATCH 28/29] iommu: exynos: remove excessive includes and sort others alphabetically Marek Szyprowski
2014-08-05 10:47 ` [PATCH 29/29] temporary: media: s5p-mfc: add support for IOMMU Marek Szyprowski
2014-08-18 23:32 ` [PATCH 00/29] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem Joerg Roedel
2014-08-19  6:07   ` Marek Szyprowski
2014-08-19 11:39     ` Andreas Färber
2014-08-19 12:01       ` Marek Szyprowski
2014-08-19 12:30         ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407235677-26324-15-git-send-email-m.szyprowski@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=inki.dae@samsung.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=pullip.cho@samsung.com \
    --cc=rjw@rjwysocki.net \
    --cc=robh@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=shaik.ameer@samsung.com \
    --cc=tomasz.figa@gmail.com \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).