1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * AMD Address Translation Library
5 * prm.c : Plumbing code for ACPI Platform Runtime Mechanism (PRM)
7 * Information on AMD PRM modules and handlers including the GUIDs and buffer
8 * structures used here are defined in the AMD ACPI Porting Guide in the
9 * chapter "Platform Runtime Mechanism Table (PRMT)"
11 * Copyright (c) 2024, Advanced Micro Devices, Inc.
12 * All Rights Reserved.
14 * Author: John Allen <john.allen@amd.com>
19 #include <linux/prmt.h>
22 * PRM parameter buffer - normalized to system physical address, as described
23 * in the "PRM Parameter Buffer" section of the AMD ACPI Porting Guide.
25 struct norm_to_sys_param_buf
{
32 static const guid_t norm_to_sys_guid
= GUID_INIT(0xE7180659, 0xA65D, 0x451D,
33 0x92, 0xCD, 0x2B, 0x56, 0xF1,
36 unsigned long prm_umc_norm_to_sys_addr(u8 socket_id
, u64 bank_id
, unsigned long addr
)
38 struct norm_to_sys_param_buf p_buf
;
39 unsigned long ret_addr
;
42 p_buf
.norm_addr
= addr
;
43 p_buf
.socket
= socket_id
;
44 p_buf
.bank_id
= bank_id
;
45 p_buf
.out_buf
= &ret_addr
;
47 ret
= acpi_call_prm_handler(norm_to_sys_guid
, &p_buf
);
52 pr_debug("PRM module/handler not available\n");
54 pr_notice_once("PRM address translation failed\n");