From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758038AbcBTHCW (ORCPT ); Sat, 20 Feb 2016 02:02:22 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:47117 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757997AbcBTHCS (ORCPT ); Sat, 20 Feb 2016 02:02:18 -0500 Date: Fri, 19 Feb 2016 23:02:09 -0800 From: Guenter Roeck To: Yong Wu Cc: Joerg Roedel , Thierry Reding , Mark Rutland , Matthias Brugger , 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 , Will Deacon , linux-kernel@vger.kernel.org, Tomasz Figa , iommu@lists.linux-foundation.org, Rob Herring , Daniel Kurtz , Sasha Hauer , linux-mediatek@lists.infradead.org, youhua.li@mediatek.com, Robin Murphy , linux-arm-kernel@lists.infradead.org, Lucas Stach , djkurtz@chromium.org Subject: Re: [v9,4/5] iommu/mediatek: Add mt8173 IOMMU driver Message-ID: <20160220070209.GA16577@roeck-us.net> References: <1455669974-1527-5-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455669974-1527-5-git-send-email-yong.wu@mediatek.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Reviewed-by: Robin Murphy > > --- > 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 > + * > + * 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 > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + 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