All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu: exynos: add support for dt based instantiation for iommu devices
@ 2012-11-05  9:48 Rahul Sharma
       [not found] ` <1352108895-21087-1-git-send-email-rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul Sharma @ 2012-11-05  9:48 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ,
	prathyush.k-Sze3O3UU22JBDgjK7y7TUQ,
	sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ, joshi-Sze3O3UU22JBDgjK7y7TUQ,
	inki.dae-Sze3O3UU22JBDgjK7y7TUQ,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ,
	rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ,
	prashanth.g-Sze3O3UU22JBDgjK7y7TUQ,
	s.shirish-Sze3O3UU22JBDgjK7y7TUQ

This patch adds supports DT based intantiation of sysmmu devices.
It also removes dependency on CONFIG_EXYNOS_DEV_SYSMMU which is
primarily meant for nont-dt platforms.

This patch is based on "arm/exynos" branch at
http://git.kernel.org/?p=linux/kernel/git/joro/iommu.git

This patch is having dependency on  linux-samsung-soc patchset named
"add dt based support for iommu for hdmi"

Signed-off-by: Rahul Sharma <rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 drivers/iommu/Kconfig        |    2 +-
 drivers/iommu/exynos-iommu.c |   28 +++++++++++++++++++++++++---
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 9f69b56..52dc41f 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -168,7 +168,7 @@ config TEGRA_IOMMU_SMMU
 
 config EXYNOS_IOMMU
 	bool "Exynos IOMMU Support"
-	depends on ARCH_EXYNOS && EXYNOS_DEV_SYSMMU
+	depends on ARCH_EXYNOS
 	select IOMMU_API
 	help
 	  Support for the IOMMU(System MMU) of Samsung Exynos application
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 7fe44f8..9079f71 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -25,6 +25,7 @@
 #include <linux/list.h>
 #include <linux/memblock.h>
 #include <linux/export.h>
+#include <linux/of_platform.h>
 
 #include <asm/cacheflush.h>
 #include <asm/pgtable.h>
@@ -576,6 +577,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
 	int i, ret;
 	struct device *dev;
 	struct sysmmu_drvdata *data;
+	struct sysmmu_platform_data *platdata;
 
 	dev = &pdev->dev;
 
@@ -634,9 +636,21 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
 		}
 	}
 
+	if(dev->of_node) {
+		platdata = devm_kzalloc(dev, sizeof(*platdata), GFP_KERNEL);
+		if (!platdata) {
+			dev_dbg(dev, "memory allocation for pdata failed\n");
+			goto err_irq;
+		}
+
+		platdata->clockname = SYSMMU_CLOCK_NAME;
+		platdata->dbgname = (char *)dev->of_node->name;
+		dev->platform_data = platdata;
+	}
+
 	if (dev_get_platdata(dev)) {
 		char *deli, *beg;
-		struct sysmmu_platform_data *platdata = dev_get_platdata(dev);
+		platdata = dev_get_platdata(dev);
 
 		beg = platdata->clockname;
 
@@ -670,8 +684,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
 
 	__set_fault_handler(data, &default_fault_handler);
 
-	if (dev->parent)
-		pm_runtime_enable(dev);
+	pm_runtime_enable(dev);
 
 	dev_dbg(dev, "(%s) Initialized\n", data->dbgname);
 	return 0;
@@ -693,11 +706,20 @@ err_alloc:
 	return ret;
 }
 
+static struct of_device_id iommu_match_types[] = {
+	{
+		.compatible = "samsung,exynos5-sysmmu",
+	}, {
+		/* end node */
+	}
+};
+
 static struct platform_driver exynos_sysmmu_driver = {
 	.probe		= exynos_sysmmu_probe,
 	.driver		= {
 		.owner		= THIS_MODULE,
 		.name		= "exynos-sysmmu",
+		.of_match_table = iommu_match_types,
 	}
 };
 
-- 
1.7.0.4

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

* [PATCH] iommu: exynos: add support for dt based instantiation for iommu devices
       [not found] ` <1352108895-21087-1-git-send-email-rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2012-11-08 22:36   ` KyongHo Cho
  2012-11-17 21:37   ` Joerg Roedel
  1 sibling, 0 replies; 5+ messages in thread
From: KyongHo Cho @ 2012-11-08 22:36 UTC (permalink / raw)
  To: Rahul Sharma
  Cc: jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ,
	prathyush.k-Sze3O3UU22JBDgjK7y7TUQ,
	sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ, joshi-Sze3O3UU22JBDgjK7y7TUQ,
	inki.dae-Sze3O3UU22JBDgjK7y7TUQ,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ,
	prashanth.g-Sze3O3UU22JBDgjK7y7TUQ,
	s.shirish-Sze3O3UU22JBDgjK7y7TUQ


[-- Attachment #1.1: Type: text/plain, Size: 4156 bytes --]

Hi.

Thank you for your work for exynos-iommu.
Actually I am preparing a design change of exynos-iommu driver including DT
support.
If you are OK, I want to discuss with you about it.

The current exynos-iommu driver needs to be upgraded to make it transparent
to the client drivers.

Thank you.

Cho KyongHo.

On Mon, Nov 5, 2012 at 6:48 PM, Rahul Sharma <rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
wrote:
> This patch adds supports DT based intantiation of sysmmu devices.
> It also removes dependency on CONFIG_EXYNOS_DEV_SYSMMU which is
> primarily meant for nont-dt platforms.
>
> This patch is based on "arm/exynos" branch at
> http://git.kernel.org/?p=linux/kernel/git/joro/iommu.git
>
> This patch is having dependency on  linux-samsung-soc patchset named
> "add dt based support for iommu for hdmi"
>
> Signed-off-by: Rahul Sharma <rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
>  drivers/iommu/Kconfig        |    2 +-
>  drivers/iommu/exynos-iommu.c |   28 +++++++++++++++++++++++++---
>  2 files changed, 26 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> index 9f69b56..52dc41f 100644
> --- a/drivers/iommu/Kconfig
> +++ b/drivers/iommu/Kconfig
> @@ -168,7 +168,7 @@ config TEGRA_IOMMU_SMMU
>
>  config EXYNOS_IOMMU
>         bool "Exynos IOMMU Support"
> -       depends on ARCH_EXYNOS && EXYNOS_DEV_SYSMMU
> +       depends on ARCH_EXYNOS
>         select IOMMU_API
>         help
>           Support for the IOMMU(System MMU) of Samsung Exynos application
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 7fe44f8..9079f71 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -25,6 +25,7 @@
>  #include <linux/list.h>
>  #include <linux/memblock.h>
>  #include <linux/export.h>
> +#include <linux/of_platform.h>
>
>  #include <asm/cacheflush.h>
>  #include <asm/pgtable.h>
> @@ -576,6 +577,7 @@ static int exynos_sysmmu_probe(struct platform_device
*pdev)
>         int i, ret;
>         struct device *dev;
>         struct sysmmu_drvdata *data;
> +       struct sysmmu_platform_data *platdata;
>
>         dev = &pdev->dev;
>
> @@ -634,9 +636,21 @@ static int exynos_sysmmu_probe(struct
platform_device *pdev)
>                 }
>         }
>
> +       if(dev->of_node) {
> +               platdata = devm_kzalloc(dev, sizeof(*platdata),
GFP_KERNEL);
> +               if (!platdata) {
> +                       dev_dbg(dev, "memory allocation for pdata
failed\n");
> +                       goto err_irq;
> +               }
> +
> +               platdata->clockname = SYSMMU_CLOCK_NAME;
> +               platdata->dbgname = (char *)dev->of_node->name;
> +               dev->platform_data = platdata;
> +       }
> +
>         if (dev_get_platdata(dev)) {
>                 char *deli, *beg;
> -               struct sysmmu_platform_data *platdata =
dev_get_platdata(dev);
> +               platdata = dev_get_platdata(dev);
>
>                 beg = platdata->clockname;
>
> @@ -670,8 +684,7 @@ static int exynos_sysmmu_probe(struct platform_device
*pdev)
>
>         __set_fault_handler(data, &default_fault_handler);
>
> -       if (dev->parent)
> -               pm_runtime_enable(dev);
> +       pm_runtime_enable(dev);
>
>         dev_dbg(dev, "(%s) Initialized\n", data->dbgname);
>         return 0;
> @@ -693,11 +706,20 @@ err_alloc:
>         return ret;
>  }
>
> +static struct of_device_id iommu_match_types[] = {
> +       {
> +               .compatible = "samsung,exynos5-sysmmu",
> +       }, {
> +               /* end node */
> +       }
> +};
> +
>  static struct platform_driver exynos_sysmmu_driver = {
>         .probe          = exynos_sysmmu_probe,
>         .driver         = {
>                 .owner          = THIS_MODULE,
>                 .name           = "exynos-sysmmu",
> +               .of_match_table = iommu_match_types,
>         }
>  };
>
> --
> 1.7.0.4
>
> _______________________________________________
> iommu mailing list
> iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu

[-- Attachment #1.2: Type: text/html, Size: 5353 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] iommu: exynos: add support for dt based instantiation for iommu devices
       [not found] ` <1352108895-21087-1-git-send-email-rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  2012-11-08 22:36   ` KyongHo Cho
@ 2012-11-17 21:37   ` Joerg Roedel
       [not found]     ` <20121117213734.GV25742-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Joerg Roedel @ 2012-11-17 21:37 UTC (permalink / raw)
  To: Rahul Sharma
  Cc: jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ,
	prathyush.k-Sze3O3UU22JBDgjK7y7TUQ,
	sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joshi-Sze3O3UU22JBDgjK7y7TUQ, inki.dae-Sze3O3UU22JBDgjK7y7TUQ,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ,
	prashanth.g-Sze3O3UU22JBDgjK7y7TUQ,
	s.shirish-Sze3O3UU22JBDgjK7y7TUQ

On Mon, Nov 05, 2012 at 03:18:15PM +0530, Rahul Sharma wrote:
>  drivers/iommu/exynos-iommu.c |   28 +++++++++++++++++++++++++---
>  2 files changed, 26 insertions(+), 4 deletions(-)

I added the following build-fix to the arm/exynos branch too:

>From e706d84c9fecd7855191eab2f9e2e0234a0f8e05 Mon Sep 17 00:00:00 2001
From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Date: Sat, 17 Nov 2012 22:29:32 +0100
Subject: [PATCH] iommu/exynos: Fix build error in exynos_sysmmu_probe

Fix the following build error:

  CC      drivers/iommu/exynos-iommu.o
/data/repos/linux/drivers/iommu/exynos-iommu.c: In function 'exynos_sysmmu_probe':
/data/repos/linux/drivers/iommu/exynos-iommu.c:647:43: error: dereferencing pointer to incomplete type
make[3]: *** [drivers/iommu/exynos-iommu.o] Error 1

Signed-off-by: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
---
 drivers/iommu/exynos-iommu.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 9079f71..da1975d 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -26,6 +26,7 @@
 #include <linux/memblock.h>
 #include <linux/export.h>
 #include <linux/of_platform.h>
+#include <linux/of.h>
 
 #include <asm/cacheflush.h>
 #include <asm/pgtable.h>
-- 
1.7.9.5

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

* Re: [PATCH] iommu: exynos: add support for dt based instantiation for iommu devices
       [not found]     ` <20121117213734.GV25742-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2012-11-29 11:13       ` Rahul Sharma
  0 siblings, 0 replies; 5+ messages in thread
From: Rahul Sharma @ 2012-11-29 11:13 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: joshi-Sze3O3UU22JBDgjK7y7TUQ, inki.dae-Sze3O3UU22JBDgjK7y7TUQ,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ,
	pullip.cho-Sze3O3UU22JBDgjK7y7TUQ, Rahul Sharma

Thanks Mr. Joerg,

I want to request you to abandon the above patches submitted by me.
The exynos-iommu drivers
patches, submitted by Mr. Kyongho Cho, also contains DT changes along
with other things.

It is been already applied to "arm/exynos" branch.

regards,
Rahul Sharma.


On Sun, Nov 18, 2012 at 3:07 AM, Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> wrote:
> On Mon, Nov 05, 2012 at 03:18:15PM +0530, Rahul Sharma wrote:
>>  drivers/iommu/exynos-iommu.c |   28 +++++++++++++++++++++++++---
>>  2 files changed, 26 insertions(+), 4 deletions(-)
>
> I added the following build-fix to the arm/exynos branch too:
>
> From e706d84c9fecd7855191eab2f9e2e0234a0f8e05 Mon Sep 17 00:00:00 2001
> From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
> Date: Sat, 17 Nov 2012 22:29:32 +0100
> Subject: [PATCH] iommu/exynos: Fix build error in exynos_sysmmu_probe
>
> Fix the following build error:
>
>   CC      drivers/iommu/exynos-iommu.o
> /data/repos/linux/drivers/iommu/exynos-iommu.c: In function 'exynos_sysmmu_probe':
> /data/repos/linux/drivers/iommu/exynos-iommu.c:647:43: error: dereferencing pointer to incomplete type
> make[3]: *** [drivers/iommu/exynos-iommu.o] Error 1
>
> Signed-off-by: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
> ---
>  drivers/iommu/exynos-iommu.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 9079f71..da1975d 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -26,6 +26,7 @@
>  #include <linux/memblock.h>
>  #include <linux/export.h>
>  #include <linux/of_platform.h>
> +#include <linux/of.h>
>
>  #include <asm/cacheflush.h>
>  #include <asm/pgtable.h>
> --
> 1.7.9.5
>
>

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

* [PATCH] iommu: exynos: add support for dt based instantiation for iommu devices
@ 2012-11-05 15:22 Rahul Sharma
  0 siblings, 0 replies; 5+ messages in thread
From: Rahul Sharma @ 2012-11-05 15:22 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ,
	prathyush.k-Sze3O3UU22JBDgjK7y7TUQ,
	sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ, joshi-Sze3O3UU22JBDgjK7y7TUQ,
	inki.dae-Sze3O3UU22JBDgjK7y7TUQ,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ,
	rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ,
	prashanth.g-Sze3O3UU22JBDgjK7y7TUQ,
	s.shirish-Sze3O3UU22JBDgjK7y7TUQ

This patch adds supports DT based intantiation of sysmmu devices.
It also removes dependency on CONFIG_EXYNOS_DEV_SYSMMU which is
primarily meant for nont-dt platforms.

This patch is based on "arm/exynos" branch at
http://git.kernel.org/?p=linux/kernel/git/joro/iommu.git

This patch is having dependency on  linux-samsung-soc patchset posted at
http://permalink.gmane.org/gmane.linux.kernel.samsung-soc/13556

Signed-off-by: Rahul Sharma <rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 drivers/iommu/Kconfig        |    2 +-
 drivers/iommu/exynos-iommu.c |   28 +++++++++++++++++++++++++---
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 9f69b56..52dc41f 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -168,7 +168,7 @@ config TEGRA_IOMMU_SMMU
 
 config EXYNOS_IOMMU
 	bool "Exynos IOMMU Support"
-	depends on ARCH_EXYNOS && EXYNOS_DEV_SYSMMU
+	depends on ARCH_EXYNOS
 	select IOMMU_API
 	help
 	  Support for the IOMMU(System MMU) of Samsung Exynos application
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 7fe44f8..64a7392 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -25,6 +25,7 @@
 #include <linux/list.h>
 #include <linux/memblock.h>
 #include <linux/export.h>
+#include <linux/of_platform.h>
 
 #include <asm/cacheflush.h>
 #include <asm/pgtable.h>
@@ -576,6 +577,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
 	int i, ret;
 	struct device *dev;
 	struct sysmmu_drvdata *data;
+	struct sysmmu_platform_data *platdata;
 
 	dev = &pdev->dev;
 
@@ -634,9 +636,21 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
 		}
 	}
 
+	if (dev->of_node) {
+		platdata = devm_kzalloc(dev, sizeof(*platdata), GFP_KERNEL);
+		if (!platdata) {
+			dev_dbg(dev, "memory allocation for pdata failed\n");
+			goto err_irq;
+		}
+
+		platdata->clockname = SYSMMU_CLOCK_NAME;
+		platdata->dbgname = (char *)dev->of_node->name;
+		dev->platform_data = platdata;
+	}
+
 	if (dev_get_platdata(dev)) {
 		char *deli, *beg;
-		struct sysmmu_platform_data *platdata = dev_get_platdata(dev);
+		platdata = dev_get_platdata(dev);
 
 		beg = platdata->clockname;
 
@@ -670,8 +684,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
 
 	__set_fault_handler(data, &default_fault_handler);
 
-	if (dev->parent)
-		pm_runtime_enable(dev);
+	pm_runtime_enable(dev);
 
 	dev_dbg(dev, "(%s) Initialized\n", data->dbgname);
 	return 0;
@@ -693,11 +706,20 @@ err_alloc:
 	return ret;
 }
 
+static struct of_device_id iommu_match_types[] = {
+	{
+		.compatible = "samsung,exynos5-sysmmu",
+	}, {
+		/* end node */
+	}
+};
+
 static struct platform_driver exynos_sysmmu_driver = {
 	.probe		= exynos_sysmmu_probe,
 	.driver		= {
 		.owner		= THIS_MODULE,
 		.name		= "exynos-sysmmu",
+		.of_match_table = iommu_match_types,
 	}
 };
 
-- 
1.7.0.4

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

end of thread, other threads:[~2012-11-29 11:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05  9:48 [PATCH] iommu: exynos: add support for dt based instantiation for iommu devices Rahul Sharma
     [not found] ` <1352108895-21087-1-git-send-email-rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-11-08 22:36   ` KyongHo Cho
2012-11-17 21:37   ` Joerg Roedel
     [not found]     ` <20121117213734.GV25742-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2012-11-29 11:13       ` Rahul Sharma
2012-11-05 15:22 Rahul Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.