/* These are useful for identifying cache coherency problems by allowing the cache or the cache and writebuffer to be turned off. (Note: the write buffer should not be on and the cache off).  */
static void __init early_cachepolicy(char **p)
/* These are useful for identifying cache coherency problems by allowing the cache or the cache and writebuffer to be turned off. (Note: the write buffer should not be on and the cache off).  */
static void __init early_cachepolicy(char **p)
{
	int i;
	for (i = 0; i < ARRAY_SIZE(cache_policies); i++) {
		int len = strlen(cache_policies[i].policy);
		if (memcmp(*p, cache_policies[i].policy, len) == 0) {
			cachepolicy = i;
			cr_alignment &= ~cache_policies[i].cr_mask;
			cr_no_alignment &= ~cache_policies[i].cr_mask;
			*p += len;
			break;
		}
	}
	if (i == ARRAY_SIZE(cache_policies))
		printk(KERN_ERR "ERROR: unknown or unsupported cache policy\n");
	if (cpu_architecture() >= CPU_ARCH_ARMv6) {
		printk(KERN_WARNING "Only cachepolicy=writeback supported on ARMv6 and later\n");
		cachepolicy = CPOLICY_WRITEBACK;
	}
	flush_cache_all();
	set_cr(cr_alignment);
}