linux/drivers/fsi/fsi-scom.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * SCOM FSI Client device driver
 *
 * Copyright (C) IBM Corporation 2016
 */

#include <linux/fsi.h>
#include <linux/module.h>
#include <linux/cdev.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/mod_devicetable.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
#include <linux/list.h>

#include <uapi/linux/fsi.h>

#define FSI_ENGID_SCOM

/* SCOM engine register set */
#define SCOM_DATA0_REG
#define SCOM_DATA1_REG
#define SCOM_CMD_REG
#define SCOM_FSI2PIB_RESET_REG
#define SCOM_STATUS_REG
#define SCOM_PIB_RESET_REG

/* Command register */
#define SCOM_WRITE_CMD
#define SCOM_READ_CMD

/* Status register bits */
#define SCOM_STATUS_ERR_SUMMARY
#define SCOM_STATUS_PROTECTION
#define SCOM_STATUS_PARITY
#define SCOM_STATUS_PIB_ABORT
#define SCOM_STATUS_PIB_RESP_MASK
#define SCOM_STATUS_PIB_RESP_SHIFT

#define SCOM_STATUS_FSI2PIB_ERROR
#define SCOM_STATUS_ANY_ERR
/* SCOM address encodings */
#define XSCOM_ADDR_IND_FLAG
#define XSCOM_ADDR_INF_FORM1

/* SCOM indirect stuff */
#define XSCOM_ADDR_DIRECT_PART
#define XSCOM_ADDR_INDIRECT_PART
#define XSCOM_DATA_IND_READ
#define XSCOM_DATA_IND_COMPLETE
#define XSCOM_DATA_IND_ERR_MASK
#define XSCOM_DATA_IND_ERR_SHIFT
#define XSCOM_DATA_IND_DATA
#define XSCOM_DATA_IND_FORM1_DATA
#define XSCOM_ADDR_FORM1_LOW
#define XSCOM_ADDR_FORM1_HI
#define XSCOM_ADDR_FORM1_HI_SHIFT

/* Retries */
#define SCOM_MAX_IND_RETRIES

struct scom_device {};

static int __put_scom(struct scom_device *scom_dev, uint64_t value,
		      uint32_t addr, uint32_t *status)
{}

static int __get_scom(struct scom_device *scom_dev, uint64_t *value,
		      uint32_t addr, uint32_t *status)
{}

static int put_indirect_scom_form0(struct scom_device *scom, uint64_t value,
				   uint64_t addr, uint32_t *status)
{}

static int put_indirect_scom_form1(struct scom_device *scom, uint64_t value,
				   uint64_t addr, uint32_t *status)
{}

static int get_indirect_scom_form0(struct scom_device *scom, uint64_t *value,
				   uint64_t addr, uint32_t *status)
{}

static int raw_put_scom(struct scom_device *scom, uint64_t value,
			uint64_t addr, uint32_t *status)
{}

static int raw_get_scom(struct scom_device *scom, uint64_t *value,
			uint64_t addr, uint32_t *status)
{}

static int handle_fsi2pib_status(struct scom_device *scom, uint32_t status)
{}

static int handle_pib_status(struct scom_device *scom, uint8_t status)
{}

static int put_scom(struct scom_device *scom, uint64_t value,
		    uint64_t addr)
{}

static int get_scom(struct scom_device *scom, uint64_t *value,
		    uint64_t addr)
{}

static ssize_t scom_read(struct file *filep, char __user *buf, size_t len,
			 loff_t *offset)
{}

static ssize_t scom_write(struct file *filep, const char __user *buf,
			  size_t len, loff_t *offset)
{}

static loff_t scom_llseek(struct file *file, loff_t offset, int whence)
{}

static void raw_convert_status(struct scom_access *acc, uint32_t status)
{}

static int scom_raw_read(struct scom_device *scom, void __user *argp)
{}

static int scom_raw_write(struct scom_device *scom, void __user *argp)
{}

static int scom_reset(struct scom_device *scom, void __user *argp)
{}

static int scom_check(struct scom_device *scom, void __user *argp)
{}

static long scom_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{}

static int scom_open(struct inode *inode, struct file *file)
{}

static const struct file_operations scom_fops =;

static void scom_free(struct device *dev)
{}

static int scom_probe(struct device *dev)
{}

static int scom_remove(struct device *dev)
{}

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

static const struct fsi_device_id scom_ids[] =;

static struct fsi_driver scom_drv =;

static int scom_init(void)
{}

static void scom_exit(void)
{}

module_init();
module_exit(scom_exit);
MODULE_LICENSE();