Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+46 -2
+5 -1
drivers/soc/tegra/fuse/fuse-tegra.c
··· 49 49 }; 50 50 51 51 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 52 55 #ifdef CONFIG_ARCH_TEGRA_194_SOC 53 56 { .compatible = "nvidia,tegra194-efuse", .data = &tegra194_fuse_soc }, 54 57 #endif ··· 329 326 .attrs = tegra_soc_attr, 330 327 }; 331 328 332 - #ifdef CONFIG_ARCH_TEGRA_194_SOC 329 + #if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \ 330 + IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) 333 331 static ssize_t platform_show(struct device *dev, struct device_attribute *attr, 334 332 char *buf) 335 333 {
+30
drivers/soc/tegra/fuse/fuse-tegra30.c
··· 356 356 .soc_attr_group = &tegra194_soc_attr_group, 357 357 }; 358 358 #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
+9 -1
drivers/soc/tegra/fuse/fuse.h
··· 115 115 extern const struct tegra_fuse_soc tegra186_fuse_soc; 116 116 #endif 117 117 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 + 118 123 #ifdef CONFIG_ARCH_TEGRA_194_SOC 119 124 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; 121 129 #endif 122 130 123 131 #endif
+1
drivers/soc/tegra/fuse/tegra-apbmisc.c
··· 56 56 { 57 57 switch (tegra_get_chip_id()) { 58 58 case TEGRA194: 59 + case TEGRA234: 59 60 if (tegra_get_platform() == 0) 60 61 return true; 61 62
+1
include/soc/tegra/fuse.h
··· 14 14 #define TEGRA210 0x21 15 15 #define TEGRA186 0x18 16 16 #define TEGRA194 0x19 17 + #define TEGRA234 0x23 17 18 18 19 #define TEGRA_FUSE_SKU_CALIB_0 0xf0 19 20 #define TEGRA30_FUSE_SATA_CALIB 0x124