2 * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
4 * SPDX-License-Identifier: GPL-2.0+
7 #ifndef __MACH_SOC_INFO_H__
8 #define __MACH_SOC_INFO_H__
10 enum uniphier_soc_id {
11 SOC_UNIPHIER_PH1_SLD3,
13 SOC_UNIPHIER_PH1_PRO4,
14 SOC_UNIPHIER_PH1_SLD8,
15 SOC_UNIPHIER_PH1_PRO5,
16 SOC_UNIPHIER_PROXSTREAM2,
17 SOC_UNIPHIER_PH1_LD6B,
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)
30 #define UNIPHIER_MULTI_SOC ((UNIPHIER_NR_ENABLED_SOCS) > 1)
32 #if UNIPHIER_MULTI_SOC
33 enum uniphier_soc_id uniphier_get_soc_type(void);
35 static inline enum uniphier_soc_id uniphier_get_soc_type(void)
37 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
38 return SOC_UNIPHIER_PH1_SLD3;
40 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
41 return SOC_UNIPHIER_PH1_LD4;
43 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
44 return SOC_UNIPHIER_PH1_PRO4;
46 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
47 return SOC_UNIPHIER_PH1_SLD8;
49 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
50 return SOC_UNIPHIER_PH1_PRO5;
52 #if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2)
53 return SOC_UNIPHIER_PROXSTREAM2;
55 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
56 return SOC_UNIPHIER_PH1_LD6B;
59 return SOC_UNIPHIER_UNKNOWN;
63 #endif /* __MACH_SOC_INFO_H__ */