fuse.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2012-2023, NVIDIA CORPORATION. All rights reserved.
  4. */
  5. #ifndef __SOC_TEGRA_FUSE_H__
  6. #define __SOC_TEGRA_FUSE_H__
  7. #include <linux/types.h>
  8. #define TEGRA20 0x20
  9. #define TEGRA30 0x30
  10. #define TEGRA114 0x35
  11. #define TEGRA124 0x40
  12. #define TEGRA132 0x13
  13. #define TEGRA210 0x21
  14. #define TEGRA186 0x18
  15. #define TEGRA194 0x19
  16. #define TEGRA234 0x23
  17. #define TEGRA241 0x24
  18. #define TEGRA264 0x26
  19. #define TEGRA_FUSE_SKU_CALIB_0 0xf0
  20. #define TEGRA30_FUSE_SATA_CALIB 0x124
  21. #define TEGRA_FUSE_USB_CALIB_EXT_0 0x250
  22. #ifndef __ASSEMBLY__
  23. enum tegra_revision {
  24. TEGRA_REVISION_UNKNOWN = 0,
  25. TEGRA_REVISION_A01,
  26. TEGRA_REVISION_A02,
  27. TEGRA_REVISION_A03,
  28. TEGRA_REVISION_A03p,
  29. TEGRA_REVISION_A04,
  30. TEGRA_REVISION_MAX,
  31. };
  32. enum tegra_platform {
  33. TEGRA_PLATFORM_SILICON = 0,
  34. TEGRA_PLATFORM_QT,
  35. TEGRA_PLATFORM_SYSTEM_FPGA,
  36. TEGRA_PLATFORM_UNIT_FPGA,
  37. TEGRA_PLATFORM_ASIM_QT,
  38. TEGRA_PLATFORM_ASIM_LINSIM,
  39. TEGRA_PLATFORM_DSIM_ASIM_LINSIM,
  40. TEGRA_PLATFORM_VERIFICATION_SIMULATION,
  41. TEGRA_PLATFORM_VDK,
  42. TEGRA_PLATFORM_VSP,
  43. TEGRA_PLATFORM_MAX,
  44. };
  45. struct tegra_sku_info {
  46. int sku_id;
  47. int cpu_process_id;
  48. int cpu_speedo_id;
  49. int cpu_speedo_value;
  50. int cpu_iddq_value;
  51. int soc_process_id;
  52. int soc_speedo_id;
  53. int soc_speedo_value;
  54. int gpu_process_id;
  55. int gpu_speedo_id;
  56. int gpu_speedo_value;
  57. enum tegra_revision revision;
  58. enum tegra_platform platform;
  59. };
  60. #ifdef CONFIG_ARCH_TEGRA
  61. extern struct tegra_sku_info tegra_sku_info;
  62. u32 tegra_read_straps(void);
  63. u32 tegra_read_ram_code(void);
  64. int tegra_fuse_readl(unsigned long offset, u32 *value);
  65. u32 tegra_read_chipid(void);
  66. u8 tegra_get_chip_id(void);
  67. u8 tegra_get_platform(void);
  68. bool tegra_is_silicon(void);
  69. int tegra194_miscreg_mask_serror(void);
  70. #else
  71. static struct tegra_sku_info tegra_sku_info __maybe_unused;
  72. static inline u32 tegra_read_straps(void)
  73. {
  74. return 0;
  75. }
  76. static inline u32 tegra_read_ram_code(void)
  77. {
  78. return 0;
  79. }
  80. static inline int tegra_fuse_readl(unsigned long offset, u32 *value)
  81. {
  82. return -ENODEV;
  83. }
  84. static inline u32 tegra_read_chipid(void)
  85. {
  86. return 0;
  87. }
  88. static inline u8 tegra_get_chip_id(void)
  89. {
  90. return 0;
  91. }
  92. static inline u8 tegra_get_platform(void)
  93. {
  94. return 0;
  95. }
  96. static inline bool tegra_is_silicon(void)
  97. {
  98. return false;
  99. }
  100. static inline int tegra194_miscreg_mask_serror(void)
  101. {
  102. return false;
  103. }
  104. #endif
  105. struct device *tegra_soc_device_register(void);
  106. #endif /* __ASSEMBLY__ */
  107. #endif /* __SOC_TEGRA_FUSE_H__ */