Re: [RFC 2/4] iommu: tegra/gart: Add device tree support

2012-04-12 Thread Thierry Reding
* Stephen Warren wrote:
 On 04/11/2012 06:10 AM, Thierry Reding wrote:
  This commit adds device tree support for the GART hardware available on
  NVIDIA Tegra 20 SoCs.
  
  Signed-off-by: Thierry Reding thierry.red...@avionic-design.de
  ---
   arch/arm/boot/dts/tegra20.dtsi |6 ++
   arch/arm/mach-tegra/board-dt-tegra20.c |1 +
   drivers/iommu/tegra-gart.c |   10 ++
   3 files changed, 17 insertions(+)
 
 I think I'd prefer at least the tegra20.dtsi change split out into a
 separate patch so I can queue it in a dt topic branch in the Tegra repo.
 
 It might be a good idea to split this into two on an arch/arm vs.
 drivers/iommu boundary. Looking at Olof's branches for 3.4, that split
 is what happened there.
 
 Finally, there should be a binding documentation file in
 Documentation/devicetree/bindings in order to specify the number of reg
 property entries needed, and their meaning, since there's more than 1
 (even though you did comment it nicely in the .dtsi file)

Okay, I'll do that.

Thierry


pgpd4sliiEaEi.pgp
Description: PGP signature
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

[RFC 2/4] iommu: tegra/gart: Add device tree support

2012-04-11 Thread Thierry Reding
This commit adds device tree support for the GART hardware available on
NVIDIA Tegra 20 SoCs.

Signed-off-by: Thierry Reding thierry.red...@avionic-design.de
---
 arch/arm/boot/dts/tegra20.dtsi |6 ++
 arch/arm/mach-tegra/board-dt-tegra20.c |1 +
 drivers/iommu/tegra-gart.c |   10 ++
 3 files changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 55b28fd..cf3ff41 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -212,5 +212,11 @@
interrupts =  0 97 0x04 ;
phy_type = utmi;
};
+
+   gart: gart@7000f000 {
+   compatible = nvidia,tegra20-gart;
+   reg =  0x7000f000 0x0100/* controller registers */
+   0x5800 0x0200 ; /* GART aperture */
+   };
 };
 
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c 
b/arch/arm/mach-tegra/board-dt-tegra20.c
index 57745e6..bffba1b 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -66,6 +66,7 @@ struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA(nvidia,tegra20-ehci, TEGRA_USB3_BASE, tegra-ehci.2,
   tegra_ehci3_pdata),
OF_DEV_AUXDATA(nvidia,tegra20-pwm, TEGRA_PWFM_BASE, tegra-pwm, 
NULL),
+   OF_DEV_AUXDATA(nvidia,tegra20-gart, TEGRA_MC_BASE, tegra-gart, 
NULL),
{}
 };
 
diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index f6bc1e6..4a571b7 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -29,6 +29,7 @@
 #include linux/device.h
 #include linux/io.h
 #include linux/iommu.h
+#include linux/of.h
 
 #include asm/cacheflush.h
 
@@ -422,6 +423,13 @@ const struct dev_pm_ops tegra_gart_pm_ops = {
.resume = tegra_gart_resume,
 };
 
+#ifdef CONFIG_OF
+static struct of_device_id tegra_gart_of_match[] __devinitdata = {
+   { .compatible = nvidia,tegra20-gart, },
+   { },
+};
+#endif
+
 static struct platform_driver tegra_gart_driver = {
.probe  = tegra_gart_probe,
.remove = tegra_gart_remove,
@@ -429,6 +437,7 @@ static struct platform_driver tegra_gart_driver = {
.owner  = THIS_MODULE,
.name   = tegra-gart,
.pm = tegra_gart_pm_ops,
+   .of_match_table = of_match_ptr(tegra_gart_of_match),
},
 };
 
@@ -448,4 +457,5 @@ module_exit(tegra_gart_exit);
 
 MODULE_DESCRIPTION(IOMMU API for GART in Tegra20);
 MODULE_AUTHOR(Hiroshi DOYU hd...@nvidia.com);
+MODULE_ALIAS(platform:tegra-gart);
 MODULE_LICENSE(GPL v2);
-- 
1.7.10

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [RFC 2/4] iommu: tegra/gart: Add device tree support

2012-04-11 Thread Stephen Warren
On 04/11/2012 06:10 AM, Thierry Reding wrote:
 This commit adds device tree support for the GART hardware available on
 NVIDIA Tegra 20 SoCs.
 
 Signed-off-by: Thierry Reding thierry.red...@avionic-design.de
 ---
  arch/arm/boot/dts/tegra20.dtsi |6 ++
  arch/arm/mach-tegra/board-dt-tegra20.c |1 +
  drivers/iommu/tegra-gart.c |   10 ++
  3 files changed, 17 insertions(+)

I think I'd prefer at least the tegra20.dtsi change split out into a
separate patch so I can queue it in a dt topic branch in the Tegra repo.

It might be a good idea to split this into two on an arch/arm vs.
drivers/iommu boundary. Looking at Olof's branches for 3.4, that split
is what happened there.

Finally, there should be a binding documentation file in
Documentation/devicetree/bindings in order to specify the number of reg
property entries needed, and their meaning, since there's more than 1
(even though you did comment it nicely in the .dtsi file)
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu