You can play some tricks using cache lockdown of some ways in the L2 cache, but it is increasingly an option not implemented in newer Cortex-A profile cores so not always available.Cortex-R profile cores tend to have better alternatives available - such as TCM.