video: tegra: host: fix merge issue
Ken Adams [Thu, 27 Jun 2013 20:13:47 +0000 (16:13 -0400)]
this commit fixes the below issue for asim + linsim:
- of_platform_populate() call from board file was missing.
due to this the parent of host1x was set incorrect
- clean up gk20a aperture defines
- hooks up prepare_poweroff of gk20a with save_state of
pm domain which was missed in merge
- remove calls to runtime pm in gk20a_probe as it never
invokes the hardware

Change-Id: I810d6c1b917582a2d3b5d9cadd4c00de72969055
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Signed-off-by: Ken Adams <kadams@nvidia.com>
Reviewed-on: http://git-master/r/242865

arch/arm/mach-tegra/board-bonaire.c
arch/arm/mach-tegra/iomap.h
drivers/video/tegra/host/gk20a/gk20a.c

index 032ddb7..cfcaf87 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/platform_data/tegra_usb.h>
 #include <linux/tegra_uart.h>
 #include <linux/serial_tegra.h>
+#include <linux/of_platform.h>
 #include <mach/clk.h>
 #include <mach/gpio-tegra.h>
 #include <mach/iomap.h>
@@ -615,6 +616,30 @@ static void __init tegra_bonaire_init(void)
        tegra_register_fuse();
 }
 
+#ifdef CONFIG_USE_OF
+struct of_dev_auxdata tegra_bonaire_auxdata_lookup[] __initdata = {
+       OF_DEV_AUXDATA("nvidia,tegra124-host1x", TEGRA_HOST1X_BASE, "host1x",
+               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-gk20a", TEGRA_GK20A_BAR0_BASE, "gk20a",
+               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vic", TEGRA_VIC_BASE, "vic03", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-msenc", TEGRA_MSENC_BASE, "msenc",
+               NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-vi", TEGRA_VI_BASE, "vi", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-isp", TEGRA_ISP_BASE, "isp", NULL),
+       OF_DEV_AUXDATA("nvidia,tegra124-tsec", TEGRA_TSEC_BASE, "tsec", NULL),
+       {}
+};
+#endif
+
+static void __init tegra_bonaire_dt_init(void)
+{
+       of_platform_populate(NULL, of_default_bus_match_table,
+               tegra_bonaire_auxdata_lookup, &platform_bus);
+
+       tegra_bonaire_init();
+}
+
 static void __init tegra_bonaire_reserve(void)
 {
 #if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
@@ -641,7 +666,7 @@ MACHINE_START(BONAIRE, BONAIRE_BOARD_NAME)
        .init_early     = tegra12x_init_early,
        .init_irq       = tegra_dt_init_irq,
        .handle_irq     = gic_handle_irq,
-       .init_machine   = tegra_bonaire_init,
+       .init_machine   = tegra_bonaire_dt_init,
        .timer          = &tegra_sys_timer,
        .dt_compat      = bonaire_dt_board_compat,
 MACHINE_END
index 79adadf..0444df1 100644 (file)
 #if defined(CONFIG_ARCH_TEGRA_12x_SOC)
 
 #define TEGRA_GK20A_BAR0_BASE  0x57000000
-#define TEGRA_GK20A_BAR0_SIZE  0x01000000
+#define TEGRA_GK20A_BAR0_SIZE  SZ_16M
+
 #define TEGRA_GK20A_BAR1_BASE  0x58000000
-#define TEGRA_GK20A_BAR1_SIZE  0x01000000
+#define TEGRA_GK20A_BAR1_SIZE  SZ_16M
 
 #endif
 
index 7bb75f2..fccb1fe 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/export.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/of_platform.h>
+
 #include <asm/cacheflush.h>
 
 #include <mach/powergate.h>
 #include <mach/pm_domains.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
-#include <linux/of_platform.h>
 
 #include "dev.h"
 #include "class_ids.h"
@@ -710,6 +711,9 @@ int nvhost_gk20a_finalize_poweron(struct platform_device *dev)
 
        nvhost_dbg_fn("");
 
+       if (g->power_on)
+               return 0;
+
        g->power_on = true;
 
        gk20a_writel(g, mc_intr_en_1_r(),
@@ -845,6 +849,7 @@ static int gk20a_probe(struct platform_device *dev)
        pdata->pd.domain.ops.suspend = nvhost_client_device_suspend;
        pdata->pd.domain.ops.resume = nvhost_client_device_resume;
        pdata->pd.dev_ops.restore_state = nvhost_module_finalize_poweron;
+       pdata->pd.dev_ops.save_state = nvhost_module_prepare_poweroff;
 #endif
 
        if (pdata->clockgate_delay) {
@@ -853,7 +858,6 @@ static int gk20a_probe(struct platform_device *dev)
                pm_runtime_use_autosuspend(&dev->dev);
        }
        pm_runtime_enable(&dev->dev);
-       pm_runtime_get_sync(&dev->dev);
 
        err = nvhost_client_device_init(dev);
        if (err) {
@@ -870,11 +874,6 @@ static int gk20a_probe(struct platform_device *dev)
                return err;
        }
 
-       if (pdata->clockgate_delay)
-               pm_runtime_put_sync_autosuspend(&dev->dev);
-       else
-               pm_runtime_put(&dev->dev);
-
        return 0;
 }