linux/drivers/soc/aspeed/aspeed-lpc-snoop.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright 2017 Google Inc
 *
 * Provides a simple driver to control the ASPEED LPC snoop interface which
 * allows the BMC to listen on and save the data written by
 * the host to an arbitrary LPC I/O port.
 *
 * Typically used by the BMC to "watch" host boot progress via port
 * 0x80 writes made by the BIOS during the boot process.
 */

#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/kfifo.h>
#include <linux/mfd/syscon.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/poll.h>
#include <linux/regmap.h>

#define DEVICE_NAME

#define NUM_SNOOP_CHANNELS
#define SNOOP_FIFO_SIZE

#define HICR5
#define HICR5_EN_SNP0W
#define HICR5_ENINT_SNP0W
#define HICR5_EN_SNP1W
#define HICR5_ENINT_SNP1W
#define HICR6
#define HICR6_STR_SNP0W
#define HICR6_STR_SNP1W
#define SNPWADR
#define SNPWADR_CH0_MASK
#define SNPWADR_CH0_SHIFT
#define SNPWADR_CH1_MASK
#define SNPWADR_CH1_SHIFT
#define SNPWDR
#define SNPWDR_CH0_MASK
#define SNPWDR_CH0_SHIFT
#define SNPWDR_CH1_MASK
#define SNPWDR_CH1_SHIFT
#define HICRB
#define HICRB_ENSNP0D
#define HICRB_ENSNP1D

struct aspeed_lpc_snoop_model_data {};

struct aspeed_lpc_snoop_channel {};

struct aspeed_lpc_snoop {};

static struct aspeed_lpc_snoop_channel *snoop_file_to_chan(struct file *file)
{}

static ssize_t snoop_file_read(struct file *file, char __user *buffer,
				size_t count, loff_t *ppos)
{}

static __poll_t snoop_file_poll(struct file *file,
				    struct poll_table_struct *pt)
{}

static const struct file_operations snoop_fops =;

/* Save a byte to a FIFO and discard the oldest byte if FIFO is full */
static void put_fifo_with_discard(struct aspeed_lpc_snoop_channel *chan, u8 val)
{}

static irqreturn_t aspeed_lpc_snoop_irq(int irq, void *arg)
{}

static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop,
				       struct platform_device *pdev)
{}

static int aspeed_lpc_enable_snoop(struct aspeed_lpc_snoop *lpc_snoop,
				   struct device *dev,
				   int channel, u16 lpc_port)
{}

static void aspeed_lpc_disable_snoop(struct aspeed_lpc_snoop *lpc_snoop,
				     int channel)
{}

static int aspeed_lpc_snoop_probe(struct platform_device *pdev)
{}

static void aspeed_lpc_snoop_remove(struct platform_device *pdev)
{}

static const struct aspeed_lpc_snoop_model_data ast2400_model_data =;

static const struct aspeed_lpc_snoop_model_data ast2500_model_data =;

static const struct of_device_id aspeed_lpc_snoop_match[] =;

static struct platform_driver aspeed_lpc_snoop_driver =;

module_platform_driver();

MODULE_DEVICE_TABLE(of, aspeed_lpc_snoop_match);
MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();