linux/drivers/memory/bt1-l2-ctl.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
 *
 * Authors:
 *   Serge Semin <[email protected]>
 *
 * Baikal-T1 CM2 L2-cache Control Block driver.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/bitfield.h>
#include <linux/types.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
#include <linux/sysfs.h>
#include <linux/of.h>

#define L2_CTL_REG
#define L2_CTL_DATA_STALL_FLD
#define L2_CTL_DATA_STALL_MASK
#define L2_CTL_TAG_STALL_FLD
#define L2_CTL_TAG_STALL_MASK
#define L2_CTL_WS_STALL_FLD
#define L2_CTL_WS_STALL_MASK
#define L2_CTL_SET_CLKRATIO
#define L2_CTL_CLKRATIO_LOCK

#define L2_CTL_STALL_MIN
#define L2_CTL_STALL_MAX
#define L2_CTL_STALL_SET_DELAY_US
#define L2_CTL_STALL_SET_TOUT_US

/*
 * struct l2_ctl - Baikal-T1 L2 Control block private data.
 * @dev: Pointer to the device structure.
 * @sys_regs: Baikal-T1 System Controller registers map.
 */
struct l2_ctl {};

/*
 * enum l2_ctl_stall - Baikal-T1 L2-cache-RAM stall identifier.
 * @L2_WSSTALL: Way-select latency.
 * @L2_TAGSTALL: Tag latency.
 * @L2_DATASTALL: Data latency.
 */
enum l2_ctl_stall {};

/*
 * struct l2_ctl_device_attribute - Baikal-T1 L2-cache device attribute.
 * @dev_attr: Actual sysfs device attribute.
 * @id: L2-cache stall field identifier.
 */
struct l2_ctl_device_attribute {};

#define to_l2_ctl_dev_attr(_dev_attr)

#define L2_CTL_ATTR_RW(_name, _prefix, _id)

static int l2_ctl_get_latency(struct l2_ctl *l2, enum l2_ctl_stall id, u32 *val)
{}

static int l2_ctl_set_latency(struct l2_ctl *l2, enum l2_ctl_stall id, u32 val)
{}

static void l2_ctl_clear_data(void *data)
{}

static struct l2_ctl *l2_ctl_create_data(struct platform_device *pdev)
{}

static int l2_ctl_find_sys_regs(struct l2_ctl *l2)
{}

static int l2_ctl_of_parse_property(struct l2_ctl *l2, enum l2_ctl_stall id,
				    const char *propname)
{}

static int l2_ctl_of_parse(struct l2_ctl *l2)
{}

static ssize_t l2_ctl_latency_show(struct device *dev,
				   struct device_attribute *attr,
				   char *buf)
{}

static ssize_t l2_ctl_latency_store(struct device *dev,
				    struct device_attribute *attr,
				    const char *buf, size_t count)
{}

static L2_CTL_ATTR_RW(l2_ws_latency, l2_ctl_latency, L2_WS_STALL);
static L2_CTL_ATTR_RW(l2_tag_latency, l2_ctl_latency, L2_TAG_STALL);
static L2_CTL_ATTR_RW(l2_data_latency, l2_ctl_latency, L2_DATA_STALL);

static struct attribute *l2_ctl_sysfs_attrs[] =;
ATTRIBUTE_GROUPS();

static void l2_ctl_remove_sysfs(void *data)
{}

static int l2_ctl_init_sysfs(struct l2_ctl *l2)
{}

static int l2_ctl_probe(struct platform_device *pdev)
{}

static const struct of_device_id l2_ctl_of_match[] =;
MODULE_DEVICE_TABLE(of, l2_ctl_of_match);

static struct platform_driver l2_ctl_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();