blob: 9b60aefc66e15ef3dbe76a3a961bba2c9c7f8666 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef __ARCH_OMAP_MTD_XIP_H__
13#define __ARCH_OMAP_MTD_XIP_H__
14
15#include <asm/hardware.h>
16#define OMAP_MPU_TIMER_BASE (0xfffec500)
17#define OMAP_MPU_TIMER_OFFSET 0x100
18
19typedef struct {
20 u32 cntl;
21 u32 load_tim;
22 u32 read_tim;
23} xip_omap_mpu_timer_regs_t;
24
25#define xip_omap_mpu_timer_base(n) ((volatile xip_omap_mpu_timer_regs_t*)IO_ADDRESS(OMAP_MPU_TIMER_BASE + (n)*OMAP_MPU_TIMER_OFFSET))
26
27#define xip_irqpending() (omap_readl(OMAP_IH1_ITR) & ~omap_readl(OMAP_IH1_MIR))
28#define xip_currtime() (~xip_omap_mpu_timer_read(0))
29#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 6)
30#define xip_cpu_idle() asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (1))
31#endif