···11+/*22+ * MTD primitives for XIP support. Architecture specific functions33+ *44+ * Do not include this file directly. It's included from linux/mtd/xip.h55+ * 66+ * Author: Nicolas Pitre77+ * Created: Nov 2, 200488+ * Copyright: (C) 2004 MontaVista Software, Inc.99+ *1010+ * This program is free software; you can redistribute it and/or modify1111+ * it under the terms of the GNU General Public License version 2 as1212+ * published by the Free Software Foundation.1313+ *1414+ * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $1515+ */1616+1717+#ifndef __ARCH_PXA_MTD_XIP_H__1818+#define __ARCH_PXA_MTD_XIP_H__1919+2020+#include <asm/arch/pxa-regs.h>2121+2222+#define xip_irqpending() (ICIP & ICMR)2323+2424+/* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */2525+#define xip_currtime() (OSCR)2626+#define xip_elapsed_since(x) (signed)((OSCR - (x)) / 4)2727+2828+/*2929+ * xip_cpu_idle() is used when waiting for a delay equal or larger than3030+ * the system timer tick period. This should put the CPU into idle mode3131+ * to save power and to be woken up only when some interrupts are pending.3232+ * As above, this should not rely upon standard kernel code.3333+ */3434+3535+#define xip_cpu_idle() asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1))3636+3737+#endif /* __ARCH_PXA_MTD_XIP_H__ */
+26
include/asm-arm/arch-sa1100/mtd-xip.h
···11+/*22+ * MTD primitives for XIP support. Architecture specific functions33+ *44+ * Do not include this file directly. It's included from linux/mtd/xip.h55+ * 66+ * Author: Nicolas Pitre77+ * Created: Nov 2, 200488+ * Copyright: (C) 2004 MontaVista Software, Inc.99+ *1010+ * This program is free software; you can redistribute it and/or modify1111+ * it under the terms of the GNU General Public License version 2 as1212+ * published by the Free Software Foundation.1313+ *1414+ * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $1515+ */1616+1717+#ifndef __ARCH_SA1100_MTD_XIP_H__1818+#define __ARCH_SA1100_MTD_XIP_H__1919+2020+#define xip_irqpending() (ICIP & ICMR)2121+2222+/* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */2323+#define xip_currtime() (OSCR)2424+#define xip_elapsed_since(x) (signed)((OSCR - (x)) / 4)2525+2626+#endif /* __ARCH_SA1100_MTD_XIP_H__ */
+26
include/asm-arm/mtd-xip.h
···11+/*22+ * MTD primitives for XIP support. Architecture specific functions33+ *44+ * Do not include this file directly. It's included from linux/mtd/xip.h55+ * 66+ * Author: Nicolas Pitre77+ * Created: Nov 2, 200488+ * Copyright: (C) 2004 MontaVista Software, Inc.99+ *1010+ * This program is free software; you can redistribute it and/or modify1111+ * it under the terms of the GNU General Public License version 2 as1212+ * published by the Free Software Foundation.1313+ *1414+ * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $1515+ */1616+1717+#ifndef __ARM_MTD_XIP_H__1818+#define __ARM_MTD_XIP_H__1919+2020+#include <asm/hardware.h>2121+#include <asm/arch/mtd-xip.h>2222+2323+/* fill instruction prefetch */2424+#define xip_iprefetch() do { asm volatile (".rep 8; nop; .endr"); } while (0)2525+2626+#endif /* __ARM_MTD_XIP_H__ */
+13-18
include/linux/mtd/xip.h
···5858 * returned value is <= the real elapsed time.5959 * note 2: this should be able to cope with a few seconds without6060 * overflowing.6161+ *6262+ * xip_iprefetch()6363+ * 6464+ * Macro to fill instruction prefetch6565+ * e.g. a series of nops: asm volatile (".rep 8; nop; .endr"); 6166 */62676363-#if defined(CONFIG_ARCH_SA1100) || defined(CONFIG_ARCH_PXA)6868+#include <asm/mtd-xip.h>64696565-#include <asm/hardware.h>6666-#ifdef CONFIG_ARCH_PXA6767-#include <asm/arch/pxa-regs.h>6868-#endif6969-7070-#define xip_irqpending() (ICIP & ICMR)7171-7272-/* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */7373-#define xip_currtime() (OSCR)7474-#define xip_elapsed_since(x) (signed)((OSCR - (x)) / 4)7575-7676-#else7070+#ifndef xip_irqpending77717872#warning "missing IRQ and timer primitives for XIP MTD support"7973#warning "some of the XIP MTD support code will be disabled"···79858086#endif81878888+#ifndef xip_iprefetch8989+#define xip_iprefetch() do { } while (0)9090+#endif9191+8292/*8393 * xip_cpu_idle() is used when waiting for a delay equal or larger than8494 * the system timer tick period. This should put the CPU into idle mode8595 * to save power and to be woken up only when some interrupts are pending.8686- * As above, this should not rely upon standard kernel code.9696+ * This should not rely upon standard kernel code.8797 */8888-8989-#if defined(CONFIG_CPU_XSCALE)9090-#define xip_cpu_idle() asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1))9191-#else9898+#ifndef xip_cpu_idle9299#define xip_cpu_idle() do { } while (0)93100#endif94101