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

« back to all changes in this revision

Viewing changes to arch/arm/plat-mxc/include/mach/hardware.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:
1
1
/*
2
 
 *  Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
3
 
 */
4
 
 
5
 
/*
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License version 2 as
8
 
 * published by the Free Software Foundation.
 
2
 * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
 
3
 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
17
 * MA  02110-1301, USA.
9
18
 */
10
19
 
11
20
#ifndef __ASM_ARCH_MXC_HARDWARE_H__
30
39
#define CHIP_REV_3_1            0x31
31
40
#define CHIP_REV_3_2            0x32
32
41
 
 
42
#define BOARD_REV_1             0x000
33
43
#define BOARD_REV_2             0x100
34
44
 
35
 
#ifndef __ASSEMBLY__
36
 
extern unsigned int system_rev;
37
 
#endif
38
 
#define mxc_set_system_rev(part, rev) {                 \
39
 
        system_rev = (part << 12) | rev;                \
40
 
}
41
 
 
42
 
#define mxc_cpu()               (system_rev >> 12)
43
 
#define mxc_is_cpu(part)        ((mxc_cpu() == part) ? 1 : 0)
44
 
#define mxc_cpu_rev()           (system_rev & 0xFF)
45
 
#define mxc_cpu_rev_major()     ((system_rev >> 4) & 0xF)
46
 
#define mxc_cpu_rev_minor()     (system_rev & 0xF)
47
 
#define mxc_cpu_is_rev(rev)     \
48
 
        ((mxc_cpu_rev() == rev) ? 1 : ((mxc_cpu_rev() < rev) ? -1 : 2))
49
 
#define MXC_REV(type)                           \
50
 
static inline int type## _rev (int rev)         \
51
 
{                                               \
52
 
        return (type() ? mxc_cpu_is_rev(rev) : 0);      \
53
 
}
54
 
 
55
45
#ifdef CONFIG_ARCH_MX3
56
 
# include <mach/mx31.h>
57
 
# define cpu_is_mx31()          (mxc_is_cpu(0x31))      /*system_rev got from Redboot */
58
 
# define cpu_is_mx32()          (mxc_is_cpu(0x32))      /*system_rev got from Redboot */
59
 
#else
60
 
# define cpu_is_mx31()          (0)
61
 
# define cpu_is_mx32()          (0)
62
 
#endif /* CONFIG_ARCH_MX3 */
 
46
#include <mach/mx3x.h>
 
47
#include <mach/mx31.h>
 
48
#endif
63
49
 
64
50
#ifdef CONFIG_ARCH_MX35
65
 
# include <mach/mx35.h>
66
 
# define cpu_is_mx35()   (1)
67
 
# define board_is_mx35(rev)   ((system_rev & rev) ? 1 : 0)
68
 
#else
69
 
# define cpu_is_mx35()   (0)
70
 
# define board_is_mx35(rev) (0)
71
 
#endif /* CONFIG_ARCH_MX35 */
 
51
#include <mach/mx3x.h>
 
52
#include <mach/mx35.h>
 
53
#endif
 
54
 
 
55
#ifdef CONFIG_ARCH_MX2
 
56
# include <mach/mx2x.h>
 
57
# ifdef CONFIG_MACH_MX21
 
58
#  include <mach/mx21.h>
 
59
# endif
 
60
# ifdef CONFIG_MACH_MX27
 
61
#  include <mach/mx27.h>
 
62
# endif
 
63
#endif
 
64
 
 
65
#ifdef CONFIG_ARCH_MX1
 
66
# include <mach/mx1.h>
 
67
#endif
72
68
 
73
69
#ifdef CONFIG_ARCH_MX37
74
70
#include <mach/mx37.h>
75
 
#define cpu_is_mx37()   (1)
76
 
#define board_is_mx37(rev)   ((system_rev & rev) ? 1 : 0)
77
 
#else
78
 
#define cpu_is_mx37()   (0)
79
 
#define board_is_mx37(rev)   (0)
80
71
#endif
81
72
 
82
73
#ifdef CONFIG_ARCH_MX51
83
 
# include <mach/mx51.h>
84
 
# define cpu_is_mx51()   (1)
85
 
#define board_is_mx51(rev)   ((system_rev & rev) ? 1 : 0)
86
 
/* BB25:Bit8 is set to 1, BB20: Bit8 is set to 0 */
87
 
#define board_is_babbage_2_5()   ((system_rev & 0x1FF) >> 8)
88
 
#else
89
 
# define cpu_is_mx51()   (0)
90
 
#define board_is_mx51(rev)      (0)
91
 
#define board_is_babbage_2_5()  (0)
92
 
#endif /* CONFIG_ARCH_MX51 */
93
 
 
94
 
#ifdef CONFIG_ARCH_MX21
95
 
#include <mach/mx21.h>
96
 
#define cpu_is_mx21()           (1)
97
 
#else
98
 
#define cpu_is_mx21()           (0)
 
74
#include <mach/mx51.h>
99
75
#endif
100
76
 
101
77
#ifdef CONFIG_ARCH_MX25
102
78
#include <mach/mx25.h>
103
 
#define cpu_is_mx25()           (1)
104
 
#else
105
 
#define cpu_is_mx25()           (0)
106
 
#endif
107
 
 
108
 
#ifdef CONFIG_ARCH_MX27
109
 
#include <mach/mx27.h>
110
 
#define cpu_is_mx27()           (1)
111
 
#else
112
 
#define cpu_is_mx27()           (0)
113
79
#endif
114
80
 
115
81
#ifndef __ASSEMBLY__
116
 
/*
117
 
 * Create inline functions to test for cpu revision
118
 
 * Function name is cpu_is_<cpu name>_rev(rev)
119
 
 *
120
 
 * Returns:
121
 
 *       0 - not the cpu queried
122
 
 *       1 - cpu and revision match
123
 
 *       2 - cpu matches, but cpu revision is greater than queried rev
124
 
 *      -1 - cpu matches, but cpu revision is less than queried rev
125
 
 */
126
 
MXC_REV(cpu_is_mx21);
127
 
MXC_REV(cpu_is_mx25);
128
 
MXC_REV(cpu_is_mx27);
129
 
MXC_REV(cpu_is_mx31);
130
 
MXC_REV(cpu_is_mx32);
131
 
MXC_REV(cpu_is_mx35);
132
 
MXC_REV(cpu_is_mx37);
133
 
MXC_REV(cpu_is_mx51);
 
82
extern unsigned int system_rev;
 
83
#define board_is_rev(rev)       (((system_rev & 0x0F00) == rev) ? 1 : 0)
134
84
#endif
 
85
 
135
86
#include <mach/mxc.h>
136
87
 
137
 
#define MXC_MAX_GPIO_LINES      (GPIO_NUM_PIN * GPIO_PORT_NUM)
138
 
 
139
 
#define MXC_EXP_IO_BASE         (MXC_MAX_INT_LINES + MXC_MAX_GPIO_LINES)
140
 
#define MXC_MAX_EXP_IO_LINES    16
141
 
 
142
 
#ifdef CONFIG_MXC_PSEUDO_IRQS
143
 
#define MXC_PSEUDO_IO_BASE      (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES)
144
 
#define MXC_MAX_PSEUDO_IO_LINES 16
145
 
#else
146
 
#define MXC_MAX_PSEUDO_IO_LINES 0
147
 
#endif
 
88
/*!
 
89
 * Register an interrupt handler for the SMN as well as the SCC.  In some
 
90
 * implementations, the SMN is not connected at all, and in others, it is
 
91
 * on the same interrupt line as the SCM. Comment this line out accordingly
 
92
 */
 
93
#define USE_SMN_INTERRUPT
 
94
 
 
95
/*!
 
96
 * This option is used to set or clear the RXDMUXSEL bit in control reg 3.
 
97
 * Certain platforms need this bit to be set in order to receive Irda data.
 
98
 */
 
99
#define MXC_UART_IR_RXDMUX      0x0004
 
100
/*!
 
101
 * This option is used to set or clear the RXDMUXSEL bit in control reg 3.
 
102
 * Certain platforms need this bit to be set in order to receive UART data.
 
103
 */
 
104
#define MXC_UART_RXDMUX         0x0004
148
105
 
149
106
#ifndef MXC_INT_FORCE
150
107
#define MXC_INT_FORCE   -1
151
108
#endif
152
 
#define MXC_MAX_INTS            (MXC_MAX_INT_LINES + \
153
 
                                MXC_MAX_GPIO_LINES + \
154
 
                                MXC_MAX_EXP_IO_LINES + \
155
 
                                MXC_MAX_PSEUDO_IO_LINES)
156
109
#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */