Problem:
For i.MX6DL/Solo with latest silicon 1.4, system will hang when doing the "hab_rvt_authenticate_image" by using 2009.08 u-boot in SDP mode.
Background:
1) 2009.08 u-boot can work with rev 1.2 chip, while 2009.08 u-boot can't work with rev 1.4 chip when calling "hab_rvt_authenticate_image" in u-boot in SDP mode.
2) 2009.08 u-boot can't work with rev 1.4 chip, while 2017.03 u-boot can work with rev 1.4 chip when calling "hab_rvt_authenticate_image" in u-boot in SDP mode.
3) 2009.08 u-boot can't work with rev 1.4 chip when calling "hab_rvt_authenticate_image to authenticate "CAAM engine" image in uboot, but it is okay when authenticate "SW engine" image.
4)2009.08 u-boot can work with rev 1.4 chip when boot from NAND, but can't work with rev 1.4 chip in SDP mode.
Investigation:
By the debugger, we can see the code go into below dead-loop when hang.
-------
clean_l2_inv_loop
LDR r2,[r1,#0x7FC]
TST r2,r4
BNE clean_l2_inv_loop <-dead loop here when the code can't really clean and invalidate the L2 cache by way
-------
The root cause is related to the L2 cache and Boot Rom code(hab_hal_flush_cache) change.
1) u-boot 2009.08 disable the L2 cache while u-boot 2017.03 enable the L2 cache.
2) Boot Rom code "hab_hal_flush_cache" change in rev1.4.
The logic in rev 1.4 is that the BootRom will clean L1 D cache and L2 Cache when we enable the L1 D cache and MMU in u-boot.
The logic in rev 1.2 is that the BootRom will clean L1 D cache and L2 Cache if we let BootROM to setup the MMU(pu_irom_mmu_enabled=true).
3)"hab_hal_flush_cache" function will be called when use CAAM to do the authentication. It will not be called when use SW to do the authentication.
Solution:
the solution for this topic can be