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 { |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 11 | SOC_UNIPHIER_SLD3, |
| 12 | SOC_UNIPHIER_LD4, |
| 13 | SOC_UNIPHIER_PRO4, |
| 14 | SOC_UNIPHIER_SLD8, |
| 15 | SOC_UNIPHIER_PRO5, |
| 16 | SOC_UNIPHIER_PXS2, |
| 17 | SOC_UNIPHIER_LD6B, |
| 18 | SOC_UNIPHIER_LD11, |
| 19 | SOC_UNIPHIER_LD20, |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 20 | SOC_UNIPHIER_UNKNOWN, |
| 21 | }; |
| 22 | |
| 23 | #define UNIPHIER_NR_ENABLED_SOCS \ |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 24 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_SLD3) + \ |
| 25 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_LD4) + \ |
| 26 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PRO4) + \ |
| 27 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_SLD8) + \ |
| 28 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PRO5) + \ |
| 29 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_PXS2) + \ |
| 30 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_LD6B) + \ |
| 31 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_LD11) + \ |
| 32 | IS_ENABLED(CONFIG_ARCH_UNIPHIER_LD20) |
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 | { |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 41 | #if defined(CONFIG_ARCH_UNIPHIER_SLD3) |
| 42 | return SOC_UNIPHIER_SLD3; |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 43 | #endif |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 44 | #if defined(CONFIG_ARCH_UNIPHIER_LD4) |
| 45 | return SOC_UNIPHIER_LD4; |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 46 | #endif |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 47 | #if defined(CONFIG_ARCH_UNIPHIER_PRO4) |
| 48 | return SOC_UNIPHIER_PRO4; |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 49 | #endif |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 50 | #if defined(CONFIG_ARCH_UNIPHIER_SLD8) |
| 51 | return SOC_UNIPHIER_SLD8; |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 52 | #endif |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 53 | #if defined(CONFIG_ARCH_UNIPHIER_PRO5) |
| 54 | return SOC_UNIPHIER_PRO5; |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 55 | #endif |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 56 | #if defined(CONFIG_ARCH_UNIPHIER_PXS2) |
| 57 | return SOC_UNIPHIER_PXS2; |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 58 | #endif |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 59 | #if defined(CONFIG_ARCH_UNIPHIER_LD6B) |
| 60 | return SOC_UNIPHIER_LD6B; |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 61 | #endif |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 62 | #if defined(CONFIG_ARCH_UNIPHIER_LD11) |
| 63 | return SOC_UNIPHIER_LD11; |
Masahiro Yamada | 6f45a97 | 2015-12-17 17:47:45 +0900 | [diff] [blame] | 64 | #endif |
Masahiro Yamada | ea65c98 | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 65 | #if defined(CONFIG_ARCH_UNIPHIER_LD20) |
| 66 | return SOC_UNIPHIER_LD20; |
Masahiro Yamada | 6f45a97 | 2015-12-17 17:47:45 +0900 | [diff] [blame] | 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__ */ |