blob: d9b38b3d2dc138324fd05c1510b56dd5d145534b [file] [log] [blame]
Masahiro Yamada323d1f92015-09-22 00:27:39 +09001/*
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
10enum uniphier_soc_id {
Masahiro Yamadaea65c982016-03-18 16:41:43 +090011 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 Yamada323d1f92015-09-22 00:27:39 +090020 SOC_UNIPHIER_UNKNOWN,
21};
22
23#define UNIPHIER_NR_ENABLED_SOCS \
Masahiro Yamadaea65c982016-03-18 16:41:43 +090024 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 Yamada323d1f92015-09-22 00:27:39 +090033
34#define UNIPHIER_MULTI_SOC ((UNIPHIER_NR_ENABLED_SOCS) > 1)
35
36#if UNIPHIER_MULTI_SOC
37enum uniphier_soc_id uniphier_get_soc_type(void);
38#else
39static inline enum uniphier_soc_id uniphier_get_soc_type(void)
40{
Masahiro Yamadaea65c982016-03-18 16:41:43 +090041#if defined(CONFIG_ARCH_UNIPHIER_SLD3)
42 return SOC_UNIPHIER_SLD3;
Masahiro Yamada323d1f92015-09-22 00:27:39 +090043#endif
Masahiro Yamadaea65c982016-03-18 16:41:43 +090044#if defined(CONFIG_ARCH_UNIPHIER_LD4)
45 return SOC_UNIPHIER_LD4;
Masahiro Yamada323d1f92015-09-22 00:27:39 +090046#endif
Masahiro Yamadaea65c982016-03-18 16:41:43 +090047#if defined(CONFIG_ARCH_UNIPHIER_PRO4)
48 return SOC_UNIPHIER_PRO4;
Masahiro Yamada323d1f92015-09-22 00:27:39 +090049#endif
Masahiro Yamadaea65c982016-03-18 16:41:43 +090050#if defined(CONFIG_ARCH_UNIPHIER_SLD8)
51 return SOC_UNIPHIER_SLD8;
Masahiro Yamada323d1f92015-09-22 00:27:39 +090052#endif
Masahiro Yamadaea65c982016-03-18 16:41:43 +090053#if defined(CONFIG_ARCH_UNIPHIER_PRO5)
54 return SOC_UNIPHIER_PRO5;
Masahiro Yamada323d1f92015-09-22 00:27:39 +090055#endif
Masahiro Yamadaea65c982016-03-18 16:41:43 +090056#if defined(CONFIG_ARCH_UNIPHIER_PXS2)
57 return SOC_UNIPHIER_PXS2;
Masahiro Yamada323d1f92015-09-22 00:27:39 +090058#endif
Masahiro Yamadaea65c982016-03-18 16:41:43 +090059#if defined(CONFIG_ARCH_UNIPHIER_LD6B)
60 return SOC_UNIPHIER_LD6B;
Masahiro Yamada323d1f92015-09-22 00:27:39 +090061#endif
Masahiro Yamadaea65c982016-03-18 16:41:43 +090062#if defined(CONFIG_ARCH_UNIPHIER_LD11)
63 return SOC_UNIPHIER_LD11;
Masahiro Yamada6f45a972015-12-17 17:47:45 +090064#endif
Masahiro Yamadaea65c982016-03-18 16:41:43 +090065#if defined(CONFIG_ARCH_UNIPHIER_LD20)
66 return SOC_UNIPHIER_LD20;
Masahiro Yamada6f45a972015-12-17 17:47:45 +090067#endif
Masahiro Yamada323d1f92015-09-22 00:27:39 +090068
69 return SOC_UNIPHIER_UNKNOWN;
70}
71#endif
72
Masahiro Yamada2071f142015-12-17 17:47:41 +090073int uniphier_get_soc_model(void);
74int uniphier_get_soc_revision(void);
75
Masahiro Yamada323d1f92015-09-22 00:27:39 +090076#endif /* __MACH_SOC_INFO_H__ */