Fix tsec timeout during smmu emulation on 6.2.0
This commit is contained in:
		| @@ -22,6 +22,7 @@ | ||||
| #include "../hos/sept.h" | ||||
| #include "../libs/fatfs/ff.h" | ||||
| #include "../mem/heap.h" | ||||
| #include "../mem/mc.h" | ||||
| #include "../mem/sdram.h" | ||||
| #include "../sec/se.h" | ||||
| #include "../sec/se_t210.h" | ||||
| @@ -314,16 +315,20 @@ get_tsec: ; | ||||
|  | ||||
|     int res = 0; | ||||
|  | ||||
|     mc_disable_ahb_redirect(); | ||||
|  | ||||
|     while (tsec_query(tsec_keys, pkg1_id->kb, &tsec_ctxt) < 0) { | ||||
|         memset(tsec_keys, 0x00, 0x20); | ||||
|         retries++; | ||||
|         if (retries > 3) { | ||||
|         if (retries > 15) { | ||||
|             res = -1; | ||||
|             break; | ||||
|         } | ||||
|     } | ||||
|     free(pkg1); | ||||
|  | ||||
|     mc_enable_ahb_redirect(); | ||||
|  | ||||
|     if (res < 0) { | ||||
|         EPRINTFARGS("ERROR %x dumping TSEC.\n", res); | ||||
|         goto out_wait; | ||||
|   | ||||
| @@ -187,10 +187,10 @@ int tsec_query(u8 *tsec_keys, u8 kb, tsec_ctxt_t *tsec_ctxt) | ||||
| 		{ | ||||
| 			smmu_flush_all(); | ||||
|  | ||||
| 			if (k == se[SE_KEYTABLE_DATA0_REG_OFFSET / 4]) | ||||
| 				continue; | ||||
| 			k = se[SE_KEYTABLE_DATA0_REG_OFFSET / 4]; | ||||
| 			key[kidx++] = k; | ||||
| 			if (k != se[SE_KEYTABLE_DATA0_REG_OFFSET / 4]) { | ||||
| 				k = se[SE_KEYTABLE_DATA0_REG_OFFSET / 4]; | ||||
| 				key[kidx++] = k; | ||||
| 			} | ||||
|  | ||||
| 			// Failsafe. | ||||
| 			if ((u32)get_tmr_us() - start > 125000) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user