xref: /openbmc/linux/drivers/soc/tegra/fuse/fuse.h (revision 94cdda6b)
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 
19 #ifndef __DRIVERS_MISC_TEGRA_FUSE_H
20 #define __DRIVERS_MISC_TEGRA_FUSE_H
21 
22 #define TEGRA_FUSE_BASE	0x7000f800
23 #define TEGRA_FUSE_SIZE	0x400
24 
25 int tegra_fuse_create_sysfs(struct device *dev, int size,
26 		     u32 (*readl)(const unsigned int offset));
27 
28 bool tegra30_spare_fuse(int bit);
29 u32 tegra30_fuse_readl(const unsigned int offset);
30 void tegra30_init_fuse_early(void);
31 void tegra_init_revision(void);
32 void tegra_init_apbmisc(void);
33 
34 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
35 void tegra20_init_speedo_data(struct tegra_sku_info *sku_info);
36 bool tegra20_spare_fuse_early(int spare_bit);
37 void tegra20_init_fuse_early(void);
38 u32 tegra20_fuse_early(const unsigned int offset);
39 #else
40 static inline void tegra20_init_speedo_data(struct tegra_sku_info *sku_info) {}
41 static inline bool tegra20_spare_fuse_early(int spare_bit)
42 {
43 	return false;
44 }
45 static inline void tegra20_init_fuse_early(void) {}
46 static inline u32 tegra20_fuse_early(const unsigned int offset)
47 {
48 	return 0;
49 }
50 #endif
51 
52 
53 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
54 void tegra30_init_speedo_data(struct tegra_sku_info *sku_info);
55 #else
56 static inline void tegra30_init_speedo_data(struct tegra_sku_info *sku_info) {}
57 #endif
58 
59 #ifdef CONFIG_ARCH_TEGRA_114_SOC
60 void tegra114_init_speedo_data(struct tegra_sku_info *sku_info);
61 #else
62 static inline void tegra114_init_speedo_data(struct tegra_sku_info *sku_info) {}
63 #endif
64 
65 #ifdef CONFIG_ARCH_TEGRA_124_SOC
66 void tegra124_init_speedo_data(struct tegra_sku_info *sku_info);
67 #else
68 static inline void tegra124_init_speedo_data(struct tegra_sku_info *sku_info) {}
69 #endif
70 
71 #endif
72