diff options
Diffstat (limited to 'arch/xtensa/include/asm/mtd-xip.h')
-rw-r--r-- | arch/xtensa/include/asm/mtd-xip.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/xtensa/include/asm/mtd-xip.h b/arch/xtensa/include/asm/mtd-xip.h new file mode 100644 index 0000000000..514325155c --- /dev/null +++ b/arch/xtensa/include/asm/mtd-xip.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _ASM_MTD_XIP_H +#define _ASM_MTD_XIP_H + +#include <asm/processor.h> + +#define xip_irqpending() (xtensa_get_sr(interrupt) & xtensa_get_sr(intenable)) +#define xip_currtime() (xtensa_get_sr(ccount)) +#define xip_elapsed_since(x) ((xtensa_get_sr(ccount) - (x)) / 1000) /* should work up to 1GHz */ +#define xip_cpu_idle() do { asm volatile ("waiti 0"); } while (0) + +#endif /* _ASM_MTD_XIP_H */ + |