fuse.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright (C) 2010 Google, Inc.
  3. * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
  4. *
  5. * Author:
  6. * Colin Cross <ccross@android.com>
  7. *
  8. * This software is licensed under the terms of the GNU General Public
  9. * License version 2, as published by the Free Software Foundation, and
  10. * may be copied, distributed, and modified under those terms.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #ifndef __DRIVERS_MISC_TEGRA_FUSE_H
  19. #define __DRIVERS_MISC_TEGRA_FUSE_H
  20. #include <linux/dmaengine.h>
  21. #include <linux/types.h>
  22. struct tegra_fuse;
  23. struct tegra_fuse_info {
  24. u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
  25. unsigned int size;
  26. unsigned int spare;
  27. };
  28. struct tegra_fuse_soc {
  29. void (*init)(struct tegra_fuse *fuse);
  30. void (*speedo_init)(struct tegra_sku_info *info);
  31. int (*probe)(struct tegra_fuse *fuse);
  32. const struct tegra_fuse_info *info;
  33. };
  34. struct tegra_fuse {
  35. struct device *dev;
  36. void __iomem *base;
  37. phys_addr_t phys;
  38. struct clk *clk;
  39. u32 (*read_early)(struct tegra_fuse *fuse, unsigned int offset);
  40. u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
  41. const struct tegra_fuse_soc *soc;
  42. /* APBDMA on Tegra20 */
  43. struct {
  44. struct mutex lock;
  45. struct completion wait;
  46. struct dma_chan *chan;
  47. struct dma_slave_config config;
  48. dma_addr_t phys;
  49. u32 *virt;
  50. } apbdma;
  51. };
  52. void tegra_init_revision(void);
  53. void tegra_init_apbmisc(void);
  54. bool __init tegra_fuse_read_spare(unsigned int spare);
  55. u32 __init tegra_fuse_read_early(unsigned int offset);
  56. #ifdef CONFIG_ARCH_TEGRA_2x_SOC
  57. void tegra20_init_speedo_data(struct tegra_sku_info *sku_info);
  58. #endif
  59. #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  60. void tegra30_init_speedo_data(struct tegra_sku_info *sku_info);
  61. #endif
  62. #ifdef CONFIG_ARCH_TEGRA_114_SOC
  63. void tegra114_init_speedo_data(struct tegra_sku_info *sku_info);
  64. #endif
  65. #if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
  66. void tegra124_init_speedo_data(struct tegra_sku_info *sku_info);
  67. #endif
  68. #ifdef CONFIG_ARCH_TEGRA_210_SOC
  69. void tegra210_init_speedo_data(struct tegra_sku_info *sku_info);
  70. #endif
  71. #ifdef CONFIG_ARCH_TEGRA_2x_SOC
  72. extern const struct tegra_fuse_soc tegra20_fuse_soc;
  73. #endif
  74. #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  75. extern const struct tegra_fuse_soc tegra30_fuse_soc;
  76. #endif
  77. #ifdef CONFIG_ARCH_TEGRA_114_SOC
  78. extern const struct tegra_fuse_soc tegra114_fuse_soc;
  79. #endif
  80. #if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
  81. extern const struct tegra_fuse_soc tegra124_fuse_soc;
  82. #endif
  83. #ifdef CONFIG_ARCH_TEGRA_210_SOC
  84. extern const struct tegra_fuse_soc tegra210_fuse_soc;
  85. #endif
  86. #endif