From patchwork Thu Aug 31 13:14:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 111393 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp2531270qge; Thu, 31 Aug 2017 06:15:13 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7i3m0gp5n2lVZzRKLxiUlOx6GMJVhDzjR1BANF4HC3UrlZ6NmtogyVuYSMKIZdHdRdU7u4 X-Received: by 10.84.224.205 with SMTP id k13mr2561907pln.203.1504185312923; Thu, 31 Aug 2017 06:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504185312; cv=none; d=google.com; s=arc-20160816; b=EzBZ/5TldmVtB06hg8Gve3HCba1o/UkHiB0FLdxMWTkgupXGvr2PwIQSP6CPnI1xhi 1DDXgb5JAzvHMznLjlTnZ+aN8UPNw1WTTdXGr5FqwMO/xgPFPXdj7gGau3tUA6v0s3dU yUrN7nsMtnqGoRncWqRYcU4HkFpShPF0i+owM9WC2UY9Ow9ltiENA1XD08TZ5FaVg3EJ R69cmXb1YolnA3dlto5yHREI5XAhLIz7FZxC3CSldLgoxJFQ9C1wuVkCUxrXY0HpPqVu 9seCubagRMNkSXiBa/It0ueybLpxkJP8vBb+hSCS6JQImLqEc8U8c7EnQNHyN/cMGgNE dpeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=tqLuq0IH8++5DGSD3NTTK5tEaOLOvpR9X9wIiuotAVs=; b=N+NMsHKb6HvCYckM/sueY2fjDCNLf5ktu6Zt3lmwwMmv3vySvpetUwGZig/B7AIZ+i GM7AYl/hQMiZ9/URFPQwca1lohW/+vwAn0BGtJFHxAZAzmTW95OIE/UvFORI9Uaho3Nh 8e68jft/XTsCTvIcB2UJiMmTMS66L6k7L9Nw82MiQv/1ZKgFngAb5wKvgD5xqmCVVZb1 TFA64DrkuBt4CZaIqDDSMiGKqUtaE25HAKJ6PBox7ekCHbP7WuENBF/RhuSjF/mn0qLv CmM4mwQCI7Vb1aCj51rV/kiHPD2EUBK/om3GvPmjtd++S3wHP9Qgw/OnDy2zLAq5Ygpk irOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gQ8Ldxpp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l73si6488116pfi.40.2017.08.31.06.15.12; Thu, 31 Aug 2017 06:15:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gQ8Ldxpp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751881AbdHaNPK (ORCPT + 26 others); Thu, 31 Aug 2017 09:15:10 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:23098 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751404AbdHaNPI (ORCPT ); Thu, 31 Aug 2017 09:15:08 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v7VDE9DJ006498; Thu, 31 Aug 2017 08:14:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1504185249; bh=yc9GebNcqqIj40pDlBg7DtUtKkmkJn8/ZwtYQYZdQTw=; h=From:To:CC:Subject:Date; b=gQ8LdxppGqK/5aAOz9wOr4OGTFIP7eCEWjemGwe/Ws8n8z5u2OK5iP9fORbqrk8St PosnWdscgTxguy1o571HID+/vkAA7S631YjU+5UfTwh09zrsGAmFv3Mcidy3Ku1zAP 7iQgSilYM3KFiZEVz1T55lFffLmog/SyRuLtxbys= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v7VDE4Uw021819; Thu, 31 Aug 2017 08:14:04 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Thu, 31 Aug 2017 08:14:04 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Thu, 31 Aug 2017 08:14:04 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v7VDE407031539; Thu, 31 Aug 2017 08:14:04 -0500 Received: from localhost (irmo.dhcp.ti.com [128.247.58.153]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id v7VDE3303313; Thu, 31 Aug 2017 08:14:04 -0500 (CDT) From: Suman Anna To: Joerg Roedel CC: , Tony Lindgren , Tero Kristo , Laurent Pinchart , , , Suman Anna Subject: [PATCH 0/2] Dual MMU support for TI DRA7xx DSPs Date: Thu, 31 Aug 2017 08:14:00 -0500 Message-ID: <20170831131402.29502-1-s-anna@ti.com> X-Mailer: git-send-email 2.13.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joerg, The following two patches enhance the OMAP IOMMU driver to support mirror-programming of two MMUs present within the DSP subsystems specifically on TI DRA7xx/AM57xx family of SOCs. The TI OMAP DSP subsystems traditionally always has a DSP core and an internal EDMA block behind a single MMU within the subsystem, but DRA7xx DSP SoCs now separate these out and the blocks are behind an individual MMU and a dedicated port to connect to the interconnect. The DT usage for these will be of the form, dsp1: dsp@40800000 { ... iommus = <&mmu0_dsp1>, <&mmu1_dsp1>; ... }; The series is based on your current 4.13 based arm/omap branch. The patches add the support in the driver, but the MMU devices themselves are still not created. There are two separate series (Add hwmod data for IPU & DSP processors/MMUs [1] and Enable DRA7 processor MMU DT nodes [2]) that add these patches, and will go through Tony and the linux-omap tree. The consumer nodes/client drivers are still in-progress and will depend on this series being merged first. Series is tested along-side these two additional series and adding the other consumer patches, no change in behavior with just these patches. regards Suman [1] https://marc.info/?l=linux-omap&m=150335933714097&w=2 [2] https://marc.info/?l=linux-omap&m=150335958414166&w=2 Following is an output of sysfs with these MMUs exercised with additional patches: root@dra7xx-evm:~# ls -l /sys/kernel/iommu_groups/ drwxr-xr-x 3 root root 0 Aug 8 03:59 0 drwxr-xr-x 3 root root 0 Aug 8 03:59 1 drwxr-xr-x 3 root root 0 Aug 8 03:59 2 drwxr-xr-x 3 root root 0 Aug 8 03:59 3 drwxr-xr-x 3 root root 0 Aug 8 03:59 4 drwxr-xr-x 3 root root 0 Aug 8 03:59 5 root@dra7xx-evm:~# ls -l /sys/kernel/iommu_groups/*/devices /sys/kernel/iommu_groups/0/devices: lrwxrwxrwx 1 root root 0 Aug 8 03:59 40800000.dsp -> ../../../../devices/platform/44000000.ocp/40800000.dsp /sys/kernel/iommu_groups/1/devices: /sys/kernel/iommu_groups/2/devices: lrwxrwxrwx 1 root root 0 Aug 8 03:59 58820000.ipu -> ../../../../devices/platform/44000000.ocp/58820000.ipu /sys/kernel/iommu_groups/3/devices: lrwxrwxrwx 1 root root 0 Aug 8 03:59 55020000.ipu -> ../../../../devices/platform/44000000.ocp/55020000.ipu /sys/kernel/iommu_groups/4/devices: lrwxrwxrwx 1 root root 0 Aug 8 03:59 41000000.dsp -> ../../../../devices/platform/44000000.ocp/41000000.dsp /sys/kernel/iommu_groups/5/devices: root@dra7xx-evm:~# ls -l /sys/kernel/iommu_groups/*/devices/*/ /sys/kernel/iommu_groups/0/devices/40800000.dsp/: lrwxrwxrwx 1 root root 0 Aug 8 15:59 driver -> ../../../../bus/platform/drivers/omap-rproc -rw-r--r-- 1 root root 4096 Aug 8 03:59 driver_override lrwxrwxrwx 1 root root 0 Aug 8 03:59 iommu -> ../40d01000.mmu/iommu/40d01000.mmu lrwxrwxrwx 1 root root 0 Aug 8 03:59 iommu_group -> ../../../../kernel/iommu_groups/0 -r--r--r-- 1 root root 4096 Aug 8 03:59 modalias lrwxrwxrwx 1 root root 0 Aug 8 03:59 of_node -> ../../../../firmware/devicetree/base/ocp/dsp@40800000 drwxr-xr-x 2 root root 0 Aug 8 03:59 power drwxr-xr-x 3 root root 0 Aug 8 04:03 remoteproc lrwxrwxrwx 1 root root 0 Aug 8 03:59 subsystem -> ../../../../bus/platform -rw-r--r-- 1 root root 4096 Aug 8 03:59 uevent /sys/kernel/iommu_groups/2/devices/58820000.ipu/: lrwxrwxrwx 1 root root 0 Aug 8 15:59 driver -> ../../../../bus/platform/drivers/omap-rproc -rw-r--r-- 1 root root 4096 Aug 8 03:59 driver_override lrwxrwxrwx 1 root root 0 Aug 8 03:59 iommu -> ../58882000.mmu/iommu/58882000.mmu lrwxrwxrwx 1 root root 0 Aug 8 03:59 iommu_group -> ../../../../kernel/iommu_groups/2 -r--r--r-- 1 root root 4096 Aug 8 03:59 modalias lrwxrwxrwx 1 root root 0 Aug 8 03:59 of_node -> ../../../../firmware/devicetree/base/ocp/ipu@58820000 drwxr-xr-x 2 root root 0 Aug 8 03:59 power drwxr-xr-x 3 root root 0 Aug 8 04:03 remoteproc lrwxrwxrwx 1 root root 0 Aug 8 03:59 subsystem -> ../../../../bus/platform -rw-r--r-- 1 root root 4096 Aug 8 03:59 uevent /sys/kernel/iommu_groups/3/devices/55020000.ipu/: lrwxrwxrwx 1 root root 0 Aug 8 15:59 driver -> ../../../../bus/platform/drivers/omap-rproc -rw-r--r-- 1 root root 4096 Aug 8 03:59 driver_override lrwxrwxrwx 1 root root 0 Aug 8 03:59 iommu -> ../55082000.mmu/iommu/55082000.mmu lrwxrwxrwx 1 root root 0 Aug 8 03:59 iommu_group -> ../../../../kernel/iommu_groups/3 -r--r--r-- 1 root root 4096 Aug 8 03:59 modalias lrwxrwxrwx 1 root root 0 Aug 8 03:59 of_node -> ../../../../firmware/devicetree/base/ocp/ipu@55020000 drwxr-xr-x 2 root root 0 Aug 8 03:59 power drwxr-xr-x 3 root root 0 Aug 8 04:03 remoteproc lrwxrwxrwx 1 root root 0 Aug 8 03:59 subsystem -> ../../../../bus/platform -rw-r--r-- 1 root root 4096 Aug 8 03:59 uevent /sys/kernel/iommu_groups/4/devices/41000000.dsp/: lrwxrwxrwx 1 root root 0 Aug 8 15:59 driver -> ../../../../bus/platform/drivers/omap-rproc -rw-r--r-- 1 root root 4096 Aug 8 03:59 driver_override lrwxrwxrwx 1 root root 0 Aug 8 03:59 iommu -> ../41501000.mmu/iommu/41501000.mmu lrwxrwxrwx 1 root root 0 Aug 8 03:59 iommu_group -> ../../../../kernel/iommu_groups/4 -r--r--r-- 1 root root 4096 Aug 8 03:59 modalias lrwxrwxrwx 1 root root 0 Aug 8 03:59 of_node -> ../../../../firmware/devicetree/base/ocp/dsp@41000000 drwxr-xr-x 2 root root 0 Aug 8 03:59 power drwxr-xr-x 3 root root 0 Aug 8 04:03 remoteproc lrwxrwxrwx 1 root root 0 Aug 8 03:59 subsystem -> ../../../../bus/platform -rw-r--r-- 1 root root 4096 Aug 8 03:59 uevent Suman Anna (2): iommu/omap: Change the attach detection logic iommu/omap: Add support to program multiple iommus drivers/iommu/omap-iommu.c | 324 ++++++++++++++++++++++++++++++++++----------- drivers/iommu/omap-iommu.h | 30 ++--- 2 files changed, 259 insertions(+), 95 deletions(-) -- 2.13.1