~ubuntu-branches/ubuntu/vivid/linux-fsl-imx51/vivid

« back to all changes in this revision

Viewing changes to arch/arm/plat-mxc/include/mach/mtd-xip.h

  • Committer: Bazaar Package Importer
  • Author(s): Andy Whitcroft, Amit Kucheria, Andy Whitcroft, Bryan Wu, Upstream Kernel Changes
  • Date: 2010-01-11 16:26:27 UTC
  • Revision ID: james.westby@ubuntu.com-20100111162627-1q2fl9tcuwcywt1e
Tags: 2.6.31-602.4
[ Amit Kucheria ]

* Update to official 2.6.31 BSP release from Freescale

[ Andy Whitcroft ]

* drop a number of modules no longer built

[ Bryan Wu ]

* [Config] Update configs after applying .31 patchset from Freescale
* [Config] Sync with imx51_defconfig from Freescale BSP

[ Upstream Kernel Changes ]

* Update to official 2.6.31 BSP release from Freescale.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * Do not include this file directly. It's included from linux/mtd/xip.h
5
5
 *
6
6
 * Copyright (C) 2008 Darius Augulis <augulis.darius@gmail.com>, Teltonika, Inc.
 
7
 * Copyright 2007-2009 Freescale Semiconductor, Inc. All Rights Reserved.
7
8
 *
8
9
 * This program is free software; you can redistribute it and/or modify
9
10
 * it under the terms of the GNU General Public License version 2 as
11
12
 *
12
13
 */
13
14
 
14
 
#include <mach/timer.h>
 
15
#include <linux/clocksource.h>
 
16
#include <mach/hardware.h>
 
17
#include <mach/system.h>
 
18
#include <mach/mxc_timer.h>
15
19
 
16
20
#ifndef __ARCH_IMX_MTD_XIP_H__
17
21
#define __ARCH_IMX_MTD_XIP_H__
18
22
 
19
 
#ifdef CONFIG_ARCH_MX1
20
23
/* AITC registers */
21
24
#define AITC_BASE       IO_ADDRESS(AVIC_BASE_ADDR)
22
25
#define NIPNDH          (AITC_BASE + 0x58)
26
29
/* MTD macros */
27
30
#define xip_irqpending() ((__raw_readl(INTENABLEH) &  __raw_readl(NIPNDH)) \
28
31
                        || (__raw_readl(INTENABLEL) &  __raw_readl(NIPNDL)))
 
32
#ifdef CONFIG_ARCH_MX1
29
33
#define xip_currtime()          (__raw_readl(TIMER_BASE + MXC_TCN))
30
34
#define xip_elapsed_since(x)    (signed)((__raw_readl(TIMER_BASE + MXC_TCN) - (x)) / 96)
31
35
#define xip_cpu_idle()          asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (0))
 
36
#else
 
37
 
 
38
extern struct clocksource *mtd_xip_clksrc;
 
39
 
 
40
#define xip_currtime()  (unsigned long)clocksource_read(mtd_xip_clksrc)
 
41
 
 
42
#if CLOCK_TICK_RATE > 1000000
 
43
#define NUMERATOR       1
 
44
#define DENOMINATOR     (CLOCK_TICK_RATE/1000000 + 1)
 
45
#else
 
46
#define NUMERATOR       (1000000/CLOCK_TICK_RATE)
 
47
#define DENOMINATOR     1
 
48
#endif
 
49
 
 
50
static inline unsigned long xip_elapsed_since(unsigned long x)
 
51
{
 
52
        return (((xip_currtime() - x) * NUMERATOR) / DENOMINATOR);
 
53
}
 
54
 
 
55
/*
 
56
 * Wait For Interrupt command for XIP kernel to put CPU in Idle mode
 
57
 */
 
58
#define xip_cpu_idle()  arch_idle()
 
59
 
32
60
#endif /* CONFIG_ARCH_MX1 */
33
61
 
34
62
#endif /* __ARCH_IMX_MTD_XIP_H__ */