Messages in this thread Patch in this message | | | From | Yazen Ghannam <> | Subject | [PATCH v2 06/31] EDAC/amd64: Define Data Fabric operations | Date | Wed, 23 Jun 2021 19:19:37 +0000 |
| |
Define a stub to hold operations for different Data Fabric versions. This will be filled in following patches.
Define a function to set the appropriate operations. Use a return code because future updates have checks that may fail.
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> --- Link: https://lkml.kernel.org/r/20210507190140.18854-3-Yazen.Ghannam@amd.com
v1->v2: * New in v2.
drivers/edac/amd64_edac.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 62eca188458f..f769353ef7e4 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -1085,6 +1085,21 @@ struct addr_ctx { u8 inst_id; }; +struct data_fabric_ops { +}; + +struct data_fabric_ops df2_ops = { +}; + +struct data_fabric_ops *df_ops; + +static int set_df_ops(struct addr_ctx *ctx) +{ + df_ops = &df2_ops; + + return 0; +} + static int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr) { u64 dram_base_addr, dram_limit_addr, dram_hole_base; @@ -1110,6 +1125,9 @@ static int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr ctx.nid = nid; ctx.inst_id = umc; + if (set_df_ops(&ctx)) + return -EINVAL; + if (amd_df_indirect_read(nid, df_regs[DRAM_OFFSET], umc, &tmp)) goto out_err; -- 2.25.1
| |