video: tegra: host: check debuginfo for nvdec boot
Deepak Nibade [Mon, 3 Oct 2016 09:53:41 +0000 (14:53 +0530)]
After waiting for falcon idle, confirm successful nvdec boot
by reading nvdec_debuginfo_r()

If register reads 0, then booting is successful
Otherwise, its error

Bug 200237849
Jira HOSTX-118

Change-Id: Ibaf6a21baaa3b5c61b432c9ceac4ddf9af233ebc
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1230795
Reviewed-on: http://git-master/r/1242938
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/video/tegra/host/nvdec/hw_nvdec.h
drivers/video/tegra/host/nvdec/nvdec.c

index 26193ba..030d1a7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2013-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -210,4 +210,8 @@ static inline u32 nvdec_scp_ctl_stat_debug_mode_m(void)
 {
        return 0x1 << 20;
 }
+static inline u32 nvdec_debuginfo_r(void)
+{
+       return 0x1094;
+}
 #endif
index 40eda3b..19db572 100644 (file)
@@ -311,6 +311,18 @@ int nvhost_nvdec_finalize_poweron(struct platform_device *dev)
                dev_err(&dev->dev, "boot failed due to timeout");
                return err;
        }
+
+       if (IS_ENABLED(CONFIG_NVDEC_BOOTLOADER)) {
+               u32 debuginfo = host1x_readl(dev, nvdec_debuginfo_r());
+
+               /* Must be zero for successful boot */
+               if (debuginfo) {
+                       dev_err(&dev->dev, "boot failed, debuginfo=%x",
+                                          debuginfo);
+                       return -ETIMEDOUT;
+               }
+       }
+
        dev_dbg(&dev->dev, "nvdec_boot: success\n");
 
 #ifdef CONFIG_TRUSTED_LITTLE_KERNEL