2009-11-28 15:10:40 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2009 ST-Ericsson.
|
|
|
|
*
|
|
|
|
* U8500 hardware definitions
|
|
|
|
*
|
|
|
|
* This file is licensed under the terms of the GNU General Public
|
|
|
|
* License version 2. This program is licensed "as is" without any
|
|
|
|
* warranty of any kind, whether express or implied.
|
|
|
|
*/
|
|
|
|
#ifndef __MACH_HARDWARE_H
|
|
|
|
#define __MACH_HARDWARE_H
|
|
|
|
|
|
|
|
/* macros to get at IO space when running virtually
|
|
|
|
* We dont map all the peripherals, let ioremap do
|
|
|
|
* this for us. We map only very basic peripherals here.
|
|
|
|
*/
|
|
|
|
#define U8500_IO_VIRTUAL 0xf0000000
|
|
|
|
#define U8500_IO_PHYSICAL 0xa0000000
|
|
|
|
|
|
|
|
/* this macro is used in assembly, so no cast */
|
|
|
|
#define IO_ADDRESS(x) \
|
|
|
|
(((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + U8500_IO_VIRTUAL)
|
|
|
|
|
|
|
|
/* typesafe io address */
|
|
|
|
#define __io_address(n) __io(IO_ADDRESS(n))
|
2010-03-03 11:54:37 +08:00
|
|
|
/* used by some plat-nomadik code */
|
|
|
|
#define io_p2v(n) __io_address(n)
|
2009-11-28 15:10:40 +08:00
|
|
|
|
2010-05-03 14:34:53 +08:00
|
|
|
#include <mach/db8500-regs.h>
|
|
|
|
#include <mach/db5500-regs.h>
|
|
|
|
|
2009-11-28 15:10:40 +08:00
|
|
|
/* ST-Ericsson modified pl022 id */
|
|
|
|
#define SSP_PER_ID 0x01080022
|
|
|
|
|
2010-03-01 12:05:56 +08:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
#include <asm/cputype.h>
|
|
|
|
|
2010-05-03 14:27:31 +08:00
|
|
|
static inline bool cpu_is_u8500(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_UX500_SOC_DB8500
|
|
|
|
return 1;
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2010-08-19 17:27:49 +08:00
|
|
|
#define CPUID_DB8500ED 0x410fc090
|
|
|
|
#define CPUID_DB8500V1 0x411fc091
|
|
|
|
#define CPUID_DB8500V2 0x412fc091
|
|
|
|
|
2010-03-01 12:05:56 +08:00
|
|
|
static inline bool cpu_is_u8500ed(void)
|
|
|
|
{
|
2010-08-19 17:27:49 +08:00
|
|
|
return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500ED);
|
2010-03-01 12:05:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool cpu_is_u8500v1(void)
|
|
|
|
{
|
2010-08-19 17:27:49 +08:00
|
|
|
return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500V1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool cpu_is_u8500v2(void)
|
|
|
|
{
|
|
|
|
return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500V2);
|
2010-03-01 12:05:56 +08:00
|
|
|
}
|
|
|
|
|
2010-08-19 17:27:49 +08:00
|
|
|
#ifdef CONFIG_UX500_SOC_DB8500
|
|
|
|
bool cpu_is_u8500v10(void);
|
|
|
|
bool cpu_is_u8500v11(void);
|
|
|
|
bool cpu_is_u8500v20(void);
|
|
|
|
#else
|
|
|
|
static inline bool cpu_is_u8500v10(void) { return false; }
|
|
|
|
static inline bool cpu_is_u8500v11(void) { return false; }
|
|
|
|
static inline bool cpu_is_u8500v20(void) { return false; }
|
|
|
|
#endif
|
|
|
|
|
2010-05-03 15:46:51 +08:00
|
|
|
static inline bool cpu_is_u5500(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_UX500_SOC_DB5500
|
|
|
|
return 1;
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2010-12-08 13:37:55 +08:00
|
|
|
#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
|
2010-12-08 13:37:57 +08:00
|
|
|
#define ux500_unknown_soc() BUG()
|
2010-12-08 13:37:55 +08:00
|
|
|
|
2010-03-01 12:05:56 +08:00
|
|
|
#endif
|
|
|
|
|
2009-11-28 15:10:40 +08:00
|
|
|
#endif /* __MACH_HARDWARE_H */
|