/* @start: start address of range operation (don't care for "all" operation) @size: data size of range operation (don't care for "all" operation) @ways: target ways (don't care for operations other than pre-fetch, touch @operation: flags to specify the desired cache operation  */
static void uniphier_cache_maint_common(u32 start, u32 size, u32 ways, u32 operation)
/* @start: start address of range operation (don't care for "all" operation) @size: data size of range operation (don't care for "all" operation) @ways: target ways (don't care for operations other than pre-fetch, touch @operation: flags to specify the desired cache operation  */
static void uniphier_cache_maint_common(u32 start, u32 size, u32 ways, u32 operation)
{
	writel(UNIPHIER_SSCOLPQS_EF, UNIPHIER_SSCOLPQS);
	do {
		writel(UNIPHIER_SSCOQM_CE | operation, UNIPHIER_SSCOQM);
		if (likely(UNIPHIER_SSCOQAD_IS_NEEDED(operation))) {
			writel(start, UNIPHIER_SSCOQAD);
			writel(size, UNIPHIER_SSCOQSZ);
		}
		if (unlikely(UNIPHIER_SSCOQWM_IS_NEEDED(operation)))
			writel(ways, UNIPHIER_SSCOQWN);
	} while (unlikely(readl(UNIPHIER_SSCOPPQSEF) &
			  (UNIPHIER_SSCOPPQSEF_FE | UNIPHIER_SSCOPPQSEF_OE)));
	while (likely(readl(UNIPHIER_SSCOLPQS) != UNIPHIER_SSCOLPQS_EF))
		cpu_relax();
}