Skip to content

Commit 1f44feb

Browse files
committed
soc/tegra: fuse: Add Tegra234 support
Add support for FUSE block found on the Tegra234 SoC, which is largely similar to the IP found on previous generations. Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent 52e6d39 commit 1f44feb

5 files changed

Lines changed: 46 additions & 2 deletions

File tree

drivers/soc/tegra/fuse/fuse-tegra.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ static struct tegra_fuse *fuse = &(struct tegra_fuse) {
4949
};
5050

5151
static const struct of_device_id tegra_fuse_match[] = {
52+
#ifdef CONFIG_ARCH_TEGRA_234_SOC
53+
{ .compatible = "nvidia,tegra234-efuse", .data = &tegra234_fuse_soc },
54+
#endif
5255
#ifdef CONFIG_ARCH_TEGRA_194_SOC
5356
{ .compatible = "nvidia,tegra194-efuse", .data = &tegra194_fuse_soc },
5457
#endif
@@ -326,7 +329,8 @@ const struct attribute_group tegra_soc_attr_group = {
326329
.attrs = tegra_soc_attr,
327330
};
328331

329-
#ifdef CONFIG_ARCH_TEGRA_194_SOC
332+
#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \
333+
IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC)
330334
static ssize_t platform_show(struct device *dev, struct device_attribute *attr,
331335
char *buf)
332336
{

drivers/soc/tegra/fuse/fuse-tegra30.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,33 @@ const struct tegra_fuse_soc tegra194_fuse_soc = {
356356
.soc_attr_group = &tegra194_soc_attr_group,
357357
};
358358
#endif
359+
360+
#if defined(CONFIG_ARCH_TEGRA_234_SOC)
361+
static const struct nvmem_cell_lookup tegra234_fuse_lookups[] = {
362+
{
363+
.nvmem_name = "fuse",
364+
.cell_name = "xusb-pad-calibration",
365+
.dev_id = "3520000.padctl",
366+
.con_id = "calibration",
367+
}, {
368+
.nvmem_name = "fuse",
369+
.cell_name = "xusb-pad-calibration-ext",
370+
.dev_id = "3520000.padctl",
371+
.con_id = "calibration-ext",
372+
},
373+
};
374+
375+
static const struct tegra_fuse_info tegra234_fuse_info = {
376+
.read = tegra30_fuse_read,
377+
.size = 0x300,
378+
.spare = 0x280,
379+
};
380+
381+
const struct tegra_fuse_soc tegra234_fuse_soc = {
382+
.init = tegra30_fuse_init,
383+
.info = &tegra234_fuse_info,
384+
.lookups = tegra234_fuse_lookups,
385+
.num_lookups = ARRAY_SIZE(tegra234_fuse_lookups),
386+
.soc_attr_group = &tegra194_soc_attr_group,
387+
};
388+
#endif

drivers/soc/tegra/fuse/fuse.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,17 @@ extern const struct tegra_fuse_soc tegra210_fuse_soc;
115115
extern const struct tegra_fuse_soc tegra186_fuse_soc;
116116
#endif
117117

118+
#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \
119+
IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC)
120+
extern const struct attribute_group tegra194_soc_attr_group;
121+
#endif
122+
118123
#ifdef CONFIG_ARCH_TEGRA_194_SOC
119124
extern const struct tegra_fuse_soc tegra194_fuse_soc;
120-
extern const struct attribute_group tegra194_soc_attr_group;
125+
#endif
126+
127+
#ifdef CONFIG_ARCH_TEGRA_234_SOC
128+
extern const struct tegra_fuse_soc tegra234_fuse_soc;
121129
#endif
122130

123131
#endif

drivers/soc/tegra/fuse/tegra-apbmisc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ bool tegra_is_silicon(void)
5656
{
5757
switch (tegra_get_chip_id()) {
5858
case TEGRA194:
59+
case TEGRA234:
5960
if (tegra_get_platform() == 0)
6061
return true;
6162

include/soc/tegra/fuse.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define TEGRA210 0x21
1515
#define TEGRA186 0x18
1616
#define TEGRA194 0x19
17+
#define TEGRA234 0x23
1718

1819
#define TEGRA_FUSE_SKU_CALIB_0 0xf0
1920
#define TEGRA30_FUSE_SATA_CALIB 0x124

0 commit comments

Comments
 (0)