Hi,
I'm sorry, I mismatched two similar questions. My answer above is related to S32K microcontrollers.
In case of MPC5748G, the caches are described in core reference manual:
https://www.nxp.com/docs/en/reference-manual/e200z4RM.pdf
Caches are enabled in startup codes and it looks like this:
#ifdef ICACHE_ENABLE
;#****************** Invalidate and Enable the Instruction cache **************
__icache_cfg:
e_lis r7, 0x0000
e_or2i r7, 0x03FF #create mask for lower 11 bits
mfspr r5, 516 #in lower 11 bits we have icache size
and. r7, r7, r5 #check if we have icache
e_beq _skip_i_cache #branch if not
e_li r5, 0x2
mtspr 1011,r5
e_li r7, 0x4
e_li r8, 0x2
;#e_lwi r11, 0xFFFFFFFB
e_lis r11,0xFFFF
e_or2i r11,0xFFFB
__icache_inv:
mfspr r9, 1011
and. r10, r7, r9
e_beq __icache_no_abort
and. r10, r11, r9
mtspr 1011, r10
e_b __icache_cfg
__icache_no_abort:
and. r10, r8, r9
e_bne __icache_inv
mfspr r5, 1011
e_ori r5, r5, 0x0001
se_isync
;#msync
mtspr 1011, r5
_skip_i_cache:
#endif
#ifdef DCACHE_ENABLE
;#****************** Invalidate and Enable the Data cache **************
__dcache_cfg:
e_lis r7, 0x0000
e_or2i r7, 0x03FF #create mask for lower 11 bits
mfspr r5, 515 #in lower 11 bits we have dcache size
and. r7, r7, r5 #check if we have dcache
e_beq _skip_d_cache #branch if not
e_li r5, 0x2
mtspr 1010,r5
e_li r7, 0x4
e_li r8, 0x2
e_lis r11,0xFFFF
e_or2i r11,0xFFFB
__dcache_inv:
mfspr r9, 1010
and. r10, r7, r9
e_beq __dcache_no_abort
and. r10, r11, r9
mtspr 1010, r10
e_b __dcache_cfg
__dcache_no_abort:
and. r10, r8, r9
e_bne __dcache_inv
mfspr r5, 1010
e_ori r5, r5, 0x0001
se_isync
msync
mtspr 1010, r5
_skip_d_cache:
#endif
Regards,
Lukas