WIP FPC-III support
[linux/fpc-iii.git] / arch / arm / mach-pxa / include / mach / mtd-xip.h
blob4b31bef9e50ae80b368d1be6514cf0a31ec1c4cf
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * MTD primitives for XIP support. Architecture specific functions
5 * Do not include this file directly. It's included from linux/mtd/xip.h
6 *
7 * Author: Nicolas Pitre
8 * Created: Nov 2, 2004
9 * Copyright: (C) 2004 MontaVista Software, Inc.
12 #ifndef __ARCH_PXA_MTD_XIP_H__
13 #define __ARCH_PXA_MTD_XIP_H__
15 #include <mach/regs-ost.h>
17 /* restored July 2017, this did not build since 2011! */
19 #define ICIP io_p2v(0x40d00000)
20 #define ICMR io_p2v(0x40d00004)
21 #define xip_irqpending() (readl(ICIP) & readl(ICMR))
23 /* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */
24 #define xip_currtime() readl(OSCR)
25 #define xip_elapsed_since(x) (signed)((readl(OSCR) - (x)) / 4)
28 * xip_cpu_idle() is used when waiting for a delay equal or larger than
29 * the system timer tick period. This should put the CPU into idle mode
30 * to save power and to be woken up only when some interrupts are pending.
31 * As above, this should not rely upon standard kernel code.
34 #define xip_cpu_idle() asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1))
36 #endif /* __ARCH_PXA_MTD_XIP_H__ */