2019-05-28 10:10:04 -07:00
/* SPDX-License-Identifier: GPL-2.0-only */
2013-01-11 13:16:19 +05:30
/*
* Copyright ( c ) 2012 , NVIDIA CORPORATION . All rights reserved .
*/
2014-07-17 13:17:24 +02:00
# ifndef __SOC_TEGRA_FUSE_H__
# define __SOC_TEGRA_FUSE_H__
2013-01-11 13:16:19 +05:30
2021-09-12 23:29:02 +03:00
# include <linux/types.h>
2014-07-11 09:52:41 +02:00
# define TEGRA20 0x20
# define TEGRA30 0x30
# define TEGRA114 0x35
# define TEGRA124 0x40
2015-01-08 08:24:45 +01:00
# define TEGRA132 0x13
2015-04-29 16:55:57 +02:00
# define TEGRA210 0x21
2020-06-26 10:44:01 +02:00
# define TEGRA186 0x18
# define TEGRA194 0x19
2020-09-17 12:07:47 +02:00
# define TEGRA234 0x23
2014-07-11 09:52:41 +02:00
2014-06-12 18:36:37 +03:00
# define TEGRA_FUSE_SKU_CALIB_0 0xf0
# define TEGRA30_FUSE_SATA_CALIB 0x124
2015-11-11 18:25:02 +01:00
# define TEGRA_FUSE_USB_CALIB_EXT_0 0x250
2014-06-12 18:36:37 +03:00
2014-07-11 09:52:41 +02:00
# ifndef __ASSEMBLY__
2014-06-12 18:36:36 +03:00
enum tegra_revision {
TEGRA_REVISION_UNKNOWN = 0 ,
TEGRA_REVISION_A01 ,
TEGRA_REVISION_A02 ,
TEGRA_REVISION_A03 ,
TEGRA_REVISION_A03p ,
TEGRA_REVISION_A04 ,
TEGRA_REVISION_MAX ,
} ;
2014-06-12 18:36:37 +03:00
struct tegra_sku_info {
int sku_id ;
int cpu_process_id ;
int cpu_speedo_id ;
int cpu_speedo_value ;
int cpu_iddq_value ;
2015-03-23 14:44:08 +01:00
int soc_process_id ;
2014-06-12 18:36:37 +03:00
int soc_speedo_id ;
2015-04-29 16:55:57 +02:00
int soc_speedo_value ;
2014-06-12 18:36:37 +03:00
int gpu_process_id ;
2015-04-29 16:55:57 +02:00
int gpu_speedo_id ;
2014-06-12 18:36:37 +03:00
int gpu_speedo_value ;
enum tegra_revision revision ;
} ;
2021-05-28 02:54:04 +03:00
# ifdef CONFIG_ARCH_TEGRA
extern struct tegra_sku_info tegra_sku_info ;
2014-06-12 18:36:36 +03:00
u32 tegra_read_straps ( void ) ;
2015-03-12 15:47:55 +01:00
u32 tegra_read_ram_code ( void ) ;
2014-06-12 18:36:37 +03:00
int tegra_fuse_readl ( unsigned long offset , u32 * value ) ;
2021-09-12 23:29:02 +03:00
u32 tegra_read_chipid ( void ) ;
u8 tegra_get_chip_id ( void ) ;
u8 tegra_get_platform ( void ) ;
bool tegra_is_silicon ( void ) ;
2020-11-04 19:48:39 +03:00
# else
static struct tegra_sku_info tegra_sku_info __maybe_unused ;
2021-05-28 02:54:04 +03:00
static inline u32 tegra_read_straps ( void )
{
return 0 ;
}
static inline u32 tegra_read_ram_code ( void )
{
return 0 ;
}
static inline int tegra_fuse_readl ( unsigned long offset , u32 * value )
{
return - ENODEV ;
}
2021-09-12 23:29:02 +03:00
static inline u32 tegra_read_chipid ( void )
{
return 0 ;
}
static inline u8 tegra_get_chip_id ( void )
{
return 0 ;
}
static inline u8 tegra_get_platform ( void )
{
return 0 ;
}
static inline bool tegra_is_silicon ( void )
{
return false ;
}
2020-11-04 19:48:39 +03:00
# endif
2014-06-12 18:36:36 +03:00
2017-08-17 16:42:17 +02:00
struct device * tegra_soc_device_register ( void ) ;
2014-07-11 09:52:41 +02:00
# endif /* __ASSEMBLY__ */
2013-01-11 13:16:19 +05:30
2014-07-17 13:17:24 +02:00
# endif /* __SOC_TEGRA_FUSE_H__ */