aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memory
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2018-12-12 15:38:56 -0500
committerJoerg Roedel <jroedel@suse.de>2019-01-16 07:54:12 -0500
commitce2785a75dbca27375f3723f4e697a2a8dc096ee (patch)
tree89451c3cdcc2103f759587db69e6eb9355423459 /drivers/memory
parent45594c683ef780f20f11b1e0018b933b6ff5d9a1 (diff)
iommu/tegra: gart: Integrate with Memory Controller driver
The device-tree binding has been changed. There is no separate GART device anymore, it is squashed into the Memory Controller. Integrate GART module with the MC in a way it is done for the SMMU on Tegra30+. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/tegra/mc.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index 55ecfb2d8cfd..e684e234361a 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -702,13 +702,56 @@ static int tegra_mc_probe(struct platform_device *pdev)
702 PTR_ERR(mc->smmu)); 702 PTR_ERR(mc->smmu));
703 } 703 }
704 704
705 if (IS_ENABLED(CONFIG_TEGRA_IOMMU_GART) && !mc->soc->smmu) {
706 mc->gart = tegra_gart_probe(&pdev->dev, mc);
707 if (IS_ERR(mc->gart)) {
708 dev_err(&pdev->dev, "failed to probe GART: %ld\n",
709 PTR_ERR(mc->gart));
710 mc->gart = NULL;
711 }
712 }
713
714 return 0;
715}
716
717static int tegra_mc_suspend(struct device *dev)
718{
719 struct tegra_mc *mc = dev_get_drvdata(dev);
720 int err;
721
722 if (IS_ENABLED(CONFIG_TEGRA_IOMMU_GART) && mc->gart) {
723 err = tegra_gart_suspend(mc->gart);
724 if (err)
725 return err;
726 }
727
705 return 0; 728 return 0;
706} 729}
707 730
731static int tegra_mc_resume(struct device *dev)
732{
733 struct tegra_mc *mc = dev_get_drvdata(dev);
734 int err;
735
736 if (IS_ENABLED(CONFIG_TEGRA_IOMMU_GART) && mc->gart) {
737 err = tegra_gart_resume(mc->gart);
738 if (err)
739 return err;
740 }
741
742 return 0;
743}
744
745static const struct dev_pm_ops tegra_mc_pm_ops = {
746 .suspend = tegra_mc_suspend,
747 .resume = tegra_mc_resume,
748};
749
708static struct platform_driver tegra_mc_driver = { 750static struct platform_driver tegra_mc_driver = {
709 .driver = { 751 .driver = {
710 .name = "tegra-mc", 752 .name = "tegra-mc",
711 .of_match_table = tegra_mc_of_match, 753 .of_match_table = tegra_mc_of_match,
754 .pm = &tegra_mc_pm_ops,
712 .suppress_bind_attrs = true, 755 .suppress_bind_attrs = true,
713 }, 756 },
714 .prevent_deferred_probe = true, 757 .prevent_deferred_probe = true,