1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * MTD primitives for XIP support. Architecture specific functions
5 * Do not include this file directly. It's included from linux/mtd/xip.h
7 * Author: Nicolas Pitre
9 * Copyright: (C) 2004 MontaVista Software, Inc.
12 #ifndef __ARCH_SA1100_MTD_XIP_H__
13 #define __ARCH_SA1100_MTD_XIP_H__
15 #include <mach/hardware.h>
17 #define xip_irqpending() (ICIP & ICMR)
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)
23 #endif /* __ARCH_SA1100_MTD_XIP_H__ */