]> git.sur5r.net Git - u-boot/blob - arch/arm/mach-uniphier/include/mach/soc_info.h
Merge remote-tracking branch 'u-boot/master'
[u-boot] / arch / arm / mach-uniphier / include / mach / soc_info.h
1 /*
2  * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7 #ifndef __MACH_SOC_INFO_H__
8 #define __MACH_SOC_INFO_H__
9
10 enum uniphier_soc_id {
11         SOC_UNIPHIER_PH1_SLD3,
12         SOC_UNIPHIER_PH1_LD4,
13         SOC_UNIPHIER_PH1_PRO4,
14         SOC_UNIPHIER_PH1_SLD8,
15         SOC_UNIPHIER_PH1_PRO5,
16         SOC_UNIPHIER_PROXSTREAM2,
17         SOC_UNIPHIER_PH1_LD6B,
18         SOC_UNIPHIER_UNKNOWN,
19 };
20
21 #define UNIPHIER_NR_ENABLED_SOCS                \
22         IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_SLD3) +     \
23         IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_LD4) +      \
24         IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_PRO4) +     \
25         IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_SLD8) +     \
26         IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_PRO5) +     \
27         IS_ENABLED(CONFIG_ARCH_UNIPHIER_PROXSTREAM2) +  \
28         IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
29
30 #define UNIPHIER_MULTI_SOC      ((UNIPHIER_NR_ENABLED_SOCS) > 1)
31
32 #if UNIPHIER_MULTI_SOC
33 enum uniphier_soc_id uniphier_get_soc_type(void);
34 #else
35 static inline enum uniphier_soc_id uniphier_get_soc_type(void)
36 {
37 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
38         return SOC_UNIPHIER_PH1_SLD3;
39 #endif
40 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
41         return SOC_UNIPHIER_PH1_LD4;
42 #endif
43 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
44         return SOC_UNIPHIER_PH1_PRO4;
45 #endif
46 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
47         return SOC_UNIPHIER_PH1_SLD8;
48 #endif
49 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
50         return SOC_UNIPHIER_PH1_PRO5;
51 #endif
52 #if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2)
53         return SOC_UNIPHIER_PROXSTREAM2;
54 #endif
55 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
56         return SOC_UNIPHIER_PH1_LD6B;
57 #endif
58
59         return SOC_UNIPHIER_UNKNOWN;
60 }
61 #endif
62
63 #endif /* __MACH_SOC_INFO_H__ */