dehash.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * AMD Address Translation Library
  4. *
  5. * dehash.c : Functions to account for hashing bits
  6. *
  7. * Copyright (c) 2023, Advanced Micro Devices, Inc.
  8. * All Rights Reserved.
  9. *
  10. * Author: Yazen Ghannam <Yazen.Ghannam@amd.com>
  11. */
  12. #include "internal.h"
  13. static int df2_dehash_addr(struct addr_ctx *ctx)
  14. {
  15. u8 hashed_bit, intlv_bit, intlv_bit_pos;
  16. intlv_bit_pos = ctx->map.intlv_bit_pos;
  17. intlv_bit = !!(BIT_ULL(intlv_bit_pos) & ctx->ret_addr);
  18. hashed_bit = intlv_bit;
  19. hashed_bit ^= FIELD_GET(BIT_ULL(12), ctx->ret_addr);
  20. hashed_bit ^= FIELD_GET(BIT_ULL(18), ctx->ret_addr);
  21. hashed_bit ^= FIELD_GET(BIT_ULL(21), ctx->ret_addr);
  22. hashed_bit ^= FIELD_GET(BIT_ULL(30), ctx->ret_addr);
  23. if (hashed_bit != intlv_bit)
  24. ctx->ret_addr ^= BIT_ULL(intlv_bit_pos);
  25. return 0;
  26. }
  27. static int df3_dehash_addr(struct addr_ctx *ctx)
  28. {
  29. bool hash_ctl_64k, hash_ctl_2M, hash_ctl_1G;
  30. u8 hashed_bit, intlv_bit, intlv_bit_pos;
  31. hash_ctl_64k = FIELD_GET(DF3_HASH_CTL_64K, ctx->map.ctl);
  32. hash_ctl_2M = FIELD_GET(DF3_HASH_CTL_2M, ctx->map.ctl);
  33. hash_ctl_1G = FIELD_GET(DF3_HASH_CTL_1G, ctx->map.ctl);
  34. intlv_bit_pos = ctx->map.intlv_bit_pos;
  35. intlv_bit = !!(BIT_ULL(intlv_bit_pos) & ctx->ret_addr);
  36. hashed_bit = intlv_bit;
  37. hashed_bit ^= FIELD_GET(BIT_ULL(14), ctx->ret_addr);
  38. hashed_bit ^= FIELD_GET(BIT_ULL(18), ctx->ret_addr) & hash_ctl_64k;
  39. hashed_bit ^= FIELD_GET(BIT_ULL(23), ctx->ret_addr) & hash_ctl_2M;
  40. hashed_bit ^= FIELD_GET(BIT_ULL(32), ctx->ret_addr) & hash_ctl_1G;
  41. if (hashed_bit != intlv_bit)
  42. ctx->ret_addr ^= BIT_ULL(intlv_bit_pos);
  43. /* Calculation complete for 2 channels. Continue for 4 and 8 channels. */
  44. if (ctx->map.intlv_mode == DF3_COD4_2CHAN_HASH)
  45. return 0;
  46. intlv_bit = FIELD_GET(BIT_ULL(12), ctx->ret_addr);
  47. hashed_bit = intlv_bit;
  48. hashed_bit ^= FIELD_GET(BIT_ULL(16), ctx->ret_addr) & hash_ctl_64k;
  49. hashed_bit ^= FIELD_GET(BIT_ULL(21), ctx->ret_addr) & hash_ctl_2M;
  50. hashed_bit ^= FIELD_GET(BIT_ULL(30), ctx->ret_addr) & hash_ctl_1G;
  51. if (hashed_bit != intlv_bit)
  52. ctx->ret_addr ^= BIT_ULL(12);
  53. /* Calculation complete for 4 channels. Continue for 8 channels. */
  54. if (ctx->map.intlv_mode == DF3_COD2_4CHAN_HASH)
  55. return 0;
  56. intlv_bit = FIELD_GET(BIT_ULL(13), ctx->ret_addr);
  57. hashed_bit = intlv_bit;
  58. hashed_bit ^= FIELD_GET(BIT_ULL(17), ctx->ret_addr) & hash_ctl_64k;
  59. hashed_bit ^= FIELD_GET(BIT_ULL(22), ctx->ret_addr) & hash_ctl_2M;
  60. hashed_bit ^= FIELD_GET(BIT_ULL(31), ctx->ret_addr) & hash_ctl_1G;
  61. if (hashed_bit != intlv_bit)
  62. ctx->ret_addr ^= BIT_ULL(13);
  63. return 0;
  64. }
  65. static int df3_6chan_dehash_addr(struct addr_ctx *ctx)
  66. {
  67. u8 intlv_bit_pos = ctx->map.intlv_bit_pos;
  68. u8 hashed_bit, intlv_bit, num_intlv_bits;
  69. bool hash_ctl_2M, hash_ctl_1G;
  70. if (ctx->map.intlv_mode != DF3_6CHAN) {
  71. atl_debug_on_bad_intlv_mode(ctx);
  72. return -EINVAL;
  73. }
  74. num_intlv_bits = ilog2(ctx->map.num_intlv_chan) + 1;
  75. hash_ctl_2M = FIELD_GET(DF3_HASH_CTL_2M, ctx->map.ctl);
  76. hash_ctl_1G = FIELD_GET(DF3_HASH_CTL_1G, ctx->map.ctl);
  77. intlv_bit = !!(BIT_ULL(intlv_bit_pos) & ctx->ret_addr);
  78. hashed_bit = intlv_bit;
  79. hashed_bit ^= !!(BIT_ULL(intlv_bit_pos + num_intlv_bits) & ctx->ret_addr);
  80. hashed_bit ^= FIELD_GET(BIT_ULL(23), ctx->ret_addr) & hash_ctl_2M;
  81. hashed_bit ^= FIELD_GET(BIT_ULL(32), ctx->ret_addr) & hash_ctl_1G;
  82. if (hashed_bit != intlv_bit)
  83. ctx->ret_addr ^= BIT_ULL(intlv_bit_pos);
  84. intlv_bit_pos++;
  85. intlv_bit = !!(BIT_ULL(intlv_bit_pos) & ctx->ret_addr);
  86. hashed_bit = intlv_bit;
  87. hashed_bit ^= FIELD_GET(BIT_ULL(21), ctx->ret_addr) & hash_ctl_2M;
  88. hashed_bit ^= FIELD_GET(BIT_ULL(30), ctx->ret_addr) & hash_ctl_1G;
  89. if (hashed_bit != intlv_bit)
  90. ctx->ret_addr ^= BIT_ULL(intlv_bit_pos);
  91. intlv_bit_pos++;
  92. intlv_bit = !!(BIT_ULL(intlv_bit_pos) & ctx->ret_addr);
  93. hashed_bit = intlv_bit;
  94. hashed_bit ^= FIELD_GET(BIT_ULL(22), ctx->ret_addr) & hash_ctl_2M;
  95. hashed_bit ^= FIELD_GET(BIT_ULL(31), ctx->ret_addr) & hash_ctl_1G;
  96. if (hashed_bit != intlv_bit)
  97. ctx->ret_addr ^= BIT_ULL(intlv_bit_pos);
  98. return 0;
  99. }
  100. static int df4_dehash_addr(struct addr_ctx *ctx)
  101. {
  102. bool hash_ctl_64k, hash_ctl_2M, hash_ctl_1G;
  103. u8 hashed_bit, intlv_bit;
  104. hash_ctl_64k = FIELD_GET(DF4_HASH_CTL_64K, ctx->map.ctl);
  105. hash_ctl_2M = FIELD_GET(DF4_HASH_CTL_2M, ctx->map.ctl);
  106. hash_ctl_1G = FIELD_GET(DF4_HASH_CTL_1G, ctx->map.ctl);
  107. intlv_bit = FIELD_GET(BIT_ULL(8), ctx->ret_addr);
  108. hashed_bit = intlv_bit;
  109. hashed_bit ^= FIELD_GET(BIT_ULL(16), ctx->ret_addr) & hash_ctl_64k;
  110. hashed_bit ^= FIELD_GET(BIT_ULL(21), ctx->ret_addr) & hash_ctl_2M;
  111. hashed_bit ^= FIELD_GET(BIT_ULL(30), ctx->ret_addr) & hash_ctl_1G;
  112. if (ctx->map.num_intlv_sockets == 1)
  113. hashed_bit ^= FIELD_GET(BIT_ULL(14), ctx->ret_addr);
  114. if (hashed_bit != intlv_bit)
  115. ctx->ret_addr ^= BIT_ULL(8);
  116. /*
  117. * Hashing is possible with socket interleaving, so check the total number
  118. * of channels in the system rather than DRAM map interleaving mode.
  119. *
  120. * Calculation complete for 2 channels. Continue for 4, 8, and 16 channels.
  121. */
  122. if (ctx->map.total_intlv_chan <= 2)
  123. return 0;
  124. intlv_bit = FIELD_GET(BIT_ULL(12), ctx->ret_addr);
  125. hashed_bit = intlv_bit;
  126. hashed_bit ^= FIELD_GET(BIT_ULL(17), ctx->ret_addr) & hash_ctl_64k;
  127. hashed_bit ^= FIELD_GET(BIT_ULL(22), ctx->ret_addr) & hash_ctl_2M;
  128. hashed_bit ^= FIELD_GET(BIT_ULL(31), ctx->ret_addr) & hash_ctl_1G;
  129. if (hashed_bit != intlv_bit)
  130. ctx->ret_addr ^= BIT_ULL(12);
  131. /* Calculation complete for 4 channels. Continue for 8 and 16 channels. */
  132. if (ctx->map.total_intlv_chan <= 4)
  133. return 0;
  134. intlv_bit = FIELD_GET(BIT_ULL(13), ctx->ret_addr);
  135. hashed_bit = intlv_bit;
  136. hashed_bit ^= FIELD_GET(BIT_ULL(18), ctx->ret_addr) & hash_ctl_64k;
  137. hashed_bit ^= FIELD_GET(BIT_ULL(23), ctx->ret_addr) & hash_ctl_2M;
  138. hashed_bit ^= FIELD_GET(BIT_ULL(32), ctx->ret_addr) & hash_ctl_1G;
  139. if (hashed_bit != intlv_bit)
  140. ctx->ret_addr ^= BIT_ULL(13);
  141. /* Calculation complete for 8 channels. Continue for 16 channels. */
  142. if (ctx->map.total_intlv_chan <= 8)
  143. return 0;
  144. intlv_bit = FIELD_GET(BIT_ULL(14), ctx->ret_addr);
  145. hashed_bit = intlv_bit;
  146. hashed_bit ^= FIELD_GET(BIT_ULL(19), ctx->ret_addr) & hash_ctl_64k;
  147. hashed_bit ^= FIELD_GET(BIT_ULL(24), ctx->ret_addr) & hash_ctl_2M;
  148. hashed_bit ^= FIELD_GET(BIT_ULL(33), ctx->ret_addr) & hash_ctl_1G;
  149. if (hashed_bit != intlv_bit)
  150. ctx->ret_addr ^= BIT_ULL(14);
  151. return 0;
  152. }
  153. static int df4p5_dehash_addr(struct addr_ctx *ctx)
  154. {
  155. bool hash_ctl_64k, hash_ctl_2M, hash_ctl_1G, hash_ctl_1T;
  156. u8 hashed_bit, intlv_bit;
  157. u64 rehash_vector;
  158. hash_ctl_64k = FIELD_GET(DF4_HASH_CTL_64K, ctx->map.ctl);
  159. hash_ctl_2M = FIELD_GET(DF4_HASH_CTL_2M, ctx->map.ctl);
  160. hash_ctl_1G = FIELD_GET(DF4_HASH_CTL_1G, ctx->map.ctl);
  161. hash_ctl_1T = FIELD_GET(DF4p5_HASH_CTL_1T, ctx->map.ctl);
  162. /*
  163. * Generate a unique address to determine which bits
  164. * need to be dehashed.
  165. *
  166. * Start with a contiguous bitmask for the total
  167. * number of channels starting at bit 8.
  168. *
  169. * Then make a gap in the proper place based on
  170. * interleave mode.
  171. */
  172. rehash_vector = ctx->map.total_intlv_chan - 1;
  173. rehash_vector <<= 8;
  174. if (ctx->map.intlv_mode == DF4p5_NPS2_4CHAN_1K_HASH ||
  175. ctx->map.intlv_mode == DF4p5_NPS1_8CHAN_1K_HASH ||
  176. ctx->map.intlv_mode == DF4p5_NPS1_16CHAN_1K_HASH)
  177. rehash_vector = expand_bits(10, 2, rehash_vector);
  178. else
  179. rehash_vector = expand_bits(9, 3, rehash_vector);
  180. if (rehash_vector & BIT_ULL(8)) {
  181. intlv_bit = FIELD_GET(BIT_ULL(8), ctx->ret_addr);
  182. hashed_bit = intlv_bit;
  183. hashed_bit ^= FIELD_GET(BIT_ULL(16), ctx->ret_addr) & hash_ctl_64k;
  184. hashed_bit ^= FIELD_GET(BIT_ULL(21), ctx->ret_addr) & hash_ctl_2M;
  185. hashed_bit ^= FIELD_GET(BIT_ULL(30), ctx->ret_addr) & hash_ctl_1G;
  186. hashed_bit ^= FIELD_GET(BIT_ULL(40), ctx->ret_addr) & hash_ctl_1T;
  187. if (hashed_bit != intlv_bit)
  188. ctx->ret_addr ^= BIT_ULL(8);
  189. }
  190. if (rehash_vector & BIT_ULL(9)) {
  191. intlv_bit = FIELD_GET(BIT_ULL(9), ctx->ret_addr);
  192. hashed_bit = intlv_bit;
  193. hashed_bit ^= FIELD_GET(BIT_ULL(17), ctx->ret_addr) & hash_ctl_64k;
  194. hashed_bit ^= FIELD_GET(BIT_ULL(22), ctx->ret_addr) & hash_ctl_2M;
  195. hashed_bit ^= FIELD_GET(BIT_ULL(31), ctx->ret_addr) & hash_ctl_1G;
  196. hashed_bit ^= FIELD_GET(BIT_ULL(41), ctx->ret_addr) & hash_ctl_1T;
  197. if (hashed_bit != intlv_bit)
  198. ctx->ret_addr ^= BIT_ULL(9);
  199. }
  200. if (rehash_vector & BIT_ULL(12)) {
  201. intlv_bit = FIELD_GET(BIT_ULL(12), ctx->ret_addr);
  202. hashed_bit = intlv_bit;
  203. hashed_bit ^= FIELD_GET(BIT_ULL(18), ctx->ret_addr) & hash_ctl_64k;
  204. hashed_bit ^= FIELD_GET(BIT_ULL(23), ctx->ret_addr) & hash_ctl_2M;
  205. hashed_bit ^= FIELD_GET(BIT_ULL(32), ctx->ret_addr) & hash_ctl_1G;
  206. hashed_bit ^= FIELD_GET(BIT_ULL(42), ctx->ret_addr) & hash_ctl_1T;
  207. if (hashed_bit != intlv_bit)
  208. ctx->ret_addr ^= BIT_ULL(12);
  209. }
  210. if (rehash_vector & BIT_ULL(13)) {
  211. intlv_bit = FIELD_GET(BIT_ULL(13), ctx->ret_addr);
  212. hashed_bit = intlv_bit;
  213. hashed_bit ^= FIELD_GET(BIT_ULL(19), ctx->ret_addr) & hash_ctl_64k;
  214. hashed_bit ^= FIELD_GET(BIT_ULL(24), ctx->ret_addr) & hash_ctl_2M;
  215. hashed_bit ^= FIELD_GET(BIT_ULL(33), ctx->ret_addr) & hash_ctl_1G;
  216. hashed_bit ^= FIELD_GET(BIT_ULL(43), ctx->ret_addr) & hash_ctl_1T;
  217. if (hashed_bit != intlv_bit)
  218. ctx->ret_addr ^= BIT_ULL(13);
  219. }
  220. if (rehash_vector & BIT_ULL(14)) {
  221. intlv_bit = FIELD_GET(BIT_ULL(14), ctx->ret_addr);
  222. hashed_bit = intlv_bit;
  223. hashed_bit ^= FIELD_GET(BIT_ULL(20), ctx->ret_addr) & hash_ctl_64k;
  224. hashed_bit ^= FIELD_GET(BIT_ULL(25), ctx->ret_addr) & hash_ctl_2M;
  225. hashed_bit ^= FIELD_GET(BIT_ULL(34), ctx->ret_addr) & hash_ctl_1G;
  226. hashed_bit ^= FIELD_GET(BIT_ULL(44), ctx->ret_addr) & hash_ctl_1T;
  227. if (hashed_bit != intlv_bit)
  228. ctx->ret_addr ^= BIT_ULL(14);
  229. }
  230. return 0;
  231. }
  232. /*
  233. * MI300 hash bits
  234. * 4K 64K 2M 1G 1T 1T
  235. * COH_ST_Select[0] = XOR of addr{8, 12, 15, 22, 29, 36, 43}
  236. * COH_ST_Select[1] = XOR of addr{9, 13, 16, 23, 30, 37, 44}
  237. * COH_ST_Select[2] = XOR of addr{10, 14, 17, 24, 31, 38, 45}
  238. * COH_ST_Select[3] = XOR of addr{11, 18, 25, 32, 39, 46}
  239. * COH_ST_Select[4] = XOR of addr{14, 19, 26, 33, 40, 47} aka Stack
  240. * DieID[0] = XOR of addr{12, 20, 27, 34, 41 }
  241. * DieID[1] = XOR of addr{13, 21, 28, 35, 42 }
  242. */
  243. static int mi300_dehash_addr(struct addr_ctx *ctx)
  244. {
  245. bool hash_ctl_4k, hash_ctl_64k, hash_ctl_2M, hash_ctl_1G, hash_ctl_1T;
  246. bool hashed_bit, intlv_bit, test_bit;
  247. u8 num_intlv_bits, base_bit, i;
  248. hash_ctl_4k = FIELD_GET(DF4p5_HASH_CTL_4K, ctx->map.ctl);
  249. hash_ctl_64k = FIELD_GET(DF4_HASH_CTL_64K, ctx->map.ctl);
  250. hash_ctl_2M = FIELD_GET(DF4_HASH_CTL_2M, ctx->map.ctl);
  251. hash_ctl_1G = FIELD_GET(DF4_HASH_CTL_1G, ctx->map.ctl);
  252. hash_ctl_1T = FIELD_GET(DF4p5_HASH_CTL_1T, ctx->map.ctl);
  253. /* Channel bits */
  254. num_intlv_bits = ilog2(ctx->map.num_intlv_chan);
  255. for (i = 0; i < num_intlv_bits; i++) {
  256. base_bit = 8 + i;
  257. /* COH_ST_Select[4] jumps to a base bit of 14. */
  258. if (i == 4)
  259. base_bit = 14;
  260. intlv_bit = BIT_ULL(base_bit) & ctx->ret_addr;
  261. hashed_bit = intlv_bit;
  262. /* 4k hash bit only applies to the first 3 bits. */
  263. if (i <= 2) {
  264. test_bit = BIT_ULL(12 + i) & ctx->ret_addr;
  265. hashed_bit ^= test_bit & hash_ctl_4k;
  266. }
  267. /* Use temporary 'test_bit' value to avoid Sparse warnings. */
  268. test_bit = BIT_ULL(15 + i) & ctx->ret_addr;
  269. hashed_bit ^= test_bit & hash_ctl_64k;
  270. test_bit = BIT_ULL(22 + i) & ctx->ret_addr;
  271. hashed_bit ^= test_bit & hash_ctl_2M;
  272. test_bit = BIT_ULL(29 + i) & ctx->ret_addr;
  273. hashed_bit ^= test_bit & hash_ctl_1G;
  274. test_bit = BIT_ULL(36 + i) & ctx->ret_addr;
  275. hashed_bit ^= test_bit & hash_ctl_1T;
  276. test_bit = BIT_ULL(43 + i) & ctx->ret_addr;
  277. hashed_bit ^= test_bit & hash_ctl_1T;
  278. if (hashed_bit != intlv_bit)
  279. ctx->ret_addr ^= BIT_ULL(base_bit);
  280. }
  281. /* Die bits */
  282. num_intlv_bits = ilog2(ctx->map.num_intlv_dies);
  283. for (i = 0; i < num_intlv_bits; i++) {
  284. base_bit = 12 + i;
  285. intlv_bit = BIT_ULL(base_bit) & ctx->ret_addr;
  286. hashed_bit = intlv_bit;
  287. test_bit = BIT_ULL(20 + i) & ctx->ret_addr;
  288. hashed_bit ^= test_bit & hash_ctl_64k;
  289. test_bit = BIT_ULL(27 + i) & ctx->ret_addr;
  290. hashed_bit ^= test_bit & hash_ctl_2M;
  291. test_bit = BIT_ULL(34 + i) & ctx->ret_addr;
  292. hashed_bit ^= test_bit & hash_ctl_1G;
  293. test_bit = BIT_ULL(41 + i) & ctx->ret_addr;
  294. hashed_bit ^= test_bit & hash_ctl_1T;
  295. if (hashed_bit != intlv_bit)
  296. ctx->ret_addr ^= BIT_ULL(base_bit);
  297. }
  298. return 0;
  299. }
  300. int dehash_address(struct addr_ctx *ctx)
  301. {
  302. switch (ctx->map.intlv_mode) {
  303. /* No hashing cases. */
  304. case NONE:
  305. case NOHASH_2CHAN:
  306. case NOHASH_4CHAN:
  307. case NOHASH_8CHAN:
  308. case NOHASH_16CHAN:
  309. case NOHASH_32CHAN:
  310. /* Hashing bits handled earlier during CS ID calculation. */
  311. case DF4_NPS4_3CHAN_HASH:
  312. case DF4_NPS2_5CHAN_HASH:
  313. case DF4_NPS2_6CHAN_HASH:
  314. case DF4_NPS1_10CHAN_HASH:
  315. case DF4_NPS1_12CHAN_HASH:
  316. case DF4p5_NPS2_6CHAN_1K_HASH:
  317. case DF4p5_NPS2_6CHAN_2K_HASH:
  318. case DF4p5_NPS1_10CHAN_1K_HASH:
  319. case DF4p5_NPS1_10CHAN_2K_HASH:
  320. case DF4p5_NPS1_12CHAN_1K_HASH:
  321. case DF4p5_NPS1_12CHAN_2K_HASH:
  322. case DF4p5_NPS0_24CHAN_1K_HASH:
  323. case DF4p5_NPS0_24CHAN_2K_HASH:
  324. /* No hash physical address bits, so nothing to do. */
  325. case DF4p5_NPS4_3CHAN_1K_HASH:
  326. case DF4p5_NPS4_3CHAN_2K_HASH:
  327. case DF4p5_NPS2_5CHAN_1K_HASH:
  328. case DF4p5_NPS2_5CHAN_2K_HASH:
  329. return 0;
  330. case DF2_2CHAN_HASH:
  331. return df2_dehash_addr(ctx);
  332. case DF3_COD4_2CHAN_HASH:
  333. case DF3_COD2_4CHAN_HASH:
  334. case DF3_COD1_8CHAN_HASH:
  335. return df3_dehash_addr(ctx);
  336. case DF3_6CHAN:
  337. return df3_6chan_dehash_addr(ctx);
  338. case DF4_NPS4_2CHAN_HASH:
  339. case DF4_NPS2_4CHAN_HASH:
  340. case DF4_NPS1_8CHAN_HASH:
  341. return df4_dehash_addr(ctx);
  342. case DF4p5_NPS4_2CHAN_1K_HASH:
  343. case DF4p5_NPS4_2CHAN_2K_HASH:
  344. case DF4p5_NPS2_4CHAN_2K_HASH:
  345. case DF4p5_NPS2_4CHAN_1K_HASH:
  346. case DF4p5_NPS1_8CHAN_1K_HASH:
  347. case DF4p5_NPS1_8CHAN_2K_HASH:
  348. case DF4p5_NPS1_16CHAN_1K_HASH:
  349. case DF4p5_NPS1_16CHAN_2K_HASH:
  350. return df4p5_dehash_addr(ctx);
  351. case MI3_HASH_8CHAN:
  352. case MI3_HASH_16CHAN:
  353. case MI3_HASH_32CHAN:
  354. return mi300_dehash_addr(ctx);
  355. default:
  356. atl_debug_on_bad_intlv_mode(ctx);
  357. return -EINVAL;
  358. }
  359. }