[PATCH 3/5] arm_mpam: add MPAM-Fb MSC firmware access support
Sudeep Holla
sudeep.holla at kernel.org
Mon May 18 07:11:01 PDT 2026
On Wed, Apr 29, 2026 at 04:13:37PM +0200, Andre Przywara wrote:
[...]
> diff --git a/drivers/resctrl/mpam_fb.c b/drivers/resctrl/mpam_fb.c
> new file mode 100644
> index 000000000000..bfb5798c74b0
> --- /dev/null
> +++ b/drivers/resctrl/mpam_fb.c
> @@ -0,0 +1,158 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (C) 2024 Arm Ltd.
> +
> +#include <linux/arm_mpam.h>
> +#include <linux/cleanup.h>
> +#include <linux/device.h>
> +#include <linux/errno.h>
> +#include <linux/gfp.h>
> +#include <linux/iopoll.h>
> +#include <linux/list.h>
> +#include <linux/mailbox_client.h>
> +#include <linux/mutex.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/printk.h>
> +#include <linux/processor.h>
> +#include <linux/slab.h>
> +#include <linux/spinlock.h>
> +#include <linux/types.h>
> +
> +#include <acpi/pcc.h>
> +
> +#include <asm/mpam.h>
> +
> +#include "mpam_fb.h"
> +
> +#define MPAM_FB_PROTOCOL_ID 0x1a
This is only possible place where referring to SCMI is Okay but good
that you have avoided by keeping it MPAM_FB_PROTOCOL_ID. You can add a
note if that is helpful but other than that remove any reference to SCMI
from this file as it is not needed and might be misleading.
Consider a system that just implements SCMI for sake of MPAM_FB_PROTOCOL
and need not be completely SCMI conformant in terms of base and other
protocol if it is not used on such a system. Using or referring SCMI must
give a misunderstanding that SCMI is needed for this to work.
> +#define MPAM_MSC_ATTRIBUTES_CMD 0x3
> +#define MPAM_MSC_READ_CMD 0x4
> +#define MPAM_MSC_WRITE_CMD 0x5
> +
> +#define MPAM_MSC_PROT_ID_MASK GENMASK(17, 10)
> +#define MPAM_MSC_TOKEN_MASK GENMASK(27, 18)
> +
> +#define SCMI_CHAN_RSVD_OFS 0x00
> +#define SCMI_CHAN_STATUS_OFS 0x04
> +#define SCMI_CHAN_STATUS_FREE_BIT BIT(0)
> +#define SCMI_CHAN_FLAGS_OFS 0x10
> +#define SCMI_CHAN_FLAGS_IRQ BIT(0)
> +#define SCMI_MSG_LENGTH_OFS 0x14
> +#define SCMI_MSG_HEADER_OFS 0x18
> +#define SCMI_MSG_PAYLOAD_OFS 0x1c
> +
However, there is nothing SCMI specific in all the above, plain PCC shared
memory layout and hence SCMI needs to be dropped. Also you don't need
all these offsets if you use acpi_pcct_ext_pcc_shared_memory directly.
--
Regards,
Sudeep
More information about the linux-arm-kernel
mailing list