• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Bestechnic (Shanghai) Co., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef __HAL_CHIPID_H__
16 #define __HAL_CHIPID_H__
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #include "plat_types.h"
23 
24 // BEST1000: A=0 C=1 D=2 F=3 G=4 I=5
25 // BEST1400: A=0 B=1 C=2(cmuRev=2&diffRom) D=3 E=4(cmuRev=3&diffRom) F=5(cmuRev=4)
26 // BEST1402: A=0 B=1
27 // BEST2000: A=0 C=1 D=2 E=3(rev=2&aonRev=4) F=4 G=5
28 // BEST2300: A=0 B=1(rfRev=15) C=3 D=4 E=5(rfRev=4&diffRom)
29 
30 enum HAL_CHIP_METAL_ID_T {
31     HAL_CHIP_METAL_ID_0,
32     HAL_CHIP_METAL_ID_1,
33     HAL_CHIP_METAL_ID_2,
34     HAL_CHIP_METAL_ID_3,
35     HAL_CHIP_METAL_ID_4,
36     HAL_CHIP_METAL_ID_5,
37     HAL_CHIP_METAL_ID_6,
38     HAL_CHIP_METAL_ID_7,
39     HAL_CHIP_METAL_ID_8,
40     HAL_CHIP_METAL_ID_9,
41     HAL_CHIP_METAL_ID_10,
42     HAL_CHIP_METAL_ID_11,
43     HAL_CHIP_METAL_ID_12,
44     HAL_CHIP_METAL_ID_13,
45     HAL_CHIP_METAL_ID_14,
46     HAL_CHIP_METAL_ID_15,
47 };
48 
49 enum HAL_BT_CHIP_SERIES_T {
50     HAL_BT_CHIP_SERIES_2000,
51     HAL_BT_CHIP_SERIES_2300,
52     HAL_BT_CHIP_SERIES_2500,
53 };
54 
55 // Invoked by hal_chipid_init() only
56 uint32_t read_hw_metal_id(void);
57 
58 void hal_chipid_init(void);
59 
60 enum HAL_CHIP_METAL_ID_T hal_get_chip_metal_id(void);
61 enum HAL_BT_CHIP_SERIES_T hal_get_bt_chip_series(void);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif
68