fuse.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2012, 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 TEGRA_FUSE_SKU_CALIB_0 0xf0
  18. #define TEGRA30_FUSE_SATA_CALIB 0x124
  19. #define TEGRA_FUSE_USB_CALIB_EXT_0 0x250
  20. #ifndef __ASSEMBLY__
  21. enum tegra_revision {
  22. TEGRA_REVISION_UNKNOWN = 0,
  23. TEGRA_REVISION_A01,
  24. TEGRA_REVISION_A02,
  25. TEGRA_REVISION_A03,
  26. TEGRA_REVISION_A03p,
  27. TEGRA_REVISION_A04,
  28. TEGRA_REVISION_MAX,
  29. };
  30. struct tegra_sku_info {
  31. int sku_id;
  32. int cpu_process_id;
  33. int cpu_speedo_id;
  34. int cpu_speedo_value;
  35. int cpu_iddq_value;
  36. int soc_process_id;
  37. int soc_speedo_id;
  38. int soc_speedo_value;
  39. int gpu_process_id;
  40. int gpu_speedo_id;
  41. int gpu_speedo_value;
  42. enum tegra_revision revision;
  43. };
  44. #ifdef CONFIG_ARCH_TEGRA
  45. extern struct tegra_sku_info tegra_sku_info;
  46. u32 tegra_read_straps(void);
  47. u32 tegra_read_ram_code(void);
  48. int tegra_fuse_readl(unsigned long offset, u32 *value);
  49. u32 tegra_read_chipid(void);
  50. u8 tegra_get_chip_id(void);
  51. u8 tegra_get_platform(void);
  52. bool tegra_is_silicon(void);
  53. int tegra194_miscreg_mask_serror(void);
  54. #else
  55. static struct tegra_sku_info tegra_sku_info __maybe_unused;
  56. static inline u32 tegra_read_straps(void)
  57. {
  58. return 0;
  59. }
  60. static inline u32 tegra_read_ram_code(void)
  61. {
  62. return 0;
  63. }
  64. static inline int tegra_fuse_readl(unsigned long offset, u32 *value)
  65. {
  66. return -ENODEV;
  67. }
  68. static inline u32 tegra_read_chipid(void)
  69. {
  70. return 0;
  71. }
  72. static inline u8 tegra_get_chip_id(void)
  73. {
  74. return 0;
  75. }
  76. static inline u8 tegra_get_platform(void)
  77. {
  78. return 0;
  79. }
  80. static inline bool tegra_is_silicon(void)
  81. {
  82. return false;
  83. }
  84. static inline int tegra194_miscreg_mask_serror(void)
  85. {
  86. return false;
  87. }
  88. #endif
  89. struct device *tegra_soc_device_register(void);
  90. #endif /* __ASSEMBLY__ */
  91. #endif /* __SOC_TEGRA_FUSE_H__ */