ARM: Tegra: Make simulated split memory a runtime option
Mark Stadler [Wed, 8 Aug 2012 03:19:14 +0000 (20:19 -0700)]
Change-Id: I7fa90bcf110ddb9105f7ca631a88668482307307
Signed-off-by: Bob Bond <rbond@nvidia.com>
Reviewed-on: http://git-master/r/95947
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Jeff Smith <jsmith@nvidia.com>
Reviewed-by: Jin Qian <jqian@nvidia.com>
Reviewed-by: Mark Stadler <mastadler@nvidia.com>
Signed-off-by: Mark Stadler <mastadler@nvidia.com>

arch/arm/mach-tegra/common.c
arch/arm/mach-tegra/include/mach/hardware.h

index 4e94524..8837344 100644 (file)
@@ -158,6 +158,11 @@ static enum power_supply_type pow_supply_type = POWER_SUPPLY_TYPE_MAINS;
 static int pwr_i2c_clk = 400;
 static u8 power_config;
 static u8 display_config;
+
+#ifdef CONFIG_TEGRA_SIMULATION_SPLIT_MEM
+static int tegra_split_mem_set;
+#endif
+
 /*
  * Storage for debug-macro.S's state.
  *
@@ -1698,10 +1703,12 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
        }
 
 #ifdef CONFIG_TEGRA_SIMULATION_SPLIT_MEM
-       tegra_carveout_start = TEGRA_ASIM_QT_CARVEOUT_START;
-       tegra_carveout_size = TEGRA_ASIM_QT_CARVEOUT_SIZE;
-       tegra_fb_start = TEGRA_ASIM_QT_FB_START;
-       tegra_fb_size = TEGRA_ASIM_QT_FB_SIZE;
+       if (tegra_split_mem_active()) {
+               tegra_carveout_start = TEGRA_ASIM_QT_CARVEOUT_START;
+               tegra_carveout_size = TEGRA_ASIM_QT_CARVEOUT_SIZE;
+               tegra_fb_start = TEGRA_ASIM_QT_FB_START;
+               tegra_fb_size = TEGRA_ASIM_QT_FB_SIZE;
+       }
 #endif
 
        if (tegra_fb_size)
@@ -2051,4 +2058,17 @@ static int __init asim_enet_init(void)
 rootfs_initcall(asim_enet_init);
 #endif
 
+#ifdef CONFIG_TEGRA_SIMULATION_SPLIT_MEM
+int tegra_split_mem_active(void)
+{
+       return tegra_split_mem_set;
+}
+
+static int __init set_tegra_split_mem(char *options)
+{
+       tegra_split_mem_set = 1;
+       return 0;
+}
+early_param("tegra_split_mem", set_tegra_split_mem);
+#endif
 #endif
index 09eecc4..5d87846 100644 (file)
@@ -58,6 +58,10 @@ enum tegra_platform {
 extern enum tegra_revision tegra_revision;
 enum tegra_chipid tegra_get_chipid(void);
 
+#ifdef CONFIG_TEGRA_SIMULATION_SPLIT_MEM
+int tegra_split_mem_active(void);
+#endif
+
 #ifdef CONFIG_TEGRA_PRE_SILICON_SUPPORT
 void tegra_get_netlist_revision(u32 *netlist, u32* patchid);
 bool tegra_cpu_is_asim(void);