1 /*
2  * Copyright (c) 2017 - 2020, Broadcom
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef CHIP_ID_H
8 #define CHIP_ID_H
9 
10 #include <lib/mmio.h>
11 
12 #include <platform_def.h>
13 
14 #define CHIP_REV_MAJOR_MASK	0xF0
15 #define CHIP_REV_MAJOR_AX	0x00
16 #define CHIP_REV_MAJOR_BX	0x10
17 #define CHIP_REV_MAJOR_CX	0x20
18 #define CHIP_REV_MAJOR_DX	0x30
19 
20 /* Get Chip ID (product number) of the chip */
chip_get_product_id(void)21 static inline unsigned int chip_get_product_id(void)
22 {
23 	return PLAT_CHIP_ID_GET;
24 }
25 
26 /* Get Revision ID (major and minor) number of the chip */
chip_get_rev_id(void)27 static inline unsigned int chip_get_rev_id(void)
28 {
29 	return PLAT_CHIP_REV_GET;
30 }
31 
chip_get_rev_id_major(void)32 static inline unsigned int chip_get_rev_id_major(void)
33 {
34 	return (chip_get_rev_id() & CHIP_REV_MAJOR_MASK);
35 }
36 
37 #endif
38