blob: d0b049aad7b2fa22996b5055c6e0a0c6f778a9fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/*
* Copyright (C) ST-Ericsson SA 2010
*
* Author: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
* for ST-Ericsson
*
*
* License terms: GNU General Public License (GPL), version 2.
*/
#ifndef __DB5500_CPU_H__
#define __DB5500_CPU_H__
#include <asm/io.h>
#include <asm/arch/hardware.h>
#define U5500_BOOT_ROM_BASE 0x90000000
#define U5500_ASIC_ID_ADDRESS (U5500_BOOT_ROM_BASE + 0x1FFF4)
#define CPUID_DB5500V1 0xA0
#define CPUID_DB5500V2 0xB0
/*
* Keep these CPU identity functions inline here because they are short
* and used by many. Will make for fast optimized compiled code.
*/
static inline unsigned int read_cpuid(void)
{
unsigned long val;
val = readl(U5500_ASIC_ID_ADDRESS);
return (val & 0xFF);
}
static inline int cpu_is_u5500v1(void)
{
return read_cpuid() == CPUID_DB5500V1;
}
static inline int cpu_is_u5500v2(void)
{
return read_cpuid() == CPUID_DB5500V2;
}
#endif /* __DB5500_CPU_H__ */
|