/* SPDX-License-Identifier: GPL-2.0 */


#ifndef __LINUX_ARM_MPAM_H
#define __LINUX_ARM_MPAM_H

#include <linux/acpi.h>
#include <linux/types.h>

struct mpam_msc;

enum mpam_msc_iface {
	MPAM_IFACE_MMIO,	
	MPAM_IFACE_PCC,		
};

enum mpam_class_types {
	MPAM_CLASS_CACHE,	
	MPAM_CLASS_MEMORY,	
	MPAM_CLASS_UNKNOWN,	
};

#define MPAM_CLASS_ID_DEFAULT	255

#ifdef CONFIG_ACPI_MPAM
int acpi_mpam_parse_resources(struct mpam_msc *msc,
			      struct acpi_mpam_msc_node *tbl_msc);

int acpi_mpam_count_msc(void);
#else
static inline int acpi_mpam_parse_resources(struct mpam_msc *msc,
					    struct acpi_mpam_msc_node *tbl_msc)
{
	return -EINVAL;
}

static inline int acpi_mpam_count_msc(void) { return -EINVAL; }
#endif

#ifdef CONFIG_ARM64_MPAM_DRIVER
int mpam_ris_create(struct mpam_msc *msc, u8 ris_idx,
		    enum mpam_class_types type, u8 class_id, int component_id);
#else
static inline int mpam_ris_create(struct mpam_msc *msc, u8 ris_idx,
				  enum mpam_class_types type, u8 class_id,
				  int component_id)
{
	return -EINVAL;
}
#endif


int mpam_register_requestor(u16 partid_max, u8 pmg_max);

#endif 
