/* Disable Kinetis Processor System (PS) cache and save previous state  */
void kinetis_ps_cache_save(unsigned long *flags)
/* Disable Kinetis Processor System (PS) cache and save previous state  */
void kinetis_ps_cache_save(unsigned long *flags)
{
	*flags = KINETIS_LMEM_PSCCR &
		(KINETIS_LMEM_CCR_ENWRBUF_MSK | KINETIS_LMEM_CCR_ENCACHE_MSK);
	KINETIS_LMEM_PSCCR =
		KINETIS_LMEM_CCR_GO_MSK |
		KINETIS_LMEM_CCR_PUSHW1_MSK | KINETIS_LMEM_CCR_INVW1_MSK |
		KINETIS_LMEM_CCR_PUSHW0_MSK | KINETIS_LMEM_CCR_INVW0_MSK;
	while (KINETIS_LMEM_PSCCR & KINETIS_LMEM_CCR_GO_MSK);
}