Changeset View
Changeset View
Standalone View
Standalone View
head/sys/powerpc/booke/machdep_e500.c
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
booke_enable_l2_cache(void) | booke_enable_l2_cache(void) | ||||
{ | { | ||||
uint32_t csr; | uint32_t csr; | ||||
/* Enable L2 cache on E500mc */ | /* Enable L2 cache on E500mc */ | ||||
if ((((mfpvr() >> 16) & 0xFFFF) == FSL_E500mc) || | if ((((mfpvr() >> 16) & 0xFFFF) == FSL_E500mc) || | ||||
(((mfpvr() >> 16) & 0xFFFF) == FSL_E5500)) { | (((mfpvr() >> 16) & 0xFFFF) == FSL_E5500)) { | ||||
csr = mfspr(SPR_L2CSR0); | csr = mfspr(SPR_L2CSR0); | ||||
if ((csr & L2CSR0_L2E) == 0) { | /* | ||||
* Don't actually attempt to manipulate the L2 cache if | |||||
* L2CFG0 is zero. | |||||
* | |||||
* Any chip with a working L2 cache will have a nonzero | |||||
* L2CFG0, as it will have a nonzero L2CSIZE field. | |||||
* | |||||
* This fixes waiting forever for cache enable in qemu, | |||||
* which does not implement the L2 cache. | |||||
*/ | |||||
if (mfspr(SPR_L2CFG0) != 0 && (csr & L2CSR0_L2E) == 0) { | |||||
l2cache_inval(); | l2cache_inval(); | ||||
l2cache_enable(); | l2cache_enable(); | ||||
} | } | ||||
csr = mfspr(SPR_L2CSR0); | csr = mfspr(SPR_L2CSR0); | ||||
if ((boothowto & RB_VERBOSE) != 0 || (csr & L2CSR0_L2E) == 0) | if ((boothowto & RB_VERBOSE) != 0 || (csr & L2CSR0_L2E) == 0) | ||||
printf("L2 cache %sabled\n", | printf("L2 cache %sabled\n", | ||||
(csr & L2CSR0_L2E) ? "en" : "dis"); | (csr & L2CSR0_L2E) ? "en" : "dis"); | ||||
Show All 31 Lines |