blob: 252ea20fe4c1baf688bddcc61f8600816cf7b9c6 [file] [log] [blame]
Thomas Gleixner9952f692019-05-28 10:10:04 -07001/* SPDX-License-Identifier: GPL-2.0-only */
Prashant Gaikwadc7736ed2013-01-11 13:16:19 +05302/*
3 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
Prashant Gaikwadc7736ed2013-01-11 13:16:19 +05304 */
5
Thierry Reding306a7f92014-07-17 13:17:24 +02006#ifndef __SOC_TEGRA_FUSE_H__
7#define __SOC_TEGRA_FUSE_H__
Prashant Gaikwadc7736ed2013-01-11 13:16:19 +05308
Thierry Reding304664e2014-07-11 09:52:41 +02009#define TEGRA20 0x20
10#define TEGRA30 0x30
11#define TEGRA114 0x35
12#define TEGRA124 0x40
Thierry Reding24ef5742015-01-08 08:24:45 +010013#define TEGRA132 0x13
Thierry Reding0dc5a0d2015-04-29 16:55:57 +020014#define TEGRA210 0x21
Thierry Reding304664e2014-07-11 09:52:41 +020015
Peter De Schrijver783c8f42014-06-12 18:36:37 +030016#define TEGRA_FUSE_SKU_CALIB_0 0xf0
17#define TEGRA30_FUSE_SATA_CALIB 0x124
Thierry Reding87d66f22015-11-11 18:25:02 +010018#define TEGRA_FUSE_USB_CALIB_EXT_0 0x250
Peter De Schrijver783c8f42014-06-12 18:36:37 +030019
Thierry Reding304664e2014-07-11 09:52:41 +020020#ifndef __ASSEMBLY__
21
Prashant Gaikwadc7736ed2013-01-11 13:16:19 +053022u32 tegra_read_chipid(void);
Thierry Reding304664e2014-07-11 09:52:41 +020023u8 tegra_get_chip_id(void);
24
Peter De Schrijver35874f32014-06-12 18:36:36 +030025enum tegra_revision {
26 TEGRA_REVISION_UNKNOWN = 0,
27 TEGRA_REVISION_A01,
28 TEGRA_REVISION_A02,
29 TEGRA_REVISION_A03,
30 TEGRA_REVISION_A03p,
31 TEGRA_REVISION_A04,
32 TEGRA_REVISION_MAX,
33};
34
Peter De Schrijver783c8f42014-06-12 18:36:37 +030035struct tegra_sku_info {
36 int sku_id;
37 int cpu_process_id;
38 int cpu_speedo_id;
39 int cpu_speedo_value;
40 int cpu_iddq_value;
Thierry Reding03b3f4c2015-03-23 14:44:08 +010041 int soc_process_id;
Peter De Schrijver783c8f42014-06-12 18:36:37 +030042 int soc_speedo_id;
Thierry Reding0dc5a0d2015-04-29 16:55:57 +020043 int soc_speedo_value;
Peter De Schrijver783c8f42014-06-12 18:36:37 +030044 int gpu_process_id;
Thierry Reding0dc5a0d2015-04-29 16:55:57 +020045 int gpu_speedo_id;
Peter De Schrijver783c8f42014-06-12 18:36:37 +030046 int gpu_speedo_value;
47 enum tegra_revision revision;
48};
49
Peter De Schrijver35874f32014-06-12 18:36:36 +030050u32 tegra_read_straps(void);
Mikko Perttunen6ea26092015-03-12 15:47:55 +010051u32 tegra_read_ram_code(void);
Peter De Schrijver783c8f42014-06-12 18:36:37 +030052int tegra_fuse_readl(unsigned long offset, u32 *value);
Peter De Schrijver35874f32014-06-12 18:36:36 +030053
Peter De Schrijver783c8f42014-06-12 18:36:37 +030054extern struct tegra_sku_info tegra_sku_info;
Peter De Schrijver35874f32014-06-12 18:36:36 +030055
Thierry Reding27a03422017-08-17 16:42:17 +020056struct device *tegra_soc_device_register(void);
57
Thierry Reding304664e2014-07-11 09:52:41 +020058#endif /* __ASSEMBLY__ */
Prashant Gaikwadc7736ed2013-01-11 13:16:19 +053059
Thierry Reding306a7f92014-07-17 13:17:24 +020060#endif /* __SOC_TEGRA_FUSE_H__ */