[COMMON] scsi: ufs: add secure log
authorHeonGwang Chu <hg.chu@samsung.com>
Tue, 20 Jun 2017 07:45:54 +0000 (16:45 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:21:04 +0000 (17:21 +0900)
Change-Id: I28257ceec3f3c7ae8186af2099a075535331b7ac
Signed-off-by: HeonGwang Chu <hg.chu@samsung.com>
drivers/scsi/ufs/ufs-exynos-dbg.c
drivers/scsi/ufs/ufs-exynos.c
drivers/scsi/ufs/ufshcd.c

index 0d5bfb396b798777c88e37553a128c94912f2533..a4a2ff8dc7b4001e35c0c19b393f311da8e36f0b 100644 (file)
@@ -971,8 +971,8 @@ static void exynos_ufs_get_sfr(struct ufs_hba *hba,
                                cfg->val = ufshcd_readl(hba, cfg->offset);
                        else if (sel_api == LOG_VS_HCI_SFR)
                                cfg->val = hci_readl(ufs, cfg->offset);
-//                     else if (sel_api == LOG_FMP_SFR)
-//                             cfg->val = exynos_smc(SMC_CMD_FMP_DUMP, 0, 0, cfg->offset);
+                       else if (sel_api == LOG_FMP_SFR)
+                               cfg->val = exynos_smc(SMC_CMD_FMP_SMU_DUMP, 0, 0, cfg->offset);
                        else if (sel_api == LOG_UNIPRO_SFR)
                                cfg->val = unipro_readl(ufs, cfg->offset);
                        else if (sel_api == LOG_PMA_SFR)
@@ -1116,8 +1116,8 @@ void exynos_ufs_dump_uic_info(struct ufs_hba *hba)
 {
        struct exynos_ufs *ufs = to_exynos_ufs(hba);
 
-//     /* secure log */
-//     exynos_smc(SMC_CMD_UFS_LOG, 1, 0, hba->secure_log.paddr);
+       /* secure log */
+       exynos_smc(SMC_CMD_UFS_LOG, 1, 0, hba->secure_log.paddr);
 
        exynos_ufs_get_sfr(hba, ufs->debug.sfr);
        exynos_ufs_get_attr(hba, ufs->debug.attr);
@@ -1163,8 +1163,8 @@ int exynos_ufs_init_dbg(struct ufs_hba *hba)
                list_add_tail(&exynos_clki->list, &ufs->debug.misc.clk_list_head);
        }
 
-//     hba->secure_log.paddr = exynos_ss_get_spare_paddr(0);
-//     hba->secure_log.vaddr = (u32 *)exynos_ss_get_spare_vaddr(0);
+       hba->secure_log.paddr = exynos_ss_get_spare_paddr(0);
+       hba->secure_log.vaddr = (u32 *)exynos_ss_get_spare_vaddr(0);
 
        return 0;
 }
index 4e3eb39aae003b6f2855bb29cd220d6e04168df3..50c83c33aad26613970ebaed2234dee5916516b9 100644 (file)
@@ -648,7 +648,7 @@ success:
        exynos_ufs_dev_hw_reset(hba);
 
        /* secure log */
-//     exynos_smc(SMC_CMD_LOG, 0, 0, 2);
+       exynos_smc(SMC_CMD_UFS_LOG, 0, 0, 0);
 out:
        return;
 }
@@ -893,7 +893,7 @@ static int __exynos_ufs_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
        exynos_ufs_smu_resume(ufs);
 
        /* secure log */
-//     exynos_smc(SMC_CMD_LOG, 0, 0, 2);
+       exynos_smc(SMC_CMD_UFS_LOG, 0, 0, 0);
 
        if (ufshcd_is_clkgating_allowed(hba))
                clk_disable_unprepare(ufs->clk_hci);
index 9cfb410f88b4047e5f4b7d2d7e8f964ae1f9f80f..fbf2e95e2a85106179dd528da82bc794b17ba799 100644 (file)
@@ -5921,6 +5921,9 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
        hba = shost_priv(host);
        tag = cmd->request->tag;
 
+       /* secure log */
+       exynos_smc(SMC_CMD_UFS_LOG, 1, 0, hba->secure_log.paddr);
+
        /* Dump debugging information to system memory */
        ufshcd_vops_dbg_register_dump(hba);
        exynos_ufs_show_uic_info(hba);
@@ -6013,6 +6016,8 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
        if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN)
                return ufshcd_eh_host_reset_handler(cmd);
 
+       /* secure log */
+       exynos_smc(SMC_CMD_UFS_LOG, 1, 0, hba->secure_log.paddr);
 
        if (cmd->cmnd[0] == READ_10 || cmd->cmnd[0] == WRITE_10) {
                unsigned long lba = (cmd->cmnd[2] << 24) |