linux/drivers/soc/ixp4xx/ixp4xx-npe.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Intel IXP4xx Network Processor Engine driver for Linux
 *
 * Copyright (C) 2007 Krzysztof Halasa <[email protected]>
 *
 * The code is based on publicly available information:
 * - Intel IXP4xx Developer's Manual and other e-papers
 * - Intel IXP400 Access Library Software (BSD license)
 * - previous works by Christian Hohnstaedt <[email protected]>
 *   Thanks, Christian.
 */

#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/firmware.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/soc/ixp4xx/npe.h>
#include <linux/soc/ixp4xx/cpu.h>

#define DEBUG_MSG
#define DEBUG_FW

#define NPE_COUNT
#define MAX_RETRIES
#define NPE_42X_DATA_SIZE
#define NPE_46X_DATA_SIZE
#define NPE_A_42X_INSTR_SIZE
#define NPE_B_AND_C_42X_INSTR_SIZE
#define NPE_46X_INSTR_SIZE
#define REGS_SIZE

#define NPE_PHYS_REG

#define FW_MAGIC
#define FW_BLOCK_TYPE_INSTR
#define FW_BLOCK_TYPE_DATA
#define FW_BLOCK_TYPE_EOF

/* NPE exec status (read) and command (write) */
#define CMD_NPE_STEP
#define CMD_NPE_START
#define CMD_NPE_STOP
#define CMD_NPE_CLR_PIPE
#define CMD_CLR_PROFILE_CNT
#define CMD_RD_INS_MEM
#define CMD_WR_INS_MEM
#define CMD_RD_DATA_MEM
#define CMD_WR_DATA_MEM
#define CMD_RD_ECS_REG
#define CMD_WR_ECS_REG

#define STAT_RUN
#define STAT_STOP
#define STAT_CLEAR
#define STAT_ECS_K

#define NPE_STEVT
#define NPE_STARTPC
#define NPE_REGMAP
#define NPE_CINDEX

#define INSTR_WR_REG_SHORT
#define INSTR_WR_REG_BYTE
#define INSTR_RD_FIFO
#define INSTR_RESET_MBOX

#define ECS_BG_CTXT_REG_0
#define ECS_BG_CTXT_REG_1
#define ECS_BG_CTXT_REG_2
#define ECS_PRI_1_CTXT_REG_0
#define ECS_PRI_1_CTXT_REG_1
#define ECS_PRI_1_CTXT_REG_2
#define ECS_PRI_2_CTXT_REG_0
#define ECS_PRI_2_CTXT_REG_1
#define ECS_PRI_2_CTXT_REG_2
#define ECS_DBG_CTXT_REG_0
#define ECS_DBG_CTXT_REG_1
#define ECS_DBG_CTXT_REG_2
#define ECS_INSTRUCT_REG

#define ECS_REG_0_ACTIVE
#define ECS_REG_0_NEXTPC_MASK
#define ECS_REG_0_LDUR_BITS
#define ECS_REG_0_LDUR_MASK
#define ECS_REG_1_CCTXT_BITS
#define ECS_REG_1_CCTXT_MASK
#define ECS_REG_1_SELCTXT_BITS
#define ECS_REG_1_SELCTXT_MASK
#define ECS_DBG_REG_2_IF
#define ECS_DBG_REG_2_IE

/* NPE watchpoint_fifo register bit */
#define WFIFO_VALID

/* NPE messaging_status register bit definitions */
#define MSGSTAT_OFNE
#define MSGSTAT_IFNF
#define MSGSTAT_OFNF
#define MSGSTAT_IFNE
#define MSGSTAT_MBINT
#define MSGSTAT_IFINT
#define MSGSTAT_OFINT
#define MSGSTAT_WFINT

/* NPE messaging_control register bit definitions */
#define MSGCTL_OUT_FIFO
#define MSGCTL_IN_FIFO
#define MSGCTL_OUT_FIFO_WRITE
#define MSGCTL_IN_FIFO_WRITE

/* NPE mailbox_status value for reset */
#define RESET_MBOX_STAT

#define NPE_A_FIRMWARE
#define NPE_B_FIRMWARE
#define NPE_C_FIRMWARE

const char *npe_names[] =;

#define print_npe(pri, npe, fmt, ...)

#if DEBUG_MSG
#define debug_msg
#else
#define debug_msg(npe, fmt, ...)
#endif

static struct {} ecs_reset[] =;

static struct npe npe_tab[NPE_COUNT] =;

int npe_running(struct npe *npe)
{}

static void npe_cmd_write(struct npe *npe, u32 addr, int cmd, u32 data)
{}

static u32 npe_cmd_read(struct npe *npe, u32 addr, int cmd)
{}

static void npe_clear_active(struct npe *npe, u32 reg)
{}

static void npe_start(struct npe *npe)
{}

static void npe_stop(struct npe *npe)
{}

static int __must_check npe_debug_instr(struct npe *npe, u32 instr, u32 ctx,
					u32 ldur)
{}

static int __must_check npe_logical_reg_write8(struct npe *npe, u32 addr,
					       u8 val, u32 ctx)
{}

static int __must_check npe_logical_reg_write16(struct npe *npe, u32 addr,
						u16 val, u32 ctx)
{}

static int __must_check npe_logical_reg_write32(struct npe *npe, u32 addr,
						u32 val, u32 ctx)
{}

static int npe_reset(struct npe *npe)
{}


int npe_send_message(struct npe *npe, const void *msg, const char *what)
{}

int npe_recv_message(struct npe *npe, void *msg, const char *what)
{}

int npe_send_recv_message(struct npe *npe, void *msg, const char *what)
{}


int npe_load_firmware(struct npe *npe, const char *name, struct device *dev)
{}


struct npe *npe_request(unsigned id)
{}

void npe_release(struct npe *npe)
{}

static int ixp4xx_npe_probe(struct platform_device *pdev)
{}

static void ixp4xx_npe_remove(struct platform_device *pdev)
{}

static const struct of_device_id ixp4xx_npe_of_match[] =;

static struct platform_driver ixp4xx_npe_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();

EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();