162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * MTD primitives for XIP support. Architecture specific functions
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Do not include this file directly. It's included from linux/mtd/xip.h
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Author:	Nicolas Pitre
862306a36Sopenharmony_ci * Created:	Nov 2, 2004
962306a36Sopenharmony_ci * Copyright:	(C) 2004 MontaVista Software, Inc.
1062306a36Sopenharmony_ci */
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#ifndef __ARCH_SA1100_MTD_XIP_H__
1362306a36Sopenharmony_ci#define __ARCH_SA1100_MTD_XIP_H__
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#include <mach/hardware.h>
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#define xip_irqpending()	(ICIP & ICMR)
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */
2062306a36Sopenharmony_ci#define xip_currtime()		readl_relaxed(OSCR)
2162306a36Sopenharmony_ci#define xip_elapsed_since(x)	(signed)((readl_relaxed(OSCR) - (x)) / 4)
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#endif /* __ARCH_SA1100_MTD_XIP_H__ */
24