]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
323d1f9d | 2 | /* |
e27d6c7d MY |
3 | * Copyright (C) 2017 Socionext Inc. |
4 | * Author: Masahiro Yamada <[email protected]> | |
323d1f9d MY |
5 | */ |
6 | ||
e27d6c7d MY |
7 | #ifndef __UNIPHIER_SOC_INFO_H__ |
8 | #define __UNIPHIER_SOC_INFO_H__ | |
323d1f9d | 9 | |
ee8ef5af MY |
10 | #include <linux/kernel.h> |
11 | #include <linux/stddef.h> | |
12 | ||
e27d6c7d MY |
13 | #define UNIPHIER_LD4_ID 0x26 |
14 | #define UNIPHIER_PRO4_ID 0x28 | |
15 | #define UNIPHIER_SLD8_ID 0x29 | |
16 | #define UNIPHIER_PRO5_ID 0x2a | |
17 | #define UNIPHIER_PXS2_ID 0x2e | |
18 | #define UNIPHIER_LD6B_ID 0x2f | |
19 | #define UNIPHIER_LD11_ID 0x31 | |
20 | #define UNIPHIER_LD20_ID 0x32 | |
2c2ab3d4 | 21 | #define UNIPHIER_PXS3_ID 0x35 |
323d1f9d | 22 | |
e27d6c7d MY |
23 | unsigned int uniphier_get_soc_id(void); |
24 | unsigned int uniphier_get_soc_model(void); | |
25 | unsigned int uniphier_get_soc_revision(void); | |
323d1f9d | 26 | |
ee8ef5af MY |
27 | #define UNIPHIER_DEFINE_SOCDATA_FUNC(__func_name, __table) \ |
28 | static typeof(&__table[0]) __func_name(void) \ | |
29 | { \ | |
30 | unsigned int soc_id; \ | |
31 | int i; \ | |
32 | \ | |
33 | soc_id = uniphier_get_soc_id(); \ | |
34 | for (i = 0; i < ARRAY_SIZE(__table); i++) { \ | |
35 | if (__table[i].soc_id == soc_id) \ | |
36 | return &__table[i]; \ | |
37 | } \ | |
38 | \ | |
39 | return NULL; \ | |
40 | } | |
41 | ||
e27d6c7d | 42 | #endif /* __UNIPHIER_SOC_INFO_H__ */ |