#define   GEN11_LSN_UNSLCVC_GAFS_HALF_CL2_MAXALLOC     (1 << 9)
 #define   GEN11_LSN_UNSLCVC_GAFS_HALF_SF_MAXALLOC      (1 << 7)
 
+#define GUCPMTIMESTAMP                         _MMIO(0xc3e8)
+
 #define __GEN9_RCS0_MOCS0                      0xc800
 #define GEN9_GFX_MOCS(i)                       _MMIO(__GEN9_RCS0_MOCS0 + (i) * 4)
 #define __GEN9_VCS0_MOCS0                      0xc900
 
        intel_uncore_forcewake_put(uncore, FORCEWAKE_GT);
 }
 
+void intel_guc_dump_time_info(struct intel_guc *guc, struct drm_printer *p)
+{
+       struct intel_gt *gt = guc_to_gt(guc);
+       intel_wakeref_t wakeref;
+       u32 stamp = 0;
+       u64 ktime;
+
+       intel_device_info_print_runtime(RUNTIME_INFO(gt->i915), p);
+
+       with_intel_runtime_pm(>->i915->runtime_pm, wakeref)
+               stamp = intel_uncore_read(gt->uncore, GUCPMTIMESTAMP);
+       ktime = ktime_get_boottime_ns();
+
+       drm_printf(p, "Kernel timestamp: 0x%08llX [%llu]\n", ktime, ktime);
+       drm_printf(p, "GuC timestamp: 0x%08X [%u]\n", stamp, stamp);
+       drm_printf(p, "CS timestamp frequency: %u Hz, %u ns\n",
+                  gt->clock_frequency, gt->clock_period_ns);
+}
+
 int intel_guc_init(struct intel_guc *guc)
 {
        struct intel_gt *gt = guc_to_gt(guc);
 
 
        intel_uc_fw_dump(&error_uc->guc_fw, &p);
        intel_uc_fw_dump(&error_uc->huc_fw, &p);
+       err_printf(m, "GuC timestamp: 0x%08x\n", error_uc->timestamp);
        intel_gpu_error_print_vma(m, NULL, error_uc->guc_log);
 }
 
        int i;
 
        err_printf(m, "GT awake: %s\n", str_yes_no(gt->awake));
+       err_printf(m, "CS timestamp frequency: %u Hz, %d ns\n",
+                  gt->clock_frequency, gt->clock_period_ns);
        err_printf(m, "EIR: 0x%08x\n", gt->eir);
        err_printf(m, "PGTBL_ER: 0x%08x\n", gt->pgtbl_er);
 
         */
        error_uc->guc_fw.path = kstrdup(uc->guc.fw.path, ALLOW_FAIL);
        error_uc->huc_fw.path = kstrdup(uc->huc.fw.path, ALLOW_FAIL);
+
+       /*
+        * Save the GuC log and include a timestamp reference for converting the
+        * log times to system times (in conjunction with the error->boottime and
+        * gt->clock_frequency fields saved elsewhere).
+        */
+       error_uc->timestamp = intel_uncore_read(gt->_gt->uncore, GUCPMTIMESTAMP);
        error_uc->guc_log = create_vma_coredump(gt->_gt, uc->guc.log.vma,
                                                "GuC log buffer", compress);
 
 static void gt_record_info(struct intel_gt_coredump *gt)
 {
        memcpy(>->info, >->_gt->info, sizeof(struct intel_gt_info));
+       gt->clock_frequency = gt->_gt->clock_frequency;
+       gt->clock_period_ns = gt->_gt->clock_period_ns;
 }
 
 /*