soc/tegra: fuse: Expose Tegra production status
Jon Hunter
maintainerPATCH 1/1 soc/tegra: fuse: Expose Tegra production status
From: Bitan Biswas <[email protected]>
For Tegra194 and Tegra234 devices there is a production fuse register that indicates if the device is a production device. Expose the production status of the chip via the sysfs for Tegra194 and Tegra234 devices. Note that '0' implies not production or unknown and '1' indicates the device is a production device.
Signed-off-by Bitan Biswas <[email protected]>
[ Re-worked for upstream submission by Jon Hunter <[email protected]> ]
Signed-off-by Jon Hunter <[email protected]>
--- drivers/soc/tegra/fuse/fuse-tegra.c | 15 +++++++++++++++ include/soc/tegra/fuse.h | 1 + 2 files changed, 16 insertions(+)
drivers/soc/tegra/fuse/fuse-tegra.c +15 -0
@@ -426,6 +426,20 @@ static ssize_t minor_show(struct device *dev, struct device_attribute *attr,static DEVICE_ATTR_RO (minor); +static ssize_t production_show (struct device *dev, +struct device_attribute *attr,char *buf) +{ +u32 reg =0 ; + +if (tegra_is_silicon ()) +if (tegra_fuse_readl (TEGRA_FUSE_PRODUCTION_MODE , ®)) +dev_err (dev,"failed to read production fuse!\n" ); + +return sprintf (buf,"%d\n" , reg); +} + +static DEVICE_ATTR_RO (production); +static struct attribute *tegra_soc_attr[] = { &dev_attr_major.attr, &dev_attr_minor.attr,
@@ -456,6 +470,7 @@ static struct attribute *tegra194_soc_attr[] = { &dev_attr_major.attr, &dev_attr_minor.attr, &dev_attr_platform.attr, + &dev_attr_production.attr, NULL, };
include/soc/tegra/fuse.h +1 -0
@@ -18,6 +18,7 @@#define TEGRA194 0x19#define TEGRA234 0x23 +#define TEGRA_FUSE_PRODUCTION_MODE 0x0#define TEGRA_FUSE_SKU_CALIB_0 0xf0#define TEGRA30_FUSE_SATA_CALIB 0x124#define TEGRA_FUSE_USB_CALIB_EXT_0 0x250
Signature · 1 line
2.25.1