spi: sprd: adi: Add a reset reason for watchdog mode
[linux/fpc-iii.git] / drivers / soc / tegra / fuse / fuse.h
blob7230cb3305033533ca82e777d9b732115da67f1d
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2010 Google, Inc.
4 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
6 * Author:
7 * Colin Cross <ccross@android.com>
8 */
10 #ifndef __DRIVERS_MISC_TEGRA_FUSE_H
11 #define __DRIVERS_MISC_TEGRA_FUSE_H
13 #include <linux/dmaengine.h>
14 #include <linux/types.h>
16 struct tegra_fuse;
18 struct tegra_fuse_info {
19 u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
20 unsigned int size;
21 unsigned int spare;
24 struct tegra_fuse_soc {
25 void (*init)(struct tegra_fuse *fuse);
26 void (*speedo_init)(struct tegra_sku_info *info);
27 int (*probe)(struct tegra_fuse *fuse);
29 const struct tegra_fuse_info *info;
32 struct tegra_fuse {
33 struct device *dev;
34 void __iomem *base;
35 phys_addr_t phys;
36 struct clk *clk;
38 u32 (*read_early)(struct tegra_fuse *fuse, unsigned int offset);
39 u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
40 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;
53 void tegra_init_revision(void);
54 void tegra_init_apbmisc(void);
56 bool __init tegra_fuse_read_spare(unsigned int spare);
57 u32 __init tegra_fuse_read_early(unsigned int offset);
59 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
60 void tegra20_init_speedo_data(struct tegra_sku_info *sku_info);
61 #endif
63 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
64 void tegra30_init_speedo_data(struct tegra_sku_info *sku_info);
65 #endif
67 #ifdef CONFIG_ARCH_TEGRA_114_SOC
68 void tegra114_init_speedo_data(struct tegra_sku_info *sku_info);
69 #endif
71 #if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
72 void tegra124_init_speedo_data(struct tegra_sku_info *sku_info);
73 #endif
75 #ifdef CONFIG_ARCH_TEGRA_210_SOC
76 void tegra210_init_speedo_data(struct tegra_sku_info *sku_info);
77 #endif
79 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
80 extern const struct tegra_fuse_soc tegra20_fuse_soc;
81 #endif
83 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
84 extern const struct tegra_fuse_soc tegra30_fuse_soc;
85 #endif
87 #ifdef CONFIG_ARCH_TEGRA_114_SOC
88 extern const struct tegra_fuse_soc tegra114_fuse_soc;
89 #endif
91 #if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
92 extern const struct tegra_fuse_soc tegra124_fuse_soc;
93 #endif
95 #ifdef CONFIG_ARCH_TEGRA_210_SOC
96 extern const struct tegra_fuse_soc tegra210_fuse_soc;
97 #endif
99 #ifdef CONFIG_ARCH_TEGRA_186_SOC
100 extern const struct tegra_fuse_soc tegra186_fuse_soc;
101 #endif
103 #endif