fuse.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2010 Google, Inc.
  4. * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
  5. *
  6. * Author:
  7. * Colin Cross <ccross@android.com>
  8. */
  9. #ifndef __DRIVERS_MISC_TEGRA_FUSE_H
  10. #define __DRIVERS_MISC_TEGRA_FUSE_H
  11. #include <linux/dmaengine.h>
  12. #include <linux/types.h>
  13. struct tegra_fuse;
  14. struct tegra_fuse_info {
  15. u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
  16. unsigned int size;
  17. unsigned int spare;
  18. };
  19. struct tegra_fuse_soc {
  20. void (*init)(struct tegra_fuse *fuse);
  21. void (*speedo_init)(struct tegra_sku_info *info);
  22. int (*probe)(struct tegra_fuse *fuse);
  23. const struct tegra_fuse_info *info;
  24. };
  25. struct tegra_fuse {
  26. struct device *dev;
  27. void __iomem *base;
  28. phys_addr_t phys;
  29. struct clk *clk;
  30. u32 (*read_early)(struct tegra_fuse *fuse, unsigned int offset);
  31. u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
  32. const struct tegra_fuse_soc *soc;
  33. /* APBDMA on Tegra20 */
  34. struct {
  35. struct mutex lock;
  36. struct completion wait;
  37. struct dma_chan *chan;
  38. struct dma_slave_config config;
  39. dma_addr_t phys;
  40. u32 *virt;
  41. } apbdma;
  42. };
  43. void tegra_init_revision(void);
  44. void tegra_init_apbmisc(void);
  45. bool __init tegra_fuse_read_spare(unsigned int spare);
  46. u32 __init tegra_fuse_read_early(unsigned int offset);
  47. #ifdef CONFIG_ARCH_TEGRA_2x_SOC
  48. void tegra20_init_speedo_data(struct tegra_sku_info *sku_info);
  49. #endif
  50. #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  51. void tegra30_init_speedo_data(struct tegra_sku_info *sku_info);
  52. #endif
  53. #ifdef CONFIG_ARCH_TEGRA_114_SOC
  54. void tegra114_init_speedo_data(struct tegra_sku_info *sku_info);
  55. #endif
  56. #if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
  57. void tegra124_init_speedo_data(struct tegra_sku_info *sku_info);
  58. #endif
  59. #ifdef CONFIG_ARCH_TEGRA_210_SOC
  60. void tegra210_init_speedo_data(struct tegra_sku_info *sku_info);
  61. #endif
  62. #ifdef CONFIG_ARCH_TEGRA_2x_SOC
  63. extern const struct tegra_fuse_soc tegra20_fuse_soc;
  64. #endif
  65. #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  66. extern const struct tegra_fuse_soc tegra30_fuse_soc;
  67. #endif
  68. #ifdef CONFIG_ARCH_TEGRA_114_SOC
  69. extern const struct tegra_fuse_soc tegra114_fuse_soc;
  70. #endif
  71. #if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
  72. extern const struct tegra_fuse_soc tegra124_fuse_soc;
  73. #endif
  74. #ifdef CONFIG_ARCH_TEGRA_210_SOC
  75. extern const struct tegra_fuse_soc tegra210_fuse_soc;
  76. #endif
  77. #ifdef CONFIG_ARCH_TEGRA_186_SOC
  78. extern const struct tegra_fuse_soc tegra186_fuse_soc;
  79. #endif
  80. #endif