Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 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, |
Masahiro Yamada | 6f45a97 | 2015-12-17 17:47:45 +0900 | [diff] [blame] | 18 | SOC_UNIPHIER_PH1_SLD11, |
| 19 | SOC_UNIPHIER_PH1_LD10, |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 20 | SOC_UNIPHIER_UNKNOWN, |
| 21 | }; |
| 22 | |
| 23 | #define UNIPHIER_NR_ENABLED_SOCS \ |
| 24 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_SLD3) + \ |
| 25 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_LD4) + \ |
| 26 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_PRO4) + \ |
| 27 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_SLD8) + \ |
| 28 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_PRO5) + \ |
| 29 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PROXSTREAM2) + \ |
Masahiro Yamada | 6f45a97 | 2015-12-17 17:47:45 +0900 | [diff] [blame] | 30 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_LD6B) + \ |
| 31 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_SLD11) + \ |
| 32 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PH1_LD10) |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 33 | |
| 34 | #define UNIPHIER_MULTI_SOC ((UNIPHIER_NR_ENABLED_SOCS) > 1) |
| 35 | |
| 36 | #if UNIPHIER_MULTI_SOC |
| 37 | enum uniphier_soc_id uniphier_get_soc_type(void); |
| 38 | #else |
| 39 | static inline enum uniphier_soc_id uniphier_get_soc_type(void) |
| 40 | { |
| 41 | #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3) |
| 42 | return SOC_UNIPHIER_PH1_SLD3; |
| 43 | #endif |
| 44 | #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4) |
| 45 | return SOC_UNIPHIER_PH1_LD4; |
| 46 | #endif |
| 47 | #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4) |
| 48 | return SOC_UNIPHIER_PH1_PRO4; |
| 49 | #endif |
| 50 | #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8) |
| 51 | return SOC_UNIPHIER_PH1_SLD8; |
| 52 | #endif |
| 53 | #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5) |
| 54 | return SOC_UNIPHIER_PH1_PRO5; |
| 55 | #endif |
| 56 | #if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2) |
| 57 | return SOC_UNIPHIER_PROXSTREAM2; |
| 58 | #endif |
| 59 | #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B) |
| 60 | return SOC_UNIPHIER_PH1_LD6B; |
| 61 | #endif |
Masahiro Yamada | 6f45a97 | 2015-12-17 17:47:45 +0900 | [diff] [blame] | 62 | #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD11) |
| 63 | return SOC_UNIPHIER_PH1_SLD11; |
| 64 | #endif |
| 65 | #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD10) |
| 66 | return SOC_UNIPHIER_PH1_LD10; |
| 67 | #endif |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 68 | |
| 69 | return SOC_UNIPHIER_UNKNOWN; |
| 70 | } |
| 71 | #endif |
| 72 | |
Masahiro Yamada | 2071f14 | 2015-12-17 17:47:41 +0900 | [diff] [blame] | 73 | int uniphier_get_soc_model(void); |
| 74 | int uniphier_get_soc_revision(void); |
| 75 | |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 76 | #endif /* __MACH_SOC_INFO_H__ */ |