]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - drivers/soc/tegra/fuse/fuse.h
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-jammy-kernel.git] / drivers / soc / tegra / fuse / fuse.h
CommitLineData
9c92ab61 1/* SPDX-License-Identifier: GPL-2.0-only */
783c8f4c
PDS
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>
783c8f4c
PDS
8 */
9
10#ifndef __DRIVERS_MISC_TEGRA_FUSE_H
11#define __DRIVERS_MISC_TEGRA_FUSE_H
12
7e939de1
TR
13#include <linux/dmaengine.h>
14#include <linux/types.h>
783c8f4c 15
7e939de1
TR
16struct tegra_fuse;
17
18struct tegra_fuse_info {
19 u32 (*read)(struct tegra_fuse *fuse, unsigned int offset);
20 unsigned int size;
21 unsigned int spare;
22};
23
24struct 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);
28
29 const struct tegra_fuse_info *info;
30};
31
32struct tegra_fuse {
33 struct device *dev;
34 void __iomem *base;
35 phys_addr_t phys;
36 struct clk *clk;
37
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;
41
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};
783c8f4c 52
783c8f4c
PDS
53void tegra_init_revision(void);
54void tegra_init_apbmisc(void);
55
7e939de1
TR
56bool __init tegra_fuse_read_spare(unsigned int spare);
57u32 __init tegra_fuse_read_early(unsigned int offset);
58
783c8f4c
PDS
59#ifdef CONFIG_ARCH_TEGRA_2x_SOC
60void tegra20_init_speedo_data(struct tegra_sku_info *sku_info);
783c8f4c
PDS
61#endif
62
783c8f4c
PDS
63#ifdef CONFIG_ARCH_TEGRA_3x_SOC
64void tegra30_init_speedo_data(struct tegra_sku_info *sku_info);
783c8f4c
PDS
65#endif
66
67#ifdef CONFIG_ARCH_TEGRA_114_SOC
68void tegra114_init_speedo_data(struct tegra_sku_info *sku_info);
783c8f4c
PDS
69#endif
70
7e939de1 71#if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
783c8f4c 72void tegra124_init_speedo_data(struct tegra_sku_info *sku_info);
7e939de1
TR
73#endif
74
0dc5a0d8
TR
75#ifdef CONFIG_ARCH_TEGRA_210_SOC
76void tegra210_init_speedo_data(struct tegra_sku_info *sku_info);
77#endif
78
7e939de1
TR
79#ifdef CONFIG_ARCH_TEGRA_2x_SOC
80extern const struct tegra_fuse_soc tegra20_fuse_soc;
81#endif
82
83#ifdef CONFIG_ARCH_TEGRA_3x_SOC
84extern const struct tegra_fuse_soc tegra30_fuse_soc;
85#endif
86
87#ifdef CONFIG_ARCH_TEGRA_114_SOC
88extern const struct tegra_fuse_soc tegra114_fuse_soc;
89#endif
90
91#if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
92extern const struct tegra_fuse_soc tegra124_fuse_soc;
783c8f4c
PDS
93#endif
94
0dc5a0d8
TR
95#ifdef CONFIG_ARCH_TEGRA_210_SOC
96extern const struct tegra_fuse_soc tegra210_fuse_soc;
97#endif
98
83468fe2
TA
99#ifdef CONFIG_ARCH_TEGRA_186_SOC
100extern const struct tegra_fuse_soc tegra186_fuse_soc;
101#endif
102
783c8f4c 103#endif