nvhost: tsec: make sure kfuse is pointed to hdmi.
Marvin Zhang [Thu, 14 Feb 2013 02:57:12 +0000 (18:57 -0800)]
tsec needs to get pkey from kfuse by changing kfuse mux to tsec,
after tsec is done, it restores mux back to hdmi so that latter
can use it to load hdcp keys.

Bug 1235326

Change-Id: I52459a67159583f3f120fe8a8cbc1ea1ec4b13c7
Signed-off-by: Marvin Zhang <mzhang@nvidia.com>
Reviewed-on: http://git-master/r/200654
Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com>
Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>

drivers/video/tegra/host/tsec/tsec.c

index ebf0f50..f02f6b4 100644 (file)
@@ -228,12 +228,19 @@ static int tsec_load_kfuse(struct platform_device *pdev)
                u32 w = nvhost_device_readl(pdev, tsec_scp_ctl_pkey_r());
 
                if (w & tsec_scp_ctl_pkey_loaded_m())
-                       return 0;
+                       break;
                udelay(TSEC_IDLE_CHECK_PERIOD);
                timeout -= check;
        } while (timeout);
 
-       return -1;
+       val = nvhost_device_readl(pdev, tsec_tegra_ctl_r());
+       val |= tsec_tegra_ctl_tkfi_kfuse_m();
+       nvhost_device_writel(pdev, tsec_tegra_ctl_r(), val);
+
+       if (timeout)
+               return 0;
+       else
+               return -1;
 }
 
 int tsec_boot(struct platform_device *dev)