/* * When Tauros2 is used on a CPU that supports the v7 hierarchical * cache operations, the cache handling code in proc-v7.S takes care * of everything, including handling DMA coherency. * * So, we only need to register outer cache operations here if we're * being used on a pre-v7 CPU, and we only need to build support for * outer cache operations into the kernel image if the kernel has been * configured to support a pre-v7 CPU.
*/ #ifdef CONFIG_CPU_32v5 /* * Low-level cache maintenance operations.
*/ staticinlinevoid tauros2_clean_pa(unsignedlong addr)
{
__asm__("mcr p15, 1, %0, c7, c11, 3" : : "r" (addr));
}
/* * v5 CPUs with Tauros2 have the L2 cache enable bit * located in the CPU Extra Features register.
*/
feat = read_extra_features(); if (!(feat & 0x00400000)) {
pr_info("Tauros2: Enabling L2 cache.\n");
write_extra_features(feat | 0x00400000);
}
#ifdef CONFIG_CPU_32v7 /* * Check whether this CPU has support for the v7 hierarchical * cache ops. (PJ4 is in its v7 personality mode if the MMFR3 * register indicates support for the v7 hierarchical cache * ops.) * * (Although strictly speaking there may exist CPUs that * implement the v7 cache ops but are only ARMv6 CPUs (due to * not complying with all of the other ARMv7 requirements), * there are no real-life examples of Tauros2 being used on * such CPUs as of yet.)
*/ if (cpuid_scheme() && (read_mmfr3() & 0xf) == 1) {
u32 actlr;
/* * When Tauros2 is used in an ARMv7 system, the L2 * enable bit is located in the Auxiliary System Control * Register (which is the only register allowed by the * ARMv7 spec to contain fine-grained cache control bits).
*/
actlr = read_actlr(); if (!(actlr & 0x00000002)) {
pr_info("Tauros2: Enabling L2 cache.\n");
write_actlr(actlr | 0x00000002);
}
mode = "ARMv7";
} #endif
if (mode == NULL) {
pr_crit("Tauros2: Unable to detect CPU mode.\n"); return;
}
pr_info("Tauros2: L2 cache support initialised " "in %s mode.\n", mode);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.