xref: /linux/arch/arm/mach-sa1100/include/mach/mtd-xip.h (revision 8e07e0e3964ca4e23ce7b68e2096fe660a888942)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * MTD primitives for XIP support. Architecture specific functions
4  *
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.
10  */
11 
12 #ifndef __ARCH_SA1100_MTD_XIP_H__
13 #define __ARCH_SA1100_MTD_XIP_H__
14 
15 #include <mach/hardware.h>
16 
17 #define xip_irqpending()	(ICIP & ICMR)
18 
19 /* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */
20 #define xip_currtime()		readl_relaxed(OSCR)
21 #define xip_elapsed_since(x)	(signed)((readl_relaxed(OSCR) - (x)) / 4)
22 
23 #endif /* __ARCH_SA1100_MTD_XIP_H__ */
24