Commit 524b2b7
cxl: Move hpa_to_spa callback to a new root decoder ops structure
The root decoder's HPA to SPA translation logic was implemented using
a single function pointer. In preparation for additional per-decoder
callbacks, convert this into a struct cxl_rd_ops and move the
hpa_to_spa pointer into it.
To avoid maintaining a static ops instance populated with mostly NULL
pointers, allocate the ops structure dynamically only when a platform
requires overrides (e.g. XOR interleave decoding).
The setup can be extended as additional callbacks are added.
Co-developed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/818530c82c351a9c0d3a204f593068dd2126a5a9.1754290144.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>1 parent 8f5ae30 commit 524b2b7
4 files changed
Lines changed: 25 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
472 | 471 | | |
473 | 472 | | |
474 | 473 | | |
475 | | - | |
476 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
477 | 481 | | |
478 | 482 | | |
479 | 483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2918 | 2918 | | |
2919 | 2919 | | |
2920 | 2920 | | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
2921 | 2926 | | |
2922 | 2927 | | |
2923 | 2928 | | |
| |||
2972 | 2977 | | |
2973 | 2978 | | |
2974 | 2979 | | |
2975 | | - | |
2976 | | - | |
| 2980 | + | |
| 2981 | + | |
2977 | 2982 | | |
2978 | 2983 | | |
2979 | 2984 | | |
| |||
2982 | 2987 | | |
2983 | 2988 | | |
2984 | 2989 | | |
2985 | | - | |
| 2990 | + | |
2986 | 2991 | | |
2987 | 2992 | | |
2988 | 2993 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
423 | 429 | | |
424 | 430 | | |
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
428 | 434 | | |
429 | | - | |
430 | 435 | | |
431 | 436 | | |
432 | 437 | | |
| 438 | + | |
433 | 439 | | |
434 | 440 | | |
435 | 441 | | |
436 | 442 | | |
437 | 443 | | |
438 | 444 | | |
439 | | - | |
440 | 445 | | |
441 | 446 | | |
442 | 447 | | |
| 448 | + | |
443 | 449 | | |
444 | 450 | | |
445 | 451 | | |
| |||
0 commit comments