xref: /openbmc/linux/include/soc/tegra/fuse.h (revision 03b3f4c8)
1306a7f91SThierry Reding /*
2306a7f91SThierry Reding  * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
3306a7f91SThierry Reding  *
4306a7f91SThierry Reding  * This program is free software; you can redistribute it and/or modify it
5306a7f91SThierry Reding  * under the terms and conditions of the GNU General Public License,
6306a7f91SThierry Reding  * version 2, as published by the Free Software Foundation.
7306a7f91SThierry Reding  *
8306a7f91SThierry Reding  * This program is distributed in the hope it will be useful, but WITHOUT
9306a7f91SThierry Reding  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10306a7f91SThierry Reding  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11306a7f91SThierry Reding  * more details.
12306a7f91SThierry Reding  *
13306a7f91SThierry Reding  * You should have received a copy of the GNU General Public License
14306a7f91SThierry Reding  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15306a7f91SThierry Reding  */
16306a7f91SThierry Reding 
17306a7f91SThierry Reding #ifndef __SOC_TEGRA_FUSE_H__
18306a7f91SThierry Reding #define __SOC_TEGRA_FUSE_H__
19306a7f91SThierry Reding 
20304664eaSThierry Reding #define TEGRA20		0x20
21304664eaSThierry Reding #define TEGRA30		0x30
22304664eaSThierry Reding #define TEGRA114	0x35
23304664eaSThierry Reding #define TEGRA124	0x40
2424ef5745SThierry Reding #define TEGRA132	0x13
250dc5a0d8SThierry Reding #define TEGRA210	0x21
26304664eaSThierry Reding 
27783c8f4cSPeter De Schrijver #define TEGRA_FUSE_SKU_CALIB_0	0xf0
28783c8f4cSPeter De Schrijver #define TEGRA30_FUSE_SATA_CALIB	0x124
29783c8f4cSPeter De Schrijver 
30304664eaSThierry Reding #ifndef __ASSEMBLY__
31304664eaSThierry Reding 
32306a7f91SThierry Reding u32 tegra_read_chipid(void);
33304664eaSThierry Reding u8 tegra_get_chip_id(void);
34304664eaSThierry Reding 
3535874f36SPeter De Schrijver enum tegra_revision {
3635874f36SPeter De Schrijver 	TEGRA_REVISION_UNKNOWN = 0,
3735874f36SPeter De Schrijver 	TEGRA_REVISION_A01,
3835874f36SPeter De Schrijver 	TEGRA_REVISION_A02,
3935874f36SPeter De Schrijver 	TEGRA_REVISION_A03,
4035874f36SPeter De Schrijver 	TEGRA_REVISION_A03p,
4135874f36SPeter De Schrijver 	TEGRA_REVISION_A04,
4235874f36SPeter De Schrijver 	TEGRA_REVISION_MAX,
4335874f36SPeter De Schrijver };
4435874f36SPeter De Schrijver 
45783c8f4cSPeter De Schrijver struct tegra_sku_info {
46783c8f4cSPeter De Schrijver 	int sku_id;
47783c8f4cSPeter De Schrijver 	int cpu_process_id;
48783c8f4cSPeter De Schrijver 	int cpu_speedo_id;
49783c8f4cSPeter De Schrijver 	int cpu_speedo_value;
50783c8f4cSPeter De Schrijver 	int cpu_iddq_value;
5103b3f4c8SThierry Reding 	int soc_process_id;
52783c8f4cSPeter De Schrijver 	int soc_speedo_id;
530dc5a0d8SThierry Reding 	int soc_speedo_value;
54783c8f4cSPeter De Schrijver 	int gpu_process_id;
550dc5a0d8SThierry Reding 	int gpu_speedo_id;
56783c8f4cSPeter De Schrijver 	int gpu_speedo_value;
57783c8f4cSPeter De Schrijver 	enum tegra_revision revision;
58783c8f4cSPeter De Schrijver };
59783c8f4cSPeter De Schrijver 
6035874f36SPeter De Schrijver u32 tegra_read_straps(void);
616ea2609aSMikko Perttunen u32 tegra_read_ram_code(void);
6235874f36SPeter De Schrijver u32 tegra_read_chipid(void);
63783c8f4cSPeter De Schrijver int tegra_fuse_readl(unsigned long offset, u32 *value);
6435874f36SPeter De Schrijver 
65783c8f4cSPeter De Schrijver extern struct tegra_sku_info tegra_sku_info;
6635874f36SPeter De Schrijver 
67304664eaSThierry Reding #endif /* __ASSEMBLY__ */
68306a7f91SThierry Reding 
69306a7f91SThierry Reding #endif /* __SOC_TEGRA_FUSE_H__ */
70