devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] MT8173 IOMMU SUPPORT
@ 2015-07-16  9:04 Yong Wu
  2015-07-16  9:04 ` [PATCH v3 2/6] dt-bindings: mediatek: Add smi dts binding Yong Wu
                   ` (3 more replies)
  0 siblings, 4 replies; 35+ messages in thread
From: Yong Wu @ 2015-07-16  9:04 UTC (permalink / raw)
  To: Joerg Roedel, Thierry Reding, Mark Rutland, Matthias Brugger
  Cc: Robin Murphy, Will Deacon, Daniel Kurtz, Tomasz Figa, Lucas Stach,
	Rob Herring, Catalin Marinas, linux-mediatek, Sasha Hauer,
	srv_heupstream, devicetree, linux-kernel, linux-arm-kernel, iommu,
	pebolle, arnd, mitchelh, cloud.chou, frederic.chen, yong.wu

This patch adds support for m4u(Multimedia Memory Management Unit),
Currently it only support the m4u with 2 levels of pagetable on mt8173.

  It is based on Robin Murphy's arm64 DMA v3: IOMMU-backed DMA mapping[1]. 
 
  Please check the hardware block diagram of Mediatek IOMMU.
 
              EMI (External Memory Interface)
               |
              m4u (Multimedia Memory Management Unit)
               |
              smi (Smart Multimedia Interface)
               |
        +---------------+-------
        |               |
        |               |
    vdec larb       disp larb      ... SoCs have different local arbiter(larb).
        |               |
        |               |
   +----+----+    +-----+-----+
   |    |    |    |     |     |    ...
   |    |    |    |     |     |    ...
   |    |    |    |     |     |    ...
  MC   PP   VLD  OVL0 RDMA0 WDMA0  ... There are different ports in each larb.
  
  Normally we specify a local arbiter(larb) for each multimedia hardware like
display, video decode, video encode and camera. And there are different ports in
each larb. Take a example, there are some ports like MC, PP, UFO, VLD, AVC_MV,
PRED_RD in video larb, all the ports are according to the video hardware.
 
  From the diagram, all the multimedia module connect with m4u via smi.
SMI is responsible to enable/disable iommu and control the clocks for each local
arbiter. If we should enable the iommu of video decode, it should config the
video's ports. And if the video hardware work whether enable/disable iommu, 
it should enable the clock of its larb's clock. And smi also help bandwidth
control for each local arbiter. So we add a special driver for smi and locate
it drivers/memory.
 
[1] http://lists.linuxfoundation.org/pipermail/iommu/2015-July/013597.html

v3:
-rebased onto v4.2-rc1
-improve iommu flow based on the Robin's DMA v3.
-change mtk iommu-cells from 1 to 2.
-about Short-Descriptor: add split function; add self-test; add some other bits like nG,
 XN according to the spec; add SUPERSECTION and MTK quirk; move io_pgtable_ops_to_pgtable
 out from LPAE to the header file.
-about SMI: move from driver/soc/mediatek to driver/memory; change the clocks from
 clk[2] to clk_apb and clk_smi; add pm.
-add iommu suspend/resume to backup/restore register.

v2: http://lists.linuxfoundation.org/pipermail/iommu/2015-May/013028.html
-add arm short descriptor support.
-seperate smi common from smi and change the clock-names according
 to smi HW.
-delete the hardcode of the port-names in mt8173.
 replace this with larb-portes-nr in dtsi.
-fix some coding style issues.

v1: http://lists.infradead.org/pipermail/linux-mediatek/2015-March/000058.html
-initial version.

Yong Wu (6):
  dt-bindings: iommu: Add binding for mediatek IOMMU
  dt-bindings: mediatek: Add smi dts binding
  iommu: add ARM short descriptor page table allocator.
  memory: mediatek: Add SMI driver
  iommu/mediatek: Add mt8173 IOMMU driver
  dts: mt8173: Add iommu/smi nodes for mt8173

 .../devicetree/bindings/iommu/mediatek,iommu.txt   |   61 ++
 .../memory-controllers/mediatek,smi-larb.txt       |   25 +
 .../bindings/memory-controllers/mediatek,smi.txt   |   24 +
 arch/arm64/boot/dts/mediatek/mt8173.dtsi           |   81 +++
 drivers/iommu/Kconfig                              |   31 +
 drivers/iommu/Makefile                             |    2 +
 drivers/iommu/io-pgtable-arm-short.c               |  742 ++++++++++++++++++++
 drivers/iommu/io-pgtable-arm.c                     |    3 -
 drivers/iommu/io-pgtable.c                         |    4 +
 drivers/iommu/io-pgtable.h                         |   13 +
 drivers/iommu/mtk_iommu.c                          |  725 +++++++++++++++++++
 drivers/memory/Kconfig                             |    8 +
 drivers/memory/Makefile                            |    1 +
 drivers/memory/mtk-smi.c                           |  285 ++++++++
 include/dt-bindings/memory/mt8173-larb-port.h      |  105 +++
 include/soc/mediatek/smi.h                         |   60 ++
 16 files changed, 2167 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
 create mode 100644 Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt
 create mode 100644 Documentation/devicetree/bindings/memory-controllers/mediatek,smi.txt
 create mode 100644 drivers/iommu/io-pgtable-arm-short.c
 create mode 100644 drivers/iommu/mtk_iommu.c
 create mode 100644 drivers/memory/mtk-smi.c
 create mode 100644 include/dt-bindings/memory/mt8173-larb-port.h
 create mode 100644 include/soc/mediatek/smi.h

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2015-09-17  2:38 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16  9:04 [PATCH v3 0/6] MT8173 IOMMU SUPPORT Yong Wu
2015-07-16  9:04 ` [PATCH v3 2/6] dt-bindings: mediatek: Add smi dts binding Yong Wu
2015-07-16  9:04 ` [PATCH v3 3/6] iommu: add ARM short descriptor page table allocator Yong Wu
     [not found]   ` <1437037475-9065-4-git-send-email-yong.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-07-21 17:11     ` Will Deacon
     [not found]       ` <20150721171101.GN31095-5wv7dgnIgG8@public.gmane.org>
2015-07-24  5:24         ` Yong Wu
2015-07-24 16:53           ` Will Deacon
     [not found]             ` <20150724165325.GC21177-5wv7dgnIgG8@public.gmane.org>
2015-07-27  4:21               ` Yong Wu
2015-07-27 14:05                 ` Robin Murphy
2015-07-27 14:11                   ` Will Deacon
     [not found]                     ` <20150727141102.GJ3358-5wv7dgnIgG8@public.gmane.org>
2015-07-28  5:08                       ` Yong Wu
2015-07-28 11:00                         ` Will Deacon
     [not found]                           ` <20150728110023.GH29209-5wv7dgnIgG8@public.gmane.org>
2015-07-28 13:37                             ` Yong Wu
2015-07-28 13:47                               ` Will Deacon
2015-07-31  7:55                 ` Yong Wu
2015-07-31 11:32                   ` Will Deacon
2015-09-14 12:25         ` Yong Wu
2015-09-16 12:55           ` Will Deacon
     [not found]             ` <20150916125535.GI28771-5wv7dgnIgG8@public.gmane.org>
2015-09-17  2:38               ` Yong Wu
     [not found] ` <1437037475-9065-1-git-send-email-yong.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-07-16  9:04   ` [PATCH v3 1/6] dt-bindings: iommu: Add binding for mediatek IOMMU Yong Wu
2015-07-16  9:04   ` [PATCH v3 4/6] memory: mediatek: Add SMI driver Yong Wu
2015-07-16  9:04   ` [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver Yong Wu
     [not found]     ` <1437037475-9065-6-git-send-email-yong.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-07-21 14:59       ` Will Deacon
     [not found]         ` <20150721145910.GG31095-5wv7dgnIgG8@public.gmane.org>
2015-07-24  5:43           ` Yong Wu
2015-07-24 16:55             ` Will Deacon
     [not found]               ` <20150724165509.GD21177-5wv7dgnIgG8@public.gmane.org>
2015-07-27  4:24                 ` Yong Wu
2015-07-27 15:48                   ` Will Deacon
2015-07-27 13:23       ` Robin Murphy
2015-07-27 15:31         ` Russell King - ARM Linux
2015-07-27 15:49           ` Robin Murphy
     [not found]             ` <55B6530A.9050903-5wv7dgnIgG8@public.gmane.org>
2015-07-29  5:41               ` Yong Wu
2015-07-29 10:31                 ` Will Deacon
     [not found]         ` <55B630CE.4050803-5wv7dgnIgG8@public.gmane.org>
2015-07-29  6:32           ` Yong Wu
2015-07-16  9:04 ` [PATCH v3 6/6] dts: mt8173: Add iommu/smi nodes for mt8173 Yong Wu
     [not found]   ` <1437037475-9065-7-git-send-email-yong.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-07-23 14:40     ` Daniel Kurtz
     [not found]       ` <CAGS+omB5xS8LoQR9-S8iqhdsRb4OWQ_B656dJSincLZ9nby1ZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-29  7:29         ` Yong Wu

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).