From patchwork Tue Aug 5 10:47:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 34910 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B5C8F2397D for ; Tue, 5 Aug 2014 10:49:08 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id q200sf2319471ykb.1 for ; Tue, 05 Aug 2014 03:49:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=U4CjpPJnSO+KMnWaQYbGBsuvnLzVDBpCuyrECNMkmKg=; b=nJOJQdBzKKiHyutZ3FuO9m4mGSic681gYj0hoVjAyYYT7bAgfqUVrZSVLuOOddOzzJ 8Wt9xu8QnS/y/le4j0cnDEs2x5mh+Aeg3iUconvLp4O/0j+GW7L98oASYo9s1wKflsho w0NP8p3x+PovPhZurLSRx/YZHP6Ah6nLGRlL5tDHg/1cTeRSGqrmWEAD4rVGtRj3z6U/ BXrccajoToYfZ0xB7AmMNHwvr6QCCEnNhoCmKt78c8z8MFYAqIXZfss4vm84TEgVZKNk dgfN9of//jgve3wXRiLvmm5UWrrl2YuiiwlUsQHvOqO4zWE5lwXOYlElsZoRmf60zXAH QMWw== X-Gm-Message-State: ALoCoQmHC2FMPXDtaujOEgxyAoKaVYOe1At8jCwbdpiBxlLqVGRvM1/ix4MsWZLUMIItK9VCywMd X-Received: by 10.236.202.143 with SMTP id d15mr1535966yho.18.1407235748521; Tue, 05 Aug 2014 03:49:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.37 with SMTP id q34ls239595qgd.5.gmail; Tue, 05 Aug 2014 03:49:08 -0700 (PDT) X-Received: by 10.220.12.78 with SMTP id w14mr381955vcw.68.1407235748423; Tue, 05 Aug 2014 03:49:08 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id cb8si783120vcb.36.2014.08.05.03.49.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 03:49:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ik5so1106397vcb.34 for ; Tue, 05 Aug 2014 03:49:08 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr2443440vcn.16.1407235748334; Tue, 05 Aug 2014 03:49:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp374539vcb; Tue, 5 Aug 2014 03:49:07 -0700 (PDT) X-Received: by 10.70.63.37 with SMTP id d5mr3184115pds.51.1407235747675; Tue, 05 Aug 2014 03:49:07 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id es5si1560954pbb.15.2014.08.05.03.49.06 for ; Tue, 05 Aug 2014 03:49:07 -0700 (PDT) Received-SPF: none (google.com: linux-samsung-soc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754974AbaHEKtF (ORCPT + 6 others); Tue, 5 Aug 2014 06:49:05 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:9343 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754956AbaHEKtD (ORCPT ); Tue, 5 Aug 2014 06:49:03 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9T001JIY16NO90@mailout2.w1.samsung.com>; Tue, 05 Aug 2014 11:48:43 +0100 (BST) X-AuditID: cbfec7f5-b7f776d000003e54-99-53e0b69d5092 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 89.DC.15956.D96B0E35; Tue, 05 Aug 2014 11:49:01 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N9T0057MY17SE80@eusync3.samsung.com>; Tue, 05 Aug 2014 11:49:01 +0100 (BST) From: Marek Szyprowski 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 , linaro-mm-sig@lists.linaro.org, Arnd Bergmann , Shaik Ameer Basha , Cho KyongHo , Joerg Roedel , Thierry Reding , Olof Johansson , Laurent Pinchart , Rob Herring , Greg Kroah-Hartman , "Rafael J. Wysocki" , Inki Dae , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Kyungmin Park Subject: [PATCH 14/29] devicetree: Update Exynos SYSMMU device tree bindings Date: Tue, 05 Aug 2014 12:47:42 +0200 Message-id: <1407235677-26324-15-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1407235677-26324-1-git-send-email-m.szyprowski@samsung.com> References: <1407235677-26324-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGLMWRmVeSWpSXmKPExsVy+t/xq7pztz0INnizitfi76Rj7BbNi9ez WUy6P4HFYsF+a4vO2RvYLXoXXGWzONv0ht2ic+ISdosvVx4yWWx6fI3V4vKuOWwWM87vY7JY e+Quu8Wp65/ZLP71HmS0OHP6EqvF/z072C0Ov2lntTjycDe7xapdfxgtbv/mcxD1eHJwHpPH 71+TGD12zrrL7jG7Yyarx6ZVnWwe++euYffYvKTe4/a/x8wek28sZ/S4cqKJ1aO3+R2bx5ar 7SwefVtWMXp83iQXwBfFZZOSmpNZllqkb5fAlfHi3DW2gpN6FbuPezUwvlTtYuTkkBAwkbj3 6DQzhC0mceHeerYuRi4OIYGljBJTZq1ghXD6mCS2XW1nBKliEzCU6HrbBVYlItDLKNHf9IMJ xGEWWMcqsb/3OgtIlbCAj8Sc1Y1AHRwcLAKqEucPloGEeQU8Jb4cOscOsU5O4v/LFUwgNidQ /PDNA6wgtpCAh8TPDWvYJzDyLmBkWMUomlqaXFCclJ5rpFecmFtcmpeul5yfu4kREjdfdzAu PWZ1iFGAg1GJh1dh791gIdbEsuLK3EOMEhzMSiK8EmseBAvxpiRWVqUW5ccXleakFh9iZOLg lGpgvKq0p2+G0rLys6a5/o+OxH2JlF6+fc4X5fOXIr/e597ck2iW7vFsW56sg8G8ncbsR829 p9z7NnH2oZ9/itu0r+aJ+nK8VT19SuumcaFoz4bZ0ovTPzB3q2a4uOR9C829IM+yx3VvAENK /aZUqeyj85ZdSRc42rklt+kdb+o9ob/iMy+sSbg0SYmlOCPRUIu5qDgRAMN/KWF5AgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch describes how generic iommu bindings are implemented by Exynos SYSMMU driver. Signed-off-by: Marek Szyprowski --- .../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>; };