/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * GXP MCU telemetry support
 *
 * Copyright (C) 2022 Google LLC
 */

#ifndef __GXP_MCU_TELEMETRY_H__
#define __GXP_MCU_TELEMETRY_H__

#include <linux/workqueue.h>

#include <gcip/gcip-telemetry.h>

#include "gxp-internal.h"

/* Buffer size must be a power of 2 */
#define GXP_MCU_TELEMETRY_LOG_BUFFER_SIZE (16 * 4096)
#define GXP_MCU_TELEMETRY_TRACE_BUFFER_SIZE (64 * 4096)

struct gxp_mcu;

struct gxp_mcu_telemetry_ctx {
	struct gcip_telemetry log;
	struct gxp_mapped_resource log_mem;
	struct gcip_telemetry trace;
	struct gxp_mapped_resource trace_mem;
};

/*
 * Allocates resources needed for @mcu->telemetry.
 *
 * Returns 0 on success, or a negative errno on error.
 */
int gxp_mcu_telemetry_init(struct gxp_mcu *mcu);

/*
 * Disable the MCU telemetry if enabled, release resources allocated in init().
 */
void gxp_mcu_telemetry_exit(struct gxp_mcu *mcu);

/* Interrupt handler. */
void gxp_mcu_telemetry_irq_handler(struct gxp_mcu *mcu);

/*
 * Sends the KCI commands about MCU telemetry buffers to the device.
 *
 * Returns the code of KCI response, or a negative errno on error.
 */
int gxp_mcu_telemetry_kci(struct gxp_mcu *mcu);

/*
 * Sets the eventfd to notify the runtime when an IRQ is sent from the device.
 *
 * Returns 0 on success, or a negative errno on error.
 */
int gxp_mcu_telemetry_register_eventfd(struct gxp_mcu *mcu,
				       enum gcip_telemetry_type type,
				       u32 eventfd);
/* Removes previously set event. */
int gxp_mcu_telemetry_unregister_eventfd(struct gxp_mcu *mcu,
					 enum gcip_telemetry_type type);

/* Maps MCU telemetry buffer into user space. */
int gxp_mcu_telemetry_mmap_buffer(struct gxp_mcu *mcu,
				  enum gcip_telemetry_type type,
				  struct vm_area_struct *vma);

#endif /* __GXP_MCU_TELEMETRY_H__ */
