2005-07-11 02:58:15 +08:00
|
|
|
/*
|
2008-08-05 23:14:15 +08:00
|
|
|
* arch/arm/plat-omap/include/mach/common.h
|
2005-07-11 02:58:15 +08:00
|
|
|
*
|
|
|
|
* Header for code common to all OMAP machines.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
|
|
|
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
|
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
|
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
|
|
|
|
#define __ARCH_ARM_MACH_OMAP_COMMON_H
|
|
|
|
|
2010-12-22 06:30:55 +08:00
|
|
|
#include <linux/delay.h>
|
|
|
|
|
2009-12-12 08:16:32 +08:00
|
|
|
#include <plat/i2c.h>
|
2007-11-07 12:54:31 +08:00
|
|
|
|
2005-07-11 02:58:15 +08:00
|
|
|
struct sys_timer;
|
|
|
|
|
|
|
|
extern void omap_map_common_io(void);
|
2011-03-30 06:54:48 +08:00
|
|
|
extern struct sys_timer omap1_timer;
|
|
|
|
extern struct sys_timer omap2_timer;
|
|
|
|
extern struct sys_timer omap3_timer;
|
|
|
|
extern struct sys_timer omap3_secure_timer;
|
|
|
|
extern struct sys_timer omap4_timer;
|
2011-01-19 04:42:23 +08:00
|
|
|
extern bool omap_32k_timer_init(void);
|
2011-01-16 12:32:01 +08:00
|
|
|
extern int __init omap_init_clocksource_32k(void);
|
2011-01-19 09:00:00 +08:00
|
|
|
extern unsigned long long notrace omap_32k_sched_clock(void);
|
2005-07-11 02:58:15 +08:00
|
|
|
|
2010-05-23 17:18:16 +08:00
|
|
|
extern void omap_reserve(void);
|
|
|
|
|
2011-08-23 14:57:24 +08:00
|
|
|
void omap2420_init_early(void);
|
|
|
|
void omap2430_init_early(void);
|
|
|
|
void omap3430_init_early(void);
|
|
|
|
void omap35xx_init_early(void);
|
|
|
|
void omap3630_init_early(void);
|
2011-10-05 09:26:28 +08:00
|
|
|
void omap3_init_early(void); /* Do not use this one */
|
2011-08-23 14:57:24 +08:00
|
|
|
void am35xx_init_early(void);
|
|
|
|
void ti816x_init_early(void);
|
|
|
|
void omap4430_init_early(void);
|
|
|
|
|
2011-10-05 04:52:57 +08:00
|
|
|
void omap_sram_init(void);
|
|
|
|
|
2010-02-15 20:33:37 +08:00
|
|
|
/*
|
|
|
|
* IO bases for various OMAP processors
|
|
|
|
* Except the tap base, rest all the io bases
|
|
|
|
* listed are physical addresses.
|
|
|
|
*/
|
2008-07-03 17:24:44 +08:00
|
|
|
struct omap_globals {
|
2008-10-06 20:49:16 +08:00
|
|
|
u32 class; /* OMAP class to detect */
|
2008-07-03 17:24:44 +08:00
|
|
|
void __iomem *tap; /* Control module ID code */
|
2011-10-05 09:17:41 +08:00
|
|
|
void __iomem *sdrc; /* SDRAM Controller */
|
|
|
|
void __iomem *sms; /* SDRAM Memory Scheduler */
|
|
|
|
void __iomem *ctrl; /* System Control Module */
|
|
|
|
void __iomem *ctrl_pad; /* PAD Control Module */
|
|
|
|
void __iomem *prm; /* Power and Reset Management */
|
|
|
|
void __iomem *cm; /* Clock Management */
|
|
|
|
void __iomem *cm2;
|
2008-07-03 17:24:44 +08:00
|
|
|
};
|
|
|
|
|
2008-05-08 07:55:13 +08:00
|
|
|
void omap2_set_globals_242x(void);
|
|
|
|
void omap2_set_globals_243x(void);
|
2010-08-04 19:43:18 +08:00
|
|
|
void omap2_set_globals_3xxx(void);
|
2009-05-29 05:16:04 +08:00
|
|
|
void omap2_set_globals_443x(void);
|
2011-02-17 00:31:39 +08:00
|
|
|
void omap2_set_globals_ti816x(void);
|
2008-05-08 07:55:13 +08:00
|
|
|
|
2008-07-03 17:24:44 +08:00
|
|
|
/* These get called from omap2_set_globals_xxxx(), do not call these */
|
2008-10-06 20:49:16 +08:00
|
|
|
void omap2_set_globals_tap(struct omap_globals *);
|
2009-01-29 03:27:37 +08:00
|
|
|
void omap2_set_globals_sdrc(struct omap_globals *);
|
2008-07-03 17:24:44 +08:00
|
|
|
void omap2_set_globals_control(struct omap_globals *);
|
|
|
|
void omap2_set_globals_prcm(struct omap_globals *);
|
|
|
|
|
2011-09-24 04:23:09 +08:00
|
|
|
void omap242x_map_io(void);
|
|
|
|
void omap243x_map_io(void);
|
2010-08-04 19:43:18 +08:00
|
|
|
void omap3_map_io(void);
|
2011-09-24 04:23:09 +08:00
|
|
|
void omap4_map_io(void);
|
|
|
|
|
2010-08-04 19:43:18 +08:00
|
|
|
|
2009-12-09 07:33:16 +08:00
|
|
|
/**
|
|
|
|
* omap_test_timeout - busy-loop, testing a condition
|
|
|
|
* @cond: condition to test until it evaluates to true
|
|
|
|
* @timeout: maximum number of microseconds in the timeout
|
|
|
|
* @index: loop index (integer)
|
|
|
|
*
|
|
|
|
* Loop waiting for @cond to become true or until at least @timeout
|
|
|
|
* microseconds have passed. To use, define some integer @index in the
|
|
|
|
* calling code. After running, if @index == @timeout, then the loop has
|
|
|
|
* timed out.
|
|
|
|
*/
|
|
|
|
#define omap_test_timeout(cond, timeout, index) \
|
|
|
|
({ \
|
|
|
|
for (index = 0; index < timeout; index++) { \
|
|
|
|
if (cond) \
|
|
|
|
break; \
|
|
|
|
udelay(1); \
|
|
|
|
} \
|
|
|
|
})
|
|
|
|
|
2010-07-27 06:34:31 +08:00
|
|
|
extern struct device *omap2_get_mpuss_device(void);
|
2010-09-01 16:14:53 +08:00
|
|
|
extern struct device *omap2_get_iva_device(void);
|
2010-07-27 06:34:31 +08:00
|
|
|
extern struct device *omap2_get_l3_device(void);
|
2010-09-01 16:14:53 +08:00
|
|
|
extern struct device *omap4_get_dsp_device(void);
|
2010-07-27 06:34:31 +08:00
|
|
|
|
2005-07-11 02:58:15 +08:00
|
|
|
#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
|