xref: /rk3399_ARM-atf/plat/nvidia/tegra/include/tegra_platform.h (revision 0aa9f3c0f2f2ff675c3c12ae5ac6ceb475d6a16f)
1 /*
2  * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
3  * Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef TEGRA_PLATFORM_H
9 #define TEGRA_PLATFORM_H
10 
11 #include <cdefs.h>
12 #include <lib/utils_def.h>
13 #include <stdbool.h>
14 
15 /*******************************************************************************
16  * Tegra major, minor version helper macros
17  ******************************************************************************/
18 #define MAJOR_VERSION_SHIFT		U(0x4)
19 #define MAJOR_VERSION_MASK		U(0xF)
20 #define MINOR_VERSION_SHIFT		U(0x10)
21 #define MINOR_VERSION_MASK		U(0xF)
22 #define CHIP_ID_SHIFT			U(8)
23 #define CHIP_ID_MASK			U(0xFF)
24 #define PRE_SI_PLATFORM_SHIFT		U(0x14)
25 #define PRE_SI_PLATFORM_MASK		U(0xF)
26 
27 /*******************************************************************************
28  * Tegra chip ID values
29  ******************************************************************************/
30 #define TEGRA_CHIPID_TEGRA13		U(0x13)
31 #define TEGRA_CHIPID_TEGRA21		U(0x21)
32 #define TEGRA_CHIPID_TEGRA18		U(0x18)
33 
34 /*******************************************************************************
35  * JEDEC Standard Manufacturer's Identification Code and Bank ID
36  ******************************************************************************/
37 #define JEDEC_NVIDIA_MFID		U(0x6B)
38 #define JEDEC_NVIDIA_BKID		U(3)
39 
40 #ifndef __ASSEMBLER__
41 
42 /*
43  * Tegra chip ID major/minor identifiers
44  */
45 uint32_t tegra_get_chipid_major(void);
46 uint32_t tegra_get_chipid_minor(void);
47 
48 /*
49  * Tegra chip ID identifiers
50  */
51 bool tegra_chipid_is_t132(void);
52 bool tegra_chipid_is_t186(void);
53 bool tegra_chipid_is_t210(void);
54 bool tegra_chipid_is_t210_b01(void);
55 
56 /*
57  * Tegra platform identifiers
58  */
59 bool tegra_platform_is_silicon(void);
60 bool tegra_platform_is_qt(void);
61 bool tegra_platform_is_emulation(void);
62 bool tegra_platform_is_linsim(void);
63 bool tegra_platform_is_fpga(void);
64 bool tegra_platform_is_unit_fpga(void);
65 bool tegra_platform_is_virt_dev_kit(void);
66 
67 #endif /* __ASSEMBLER__ */
68 
69 #endif /* TEGRA_PLATFORM_H */
70