nvgpu: disable elgp and clock gating via dt
Martin Gao [Fri, 27 Jan 2017 23:17:37 +0000 (15:17 -0800)]
Bug 1865815

Change-Id: Ibd151f775f51f7a299aa61af4fbb34287b1cae64
Signed-off-by: Martin Gao <marting@nvidia.com>
Reviewed-on: http://git-master/r/1296821
Reviewed-by: David Dastous St Hilaire <ddastoussthi@nvidia.com>
Tested-by: David Dastous St Hilaire <ddastoussthi@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

arch/arm64/boot/dts/tegra210-darcy-p2894-common.dtsi
drivers/gpu/nvgpu/gk20a/gk20a.c
drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c

index 3399648..d952ca3 100644 (file)
                nvidia,bootloader-vbus-enable=<0x1>;
                fastboot-instructions = "Press X/Y to move highlight\nPress Button A to select\nConnect SHIELD Controller using USB cable. Use USB port near HDMI port for the controller and USB port away for PC connection\n";
                nvidia,fastboot_without_usb;
+               nvidia,gpu-disable-power-saving;
                verified-boot {
                        ui-timeout-ms {
                                yellow-state = <7000>;
index 95b9dc8..7883607 100644 (file)
@@ -1406,10 +1406,14 @@ static int gk20a_probe(struct platform_device *dev)
                const struct of_device_id *match;
 
                match = of_match_device(tegra_gk20a_of_match, &dev->dev);
-               if (match)
+               if (match) {
+                       dev_info(&dev->dev, "load platform data from DT node.\n");
                        platform = (struct gk20a_platform *)match->data;
-       } else
+               }
+       } else {
+               dev_info(&dev->dev, "fallback and load predefined platform data.\n");
                platform = (struct gk20a_platform *)dev->dev.platform_data;
+       }
 
        if (!platform) {
                dev_err(&dev->dev, "no platform data\n");
index ddc794e..d2e98c1 100644 (file)
@@ -744,6 +744,7 @@ static int gk20a_tegra_probe(struct platform_device *dev)
        const __be32 *host1x_ptr;
        struct platform_device *host1x_pdev = NULL;
        bool joint_xpu_rail = false;
+       bool disable_power_saving = false;
 
        host1x_ptr = of_get_property(np, "nvidia,host1x", NULL);
        if (host1x_ptr) {
@@ -773,6 +774,17 @@ static int gk20a_tegra_probe(struct platform_device *dev)
                platform->can_railgate = false;
        }
 
+       disable_power_saving = of_property_read_bool(of_chosen,
+                               "nvidia,gpu-disable-power-saving");
+       if (disable_power_saving) {
+               dev_info(&dev->dev, "disable power gating.\n");
+               platform->can_railgate = false;
+               platform->enable_slcg = false;
+               platform->enable_blcg = false;
+               platform->enable_elcg = false;
+               platform->enable_elpg = false;
+       }
+
        /* WAR for bug 1547668: Disable railgating and scaling irrespective of
         * platform data if the rework has not been made. */