linux/drivers/platform/x86/intel/telemetry/pltdrv.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Intel SOC Telemetry Platform Driver: Currently supports APL
 * Copyright (c) 2015, Intel Corporation.
 * All Rights Reserved.
 *
 * This file provides the platform specific telemetry implementation for APL.
 * It used the PUNIT and PMC IPC interfaces for configuring the counters.
 * The accumulated results are fetched from SRAM.
 */

#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>

#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
#include <asm/intel_punit_ipc.h>
#include <asm/intel_telemetry.h>

#define DRIVER_NAME
#define DRIVER_VERSION

#define TELEM_TRC_VERBOSITY_MASK

#define TELEM_MIN_PERIOD(x)
#define TELEM_MAX_PERIOD(x)
#define TELEM_SAMPLE_PERIOD_INVALID(x)
#define TELEM_CLEAR_SAMPLE_PERIOD(x)

#define TELEM_SAMPLING_DEFAULT_PERIOD

#define TELEM_MAX_EVENTS_SRAM
#define TELEM_SSRAM_STARTTIME_OFFSET
#define TELEM_SSRAM_EVTLOG_OFFSET

#define IOSS_TELEM
#define IOSS_TELEM_EVENT_READ
#define IOSS_TELEM_EVENT_WRITE
#define IOSS_TELEM_INFO_READ
#define IOSS_TELEM_TRACE_CTL_READ
#define IOSS_TELEM_TRACE_CTL_WRITE
#define IOSS_TELEM_EVENT_CTL_READ
#define IOSS_TELEM_EVENT_CTL_WRITE
#define IOSS_TELEM_EVT_WRITE_SIZE

#define TELEM_INFO_SRAMEVTS_MASK
#define TELEM_INFO_SRAMEVTS_SHIFT
#define TELEM_SSRAM_READ_TIMEOUT

#define TELEM_INFO_NENABLES_MASK
#define TELEM_EVENT_ENABLE

#define TELEM_MASK_BIT
#define TELEM_MASK_BYTE
#define BYTES_PER_LONG
#define TELEM_MASK_PCS_STATE

#define TELEM_DISABLE(x)
#define TELEM_CLEAR_EVENTS(x)
#define TELEM_ENABLE_SRAM_EVT_TRACE(x)
#define TELEM_ENABLE_PERIODIC(x)
#define TELEM_EXTRACT_VERBOSITY(x, y)
#define TELEM_CLEAR_VERBOSITY_BITS(x)
#define TELEM_SET_VERBOSITY_BITS(x, y)

enum telemetry_action {};

struct telem_ssram_region {};

static struct telemetry_plt_config *telm_conf;

/*
 * The following counters are programmed by default during setup.
 * Only 20 allocated to kernel driver
 */
static struct telemetry_evtmap
	telemetry_apl_ioss_default_events[TELEM_MAX_OS_ALLOCATED_EVENTS] =;


static struct telemetry_evtmap
	telemetry_apl_pss_default_events[TELEM_MAX_OS_ALLOCATED_EVENTS] =;

static struct telemetry_evtmap
	telemetry_glk_pss_default_events[TELEM_MAX_OS_ALLOCATED_EVENTS] =;

/* APL specific Data */
static struct telemetry_plt_config telem_apl_config =;

/* GLK specific Data */
static struct telemetry_plt_config telem_glk_config =;

static const struct x86_cpu_id telemetry_cpu_ids[] =;

MODULE_DEVICE_TABLE(x86cpu, telemetry_cpu_ids);

static inline int telem_get_unitconfig(enum telemetry_unit telem_unit,
				     struct telemetry_unit_config **unit_config)
{}

static int telemetry_check_evtid(enum telemetry_unit telem_unit,
				 u32 *evtmap, u8 len,
				 enum telemetry_action action)
{}


static inline int telemetry_plt_config_ioss_event(u32 evt_id, int index)
{}

static inline int telemetry_plt_config_pss_event(u32 evt_id, int index)
{}

static int telemetry_setup_iossevtconfig(struct telemetry_evtconfig evtconfig,
					 enum telemetry_action action)
{}


static int telemetry_setup_pssevtconfig(struct telemetry_evtconfig evtconfig,
					enum telemetry_action action)
{}

static int telemetry_setup_evtconfig(struct telemetry_evtconfig pss_evtconfig,
				     struct telemetry_evtconfig ioss_evtconfig,
				     enum telemetry_action action)
{}

static int telemetry_setup(struct platform_device *pdev)
{}

static int telemetry_plt_update_events(struct telemetry_evtconfig pss_evtconfig,
				struct telemetry_evtconfig ioss_evtconfig)
{}


static int telemetry_plt_set_sampling_period(u8 pss_period, u8 ioss_period)
{}


static int telemetry_plt_get_sampling_period(u8 *pss_min_period,
					     u8 *pss_max_period,
					     u8 *ioss_min_period,
					     u8 *ioss_max_period)
{}


static int telemetry_plt_reset_events(void)
{}


static int telemetry_plt_get_eventconfig(struct telemetry_evtconfig *pss_config,
					struct telemetry_evtconfig *ioss_config,
					int pss_len, int ioss_len)
{}


static int telemetry_plt_add_events(u8 num_pss_evts, u8 num_ioss_evts,
				    u32 *pss_evtmap, u32 *ioss_evtmap)
{}

static int telem_evtlog_read(enum telemetry_unit telem_unit,
			     struct telem_ssram_region *ssram_region, u8 len)
{}

static int telemetry_plt_raw_read_eventlog(enum telemetry_unit telem_unit,
					   struct telemetry_evtlog *evtlog,
					   int len, int log_all_evts)
{}

static int telemetry_plt_read_eventlog(enum telemetry_unit telem_unit,
		struct telemetry_evtlog *evtlog, int len, int log_all_evts)
{}

static int telemetry_plt_get_trace_verbosity(enum telemetry_unit telem_unit,
					     u32 *verbosity)
{}

static int telemetry_plt_set_trace_verbosity(enum telemetry_unit telem_unit,
					     u32 verbosity)
{}

static const struct telemetry_core_ops telm_pltops =;

static int telemetry_pltdrv_probe(struct platform_device *pdev)
{}

static void telemetry_pltdrv_remove(struct platform_device *pdev)
{}

static struct platform_driver telemetry_soc_driver =;

static int __init telemetry_module_init(void)
{}

static void __exit telemetry_module_exit(void)
{}

device_initcall(telemetry_module_init);
module_exit(telemetry_module_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_VERSION();
MODULE_LICENSE();