linux/drivers/net/ethernet/qualcomm/qca_7k.h

/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
/*
 *   Copyright (c) 2011, 2012, Qualcomm Atheros Communications Inc.
 *   Copyright (c) 2014, I2SE GmbH
 */

/*   Qualcomm Atheros SPI register definition.
 *
 *   This module is designed to define the Qualcomm Atheros SPI
 *   register placeholders.
 */

#ifndef _QCA_7K_H
#define _QCA_7K_H

#include <linux/types.h>

#include "qca_spi.h"

#define QCA7K_SPI_READ
#define QCA7K_SPI_WRITE
#define QCA7K_SPI_INTERNAL
#define QCA7K_SPI_EXTERNAL

#define QCASPI_CMD_LEN
#define QCASPI_HW_PKT_LEN
#define QCASPI_HW_BUF_LEN

/*   SPI registers;                               */
#define SPI_REG_BFR_SIZE
#define SPI_REG_WRBUF_SPC_AVA
#define SPI_REG_RDBUF_BYTE_AVA
#define SPI_REG_SPI_CONFIG
#define SPI_REG_SPI_STATUS
#define SPI_REG_INTR_CAUSE
#define SPI_REG_INTR_ENABLE
#define SPI_REG_RDBUF_WATERMARK
#define SPI_REG_WRBUF_WATERMARK
#define SPI_REG_SIGNATURE
#define SPI_REG_ACTION_CTRL

/*   SPI_CONFIG register definition;             */
#define QCASPI_SLAVE_RESET_BIT

/*   INTR_CAUSE/ENABLE register definition.      */
#define SPI_INT_WRBUF_BELOW_WM
#define SPI_INT_CPU_ON
#define SPI_INT_ADDR_ERR
#define SPI_INT_WRBUF_ERR
#define SPI_INT_RDBUF_ERR
#define SPI_INT_PKT_AVLBL

void qcaspi_spi_error(struct qcaspi *qca);
int qcaspi_read_register(struct qcaspi *qca, u16 reg, u16 *result);
int qcaspi_write_register(struct qcaspi *qca, u16 reg, u16 value, int retry);

#endif /* _QCA_7K_H */