linux/drivers/net/ethernet/marvell/octeontx2/af/cgx_fw_if.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Marvell OcteonTx2 CGX driver
 *
 * Copyright (C) 2018 Marvell.
 *
 */

#ifndef __CGX_FW_INTF_H__
#define __CGX_FW_INTF_H__

#include <linux/bitops.h>
#include <linux/bitfield.h>

#define CGX_FIRMWARE_MAJOR_VER
#define CGX_FIRMWARE_MINOR_VER

#define CGX_EVENT_ACK

/* CGX error types. set for cmd response status as CGX_STAT_FAIL */
enum cgx_error_type {};

/* LINK speed types */
enum cgx_link_speed {};

enum CGX_MODE_ {};
/* REQUEST ID types. Input to firmware */
enum cgx_cmd_id {};

/* async event ids */
enum cgx_evt_id {};

/* event types - cause of interrupt */
enum cgx_evt_type {};

enum cgx_stat {};

enum cgx_cmd_own {};

/* m - bit mask
 * y - value to be written in the bitrange
 * x - input value whose bitrange to be modified
 */
#define FIELD_SET(m, y, x)

/* scratchx(0) CSR used for ATF->non-secure SW communication.
 * This acts as the status register
 * Provides details on command ack/status, command response, error details
 */
#define EVTREG_ACK
#define EVTREG_EVT_TYPE
#define EVTREG_STAT
#define EVTREG_ID

/* Response to command IDs with command status as CGX_STAT_FAIL
 *
 * Not applicable for commands :
 * CGX_CMD_LINK_BRING_UP/DOWN/CGX_EVT_LINK_CHANGE
 */
#define EVTREG_ERRTYPE

/* Response to cmd ID as CGX_CMD_GET_FW_VER with cmd status as
 * CGX_STAT_SUCCESS
 */
#define RESP_MAJOR_VER
#define RESP_MINOR_VER

/* Response to cmd ID as CGX_CMD_GET_MAC_ADDR with cmd status as
 * CGX_STAT_SUCCESS
 */
#define RESP_MAC_ADDR

/* Response to cmd ID as CGX_CMD_GET_MKEX_PRFL_SIZE with cmd status as
 * CGX_STAT_SUCCESS
 */
#define RESP_MKEX_PRFL_SIZE

/* Response to cmd ID as CGX_CMD_GET_MKEX_PRFL_ADDR with cmd status as
 * CGX_STAT_SUCCESS
 */
#define RESP_MKEX_PRFL_ADDR

/* Response to cmd ID as CGX_CMD_GET_FWD_BASE with cmd status as
 * CGX_STAT_SUCCESS
 */
#define RESP_FWD_BASE
#define RESP_LINKSTAT_LMAC_TYPE

/* Response to cmd ID - CGX_CMD_LINK_BRING_UP/DOWN, event ID CGX_EVT_LINK_CHANGE
 * status can be either CGX_STAT_FAIL or CGX_STAT_SUCCESS
 *
 * In case of CGX_STAT_FAIL, it indicates CGX configuration failed
 * when processing link up/down/change command.
 * Both err_type and current link status will be updated
 *
 * In case of CGX_STAT_SUCCESS, err_type will be CGX_ERR_NONE and current
 * link status will be updated
 */
struct cgx_lnk_sts {};

#define RESP_LINKSTAT_UP
#define RESP_LINKSTAT_FDUPLEX
#define RESP_LINKSTAT_SPEED
#define RESP_LINKSTAT_ERRTYPE
#define RESP_LINKSTAT_AN
#define RESP_LINKSTAT_FEC
#define RESP_LINKSTAT_PORT

/* scratchx(1) CSR used for non-secure SW->ATF communication
 * This CSR acts as a command register
 */
#define CMDREG_OWN
#define CMDREG_ID

/* Any command using enable/disable as an argument need
 * to set this bitfield.
 * Ex: Loopback, HiGig...
 */
#define CMDREG_ENABLE

/* command argument to be passed for cmd ID - CGX_CMD_SET_MTU */
#define CMDMTU_SIZE

/* command argument to be passed for cmd ID - CGX_CMD_LINK_CHANGE */
#define CMDLINKCHANGE_LINKUP
#define CMDLINKCHANGE_FULLDPLX
#define CMDLINKCHANGE_SPEED

#define CMDSETFEC
/* command argument to be passed for cmd ID - CGX_CMD_MODE_CHANGE */
#define CMDMODECHANGE_SPEED
#define CMDMODECHANGE_DUPLEX
#define CMDMODECHANGE_AN
#define CMDMODECHANGE_PORT
#define CMDMODECHANGE_FLAGS

/* LINK_BRING_UP command timeout */
#define LINKCFG_TIMEOUT
#endif /* __CGX_FW_INTF_H__ */