ux500: dynamic SOC detection

Dynamically detect the DBx500 SOC an revision based on the ASIC ID.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
This commit is contained in:
Rabin Vincent
2010-12-08 11:07:59 +05:30
committed by Linus Walleij
parent 5dc55e0a39
commit abf12d719a
8 changed files with 213 additions and 137 deletions

View File

@@ -34,57 +34,9 @@
#ifndef __ASSEMBLY__
#include <asm/cputype.h>
static inline bool cpu_is_u8500(void)
{
#ifdef CONFIG_UX500_SOC_DB8500
return 1;
#else
return 0;
#endif
}
#define CPUID_DB8500ED 0x410fc090
#define CPUID_DB8500V1 0x411fc091
#define CPUID_DB8500V2 0x412fc091
static inline bool cpu_is_u8500ed(void)
{
return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500ED);
}
static inline bool cpu_is_u8500v1(void)
{
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);
}
#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
static inline bool cpu_is_u5500(void)
{
#ifdef CONFIG_UX500_SOC_DB5500
return 1;
#else
return 0;
#endif
}
#include <mach/id.h>
#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
#define ux500_unknown_soc() BUG()
#endif