Varun Wadekar | 28dcc21 | 2016-07-20 10:28:51 -0700 | [diff] [blame] | 1 | /* |
Antonio Nino Diaz | 4b32e62 | 2018-08-16 16:52:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. |
Varun Wadekar | 3923f88 | 2020-05-12 14:04:10 -0700 | [diff] [blame] | 3 | * Copyright (c) 2020, NVIDIA Corporation. All rights reserved. |
Varun Wadekar | 28dcc21 | 2016-07-20 10:28:51 -0700 | [diff] [blame] | 4 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 5 | * SPDX-License-Identifier: BSD-3-Clause |
Varun Wadekar | 28dcc21 | 2016-07-20 10:28:51 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 8 | #ifndef TEGRA_PLATFORM_H |
| 9 | #define TEGRA_PLATFORM_H |
Varun Wadekar | 28dcc21 | 2016-07-20 10:28:51 -0700 | [diff] [blame] | 10 | |
Antonio Nino Diaz | 4b32e62 | 2018-08-16 16:52:57 +0100 | [diff] [blame] | 11 | #include <cdefs.h> |
Ambroise Vincent | ffbf32a | 2019-03-28 09:01:18 +0000 | [diff] [blame] | 12 | #include <lib/utils_def.h> |
Anthony Zhou | 70262ef | 2017-03-22 14:37:04 +0800 | [diff] [blame] | 13 | #include <stdbool.h> |
Marvin Hsu | 589a7e1 | 2017-04-12 20:40:27 +0800 | [diff] [blame] | 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) |
Varun Wadekar | 28dcc21 | 2016-07-20 10:28:51 -0700 | [diff] [blame] | 26 | |
Harvey Hsieh | 6dc0d76 | 2017-04-24 19:35:51 +0800 | [diff] [blame] | 27 | /******************************************************************************* |
Marvin Hsu | 589a7e1 | 2017-04-12 20:40:27 +0800 | [diff] [blame] | 28 | * Tegra chip ID values |
Harvey Hsieh | 6dc0d76 | 2017-04-24 19:35:51 +0800 | [diff] [blame] | 29 | ******************************************************************************/ |
| 30 | #define TEGRA_CHIPID_TEGRA13 U(0x13) |
| 31 | #define TEGRA_CHIPID_TEGRA21 U(0x21) |
| 32 | #define TEGRA_CHIPID_TEGRA18 U(0x18) |
David Pu | 819975f | 2019-08-05 17:00:31 -0700 | [diff] [blame] | 33 | #define TEGRA_CHIPID_TEGRA19 U(0x19) |
Harvey Hsieh | 6dc0d76 | 2017-04-24 19:35:51 +0800 | [diff] [blame] | 34 | |
Varun Wadekar | 3923f88 | 2020-05-12 14:04:10 -0700 | [diff] [blame] | 35 | /******************************************************************************* |
| 36 | * JEDEC Standard Manufacturer's Identification Code and Bank ID |
| 37 | ******************************************************************************/ |
| 38 | #define JEDEC_NVIDIA_MFID U(0x6B) |
| 39 | #define JEDEC_NVIDIA_BKID U(3) |
| 40 | |
Julius Werner | 53456fc | 2019-07-09 13:49:11 -0700 | [diff] [blame] | 41 | #ifndef __ASSEMBLER__ |
Harvey Hsieh | 6dc0d76 | 2017-04-24 19:35:51 +0800 | [diff] [blame] | 42 | |
| 43 | /* |
| 44 | * Tegra chip ID major/minor identifiers |
Varun Wadekar | fc9b91e | 2017-03-10 09:53:37 -0800 | [diff] [blame] | 45 | */ |
| 46 | uint32_t tegra_get_chipid_major(void); |
| 47 | uint32_t tegra_get_chipid_minor(void); |
| 48 | |
| 49 | /* |
Marvin Hsu | 589a7e1 | 2017-04-12 20:40:27 +0800 | [diff] [blame] | 50 | * Tegra chip ID identifiers |
Varun Wadekar | 28dcc21 | 2016-07-20 10:28:51 -0700 | [diff] [blame] | 51 | */ |
Marvin Hsu | 589a7e1 | 2017-04-12 20:40:27 +0800 | [diff] [blame] | 52 | bool tegra_chipid_is_t132(void); |
| 53 | bool tegra_chipid_is_t186(void); |
| 54 | bool tegra_chipid_is_t210(void); |
| 55 | bool tegra_chipid_is_t210_b01(void); |
David Pu | 819975f | 2019-08-05 17:00:31 -0700 | [diff] [blame] | 56 | bool tegra_chipid_is_t194(void); |
Varun Wadekar | fdcdfe2 | 2017-04-13 14:12:49 -0700 | [diff] [blame] | 57 | |
Varun Wadekar | 28dcc21 | 2016-07-20 10:28:51 -0700 | [diff] [blame] | 58 | /* |
| 59 | * Tegra platform identifiers |
| 60 | */ |
Anthony Zhou | 70262ef | 2017-03-22 14:37:04 +0800 | [diff] [blame] | 61 | bool tegra_platform_is_silicon(void); |
| 62 | bool tegra_platform_is_qt(void); |
| 63 | bool tegra_platform_is_emulation(void); |
| 64 | bool tegra_platform_is_linsim(void); |
| 65 | bool tegra_platform_is_fpga(void); |
| 66 | bool tegra_platform_is_unit_fpga(void); |
| 67 | bool tegra_platform_is_virt_dev_kit(void); |
Varun Wadekar | 28dcc21 | 2016-07-20 10:28:51 -0700 | [diff] [blame] | 68 | |
Julius Werner | 53456fc | 2019-07-09 13:49:11 -0700 | [diff] [blame] | 69 | #endif /* __ASSEMBLER__ */ |
Harvey Hsieh | 6dc0d76 | 2017-04-24 19:35:51 +0800 | [diff] [blame] | 70 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 71 | #endif /* TEGRA_PLATFORM_H */ |