Re: [PATCH v8 07/12] iommu/exynos: support for device tree

2013-08-02 Thread Bartlomiej Zolnierkiewicz

Hi,

On Friday, July 26, 2013 08:28:36 PM Cho KyongHo wrote:
> This commit adds device tree support for System MMU.
> This also include the following changes and enhancements:
> 
> * use managed device helper functions.
> Simplyfies System MMU device driver.
> 
> * use only a single clock descriptor.
> System MMU device descriptor is seperate if it is imposible to make
> a single clock descriptor to make a device descriptor for a group of
> System MMUs.
> 
> * removed dbgname member from sysmmu_drvdata structure.
> debugging kernel message for a System MMU is distinguisheable with the
> name of device descroptors.

It would make review easier and speed up merge process if this patch
would be split on separate ones (each containing one logical change).

> Signed-off-by: Cho KyongHo 
> ---
>  drivers/iommu/Kconfig|5 +-
>  drivers/iommu/exynos-iommu.c |  182 
> --
>  2 files changed, 70 insertions(+), 117 deletions(-)
> 
> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> index c332fb9..d45f3c9 100644
> --- a/drivers/iommu/Kconfig
> +++ b/drivers/iommu/Kconfig
> @@ -168,16 +168,15 @@ 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
> + default n

default n is superfluous

>   help
> Support for the IOMMU(System MMU) of Samsung Exynos application
> processor family. This enables H/W multimedia accellerators to see
> non-linear physical memory chunks as a linear memory in their
> address spaces
>  
> -   If unsure, say N here.
> -

Removal of these 2 lines doesn't seem to be an improvement IMHO.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R Institute Poland
Samsung Electronics

>  config EXYNOS_IOMMU_DEBUG
>   bool "Debugging log for Exynos IOMMU"
>   depends on EXYNOS_IOMMU
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index 093eea5..cfc02ed 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -26,6 +26,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> @@ -170,15 +171,14 @@ struct sysmmu_drvdata {
>   struct list_head node; /* entry of exynos_iommu_domain.clients */
>   struct device *sysmmu;  /* System MMU's device descriptor */
>   struct device *dev; /* Owner of system MMU */
> - char *dbgname;
>   int nsfrs;
> - void __iomem **sfrbases;
> - struct clk *clk[2];
> + struct clk *clk;
>   int activations;
>   rwlock_t lock;
>   struct iommu_domain *domain;
>   sysmmu_fault_handler_t fault_handler;
>   unsigned long pgtable;
> + void __iomem *sfrbases[0];
>  };
>  
>  static bool set_sysmmu_active(struct sysmmu_drvdata *data)
> @@ -385,8 +385,8 @@ static irqreturn_t exynos_sysmmu_irq(int irq, void 
> *dev_id)
>   if (!ret && (itype != SYSMMU_FAULT_UNKNOWN))
>   __raw_writel(1 << itype, data->sfrbases[i] + REG_INT_CLEAR);
>   else
> - dev_dbg(data->sysmmu, "(%s) %s is not handled.\n",
> - data->dbgname, sysmmu_fault_name[itype]);
> + dev_dbg(data->sysmmu, "%s is not handled.\n",
> + sysmmu_fault_name[itype]);
>  
>   if (itype != SYSMMU_FAULT_UNKNOWN)
>   sysmmu_unblock(data->sfrbases[i]);
> @@ -410,10 +410,8 @@ static bool __exynos_sysmmu_disable(struct 
> sysmmu_drvdata *data)
>   for (i = 0; i < data->nsfrs; i++)
>   __raw_writel(CTRL_DISABLE, data->sfrbases[i] + REG_MMU_CTRL);
>  
> - if (data->clk[1])
> - clk_disable(data->clk[1]);
> - if (data->clk[0])
> - clk_disable(data->clk[0]);
> + if (data->clk)
> + clk_disable(data->clk);
>  
>   disabled = true;
>   data->pgtable = 0;
> @@ -422,10 +420,10 @@ finish:
>   write_unlock_irqrestore(>lock, flags);
>  
>   if (disabled)
> - dev_dbg(data->sysmmu, "(%s) Disabled\n", data->dbgname);
> + dev_dbg(data->sysmmu, "Disabled\n");
>   else
> - dev_dbg(data->sysmmu, "(%s) %d times left to be disabled\n",
> - data->dbgname, data->activations);
> + dev_dbg(data->sysmmu, "%d times left to be disabled\n",
> + data->activations);
>  
>   return disabled;
>  }
> @@ -452,14 +450,12 @@ static int __exynos_sysmmu_enable(struct sysmmu_drvdata 
> *data,
>   ret = 1;
>   }
>  
> - dev_dbg(data->sysmmu, "(%s) Already enabled\n", data->dbgname);
> + dev_dbg(data->sysmmu, "Already enabled\n");
>   goto finish;
>   }
>  
> - if (data->clk[0])
> - clk_enable(data->clk[0]);
> - if (data->clk[1])
> - clk_enable(data->clk[1]);
> + if 

Re: [PATCH v8 07/12] iommu/exynos: support for device tree

2013-08-02 Thread Bartlomiej Zolnierkiewicz

Hi,

On Friday, July 26, 2013 08:28:36 PM Cho KyongHo wrote:
 This commit adds device tree support for System MMU.
 This also include the following changes and enhancements:
 
 * use managed device helper functions.
 Simplyfies System MMU device driver.
 
 * use only a single clock descriptor.
 System MMU device descriptor is seperate if it is imposible to make
 a single clock descriptor to make a device descriptor for a group of
 System MMUs.
 
 * removed dbgname member from sysmmu_drvdata structure.
 debugging kernel message for a System MMU is distinguisheable with the
 name of device descroptors.

It would make review easier and speed up merge process if this patch
would be split on separate ones (each containing one logical change).

 Signed-off-by: Cho KyongHo pullip@samsung.com
 ---
  drivers/iommu/Kconfig|5 +-
  drivers/iommu/exynos-iommu.c |  182 
 --
  2 files changed, 70 insertions(+), 117 deletions(-)
 
 diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
 index c332fb9..d45f3c9 100644
 --- a/drivers/iommu/Kconfig
 +++ b/drivers/iommu/Kconfig
 @@ -168,16 +168,15 @@ 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
 + default n

default n is superfluous

   help
 Support for the IOMMU(System MMU) of Samsung Exynos application
 processor family. This enables H/W multimedia accellerators to see
 non-linear physical memory chunks as a linear memory in their
 address spaces
  
 -   If unsure, say N here.
 -

Removal of these 2 lines doesn't seem to be an improvement IMHO.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung RD Institute Poland
Samsung Electronics

  config EXYNOS_IOMMU_DEBUG
   bool Debugging log for Exynos IOMMU
   depends on EXYNOS_IOMMU
 diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
 index 093eea5..cfc02ed 100644
 --- a/drivers/iommu/exynos-iommu.c
 +++ b/drivers/iommu/exynos-iommu.c
 @@ -26,6 +26,7 @@
  #include linux/list.h
  #include linux/memblock.h
  #include linux/export.h
 +#include linux/of.h
  
  #include asm/cacheflush.h
  #include asm/pgtable.h
 @@ -170,15 +171,14 @@ struct sysmmu_drvdata {
   struct list_head node; /* entry of exynos_iommu_domain.clients */
   struct device *sysmmu;  /* System MMU's device descriptor */
   struct device *dev; /* Owner of system MMU */
 - char *dbgname;
   int nsfrs;
 - void __iomem **sfrbases;
 - struct clk *clk[2];
 + struct clk *clk;
   int activations;
   rwlock_t lock;
   struct iommu_domain *domain;
   sysmmu_fault_handler_t fault_handler;
   unsigned long pgtable;
 + void __iomem *sfrbases[0];
  };
  
  static bool set_sysmmu_active(struct sysmmu_drvdata *data)
 @@ -385,8 +385,8 @@ static irqreturn_t exynos_sysmmu_irq(int irq, void 
 *dev_id)
   if (!ret  (itype != SYSMMU_FAULT_UNKNOWN))
   __raw_writel(1  itype, data-sfrbases[i] + REG_INT_CLEAR);
   else
 - dev_dbg(data-sysmmu, (%s) %s is not handled.\n,
 - data-dbgname, sysmmu_fault_name[itype]);
 + dev_dbg(data-sysmmu, %s is not handled.\n,
 + sysmmu_fault_name[itype]);
  
   if (itype != SYSMMU_FAULT_UNKNOWN)
   sysmmu_unblock(data-sfrbases[i]);
 @@ -410,10 +410,8 @@ static bool __exynos_sysmmu_disable(struct 
 sysmmu_drvdata *data)
   for (i = 0; i  data-nsfrs; i++)
   __raw_writel(CTRL_DISABLE, data-sfrbases[i] + REG_MMU_CTRL);
  
 - if (data-clk[1])
 - clk_disable(data-clk[1]);
 - if (data-clk[0])
 - clk_disable(data-clk[0]);
 + if (data-clk)
 + clk_disable(data-clk);
  
   disabled = true;
   data-pgtable = 0;
 @@ -422,10 +420,10 @@ finish:
   write_unlock_irqrestore(data-lock, flags);
  
   if (disabled)
 - dev_dbg(data-sysmmu, (%s) Disabled\n, data-dbgname);
 + dev_dbg(data-sysmmu, Disabled\n);
   else
 - dev_dbg(data-sysmmu, (%s) %d times left to be disabled\n,
 - data-dbgname, data-activations);
 + dev_dbg(data-sysmmu, %d times left to be disabled\n,
 + data-activations);
  
   return disabled;
  }
 @@ -452,14 +450,12 @@ static int __exynos_sysmmu_enable(struct sysmmu_drvdata 
 *data,
   ret = 1;
   }
  
 - dev_dbg(data-sysmmu, (%s) Already enabled\n, data-dbgname);
 + dev_dbg(data-sysmmu, Already enabled\n);
   goto finish;
   }
  
 - if (data-clk[0])
 - clk_enable(data-clk[0]);
 - if (data-clk[1])
 - clk_enable(data-clk[1]);
 + if (data-clk)
 + clk_enable(data-clk);
  
   data-pgtable = 

RE: [PATCH v8 07/12] iommu/exynos: support for device tree

2013-08-01 Thread Cho KyongHo
> -Original Message-
> From: Tomasz Figa [mailto:tomasz.f...@gmail.com]
> Sent: Saturday, July 27, 2013 11:07 PM
> 
> Hi,
> 
> On Friday 26 of July 2013 20:28:36 Cho KyongHo wrote:
> > This commit adds device tree support for System MMU.
> > This also include the following changes and enhancements:
> >
> > * use managed device helper functions.
> > Simplyfies System MMU device driver.
> >
> > * use only a single clock descriptor.
> > System MMU device descriptor is seperate if it is imposible to make
> > a single clock descriptor to make a device descriptor for a group of
> > System MMUs.
> >
> > * removed dbgname member from sysmmu_drvdata structure.
> > debugging kernel message for a System MMU is distinguisheable with the
> > name of device descroptors.
> >
> > Signed-off-by: Cho KyongHo 
> > ---
> >  drivers/iommu/Kconfig|5 +-
> >  drivers/iommu/exynos-iommu.c |  182
> > -- 2 files changed, 70
> > insertions(+), 117 deletions(-)
> 
> Whenever you introduce or modify (extend) a device tree binding please
> don't forget about reflecting that in documentation
> (Documentation/devicetree/bindings) and CCing devicetree mailing list
> (devicet...@vger.kernel.org). Both of these steps are necessary to get any
> device tree stuff merged.
> 

Oh I see.
Thank you for advice.

> Best regards,
> Tomasz

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v8 07/12] iommu/exynos: support for device tree

2013-08-01 Thread Cho KyongHo
 -Original Message-
 From: Tomasz Figa [mailto:tomasz.f...@gmail.com]
 Sent: Saturday, July 27, 2013 11:07 PM
 
 Hi,
 
 On Friday 26 of July 2013 20:28:36 Cho KyongHo wrote:
  This commit adds device tree support for System MMU.
  This also include the following changes and enhancements:
 
  * use managed device helper functions.
  Simplyfies System MMU device driver.
 
  * use only a single clock descriptor.
  System MMU device descriptor is seperate if it is imposible to make
  a single clock descriptor to make a device descriptor for a group of
  System MMUs.
 
  * removed dbgname member from sysmmu_drvdata structure.
  debugging kernel message for a System MMU is distinguisheable with the
  name of device descroptors.
 
  Signed-off-by: Cho KyongHo pullip@samsung.com
  ---
   drivers/iommu/Kconfig|5 +-
   drivers/iommu/exynos-iommu.c |  182
  -- 2 files changed, 70
  insertions(+), 117 deletions(-)
 
 Whenever you introduce or modify (extend) a device tree binding please
 don't forget about reflecting that in documentation
 (Documentation/devicetree/bindings) and CCing devicetree mailing list
 (devicet...@vger.kernel.org). Both of these steps are necessary to get any
 device tree stuff merged.
 

Oh I see.
Thank you for advice.

 Best regards,
 Tomasz

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v8 07/12] iommu/exynos: support for device tree

2013-07-27 Thread Tomasz Figa
Hi,

On Friday 26 of July 2013 20:28:36 Cho KyongHo wrote:
> This commit adds device tree support for System MMU.
> This also include the following changes and enhancements:
> 
> * use managed device helper functions.
> Simplyfies System MMU device driver.
> 
> * use only a single clock descriptor.
> System MMU device descriptor is seperate if it is imposible to make
> a single clock descriptor to make a device descriptor for a group of
> System MMUs.
> 
> * removed dbgname member from sysmmu_drvdata structure.
> debugging kernel message for a System MMU is distinguisheable with the
> name of device descroptors.
> 
> Signed-off-by: Cho KyongHo 
> ---
>  drivers/iommu/Kconfig|5 +-
>  drivers/iommu/exynos-iommu.c |  182
> -- 2 files changed, 70
> insertions(+), 117 deletions(-)

Whenever you introduce or modify (extend) a device tree binding please 
don't forget about reflecting that in documentation 
(Documentation/devicetree/bindings) and CCing devicetree mailing list 
(devicet...@vger.kernel.org). Both of these steps are necessary to get any 
device tree stuff merged.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v8 07/12] iommu/exynos: support for device tree

2013-07-27 Thread Tomasz Figa
Hi,

On Friday 26 of July 2013 20:28:36 Cho KyongHo wrote:
 This commit adds device tree support for System MMU.
 This also include the following changes and enhancements:
 
 * use managed device helper functions.
 Simplyfies System MMU device driver.
 
 * use only a single clock descriptor.
 System MMU device descriptor is seperate if it is imposible to make
 a single clock descriptor to make a device descriptor for a group of
 System MMUs.
 
 * removed dbgname member from sysmmu_drvdata structure.
 debugging kernel message for a System MMU is distinguisheable with the
 name of device descroptors.
 
 Signed-off-by: Cho KyongHo pullip@samsung.com
 ---
  drivers/iommu/Kconfig|5 +-
  drivers/iommu/exynos-iommu.c |  182
 -- 2 files changed, 70
 insertions(+), 117 deletions(-)

Whenever you introduce or modify (extend) a device tree binding please 
don't forget about reflecting that in documentation 
(Documentation/devicetree/bindings) and CCing devicetree mailing list 
(devicet...@vger.kernel.org). Both of these steps are necessary to get any 
device tree stuff merged.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v8 07/12] iommu/exynos: support for device tree

2013-07-26 Thread Cho KyongHo
This commit adds device tree support for System MMU.
This also include the following changes and enhancements:

* use managed device helper functions.
Simplyfies System MMU device driver.

* use only a single clock descriptor.
System MMU device descriptor is seperate if it is imposible to make
a single clock descriptor to make a device descriptor for a group of
System MMUs.

* removed dbgname member from sysmmu_drvdata structure.
debugging kernel message for a System MMU is distinguisheable with the
name of device descroptors.

Signed-off-by: Cho KyongHo 
---
 drivers/iommu/Kconfig|5 +-
 drivers/iommu/exynos-iommu.c |  182 --
 2 files changed, 70 insertions(+), 117 deletions(-)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index c332fb9..d45f3c9 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -168,16 +168,15 @@ 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
+   default n
help
  Support for the IOMMU(System MMU) of Samsung Exynos application
  processor family. This enables H/W multimedia accellerators to see
  non-linear physical memory chunks as a linear memory in their
  address spaces
 
- If unsure, say N here.
-
 config EXYNOS_IOMMU_DEBUG
bool "Debugging log for Exynos IOMMU"
depends on EXYNOS_IOMMU
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 093eea5..cfc02ed 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -170,15 +171,14 @@ struct sysmmu_drvdata {
struct list_head node; /* entry of exynos_iommu_domain.clients */
struct device *sysmmu;  /* System MMU's device descriptor */
struct device *dev; /* Owner of system MMU */
-   char *dbgname;
int nsfrs;
-   void __iomem **sfrbases;
-   struct clk *clk[2];
+   struct clk *clk;
int activations;
rwlock_t lock;
struct iommu_domain *domain;
sysmmu_fault_handler_t fault_handler;
unsigned long pgtable;
+   void __iomem *sfrbases[0];
 };
 
 static bool set_sysmmu_active(struct sysmmu_drvdata *data)
@@ -385,8 +385,8 @@ static irqreturn_t exynos_sysmmu_irq(int irq, void *dev_id)
if (!ret && (itype != SYSMMU_FAULT_UNKNOWN))
__raw_writel(1 << itype, data->sfrbases[i] + REG_INT_CLEAR);
else
-   dev_dbg(data->sysmmu, "(%s) %s is not handled.\n",
-   data->dbgname, sysmmu_fault_name[itype]);
+   dev_dbg(data->sysmmu, "%s is not handled.\n",
+   sysmmu_fault_name[itype]);
 
if (itype != SYSMMU_FAULT_UNKNOWN)
sysmmu_unblock(data->sfrbases[i]);
@@ -410,10 +410,8 @@ static bool __exynos_sysmmu_disable(struct sysmmu_drvdata 
*data)
for (i = 0; i < data->nsfrs; i++)
__raw_writel(CTRL_DISABLE, data->sfrbases[i] + REG_MMU_CTRL);
 
-   if (data->clk[1])
-   clk_disable(data->clk[1]);
-   if (data->clk[0])
-   clk_disable(data->clk[0]);
+   if (data->clk)
+   clk_disable(data->clk);
 
disabled = true;
data->pgtable = 0;
@@ -422,10 +420,10 @@ finish:
write_unlock_irqrestore(>lock, flags);
 
if (disabled)
-   dev_dbg(data->sysmmu, "(%s) Disabled\n", data->dbgname);
+   dev_dbg(data->sysmmu, "Disabled\n");
else
-   dev_dbg(data->sysmmu, "(%s) %d times left to be disabled\n",
-   data->dbgname, data->activations);
+   dev_dbg(data->sysmmu, "%d times left to be disabled\n",
+   data->activations);
 
return disabled;
 }
@@ -452,14 +450,12 @@ static int __exynos_sysmmu_enable(struct sysmmu_drvdata 
*data,
ret = 1;
}
 
-   dev_dbg(data->sysmmu, "(%s) Already enabled\n", data->dbgname);
+   dev_dbg(data->sysmmu, "Already enabled\n");
goto finish;
}
 
-   if (data->clk[0])
-   clk_enable(data->clk[0]);
-   if (data->clk[1])
-   clk_enable(data->clk[1]);
+   if (data->clk)
+   clk_enable(data->clk);
 
data->pgtable = pgtable;
 
@@ -479,7 +475,7 @@ static int __exynos_sysmmu_enable(struct sysmmu_drvdata 
*data,
 
data->domain = domain;
 
-   dev_dbg(data->sysmmu, "(%s) Enabled\n", data->dbgname);
+   dev_dbg(data->sysmmu, "Enabled\n");
 finish:
write_unlock_irqrestore(>lock, flags);
 
@@ -495,7 +491,7 @@ int exynos_sysmmu_enable(struct device *dev, unsigned long 
pgtable)
 
ret = pm_runtime_get_sync(data->sysmmu);

[PATCH v8 07/12] iommu/exynos: support for device tree

2013-07-26 Thread Cho KyongHo
This commit adds device tree support for System MMU.
This also include the following changes and enhancements:

* use managed device helper functions.
Simplyfies System MMU device driver.

* use only a single clock descriptor.
System MMU device descriptor is seperate if it is imposible to make
a single clock descriptor to make a device descriptor for a group of
System MMUs.

* removed dbgname member from sysmmu_drvdata structure.
debugging kernel message for a System MMU is distinguisheable with the
name of device descroptors.

Signed-off-by: Cho KyongHo pullip@samsung.com
---
 drivers/iommu/Kconfig|5 +-
 drivers/iommu/exynos-iommu.c |  182 --
 2 files changed, 70 insertions(+), 117 deletions(-)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index c332fb9..d45f3c9 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -168,16 +168,15 @@ 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
+   default n
help
  Support for the IOMMU(System MMU) of Samsung Exynos application
  processor family. This enables H/W multimedia accellerators to see
  non-linear physical memory chunks as a linear memory in their
  address spaces
 
- If unsure, say N here.
-
 config EXYNOS_IOMMU_DEBUG
bool Debugging log for Exynos IOMMU
depends on EXYNOS_IOMMU
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 093eea5..cfc02ed 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -26,6 +26,7 @@
 #include linux/list.h
 #include linux/memblock.h
 #include linux/export.h
+#include linux/of.h
 
 #include asm/cacheflush.h
 #include asm/pgtable.h
@@ -170,15 +171,14 @@ struct sysmmu_drvdata {
struct list_head node; /* entry of exynos_iommu_domain.clients */
struct device *sysmmu;  /* System MMU's device descriptor */
struct device *dev; /* Owner of system MMU */
-   char *dbgname;
int nsfrs;
-   void __iomem **sfrbases;
-   struct clk *clk[2];
+   struct clk *clk;
int activations;
rwlock_t lock;
struct iommu_domain *domain;
sysmmu_fault_handler_t fault_handler;
unsigned long pgtable;
+   void __iomem *sfrbases[0];
 };
 
 static bool set_sysmmu_active(struct sysmmu_drvdata *data)
@@ -385,8 +385,8 @@ static irqreturn_t exynos_sysmmu_irq(int irq, void *dev_id)
if (!ret  (itype != SYSMMU_FAULT_UNKNOWN))
__raw_writel(1  itype, data-sfrbases[i] + REG_INT_CLEAR);
else
-   dev_dbg(data-sysmmu, (%s) %s is not handled.\n,
-   data-dbgname, sysmmu_fault_name[itype]);
+   dev_dbg(data-sysmmu, %s is not handled.\n,
+   sysmmu_fault_name[itype]);
 
if (itype != SYSMMU_FAULT_UNKNOWN)
sysmmu_unblock(data-sfrbases[i]);
@@ -410,10 +410,8 @@ static bool __exynos_sysmmu_disable(struct sysmmu_drvdata 
*data)
for (i = 0; i  data-nsfrs; i++)
__raw_writel(CTRL_DISABLE, data-sfrbases[i] + REG_MMU_CTRL);
 
-   if (data-clk[1])
-   clk_disable(data-clk[1]);
-   if (data-clk[0])
-   clk_disable(data-clk[0]);
+   if (data-clk)
+   clk_disable(data-clk);
 
disabled = true;
data-pgtable = 0;
@@ -422,10 +420,10 @@ finish:
write_unlock_irqrestore(data-lock, flags);
 
if (disabled)
-   dev_dbg(data-sysmmu, (%s) Disabled\n, data-dbgname);
+   dev_dbg(data-sysmmu, Disabled\n);
else
-   dev_dbg(data-sysmmu, (%s) %d times left to be disabled\n,
-   data-dbgname, data-activations);
+   dev_dbg(data-sysmmu, %d times left to be disabled\n,
+   data-activations);
 
return disabled;
 }
@@ -452,14 +450,12 @@ static int __exynos_sysmmu_enable(struct sysmmu_drvdata 
*data,
ret = 1;
}
 
-   dev_dbg(data-sysmmu, (%s) Already enabled\n, data-dbgname);
+   dev_dbg(data-sysmmu, Already enabled\n);
goto finish;
}
 
-   if (data-clk[0])
-   clk_enable(data-clk[0]);
-   if (data-clk[1])
-   clk_enable(data-clk[1]);
+   if (data-clk)
+   clk_enable(data-clk);
 
data-pgtable = pgtable;
 
@@ -479,7 +475,7 @@ static int __exynos_sysmmu_enable(struct sysmmu_drvdata 
*data,
 
data-domain = domain;
 
-   dev_dbg(data-sysmmu, (%s) Enabled\n, data-dbgname);
+   dev_dbg(data-sysmmu, Enabled\n);
 finish:
write_unlock_irqrestore(data-lock, flags);
 
@@ -495,7 +491,7 @@ int exynos_sysmmu_enable(struct device *dev, unsigned long 
pgtable)