fuse-tegra30.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2013-2022, NVIDIA CORPORATION. All rights reserved.
  4. */
  5. #include <linux/device.h>
  6. #include <linux/clk.h>
  7. #include <linux/err.h>
  8. #include <linux/io.h>
  9. #include <linux/kernel.h>
  10. #include <linux/nvmem-consumer.h>
  11. #include <linux/nvmem-provider.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/pm_runtime.h>
  14. #include <linux/random.h>
  15. #include <soc/tegra/fuse.h>
  16. #include "fuse.h"
  17. #define FUSE_BEGIN 0x100
  18. /* Tegra30 and later */
  19. #define FUSE_VENDOR_CODE 0x100
  20. #define FUSE_FAB_CODE 0x104
  21. #define FUSE_LOT_CODE_0 0x108
  22. #define FUSE_LOT_CODE_1 0x10c
  23. #define FUSE_WAFER_ID 0x110
  24. #define FUSE_X_COORDINATE 0x114
  25. #define FUSE_Y_COORDINATE 0x118
  26. #define FUSE_HAS_REVISION_INFO BIT(0)
  27. #if defined(CONFIG_ARCH_TEGRA_3x_SOC) || \
  28. defined(CONFIG_ARCH_TEGRA_114_SOC) || \
  29. defined(CONFIG_ARCH_TEGRA_124_SOC) || \
  30. defined(CONFIG_ARCH_TEGRA_132_SOC) || \
  31. defined(CONFIG_ARCH_TEGRA_210_SOC) || \
  32. defined(CONFIG_ARCH_TEGRA_186_SOC) || \
  33. defined(CONFIG_ARCH_TEGRA_194_SOC) || \
  34. defined(CONFIG_ARCH_TEGRA_234_SOC) || \
  35. defined(CONFIG_ARCH_TEGRA_241_SOC)
  36. static u32 tegra30_fuse_read_early(struct tegra_fuse *fuse, unsigned int offset)
  37. {
  38. if (WARN_ON(!fuse->base))
  39. return 0;
  40. return readl_relaxed(fuse->base + FUSE_BEGIN + offset);
  41. }
  42. static u32 tegra30_fuse_read(struct tegra_fuse *fuse, unsigned int offset)
  43. {
  44. u32 value;
  45. int err;
  46. err = pm_runtime_resume_and_get(fuse->dev);
  47. if (err)
  48. return 0;
  49. value = readl_relaxed(fuse->base + FUSE_BEGIN + offset);
  50. pm_runtime_put(fuse->dev);
  51. return value;
  52. }
  53. static void __init tegra30_fuse_add_randomness(void)
  54. {
  55. u32 randomness[12];
  56. randomness[0] = tegra_sku_info.sku_id;
  57. randomness[1] = tegra_read_straps();
  58. randomness[2] = tegra_read_chipid();
  59. randomness[3] = tegra_sku_info.cpu_process_id << 16;
  60. randomness[3] |= tegra_sku_info.soc_process_id;
  61. randomness[4] = tegra_sku_info.cpu_speedo_id << 16;
  62. randomness[4] |= tegra_sku_info.soc_speedo_id;
  63. randomness[5] = tegra_fuse_read_early(FUSE_VENDOR_CODE);
  64. randomness[6] = tegra_fuse_read_early(FUSE_FAB_CODE);
  65. randomness[7] = tegra_fuse_read_early(FUSE_LOT_CODE_0);
  66. randomness[8] = tegra_fuse_read_early(FUSE_LOT_CODE_1);
  67. randomness[9] = tegra_fuse_read_early(FUSE_WAFER_ID);
  68. randomness[10] = tegra_fuse_read_early(FUSE_X_COORDINATE);
  69. randomness[11] = tegra_fuse_read_early(FUSE_Y_COORDINATE);
  70. add_device_randomness(randomness, sizeof(randomness));
  71. }
  72. static void __init tegra30_fuse_init(struct tegra_fuse *fuse)
  73. {
  74. fuse->read_early = tegra30_fuse_read_early;
  75. fuse->read = tegra30_fuse_read;
  76. tegra_init_revision();
  77. if (fuse->soc->speedo_init)
  78. fuse->soc->speedo_init(&tegra_sku_info);
  79. tegra30_fuse_add_randomness();
  80. }
  81. #endif
  82. #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  83. static const struct tegra_fuse_info tegra30_fuse_info = {
  84. .read = tegra30_fuse_read,
  85. .size = 0x2a4,
  86. .spare = 0x144,
  87. };
  88. const struct tegra_fuse_soc tegra30_fuse_soc = {
  89. .init = tegra30_fuse_init,
  90. .speedo_init = tegra30_init_speedo_data,
  91. .info = &tegra30_fuse_info,
  92. .soc_attr_group = &tegra_soc_attr_group,
  93. .clk_suspend_on = false,
  94. };
  95. #endif
  96. #ifdef CONFIG_ARCH_TEGRA_114_SOC
  97. static const struct tegra_fuse_info tegra114_fuse_info = {
  98. .read = tegra30_fuse_read,
  99. .size = 0x2a0,
  100. .spare = 0x180,
  101. };
  102. const struct tegra_fuse_soc tegra114_fuse_soc = {
  103. .init = tegra30_fuse_init,
  104. .speedo_init = tegra114_init_speedo_data,
  105. .info = &tegra114_fuse_info,
  106. .soc_attr_group = &tegra_soc_attr_group,
  107. .clk_suspend_on = false,
  108. };
  109. #endif
  110. #if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)
  111. static const struct nvmem_cell_info tegra124_fuse_cells[] = {
  112. {
  113. .name = "tsensor-cpu1",
  114. .offset = 0x084,
  115. .bytes = 4,
  116. .bit_offset = 0,
  117. .nbits = 32,
  118. }, {
  119. .name = "tsensor-cpu2",
  120. .offset = 0x088,
  121. .bytes = 4,
  122. .bit_offset = 0,
  123. .nbits = 32,
  124. }, {
  125. .name = "tsensor-cpu0",
  126. .offset = 0x098,
  127. .bytes = 4,
  128. .bit_offset = 0,
  129. .nbits = 32,
  130. }, {
  131. .name = "xusb-pad-calibration",
  132. .offset = 0x0f0,
  133. .bytes = 4,
  134. .bit_offset = 0,
  135. .nbits = 32,
  136. }, {
  137. .name = "tsensor-cpu3",
  138. .offset = 0x12c,
  139. .bytes = 4,
  140. .bit_offset = 0,
  141. .nbits = 32,
  142. }, {
  143. .name = "sata-calibration",
  144. .offset = 0x124,
  145. .bytes = 4,
  146. .bit_offset = 0,
  147. .nbits = 32,
  148. }, {
  149. .name = "tsensor-gpu",
  150. .offset = 0x154,
  151. .bytes = 4,
  152. .bit_offset = 0,
  153. .nbits = 32,
  154. }, {
  155. .name = "tsensor-mem0",
  156. .offset = 0x158,
  157. .bytes = 4,
  158. .bit_offset = 0,
  159. .nbits = 32,
  160. }, {
  161. .name = "tsensor-mem1",
  162. .offset = 0x15c,
  163. .bytes = 4,
  164. .bit_offset = 0,
  165. .nbits = 32,
  166. }, {
  167. .name = "tsensor-pllx",
  168. .offset = 0x160,
  169. .bytes = 4,
  170. .bit_offset = 0,
  171. .nbits = 32,
  172. }, {
  173. .name = "tsensor-common",
  174. .offset = 0x180,
  175. .bytes = 4,
  176. .bit_offset = 0,
  177. .nbits = 32,
  178. }, {
  179. .name = "tsensor-realignment",
  180. .offset = 0x1fc,
  181. .bytes = 4,
  182. .bit_offset = 0,
  183. .nbits = 32,
  184. },
  185. };
  186. static const struct nvmem_cell_lookup tegra124_fuse_lookups[] = {
  187. {
  188. .nvmem_name = "fuse",
  189. .cell_name = "xusb-pad-calibration",
  190. .dev_id = "7009f000.padctl",
  191. .con_id = "calibration",
  192. }, {
  193. .nvmem_name = "fuse",
  194. .cell_name = "sata-calibration",
  195. .dev_id = "70020000.sata",
  196. .con_id = "calibration",
  197. }, {
  198. .nvmem_name = "fuse",
  199. .cell_name = "tsensor-common",
  200. .dev_id = "700e2000.thermal-sensor",
  201. .con_id = "common",
  202. }, {
  203. .nvmem_name = "fuse",
  204. .cell_name = "tsensor-realignment",
  205. .dev_id = "700e2000.thermal-sensor",
  206. .con_id = "realignment",
  207. }, {
  208. .nvmem_name = "fuse",
  209. .cell_name = "tsensor-cpu0",
  210. .dev_id = "700e2000.thermal-sensor",
  211. .con_id = "cpu0",
  212. }, {
  213. .nvmem_name = "fuse",
  214. .cell_name = "tsensor-cpu1",
  215. .dev_id = "700e2000.thermal-sensor",
  216. .con_id = "cpu1",
  217. }, {
  218. .nvmem_name = "fuse",
  219. .cell_name = "tsensor-cpu2",
  220. .dev_id = "700e2000.thermal-sensor",
  221. .con_id = "cpu2",
  222. }, {
  223. .nvmem_name = "fuse",
  224. .cell_name = "tsensor-cpu3",
  225. .dev_id = "700e2000.thermal-sensor",
  226. .con_id = "cpu3",
  227. }, {
  228. .nvmem_name = "fuse",
  229. .cell_name = "tsensor-mem0",
  230. .dev_id = "700e2000.thermal-sensor",
  231. .con_id = "mem0",
  232. }, {
  233. .nvmem_name = "fuse",
  234. .cell_name = "tsensor-mem1",
  235. .dev_id = "700e2000.thermal-sensor",
  236. .con_id = "mem1",
  237. }, {
  238. .nvmem_name = "fuse",
  239. .cell_name = "tsensor-gpu",
  240. .dev_id = "700e2000.thermal-sensor",
  241. .con_id = "gpu",
  242. }, {
  243. .nvmem_name = "fuse",
  244. .cell_name = "tsensor-pllx",
  245. .dev_id = "700e2000.thermal-sensor",
  246. .con_id = "pllx",
  247. },
  248. };
  249. static const struct tegra_fuse_info tegra124_fuse_info = {
  250. .read = tegra30_fuse_read,
  251. .size = 0x300,
  252. .spare = 0x200,
  253. };
  254. const struct tegra_fuse_soc tegra124_fuse_soc = {
  255. .init = tegra30_fuse_init,
  256. .speedo_init = tegra124_init_speedo_data,
  257. .info = &tegra124_fuse_info,
  258. .lookups = tegra124_fuse_lookups,
  259. .num_lookups = ARRAY_SIZE(tegra124_fuse_lookups),
  260. .cells = tegra124_fuse_cells,
  261. .num_cells = ARRAY_SIZE(tegra124_fuse_cells),
  262. .soc_attr_group = &tegra_soc_attr_group,
  263. .clk_suspend_on = true,
  264. };
  265. #endif
  266. #if defined(CONFIG_ARCH_TEGRA_210_SOC)
  267. static const struct nvmem_cell_info tegra210_fuse_cells[] = {
  268. {
  269. .name = "tsensor-cpu1",
  270. .offset = 0x084,
  271. .bytes = 4,
  272. .bit_offset = 0,
  273. .nbits = 32,
  274. }, {
  275. .name = "tsensor-cpu2",
  276. .offset = 0x088,
  277. .bytes = 4,
  278. .bit_offset = 0,
  279. .nbits = 32,
  280. }, {
  281. .name = "tsensor-cpu0",
  282. .offset = 0x098,
  283. .bytes = 4,
  284. .bit_offset = 0,
  285. .nbits = 32,
  286. }, {
  287. .name = "xusb-pad-calibration",
  288. .offset = 0x0f0,
  289. .bytes = 4,
  290. .bit_offset = 0,
  291. .nbits = 32,
  292. }, {
  293. .name = "tsensor-cpu3",
  294. .offset = 0x12c,
  295. .bytes = 4,
  296. .bit_offset = 0,
  297. .nbits = 32,
  298. }, {
  299. .name = "sata-calibration",
  300. .offset = 0x124,
  301. .bytes = 4,
  302. .bit_offset = 0,
  303. .nbits = 32,
  304. }, {
  305. .name = "tsensor-gpu",
  306. .offset = 0x154,
  307. .bytes = 4,
  308. .bit_offset = 0,
  309. .nbits = 32,
  310. }, {
  311. .name = "tsensor-mem0",
  312. .offset = 0x158,
  313. .bytes = 4,
  314. .bit_offset = 0,
  315. .nbits = 32,
  316. }, {
  317. .name = "tsensor-mem1",
  318. .offset = 0x15c,
  319. .bytes = 4,
  320. .bit_offset = 0,
  321. .nbits = 32,
  322. }, {
  323. .name = "tsensor-pllx",
  324. .offset = 0x160,
  325. .bytes = 4,
  326. .bit_offset = 0,
  327. .nbits = 32,
  328. }, {
  329. .name = "tsensor-common",
  330. .offset = 0x180,
  331. .bytes = 4,
  332. .bit_offset = 0,
  333. .nbits = 32,
  334. }, {
  335. .name = "gpu-calibration",
  336. .offset = 0x204,
  337. .bytes = 4,
  338. .bit_offset = 0,
  339. .nbits = 32,
  340. }, {
  341. .name = "xusb-pad-calibration-ext",
  342. .offset = 0x250,
  343. .bytes = 4,
  344. .bit_offset = 0,
  345. .nbits = 32,
  346. },
  347. };
  348. static const struct nvmem_cell_lookup tegra210_fuse_lookups[] = {
  349. {
  350. .nvmem_name = "fuse",
  351. .cell_name = "tsensor-cpu1",
  352. .dev_id = "700e2000.thermal-sensor",
  353. .con_id = "cpu1",
  354. }, {
  355. .nvmem_name = "fuse",
  356. .cell_name = "tsensor-cpu2",
  357. .dev_id = "700e2000.thermal-sensor",
  358. .con_id = "cpu2",
  359. }, {
  360. .nvmem_name = "fuse",
  361. .cell_name = "tsensor-cpu0",
  362. .dev_id = "700e2000.thermal-sensor",
  363. .con_id = "cpu0",
  364. }, {
  365. .nvmem_name = "fuse",
  366. .cell_name = "xusb-pad-calibration",
  367. .dev_id = "7009f000.padctl",
  368. .con_id = "calibration",
  369. }, {
  370. .nvmem_name = "fuse",
  371. .cell_name = "tsensor-cpu3",
  372. .dev_id = "700e2000.thermal-sensor",
  373. .con_id = "cpu3",
  374. }, {
  375. .nvmem_name = "fuse",
  376. .cell_name = "sata-calibration",
  377. .dev_id = "70020000.sata",
  378. .con_id = "calibration",
  379. }, {
  380. .nvmem_name = "fuse",
  381. .cell_name = "tsensor-gpu",
  382. .dev_id = "700e2000.thermal-sensor",
  383. .con_id = "gpu",
  384. }, {
  385. .nvmem_name = "fuse",
  386. .cell_name = "tsensor-mem0",
  387. .dev_id = "700e2000.thermal-sensor",
  388. .con_id = "mem0",
  389. }, {
  390. .nvmem_name = "fuse",
  391. .cell_name = "tsensor-mem1",
  392. .dev_id = "700e2000.thermal-sensor",
  393. .con_id = "mem1",
  394. }, {
  395. .nvmem_name = "fuse",
  396. .cell_name = "tsensor-pllx",
  397. .dev_id = "700e2000.thermal-sensor",
  398. .con_id = "pllx",
  399. }, {
  400. .nvmem_name = "fuse",
  401. .cell_name = "tsensor-common",
  402. .dev_id = "700e2000.thermal-sensor",
  403. .con_id = "common",
  404. }, {
  405. .nvmem_name = "fuse",
  406. .cell_name = "gpu-calibration",
  407. .dev_id = "57000000.gpu",
  408. .con_id = "calibration",
  409. }, {
  410. .nvmem_name = "fuse",
  411. .cell_name = "xusb-pad-calibration-ext",
  412. .dev_id = "7009f000.padctl",
  413. .con_id = "calibration-ext",
  414. },
  415. };
  416. static const struct tegra_fuse_info tegra210_fuse_info = {
  417. .read = tegra30_fuse_read,
  418. .size = 0x300,
  419. .spare = 0x280,
  420. };
  421. const struct tegra_fuse_soc tegra210_fuse_soc = {
  422. .init = tegra30_fuse_init,
  423. .speedo_init = tegra210_init_speedo_data,
  424. .info = &tegra210_fuse_info,
  425. .lookups = tegra210_fuse_lookups,
  426. .cells = tegra210_fuse_cells,
  427. .num_cells = ARRAY_SIZE(tegra210_fuse_cells),
  428. .num_lookups = ARRAY_SIZE(tegra210_fuse_lookups),
  429. .soc_attr_group = &tegra_soc_attr_group,
  430. .clk_suspend_on = false,
  431. };
  432. #endif
  433. #if defined(CONFIG_ARCH_TEGRA_186_SOC)
  434. static const struct nvmem_cell_info tegra186_fuse_cells[] = {
  435. {
  436. .name = "xusb-pad-calibration",
  437. .offset = 0x0f0,
  438. .bytes = 4,
  439. .bit_offset = 0,
  440. .nbits = 32,
  441. }, {
  442. .name = "xusb-pad-calibration-ext",
  443. .offset = 0x250,
  444. .bytes = 4,
  445. .bit_offset = 0,
  446. .nbits = 32,
  447. },
  448. };
  449. static const struct nvmem_cell_lookup tegra186_fuse_lookups[] = {
  450. {
  451. .nvmem_name = "fuse",
  452. .cell_name = "xusb-pad-calibration",
  453. .dev_id = "3520000.padctl",
  454. .con_id = "calibration",
  455. }, {
  456. .nvmem_name = "fuse",
  457. .cell_name = "xusb-pad-calibration-ext",
  458. .dev_id = "3520000.padctl",
  459. .con_id = "calibration-ext",
  460. },
  461. };
  462. static const struct nvmem_keepout tegra186_fuse_keepouts[] = {
  463. { .start = 0x01c, .end = 0x0f0 },
  464. { .start = 0x138, .end = 0x198 },
  465. { .start = 0x1d8, .end = 0x250 },
  466. { .start = 0x280, .end = 0x290 },
  467. { .start = 0x340, .end = 0x344 }
  468. };
  469. static const struct tegra_fuse_info tegra186_fuse_info = {
  470. .read = tegra30_fuse_read,
  471. .size = 0x478,
  472. .spare = 0x280,
  473. };
  474. const struct tegra_fuse_soc tegra186_fuse_soc = {
  475. .init = tegra30_fuse_init,
  476. .info = &tegra186_fuse_info,
  477. .lookups = tegra186_fuse_lookups,
  478. .num_lookups = ARRAY_SIZE(tegra186_fuse_lookups),
  479. .cells = tegra186_fuse_cells,
  480. .num_cells = ARRAY_SIZE(tegra186_fuse_cells),
  481. .keepouts = tegra186_fuse_keepouts,
  482. .num_keepouts = ARRAY_SIZE(tegra186_fuse_keepouts),
  483. .soc_attr_group = &tegra_soc_attr_group,
  484. .clk_suspend_on = false,
  485. };
  486. #endif
  487. #if defined(CONFIG_ARCH_TEGRA_194_SOC)
  488. static const struct nvmem_cell_info tegra194_fuse_cells[] = {
  489. {
  490. .name = "xusb-pad-calibration",
  491. .offset = 0x0f0,
  492. .bytes = 4,
  493. .bit_offset = 0,
  494. .nbits = 32,
  495. }, {
  496. .name = "gpu-gcplex-config-fuse",
  497. .offset = 0x1c8,
  498. .bytes = 4,
  499. .bit_offset = 0,
  500. .nbits = 32,
  501. }, {
  502. .name = "xusb-pad-calibration-ext",
  503. .offset = 0x250,
  504. .bytes = 4,
  505. .bit_offset = 0,
  506. .nbits = 32,
  507. }, {
  508. .name = "gpu-pdi0",
  509. .offset = 0x300,
  510. .bytes = 4,
  511. .bit_offset = 0,
  512. .nbits = 32,
  513. }, {
  514. .name = "gpu-pdi1",
  515. .offset = 0x304,
  516. .bytes = 4,
  517. .bit_offset = 0,
  518. .nbits = 32,
  519. },
  520. };
  521. static const struct nvmem_cell_lookup tegra194_fuse_lookups[] = {
  522. {
  523. .nvmem_name = "fuse",
  524. .cell_name = "xusb-pad-calibration",
  525. .dev_id = "3520000.padctl",
  526. .con_id = "calibration",
  527. }, {
  528. .nvmem_name = "fuse",
  529. .cell_name = "xusb-pad-calibration-ext",
  530. .dev_id = "3520000.padctl",
  531. .con_id = "calibration-ext",
  532. }, {
  533. .nvmem_name = "fuse",
  534. .cell_name = "gpu-gcplex-config-fuse",
  535. .dev_id = "17000000.gpu",
  536. .con_id = "gcplex-config-fuse",
  537. }, {
  538. .nvmem_name = "fuse",
  539. .cell_name = "gpu-pdi0",
  540. .dev_id = "17000000.gpu",
  541. .con_id = "pdi0",
  542. }, {
  543. .nvmem_name = "fuse",
  544. .cell_name = "gpu-pdi1",
  545. .dev_id = "17000000.gpu",
  546. .con_id = "pdi1",
  547. },
  548. };
  549. static const struct nvmem_keepout tegra194_fuse_keepouts[] = {
  550. { .start = 0x01c, .end = 0x0b8 },
  551. { .start = 0x12c, .end = 0x198 },
  552. { .start = 0x1a0, .end = 0x1bc },
  553. { .start = 0x1d8, .end = 0x250 },
  554. { .start = 0x270, .end = 0x290 },
  555. { .start = 0x310, .end = 0x45c }
  556. };
  557. static const struct tegra_fuse_info tegra194_fuse_info = {
  558. .read = tegra30_fuse_read,
  559. .size = 0x650,
  560. .spare = 0x280,
  561. };
  562. const struct tegra_fuse_soc tegra194_fuse_soc = {
  563. .init = tegra30_fuse_init,
  564. .info = &tegra194_fuse_info,
  565. .lookups = tegra194_fuse_lookups,
  566. .num_lookups = ARRAY_SIZE(tegra194_fuse_lookups),
  567. .cells = tegra194_fuse_cells,
  568. .num_cells = ARRAY_SIZE(tegra194_fuse_cells),
  569. .keepouts = tegra194_fuse_keepouts,
  570. .num_keepouts = ARRAY_SIZE(tegra194_fuse_keepouts),
  571. .soc_attr_group = &tegra194_soc_attr_group,
  572. .clk_suspend_on = false,
  573. };
  574. #endif
  575. #if defined(CONFIG_ARCH_TEGRA_234_SOC)
  576. static const struct nvmem_cell_info tegra234_fuse_cells[] = {
  577. {
  578. .name = "xusb-pad-calibration",
  579. .offset = 0x0f0,
  580. .bytes = 4,
  581. .bit_offset = 0,
  582. .nbits = 32,
  583. }, {
  584. .name = "xusb-pad-calibration-ext",
  585. .offset = 0x250,
  586. .bytes = 4,
  587. .bit_offset = 0,
  588. .nbits = 32,
  589. },
  590. };
  591. static const struct nvmem_cell_lookup tegra234_fuse_lookups[] = {
  592. {
  593. .nvmem_name = "fuse",
  594. .cell_name = "xusb-pad-calibration",
  595. .dev_id = "3520000.padctl",
  596. .con_id = "calibration",
  597. }, {
  598. .nvmem_name = "fuse",
  599. .cell_name = "xusb-pad-calibration-ext",
  600. .dev_id = "3520000.padctl",
  601. .con_id = "calibration-ext",
  602. },
  603. };
  604. static const struct nvmem_keepout tegra234_fuse_keepouts[] = {
  605. { .start = 0x01c, .end = 0x064 },
  606. { .start = 0x084, .end = 0x0a0 },
  607. { .start = 0x0a4, .end = 0x0c8 },
  608. { .start = 0x12c, .end = 0x164 },
  609. { .start = 0x16c, .end = 0x184 },
  610. { .start = 0x190, .end = 0x198 },
  611. { .start = 0x1a0, .end = 0x204 },
  612. { .start = 0x21c, .end = 0x2f0 },
  613. { .start = 0x310, .end = 0x3d8 },
  614. { .start = 0x400, .end = 0x420 },
  615. { .start = 0x444, .end = 0x490 },
  616. { .start = 0x4bc, .end = 0x4f0 },
  617. { .start = 0x4f8, .end = 0x54c },
  618. { .start = 0x57c, .end = 0x7e8 },
  619. { .start = 0x8d0, .end = 0x8d8 },
  620. { .start = 0xacc, .end = 0xf00 }
  621. };
  622. static const struct tegra_fuse_info tegra234_fuse_info = {
  623. .read = tegra30_fuse_read,
  624. .size = 0xf90,
  625. .spare = 0x280,
  626. };
  627. const struct tegra_fuse_soc tegra234_fuse_soc = {
  628. .init = tegra30_fuse_init,
  629. .info = &tegra234_fuse_info,
  630. .lookups = tegra234_fuse_lookups,
  631. .num_lookups = ARRAY_SIZE(tegra234_fuse_lookups),
  632. .cells = tegra234_fuse_cells,
  633. .num_cells = ARRAY_SIZE(tegra234_fuse_cells),
  634. .keepouts = tegra234_fuse_keepouts,
  635. .num_keepouts = ARRAY_SIZE(tegra234_fuse_keepouts),
  636. .soc_attr_group = &tegra194_soc_attr_group,
  637. .clk_suspend_on = false,
  638. };
  639. #endif
  640. #if defined(CONFIG_ARCH_TEGRA_241_SOC)
  641. static const struct tegra_fuse_info tegra241_fuse_info = {
  642. .read = tegra30_fuse_read,
  643. .size = 0x16008,
  644. .spare = 0xcf0,
  645. };
  646. static const struct nvmem_keepout tegra241_fuse_keepouts[] = {
  647. { .start = 0xc, .end = 0x1600c }
  648. };
  649. const struct tegra_fuse_soc tegra241_fuse_soc = {
  650. .init = tegra30_fuse_init,
  651. .info = &tegra241_fuse_info,
  652. .keepouts = tegra241_fuse_keepouts,
  653. .num_keepouts = ARRAY_SIZE(tegra241_fuse_keepouts),
  654. .soc_attr_group = &tegra194_soc_attr_group,
  655. };
  656. #endif