mtd-xip.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * MTD primitives for XIP support. Architecture specific functions
  3. *
  4. * Do not include this file directly. It's included from linux/mtd/xip.h
  5. *
  6. * Copyright (C) 2008 Darius Augulis <augulis.darius@gmail.com>, Teltonika, Inc.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #include <mach/mxc_timer.h>
  14. #ifndef __ARCH_IMX_MTD_XIP_H__
  15. #define __ARCH_IMX_MTD_XIP_H__
  16. #ifdef CONFIG_ARCH_MX1
  17. /* AITC registers */
  18. #define AITC_BASE IO_ADDRESS(AVIC_BASE_ADDR)
  19. #define NIPNDH (AITC_BASE + 0x58)
  20. #define NIPNDL (AITC_BASE + 0x5C)
  21. #define INTENABLEH (AITC_BASE + 0x10)
  22. #define INTENABLEL (AITC_BASE + 0x14)
  23. /* MTD macros */
  24. #define xip_irqpending() ((__raw_readl(INTENABLEH) & __raw_readl(NIPNDH)) \
  25. || (__raw_readl(INTENABLEL) & __raw_readl(NIPNDL)))
  26. #define xip_currtime() (__raw_readl(TIMER_BASE + MXC_TCN))
  27. #define xip_elapsed_since(x) (signed)((__raw_readl(TIMER_BASE + MXC_TCN) - (x)) / 96)
  28. #define xip_cpu_idle() asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (0))
  29. #endif /* CONFIG_ARCH_MX1 */
  30. #endif /* __ARCH_IMX_MTD_XIP_H__ */