Skip to content

Commit

Permalink
iommu: tegra/gart: Add device tree support
Browse files Browse the repository at this point in the history
This commit adds device tree support for the GART hardware available on
NVIDIA Tegra 20 SoCs.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
  • Loading branch information
Thierry Reding authored and Joerg Roedel committed Apr 16, 2012
1 parent 543f3f3 commit 7cffae4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Documentation/devicetree/bindings/iommu/nvidia,tegra20-gart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
NVIDIA Tegra 20 GART

Required properties:
- compatible: "nvidia,tegra20-gart"
- reg: Two pairs of cells specifying the physical address and size of
the memory controller registers and the GART aperture respectively.

Example:

gart: gart@7000f000 {
compatible = "nvidia,tegra20-gart";
reg = < 0x7000f000 0x00000100 /* controller registers */
0x58000000 0x02000000 >; /* GART aperture */
};
11 changes: 11 additions & 0 deletions drivers/iommu/tegra-gart.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/device.h>
#include <linux/io.h>
#include <linux/iommu.h>
#include <linux/of.h>

#include <asm/cacheflush.h>

Expand Down Expand Up @@ -422,13 +423,22 @@ 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", },
{ },
};
MODULE_DEVICE_TABLE(of, tegra_gart_of_match);
#endif

static struct platform_driver tegra_gart_driver = {
.probe = tegra_gart_probe,
.remove = tegra_gart_remove,
.driver = {
.owner = THIS_MODULE,
.name = "tegra-gart",
.pm = &tegra_gart_pm_ops,
.of_match_table = of_match_ptr(tegra_gart_of_match),
},
};

Expand All @@ -448,4 +458,5 @@ module_exit(tegra_gart_exit);

MODULE_DESCRIPTION("IOMMU API for GART in Tegra20");
MODULE_AUTHOR("Hiroshi DOYU <hdoyu@nvidia.com>");
MODULE_ALIAS("platform:tegra-gart");
MODULE_LICENSE("GPL v2");

0 comments on commit 7cffae4

Please sign in to comment.