xref: /linux/arch/xtensa/include/asm/mtd-xip.h (revision 2697b79a469b68e3ad3640f55284359c1396278d)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _ASM_MTD_XIP_H
4 #define _ASM_MTD_XIP_H
5 
6 #include <asm/processor.h>
7 
8 #define xip_irqpending()	(xtensa_get_sr(interrupt) & xtensa_get_sr(intenable))
9 #define xip_currtime()		(xtensa_get_sr(ccount))
10 #define xip_elapsed_since(x)	((xtensa_get_sr(ccount) - (x)) / 1000) /* should work up to 1GHz */
11 #define xip_cpu_idle()		do { asm volatile ("waiti 0"); } while (0)
12 
13 #endif /* _ASM_MTD_XIP_H */
14 
15