// SPDX-License-Identifier: GPL-2.0
/*
 * System Control and Management Interface (SCMI) Performance Protocol
 *
 * Copyright (C) 2018-2023 ARM Ltd.
 */

#define pr_fmt(fmt) "SCMI Notifications PERF - " fmt

#include <linux/bits.h>
#include <linux/hashtable.h>
#include <linux/io.h>
#include <linux/log2.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_opp.h>
#include <linux/scmi_protocol.h>
#include <linux/sort.h>
#include <linux/xarray.h>

#include <trace/events/scmi.h>

#include "protocols.h"
#include "notify.h"

/* Updated only after ALL the mandatory features for that version are merged */
#define SCMI_PROTOCOL_SUPPORTED_VERSION		0x40000

#define MAX_OPPS		32

enum scmi_performance_protocol_cmd {
	PERF_DOMAIN_ATTRIBUTES = 0x3,
	PERF_DESCRIBE_LEVELS = 0x4,
	PERF_LIMITS_SET = 0x5,
	PERF_LIMITS_GET = 0x6,
	PERF_LEVEL_SET = 0x7,
	PERF_LEVEL_GET = 0x8,
	PERF_NOTIFY_LIMITS = 0x9,
	PERF_NOTIFY_LEVEL = 0xa,
	PERF_DESCRIBE_FASTCHANNEL = 0xb,
	PERF_DOMAIN_NAME_GET = 0xc,
};

enum {
	PERF_FC_LEVEL,
	PERF_FC_LIMIT,
	PERF_FC_MAX,
};

struct scmi_opp {
	u32 perf;
	u32 power;
	u32 trans_latency_us;
	u32 indicative_freq;
	u32 level_index;
	struct hlist_node hash;
};

struct scmi_msg_resp_perf_attributes {
	__le16 num_domains;
	__le16 flags;
#define POWER_SCALE_IN_MILLIWATT(x)	((x) & BIT(0))
#define POWER_SCALE_IN_MICROWATT(x)	((x) & BIT(1))
	__le32 stats_addr_low;
	__le32 stats_addr_high;
	__le32 stats_size;
};

struct scmi_msg_resp_perf_domain_attributes {
	__le32 flags;
#define SUPPORTS_SET_LIMITS(x)		((x) & BIT(31))
#define SUPPORTS_SET_PERF_LVL(x)	((x) & BIT(30))
#define SUPPORTS_PERF_LIMIT_NOTIFY(x)	((x) & BIT(29))
#define SUPPORTS_PERF_LEVEL_NOTIFY(x)	((x) & BIT(28))
#define SUPPORTS_PERF_FASTCHANNELS(x)	((x) & BIT(27))
#define SUPPORTS_EXTENDED_NAMES(x)	((x) & BIT(26))
#define SUPPORTS_LEVEL_INDEXING(x)	((x) & BIT(25))
	__le32 rate_limit_us;
	__le32 sustained_freq_khz;
	__le32 sustained_perf_level;
	    u8 name[SCMI_SHORT_NAME_MAX_SIZE];
};

struct scmi_msg_perf_describe_levels {
	__le32 domain;
	__le32 level_index;
};

struct scmi_perf_set_limits {
	__le32 domain;
	__le32 max_level;
	__le32 min_level;
};

struct scmi_perf_get_limits {
	__le32 max_level;
	__le32 min_level;
};

struct scmi_perf_set_level {
	__le32 domain;
	__le32 level;
};

struct scmi_perf_notify_level_or_limits {
	__le32 domain;
	__le32 notify_enable;
};

struct scmi_perf_limits_notify_payld {
	__le32 agent_id;
	__le32 domain_id;
	__le32 range_max;
	__le32 range_min;
};

struct scmi_perf_level_notify_payld {
	__le32 agent_id;
	__le32 domain_id;
	__le32 performance_level;
};

struct scmi_msg_resp_perf_describe_levels {
	__le16 num_returned;
	__le16 num_remaining;
	struct {
		__le32 perf_val;
		__le32 power;
		__le16 transition_latency_us;
		__le16 reserved;
	} opp[];
};

struct scmi_msg_resp_perf_describe_levels_v4 {
	__le16 num_returned;
	__le16 num_remaining;
	struct {
		__le32 perf_val;
		__le32 power;
		__le16 transition_latency_us;
		__le16 reserved;
		__le32 indicative_freq;
		__le32 level_index;
	} opp[];
};

struct perf_dom_info {
	u32 id;
	bool set_limits;
	bool perf_limit_notify;
	bool perf_level_notify;
	bool perf_fastchannels;
	bool level_indexing_mode;
	u32 opp_count;
	u32 rate_limit_us;
	u32 sustained_freq_khz;
	u32 sustained_perf_level;
	unsigned long mult_factor;
	struct scmi_perf_domain_info info;
	struct scmi_opp opp[MAX_OPPS];
	struct scmi_fc_info *fc_info;
	struct xarray opps_by_idx;
	struct xarray opps_by_lvl;
	DECLARE_HASHTABLE(opps_by_freq, ilog2(MAX_OPPS));
};

#define LOOKUP_BY_FREQ(__htp, __freq)					\
({									\
		/* u32 cast is needed to pick right hash func */	\
		u32 f_ = (u32)(__freq);					\
		struct scmi_opp *_opp;					\
									\
		hash_for_each_possible((__htp), _opp, hash, f_)		\
			if (_opp->indicative_freq == f_)		\
				break;					\
		_opp;							\
})

struct scmi_perf_info {
	u32 version;
	u16 num_domains;
	enum scmi_power_scale power_scale;
	u64 stats_addr;
	u32 stats_size;
	bool notify_lvl_cmd;
	bool notify_lim_cmd;
	struct perf_dom_info *dom_info;
};

static enum scmi_performance_protocol_cmd evt_2_cmd[] = {
	PERF_NOTIFY_LIMITS,
	PERF_NOTIFY_LEVEL,
};

static int scmi_perf_attributes_get(const struct scmi_protocol_handle *ph,
				    struct scmi_perf_info *pi)
{
	int ret;
	struct scmi_xfer *t;
	struct scmi_msg_resp_perf_attributes *attr;

	ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES, 0,
				      sizeof(*attr), &t);
	if (ret)
		return ret;

	attr = t->rx.buf;

	ret = ph->xops->do_xfer(ph, t);
	if (!ret) {
		u16 flags = le16_to_cpu(attr->flags);

		pi->num_domains = le16_to_cpu(attr->num_domains);

		if (POWER_SCALE_IN_MILLIWATT(flags))
			pi->power_scale = SCMI_POWER_MILLIWATTS;
		if (PROTOCOL_REV_MAJOR(pi->version) >= 0x3)
			if (POWER_SCALE_IN_MICROWATT(flags))
				pi->power_scale = SCMI_POWER_MICROWATTS;

		pi->stats_addr = le32_to_cpu(attr->stats_addr_low) |
				(u64)le32_to_cpu(attr->stats_addr_high) << 32;
		pi->stats_size = le32_to_cpu(attr->stats_size);
	}

	ph->xops->xfer_put(ph, t);

	if (!ret) {
		if (!ph->hops->protocol_msg_check(ph, PERF_NOTIFY_LEVEL, NULL))
			pi->notify_lvl_cmd = true;

		if (!ph->hops->protocol_msg_check(ph, PERF_NOTIFY_LIMITS, NULL))
			pi->notify_lim_cmd = true;
	}

	return ret;
}

static void scmi_perf_xa_destroy(void *data)
{
	int domain;
	struct scmi_perf_info *pinfo = data;

	for (domain = 0; domain < pinfo->num_domains; domain++) {
		xa_destroy(&((pinfo->dom_info + domain)->opps_by_idx));
		xa_destroy(&((pinfo->dom_info + domain)->opps_by_lvl));
	}
}

static int
scmi_perf_domain_attributes_get(const struct scmi_protocol_handle *ph,
				struct perf_dom_info *dom_info,
				bool notify_lim_cmd, bool notify_lvl_cmd,
				u32 version)
{
	int ret;
	u32 flags;
	struct scmi_xfer *t;
	struct scmi_msg_resp_perf_domain_attributes *attr;

	ret = ph->xops->xfer_get_init(ph, PERF_DOMAIN_ATTRIBUTES,
				      sizeof(dom_info->id), sizeof(*attr), &t);
	if (ret)
		return ret;

	put_unaligned_le32(dom_info->id, t->tx.buf);
	attr = t->rx.buf;

	ret = ph->xops->do_xfer(ph, t);
	if (!ret) {
		flags = le32_to_cpu(attr->flags);

		dom_info->set_limits = SUPPORTS_SET_LIMITS(flags);
		dom_info->info.set_perf = SUPPORTS_SET_PERF_LVL(flags);
		if (notify_lim_cmd)
			dom_info->perf_limit_notify =
				SUPPORTS_PERF_LIMIT_NOTIFY(flags);
		if (notify_lvl_cmd)
			dom_info->perf_level_notify =
				SUPPORTS_PERF_LEVEL_NOTIFY(flags);
		dom_info->perf_fastchannels = SUPPORTS_PERF_FASTCHANNELS(flags);
		if (PROTOCOL_REV_MAJOR(version) >= 0x4)
			dom_info->level_indexing_mode =
				SUPPORTS_LEVEL_INDEXING(flags);
		dom_info->rate_limit_us = le32_to_cpu(attr->rate_limit_us) &
						GENMASK(19, 0);
		dom_info->sustained_freq_khz =
					le32_to_cpu(attr->sustained_freq_khz);
		dom_info->sustained_perf_level =
					le32_to_cpu(attr->sustained_perf_level);
		/*
		 * sustained_freq_khz = mult_factor * sustained_perf_level
		 * mult_factor must be non zero positive integer(not fraction)
		 */
		if (!dom_info->sustained_freq_khz ||
		    !dom_info->sustained_perf_level ||
		    dom_info->level_indexing_mode) {
			/* CPUFreq converts to kHz, hence default 1000 */
			dom_info->mult_factor =	1000;
		} else {
			dom_info->mult_factor =
					(dom_info->sustained_freq_khz * 1000UL)
					/ dom_info->sustained_perf_level;
			if ((dom_info->sustained_freq_khz * 1000UL) %
			    dom_info->sustained_perf_level)
				dev_warn(ph->dev,
					 "multiplier for domain %d rounded\n",
					 dom_info->id);
		}
		if (!dom_info->mult_factor)
			dev_warn(ph->dev,
			         "Wrong sustained perf/frequency(domain %d)\n",
				 dom_info->id);

		strscpy(dom_info->info.name, attr->name,
			SCMI_SHORT_NAME_MAX_SIZE);
	}

	ph->xops->xfer_put(ph, t);

	/*
	 * If supported overwrite short name with the extended one;
	 * on error just carry on and use already provided short name.
	 */
	if (!ret && PROTOCOL_REV_MAJOR(version) >= 0x3 &&
	    SUPPORTS_EXTENDED_NAMES(flags))
		ph->hops->extended_name_get(ph, PERF_DOMAIN_NAME_GET,
					    dom_info->id, NULL, dom_info->info.name,
					    SCMI_MAX_STR_SIZE);

	xa_init(&dom_info->opps_by_lvl);
	if (dom_info->level_indexing_mode) {
		xa_init(&dom_info->opps_by_idx);
		hash_init(dom_info->opps_by_freq);
	}

	return ret;
}

static int opp_cmp_func(const void *opp1, const void *opp2)
{
	const struct scmi_opp *t1 = opp1, *t2 = opp2;

	return t1->perf - t2->perf;
}

struct scmi_perf_ipriv {
	u32 version;
	struct perf_dom_info *perf_dom;
};

static void iter_perf_levels_prepare_message(void *message,
					     unsigned int desc_index,
					     const void *priv)
{
	struct scmi_msg_perf_describe_levels *msg = message;
	const struct scmi_perf_ipriv *p = priv;

	msg->domain = cpu_to_le32(p->perf_dom->id);
	/* Set the number of OPPs to be skipped/already read */
	msg->level_index = cpu_to_le32(desc_index);
}

static int iter_perf_levels_update_state(struct scmi_iterator_state *st,
					 const void *response, void *priv)
{
	const struct scmi_msg_resp_perf_describe_levels *r = response;

	st->num_returned = le16_to_cpu(r->num_returned);
	st->num_remaining = le16_to_cpu(r->num_remaining);

	return 0;
}

static inline void
process_response_opp(struct device *dev, struct perf_dom_info *dom,
		     struct scmi_opp *opp, unsigned int loop_idx,
		     const struct scmi_msg_resp_perf_describe_levels *r)
{
	int ret;

	opp->perf = le32_to_cpu(r->opp[loop_idx].perf_val);
	opp->power = le32_to_cpu(r->opp[loop_idx].power);
	opp->trans_latency_us =
		le16_to_cpu(r->opp[loop_idx].transition_latency_us);

	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
	if (ret)
		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
			 opp->perf, dom->info.name, ret);
}

static inline void
process_response_opp_v4(struct device *dev, struct perf_dom_info *dom,
			struct scmi_opp *opp, unsigned int loop_idx,
			const struct scmi_msg_resp_perf_describe_levels_v4 *r)
{
	int ret;

	opp->perf = le32_to_cpu(r->opp[loop_idx].perf_val);
	opp->power = le32_to_cpu(r->opp[loop_idx].power);
	opp->trans_latency_us =
		le16_to_cpu(r->opp[loop_idx].transition_latency_us);

	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
	if (ret)
		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
			 opp->perf, dom->info.name, ret);

	/* Note that PERF v4 reports always five 32-bit words */
	opp->indicative_freq = le32_to_cpu(r->opp[loop_idx].indicative_freq);
	if (dom->level_indexing_mode) {
		opp->level_index = le32_to_cpu(r->opp[loop_idx].level_index);

		ret = xa_insert(&dom->opps_by_idx, opp->level_index, opp,
				GFP_KERNEL);
		if (ret)
			dev_warn(dev,
				 "Failed to add opps_by_idx at %d for %s - ret:%d\n",
				 opp->level_index, dom->info.name, ret);

		hash_add(dom->opps_by_freq, &opp->hash, opp->indicative_freq);
	}
}

static int
iter_perf_levels_process_response(const struct scmi_protocol_handle *ph,
				  const void *response,
				  struct scmi_iterator_state *st, void *priv)
{
	struct scmi_opp *opp;
	struct scmi_perf_ipriv *p = priv;

	opp = &p->perf_dom->opp[st->desc_index + st->loop_idx];
	if (PROTOCOL_REV_MAJOR(p->version) <= 0x3)
		process_response_opp(ph->dev, p->perf_dom, opp, st->loop_idx,
				     response);
	else
		process_response_opp_v4(ph->dev, p->perf_dom, opp, st->loop_idx,
					response);
	p->perf_dom->opp_count++;

	dev_dbg(ph->dev, "Level %d Power %d Latency %dus Ifreq %d Index %d\n",
		opp->perf, opp->power, opp->trans_latency_us,
		opp->indicative_freq, opp->level_index);

	return 0;
}

static int
scmi_perf_describe_levels_get(const struct scmi_protocol_handle *ph,
			      struct perf_dom_info *perf_dom, u32 version)
{
	int ret;
	void *iter;
	struct scmi_iterator_ops ops = {
		.prepare_message = iter_perf_levels_prepare_message,
		.update_state = iter_perf_levels_update_state,
		.process_response = iter_perf_levels_process_response,
	};
	struct scmi_perf_ipriv ppriv = {
		.version = version,
		.perf_dom = perf_dom,
	};

	iter = ph->hops->iter_response_init(ph, &ops, MAX_OPPS,
					    PERF_DESCRIBE_LEVELS,
					    sizeof(struct scmi_msg_perf_describe_levels),
					    &ppriv);
	if (IS_ERR(iter))
		return PTR_ERR(iter);

	ret = ph->hops->iter_response_run(iter);
	if (ret)
		return ret;

	if (perf_dom->opp_count)
		sort(perf_dom->opp, perf_dom->opp_count,
		     sizeof(struct scmi_opp), opp_cmp_func, NULL);

	return ret;
}

static int scmi_perf_num_domains_get(const struct scmi_protocol_handle *ph)
{
	struct scmi_perf_info *pi = ph->get_priv(ph);

	return pi->num_domains;
}

static inline struct perf_dom_info *
scmi_perf_domain_lookup(const struct scmi_protocol_handle *ph, u32 domain)
{
	struct scmi_perf_info *pi = ph->get_priv(ph);

	if (domain >= pi->num_domains)
		return ERR_PTR(-EINVAL);

	return pi->dom_info + domain;
}

static const struct scmi_perf_domain_info *
scmi_perf_info_get(const struct scmi_protocol_handle *ph, u32 domain)
{
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return ERR_PTR(-EINVAL);

	return &dom->info;
}

static int scmi_perf_msg_limits_set(const struct scmi_protocol_handle *ph,
				    u32 domain, u32 max_perf, u32 min_perf)
{
	int ret;
	struct scmi_xfer *t;
	struct scmi_perf_set_limits *limits;

	ret = ph->xops->xfer_get_init(ph, PERF_LIMITS_SET,
				      sizeof(*limits), 0, &t);
	if (ret)
		return ret;

	limits = t->tx.buf;
	limits->domain = cpu_to_le32(domain);
	limits->max_level = cpu_to_le32(max_perf);
	limits->min_level = cpu_to_le32(min_perf);

	ret = ph->xops->do_xfer(ph, t);

	ph->xops->xfer_put(ph, t);
	return ret;
}

static int __scmi_perf_limits_set(const struct scmi_protocol_handle *ph,
				  struct perf_dom_info *dom, u32 max_perf,
				  u32 min_perf)
{
	if (dom->fc_info && dom->fc_info[PERF_FC_LIMIT].set_addr) {
		struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LIMIT];

		trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LIMITS_SET,
				   dom->id, min_perf, max_perf);
		iowrite32(max_perf, fci->set_addr);
		iowrite32(min_perf, fci->set_addr + 4);
		ph->hops->fastchannel_db_ring(fci->set_db);
		return 0;
	}

	return scmi_perf_msg_limits_set(ph, dom->id, max_perf, min_perf);
}

static int scmi_perf_limits_set(const struct scmi_protocol_handle *ph,
				u32 domain, u32 max_perf, u32 min_perf)
{
	struct scmi_perf_info *pi = ph->get_priv(ph);
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	if (!dom->set_limits)
		return -EOPNOTSUPP;

	if (PROTOCOL_REV_MAJOR(pi->version) >= 0x3 && !max_perf && !min_perf)
		return -EINVAL;

	if (dom->level_indexing_mode) {
		struct scmi_opp *opp;

		if (min_perf) {
			opp = xa_load(&dom->opps_by_lvl, min_perf);
			if (!opp)
				return -EIO;

			min_perf = opp->level_index;
		}

		if (max_perf) {
			opp = xa_load(&dom->opps_by_lvl, max_perf);
			if (!opp)
				return -EIO;

			max_perf = opp->level_index;
		}
	}

	return __scmi_perf_limits_set(ph, dom, max_perf, min_perf);
}

static int scmi_perf_msg_limits_get(const struct scmi_protocol_handle *ph,
				    u32 domain, u32 *max_perf, u32 *min_perf)
{
	int ret;
	struct scmi_xfer *t;
	struct scmi_perf_get_limits *limits;

	ret = ph->xops->xfer_get_init(ph, PERF_LIMITS_GET,
				      sizeof(__le32), 0, &t);
	if (ret)
		return ret;

	put_unaligned_le32(domain, t->tx.buf);

	ret = ph->xops->do_xfer(ph, t);
	if (!ret) {
		limits = t->rx.buf;

		*max_perf = le32_to_cpu(limits->max_level);
		*min_perf = le32_to_cpu(limits->min_level);
	}

	ph->xops->xfer_put(ph, t);
	return ret;
}

static int __scmi_perf_limits_get(const struct scmi_protocol_handle *ph,
				  struct perf_dom_info *dom, u32 *max_perf,
				  u32 *min_perf)
{
	if (dom->fc_info && dom->fc_info[PERF_FC_LIMIT].get_addr) {
		struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LIMIT];

		*max_perf = ioread32(fci->get_addr);
		*min_perf = ioread32(fci->get_addr + 4);
		trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LIMITS_GET,
				   dom->id, *min_perf, *max_perf);
		return 0;
	}

	return scmi_perf_msg_limits_get(ph, dom->id, max_perf, min_perf);
}

static int scmi_perf_limits_get(const struct scmi_protocol_handle *ph,
				u32 domain, u32 *max_perf, u32 *min_perf)
{
	int ret;
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	ret = __scmi_perf_limits_get(ph, dom, max_perf, min_perf);
	if (ret)
		return ret;

	if (dom->level_indexing_mode) {
		struct scmi_opp *opp;

		opp = xa_load(&dom->opps_by_idx, *min_perf);
		if (!opp)
			return -EIO;

		*min_perf = opp->perf;

		opp = xa_load(&dom->opps_by_idx, *max_perf);
		if (!opp)
			return -EIO;

		*max_perf = opp->perf;
	}

	return 0;
}

static int scmi_perf_msg_level_set(const struct scmi_protocol_handle *ph,
				   u32 domain, u32 level, bool poll)
{
	int ret;
	struct scmi_xfer *t;
	struct scmi_perf_set_level *lvl;

	ret = ph->xops->xfer_get_init(ph, PERF_LEVEL_SET, sizeof(*lvl), 0, &t);
	if (ret)
		return ret;

	t->hdr.poll_completion = poll;
	lvl = t->tx.buf;
	lvl->domain = cpu_to_le32(domain);
	lvl->level = cpu_to_le32(level);

	ret = ph->xops->do_xfer(ph, t);

	ph->xops->xfer_put(ph, t);
	return ret;
}

static int __scmi_perf_level_set(const struct scmi_protocol_handle *ph,
				 struct perf_dom_info *dom, u32 level,
				 bool poll)
{
	if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL].set_addr) {
		struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LEVEL];

		trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LEVEL_SET,
				   dom->id, level, 0);
		iowrite32(level, fci->set_addr);
		ph->hops->fastchannel_db_ring(fci->set_db);
		return 0;
	}

	return scmi_perf_msg_level_set(ph, dom->id, level, poll);
}

static int scmi_perf_level_set(const struct scmi_protocol_handle *ph,
			       u32 domain, u32 level, bool poll)
{
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	if (!dom->info.set_perf)
		return -EOPNOTSUPP;

	if (dom->level_indexing_mode) {
		struct scmi_opp *opp;

		opp = xa_load(&dom->opps_by_lvl, level);
		if (!opp)
			return -EIO;

		level = opp->level_index;
	}

	return __scmi_perf_level_set(ph, dom, level, poll);
}

static int scmi_perf_msg_level_get(const struct scmi_protocol_handle *ph,
				   u32 domain, u32 *level, bool poll)
{
	int ret;
	struct scmi_xfer *t;

	ret = ph->xops->xfer_get_init(ph, PERF_LEVEL_GET,
				     sizeof(u32), sizeof(u32), &t);
	if (ret)
		return ret;

	t->hdr.poll_completion = poll;
	put_unaligned_le32(domain, t->tx.buf);

	ret = ph->xops->do_xfer(ph, t);
	if (!ret)
		*level = get_unaligned_le32(t->rx.buf);

	ph->xops->xfer_put(ph, t);
	return ret;
}

static int __scmi_perf_level_get(const struct scmi_protocol_handle *ph,
				 struct perf_dom_info *dom, u32 *level,
				 bool poll)
{
	if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL].get_addr) {
		*level = ioread32(dom->fc_info[PERF_FC_LEVEL].get_addr);
		trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LEVEL_GET,
				   dom->id, *level, 0);
		return 0;
	}

	return scmi_perf_msg_level_get(ph, dom->id, level, poll);
}

static int scmi_perf_level_get(const struct scmi_protocol_handle *ph,
			       u32 domain, u32 *level, bool poll)
{
	int ret;
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	ret = __scmi_perf_level_get(ph, dom, level, poll);
	if (ret)
		return ret;

	if (dom->level_indexing_mode) {
		struct scmi_opp *opp;

		opp = xa_load(&dom->opps_by_idx, *level);
		if (!opp)
			return -EIO;

		*level = opp->perf;
	}

	return 0;
}

static int scmi_perf_level_limits_notify(const struct scmi_protocol_handle *ph,
					 u32 domain, int message_id,
					 bool enable)
{
	int ret;
	struct scmi_xfer *t;
	struct scmi_perf_notify_level_or_limits *notify;

	ret = ph->xops->xfer_get_init(ph, message_id, sizeof(*notify), 0, &t);
	if (ret)
		return ret;

	notify = t->tx.buf;
	notify->domain = cpu_to_le32(domain);
	notify->notify_enable = enable ? cpu_to_le32(BIT(0)) : 0;

	ret = ph->xops->do_xfer(ph, t);

	ph->xops->xfer_put(ph, t);
	return ret;
}

static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph,
				     struct perf_dom_info *dom)
{
	struct scmi_fc_info *fc;

	fc = devm_kcalloc(ph->dev, PERF_FC_MAX, sizeof(*fc), GFP_KERNEL);
	if (!fc)
		return;

	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
				   PERF_LEVEL_GET, 4, dom->id,
				   &fc[PERF_FC_LEVEL].get_addr, NULL,
				   &fc[PERF_FC_LEVEL].rate_limit);

	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
				   PERF_LIMITS_GET, 8, dom->id,
				   &fc[PERF_FC_LIMIT].get_addr, NULL,
				   &fc[PERF_FC_LIMIT].rate_limit);

	if (dom->info.set_perf)
		ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
					   PERF_LEVEL_SET, 4, dom->id,
					   &fc[PERF_FC_LEVEL].set_addr,
					   &fc[PERF_FC_LEVEL].set_db,
					   &fc[PERF_FC_LEVEL].rate_limit);

	if (dom->set_limits)
		ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
					   PERF_LIMITS_SET, 8, dom->id,
					   &fc[PERF_FC_LIMIT].set_addr,
					   &fc[PERF_FC_LIMIT].set_db,
					   &fc[PERF_FC_LIMIT].rate_limit);

	dom->fc_info = fc;
}

static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
				     struct device *dev, u32 domain)
{
	int idx, ret;
	unsigned long freq;
	struct dev_pm_opp_data data = {};
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	for (idx = 0; idx < dom->opp_count; idx++) {
		if (!dom->level_indexing_mode)
			freq = dom->opp[idx].perf * dom->mult_factor;
		else
			freq = dom->opp[idx].indicative_freq * dom->mult_factor;

		/* All OPPs above the sustained frequency are treated as turbo */
		data.turbo = freq > dom->sustained_freq_khz * 1000;

		data.level = dom->opp[idx].perf;
		data.freq = freq;

		ret = dev_pm_opp_add_dynamic(dev, &data);
		if (ret) {
			dev_warn(dev, "[%d][%s]: Failed to add OPP[%d] %lu\n",
				 domain, dom->info.name, idx, freq);
			dev_pm_opp_remove_all_dynamic(dev);
			return ret;
		}

		dev_dbg(dev, "[%d][%s]:: Registered OPP[%d] %lu\n",
			domain, dom->info.name, idx, freq);
	}
	return 0;
}

static int
scmi_dvfs_transition_latency_get(const struct scmi_protocol_handle *ph,
				 u32 domain)
{
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	/* uS to nS */
	return dom->opp[dom->opp_count - 1].trans_latency_us * 1000;
}

static int
scmi_dvfs_rate_limit_get(const struct scmi_protocol_handle *ph,
			 u32 domain, u32 *rate_limit)
{
	struct perf_dom_info *dom;

	if (!rate_limit)
		return -EINVAL;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	*rate_limit = dom->rate_limit_us;
	return 0;
}

static int scmi_dvfs_freq_set(const struct scmi_protocol_handle *ph, u32 domain,
			      unsigned long freq, bool poll)
{
	unsigned int level;
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	if (!dom->level_indexing_mode) {
		level = freq / dom->mult_factor;
	} else {
		struct scmi_opp *opp;

		opp = LOOKUP_BY_FREQ(dom->opps_by_freq,
				     freq / dom->mult_factor);
		if (!opp)
			return -EIO;

		level = opp->level_index;
	}

	return __scmi_perf_level_set(ph, dom, level, poll);
}

static int scmi_dvfs_freq_get(const struct scmi_protocol_handle *ph, u32 domain,
			      unsigned long *freq, bool poll)
{
	int ret;
	u32 level;
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	ret = __scmi_perf_level_get(ph, dom, &level, poll);
	if (ret)
		return ret;

	if (!dom->level_indexing_mode) {
		*freq = level * dom->mult_factor;
	} else {
		struct scmi_opp *opp;

		opp = xa_load(&dom->opps_by_idx, level);
		if (!opp)
			return -EIO;

		*freq = opp->indicative_freq * dom->mult_factor;
	}

	return ret;
}

static int scmi_dvfs_est_power_get(const struct scmi_protocol_handle *ph,
				   u32 domain, unsigned long *freq,
				   unsigned long *power)
{
	struct perf_dom_info *dom;
	unsigned long opp_freq;
	int idx, ret = -EINVAL;
	struct scmi_opp *opp;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) {
		if (!dom->level_indexing_mode)
			opp_freq = opp->perf * dom->mult_factor;
		else
			opp_freq = opp->indicative_freq * dom->mult_factor;

		if (opp_freq < *freq)
			continue;

		*freq = opp_freq;
		*power = opp->power;
		ret = 0;
		break;
	}

	return ret;
}

static bool scmi_fast_switch_possible(const struct scmi_protocol_handle *ph,
				      u32 domain)
{
	struct perf_dom_info *dom;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return false;

	return dom->fc_info && dom->fc_info[PERF_FC_LEVEL].set_addr;
}

static int scmi_fast_switch_rate_limit(const struct scmi_protocol_handle *ph,
				       u32 domain, u32 *rate_limit)
{
	struct perf_dom_info *dom;

	if (!rate_limit)
		return -EINVAL;

	dom = scmi_perf_domain_lookup(ph, domain);
	if (IS_ERR(dom))
		return PTR_ERR(dom);

	if (!dom->fc_info)
		return -EINVAL;

	*rate_limit = dom->fc_info[PERF_FC_LEVEL].rate_limit;
	return 0;
}

static enum scmi_power_scale
scmi_power_scale_get(const struct scmi_protocol_handle *ph)
{
	struct scmi_perf_info *pi = ph->get_priv(ph);

	return pi->power_scale;
}

static const struct scmi_perf_proto_ops perf_proto_ops = {
	.num_domains_get = scmi_perf_num_domains_get,
	.info_get = scmi_perf_info_get,
	.limits_set = scmi_perf_limits_set,
	.limits_get = scmi_perf_limits_get,
	.level_set = scmi_perf_level_set,
	.level_get = scmi_perf_level_get,
	.transition_latency_get = scmi_dvfs_transition_latency_get,
	.rate_limit_get = scmi_dvfs_rate_limit_get,
	.device_opps_add = scmi_dvfs_device_opps_add,
	.freq_set = scmi_dvfs_freq_set,
	.freq_get = scmi_dvfs_freq_get,
	.est_power_get = scmi_dvfs_est_power_get,
	.fast_switch_possible = scmi_fast_switch_possible,
	.fast_switch_rate_limit = scmi_fast_switch_rate_limit,
	.power_scale_get = scmi_power_scale_get,
};

static bool scmi_perf_notify_supported(const struct scmi_protocol_handle *ph,
				       u8 evt_id, u32 src_id)
{
	bool supported;
	struct perf_dom_info *dom;

	if (evt_id >= ARRAY_SIZE(evt_2_cmd))
		return false;

	dom = scmi_perf_domain_lookup(ph, src_id);
	if (IS_ERR(dom))
		return false;

	if (evt_id == SCMI_EVENT_PERFORMANCE_LIMITS_CHANGED)
		supported = dom->perf_limit_notify;
	else
		supported = dom->perf_level_notify;

	return supported;
}

static int scmi_perf_set_notify_enabled(const struct scmi_protocol_handle *ph,
					u8 evt_id, u32 src_id, bool enable)
{
	int ret, cmd_id;

	if (evt_id >= ARRAY_SIZE(evt_2_cmd))
		return -EINVAL;

	cmd_id = evt_2_cmd[evt_id];
	ret = scmi_perf_level_limits_notify(ph, src_id, cmd_id, enable);
	if (ret)
		pr_debug("FAIL_ENABLED - evt[%X] dom[%d] - ret:%d\n",
			 evt_id, src_id, ret);

	return ret;
}

static int
scmi_perf_xlate_opp_to_freq(struct perf_dom_info *dom,
			    unsigned int index, unsigned long *freq)
{
	struct scmi_opp *opp;

	if (!dom || !freq)
		return -EINVAL;

	if (!dom->level_indexing_mode) {
		opp = xa_load(&dom->opps_by_lvl, index);
		if (!opp)
			return -ENODEV;

		*freq = opp->perf * dom->mult_factor;
	} else {
		opp = xa_load(&dom->opps_by_idx, index);
		if (!opp)
			return -ENODEV;

		*freq = opp->indicative_freq * dom->mult_factor;
	}

	return 0;
}

static void *scmi_perf_fill_custom_report(const struct scmi_protocol_handle *ph,
					  u8 evt_id, ktime_t timestamp,
					  const void *payld, size_t payld_sz,
					  void *report, u32 *src_id)
{
	int ret;
	void *rep = NULL;
	struct perf_dom_info *dom;

	switch (evt_id) {
	case SCMI_EVENT_PERFORMANCE_LIMITS_CHANGED:
	{
		const struct scmi_perf_limits_notify_payld *p = payld;
		struct scmi_perf_limits_report *r = report;
		unsigned long freq_min, freq_max;

		if (sizeof(*p) != payld_sz)
			break;

		r->timestamp = timestamp;
		r->agent_id = le32_to_cpu(p->agent_id);
		r->domain_id = le32_to_cpu(p->domain_id);
		r->range_max = le32_to_cpu(p->range_max);
		r->range_min = le32_to_cpu(p->range_min);
		/* Check if the reported domain exist at all */
		dom = scmi_perf_domain_lookup(ph, r->domain_id);
		if (IS_ERR(dom))
			break;
		/*
		 * Event will be reported from this point on...
		 * ...even if, later, xlated frequencies were not retrieved.
		 */
		*src_id = r->domain_id;
		rep = r;

		ret = scmi_perf_xlate_opp_to_freq(dom, r->range_max, &freq_max);
		if (ret)
			break;

		ret = scmi_perf_xlate_opp_to_freq(dom, r->range_min, &freq_min);
		if (ret)
			break;

		/* Report translated freqs ONLY if both available */
		r->range_max_freq = freq_max;
		r->range_min_freq = freq_min;

		break;
	}
	case SCMI_EVENT_PERFORMANCE_LEVEL_CHANGED:
	{
		const struct scmi_perf_level_notify_payld *p = payld;
		struct scmi_perf_level_report *r = report;
		unsigned long freq;

		if (sizeof(*p) != payld_sz)
			break;

		r->timestamp = timestamp;
		r->agent_id = le32_to_cpu(p->agent_id);
		r->domain_id = le32_to_cpu(p->domain_id);
		/* Report translated freqs ONLY if available */
		r->performance_level = le32_to_cpu(p->performance_level);
		/* Check if the reported domain exist at all */
		dom = scmi_perf_domain_lookup(ph, r->domain_id);
		if (IS_ERR(dom))
			break;
		/*
		 * Event will be reported from this point on...
		 * ...even if, later, xlated frequencies were not retrieved.
		 */
		*src_id = r->domain_id;
		rep = r;

		/* Report translated freqs ONLY if available */
		ret = scmi_perf_xlate_opp_to_freq(dom, r->performance_level,
						  &freq);
		if (ret)
			break;

		r->performance_level_freq = freq;

		break;
	}
	default:
		break;
	}

	return rep;
}

static int scmi_perf_get_num_sources(const struct scmi_protocol_handle *ph)
{
	struct scmi_perf_info *pi = ph->get_priv(ph);

	if (!pi)
		return -EINVAL;

	return pi->num_domains;
}

static const struct scmi_event perf_events[] = {
	{
		.id = SCMI_EVENT_PERFORMANCE_LIMITS_CHANGED,
		.max_payld_sz = sizeof(struct scmi_perf_limits_notify_payld),
		.max_report_sz = sizeof(struct scmi_perf_limits_report),
	},
	{
		.id = SCMI_EVENT_PERFORMANCE_LEVEL_CHANGED,
		.max_payld_sz = sizeof(struct scmi_perf_level_notify_payld),
		.max_report_sz = sizeof(struct scmi_perf_level_report),
	},
};

static const struct scmi_event_ops perf_event_ops = {
	.is_notify_supported = scmi_perf_notify_supported,
	.get_num_sources = scmi_perf_get_num_sources,
	.set_notify_enabled = scmi_perf_set_notify_enabled,
	.fill_custom_report = scmi_perf_fill_custom_report,
};

static const struct scmi_protocol_events perf_protocol_events = {
	.queue_sz = SCMI_PROTO_QUEUE_SZ,
	.ops = &perf_event_ops,
	.evts = perf_events,
	.num_events = ARRAY_SIZE(perf_events),
};

static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph)
{
	int domain, ret;
	u32 version;
	struct scmi_perf_info *pinfo;

	ret = ph->xops->version_get(ph, &version);
	if (ret)
		return ret;

	dev_dbg(ph->dev, "Performance Version %d.%d\n",
		PROTOCOL_REV_MAJOR(version), PROTOCOL_REV_MINOR(version));

	pinfo = devm_kzalloc(ph->dev, sizeof(*pinfo), GFP_KERNEL);
	if (!pinfo)
		return -ENOMEM;

	pinfo->version = version;

	ret = scmi_perf_attributes_get(ph, pinfo);
	if (ret)
		return ret;

	pinfo->dom_info = devm_kcalloc(ph->dev, pinfo->num_domains,
				       sizeof(*pinfo->dom_info), GFP_KERNEL);
	if (!pinfo->dom_info)
		return -ENOMEM;

	for (domain = 0; domain < pinfo->num_domains; domain++) {
		struct perf_dom_info *dom = pinfo->dom_info + domain;

		dom->id = domain;
		scmi_perf_domain_attributes_get(ph, dom, pinfo->notify_lim_cmd,
						pinfo->notify_lvl_cmd, version);
		scmi_perf_describe_levels_get(ph, dom, version);

		if (dom->perf_fastchannels)
			scmi_perf_domain_init_fc(ph, dom);
	}

	ret = devm_add_action_or_reset(ph->dev, scmi_perf_xa_destroy, pinfo);
	if (ret)
		return ret;

	return ph->set_priv(ph, pinfo, version);
}

static const struct scmi_protocol scmi_perf = {
	.id = SCMI_PROTOCOL_PERF,
	.owner = THIS_MODULE,
	.instance_init = &scmi_perf_protocol_init,
	.ops = &perf_proto_ops,
	.events = &perf_protocol_events,
	.supported_version = SCMI_PROTOCOL_SUPPORTED_VERSION,
};

DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(perf, scmi_perf)
