From: Guenter Roeck <linux@roeck-us.net>
To: Yong Wu <yong.wu@mediatek.com>
Cc: Joerg Roedel <joro@8bytes.org>,
Thierry Reding <treding@nvidia.com>,
Mark Rutland <mark.rutland@arm.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
p.zabel@pengutronix.de, devicetree@vger.kernel.org,
pebolle@tiscali.nl, kendrick.hsu@mediatek.com,
mitchelh@codeaurora.org, arnd@arndb.de,
srv_heupstream@mediatek.com,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
linux-kernel@vger.kernel.org, Tomasz Figa <tfiga@google.com>,
iommu@lists.linux-foundation.org,
Rob Herring <robh+dt@kernel.org>,
Daniel Kurtz <djkurtz@google.com>,
Sasha Hauer <kernel@pengutronix.de>,
linux-mediatek@lists.infradead.org, youhua.li@mediatek.com,
Robin Murphy <robin.murphy@arm.com>,
linux-arm-kernel@lists.infradead.org,
Lucas Stach <l.stach@pengutronix.de>,
djkurtz@chromium.org
Subject: Re: [v9,4/5] iommu/mediatek: Add mt8173 IOMMU driver
Date: Fri, 19 Feb 2016 23:02:09 -0800 [thread overview]
Message-ID: <20160220070209.GA16577@roeck-us.net> (raw)
In-Reply-To: <1455669974-1527-5-git-send-email-yong.wu@mediatek.com>
On Wed, Feb 17, 2016 at 08:46:13AM +0800, Yong Wu wrote:
> This patch adds support for mediatek m4u (MultiMedia Memory Management
> Unit).
>
> Signed-off-by: Yong Wu <yong.wu@mediatek.com>
> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
>
> ---
> drivers/iommu/Kconfig | 16 +
> drivers/iommu/Makefile | 1 +
> drivers/iommu/mtk_iommu.c | 732 ++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 749 insertions(+)
> create mode 100644 drivers/iommu/mtk_iommu.c
>
> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> index a1e75cb..4922aa8 100644
> --- a/drivers/iommu/Kconfig
> +++ b/drivers/iommu/Kconfig
> @@ -318,4 +318,20 @@ config S390_IOMMU
> help
> Support for the IOMMU API for s390 PCI devices.
>
> +config MTK_IOMMU
> + bool "MTK IOMMU Support"
> + depends on ARM || ARM64
> + depends on ARCH_MEDIATEK || COMPILE_TEST
> + select IOMMU_API
> + select IOMMU_DMA
> + select IOMMU_IO_PGTABLE_ARMV7S
> + select MEMORY
> + select MTK_SMI
> + help
> + Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
> + Memory Management Unit. This option enables remapping of DMA memory
> + accesses for the multimedia subsystem.
> +
> + If unsure, say N here.
> +
> endif # IOMMU_SUPPORT
> diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile
> index 42fc0c2..44ae2e0 100644
> --- a/drivers/iommu/Makefile
> +++ b/drivers/iommu/Makefile
> @@ -16,6 +16,7 @@ obj-$(CONFIG_INTEL_IOMMU) += intel-iommu.o
> obj-$(CONFIG_INTEL_IOMMU_SVM) += intel-svm.o
> obj-$(CONFIG_IPMMU_VMSA) += ipmmu-vmsa.o
> obj-$(CONFIG_IRQ_REMAP) += intel_irq_remapping.o irq_remapping.o
> +obj-$(CONFIG_MTK_IOMMU) += mtk_iommu.o
> obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o
> obj-$(CONFIG_OMAP_IOMMU_DEBUG) += omap-iommu-debug.o
> obj-$(CONFIG_ROCKCHIP_IOMMU) += rockchip-iommu.o
> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> new file mode 100644
> index 0000000..60fe97b
> --- /dev/null
> +++ b/drivers/iommu/mtk_iommu.c
> @@ -0,0 +1,732 @@
> +/*
> + * Copyright (c) 2015-2016 MediaTek Inc.
> + * Author: Yong Wu <yong.wu@mediatek.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +#include <linux/clk.h>
> +#include <linux/component.h>
> +#include <linux/dma-iommu.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/iommu.h>
> +#include <linux/iopoll.h>
> +#include <linux/list.h>
> +#include <linux/module.h>
> +#include <linux/of_address.h>
> +#include <linux/of_iommu.h>
> +#include <linux/of_irq.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <soc/mediatek/smi.h>
> +#include <dt-bindings/memory/mt8173-larb-port.h>
> +
Some missing includes:
linux/bug.h
for WARN_ON()
linux/device.h
for dev_xxx() error messages, dev_get_drvdata(), etc.
linux/err.h
for error functions (IS_ERR, error definitions)
linux/slab.h
for kzalloc() etc.
linux/spinlock.h
for spinlock functions
asm/barrier.h
for wmb()
Guenter
next prev parent reply other threads:[~2016-02-20 7:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 0:46 [PATCH v9 0/5] MT8173 IOMMU SUPPORT Yong Wu
2016-02-17 0:46 ` [PATCH v9 1/5] dt-bindings: iommu: Add binding for mediatek IOMMU Yong Wu
2016-02-17 0:46 ` [PATCH v9 2/5] dt-bindings: mediatek: Add smi dts binding Yong Wu
2016-02-17 0:46 ` [PATCH v9 3/5] memory: mediatek: Add SMI driver Yong Wu
2016-02-17 0:46 ` [PATCH v9 4/5] iommu/mediatek: Add mt8173 IOMMU driver Yong Wu
2016-02-20 7:02 ` Guenter Roeck [this message]
2016-02-21 18:43 ` [v9,4/5] " Yong Wu
2016-02-17 0:46 ` [PATCH v9 5/5] dts: mt8173: Add iommu/smi nodes for mt8173 Yong Wu
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=20160220070209.GA16577@roeck-us.net \
--to=linux@roeck-us.net \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=djkurtz@chromium.org \
--cc=djkurtz@google.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=kendrick.hsu@mediatek.com \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=mitchelh@codeaurora.org \
--cc=p.zabel@pengutronix.de \
--cc=pebolle@tiscali.nl \
--cc=robh+dt@kernel.org \
--cc=robin.murphy@arm.com \
--cc=srv_heupstream@mediatek.com \
--cc=tfiga@google.com \
--cc=treding@nvidia.com \
--cc=will.deacon@arm.com \
--cc=yong.wu@mediatek.com \
--cc=youhua.li@mediatek.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