2 * Copyright (C) 2009 ST-Ericsson.
4 * U8500 hardware definitions
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
10 #ifndef __MACH_HARDWARE_H
11 #define __MACH_HARDWARE_H
13 /* macros to get at IO space when running virtually
14 * We dont map all the peripherals, let ioremap do
15 * this for us. We map only very basic peripherals here.
17 #define U8500_IO_VIRTUAL 0xf0000000
18 #define U8500_IO_PHYSICAL 0xa0000000
20 /* this macro is used in assembly, so no cast */
21 #define IO_ADDRESS(x) \
22 (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + U8500_IO_VIRTUAL)
24 /* typesafe io address */
25 #define __io_address(n) __io(IO_ADDRESS(n))
26 /* used by some plat-nomadik code */
27 #define io_p2v(n) __io_address(n)
29 #include <mach/db8500-regs.h>
30 #include <mach/db5500-regs.h>
32 /* ST-Ericsson modified pl022 id */
33 #define SSP_PER_ID 0x01080022
37 #include <asm/cputype.h>
39 static inline bool cpu_is_u8500(void)
41 #ifdef CONFIG_UX500_SOC_DB8500
48 #define CPUID_DB8500ED 0x410fc090
49 #define CPUID_DB8500V1 0x411fc091
50 #define CPUID_DB8500V2 0x412fc091
52 static inline bool cpu_is_u8500ed(void)
54 return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500ED);
57 static inline bool cpu_is_u8500v1(void)
59 return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500V1);
62 static inline bool cpu_is_u8500v2(void)
64 return cpu_is_u8500() && (read_cpuid_id() == CPUID_DB8500V2);
67 #ifdef CONFIG_UX500_SOC_DB8500
68 bool cpu_is_u8500v10(void);
69 bool cpu_is_u8500v11(void);
70 bool cpu_is_u8500v20(void);
72 static inline bool cpu_is_u8500v10(void) { return false; }
73 static inline bool cpu_is_u8500v11(void) { return false; }
74 static inline bool cpu_is_u8500v20(void) { return false; }
77 static inline bool cpu_is_u5500(void)
79 #ifdef CONFIG_UX500_SOC_DB5500
86 #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
87 #define ux500_unknown_soc() BUG()
91 #endif /* __MACH_HARDWARE_H */