/***********************license start************************************
* Copyright (c) 2003-2017 Cavium, Inc.
* All rights reserved.
*
* License: one of 'Cavium License' or 'GNU General Public License Version 2'
*
* This file is provided under the terms of the Cavium License (see below)
* or under the terms of GNU General Public License, Version 2, as
* published by the Free Software Foundation. When using or redistributing
* this file, you may do so under either license.
*
* Cavium License: Redistribution and use in source and binary forms, with
* or without modification, are permitted provided that the following
* conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* * Neither the name of Cavium Inc. nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* This Software, including technical data, may be subject to U.S. export
* control laws, including the U.S. Export Administration Act and its
* associated regulations, and may be subject to export or import
* regulations in other countries.
*
* TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
* AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS
* OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
* RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
* REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
* DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY)
* WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A
* PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET
* ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE
* ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES
* WITH YOU.
***********************license end**************************************/
#ifndef __ZIP_REGS_H__
#define __ZIP_REGS_H__
/*
* Configuration and status register (CSR) address and type definitions for
* Cavium ZIP.
*/
#include <linux/kern_levels.h>
/* ZIP invocation result completion status codes */
#define ZIP_CMD_NOTDONE 0x0
/* Successful completion. */
#define ZIP_CMD_SUCCESS 0x1
/* Output truncated */
#define ZIP_CMD_DTRUNC 0x2
/* Dynamic Stop */
#define ZIP_CMD_DYNAMIC_STOP 0x3
/* Uncompress ran out of input data when IWORD0[EF] was set */
#define ZIP_CMD_ITRUNC 0x4
/* Uncompress found the reserved block type 3 */
#define ZIP_CMD_RBLOCK 0x5
/*
* Uncompress found LEN != ZIP_CMD_NLEN in an uncompressed block in the input.
*/
#define ZIP_CMD_NLEN 0x6
/* Uncompress found a bad code in the main Huffman codes. */
#define ZIP_CMD_BADCODE 0x7
/* Uncompress found a bad code in the 19 Huffman codes encoding lengths. */
#define ZIP_CMD_BADCODE2 0x8
/* Compress found a zero-length input. */
#define ZIP_CMD_ZERO_LEN 0x9
/* The compress or decompress encountered an internal parity error. */
#define ZIP_CMD_PARITY 0xA
/*
* Uncompress found a string identifier that precedes the uncompressed data and
* decompression history.
*/
#define ZIP_CMD_FATAL 0xB
/**
* enum zip_int_vec_e - ZIP MSI-X Vector Enumeration, enumerates the MSI-X
* interrupt vectors.
*/
enum zip_int_vec_e {
ZIP_INT_VEC_E_ECCE = 0x10,
ZIP_INT_VEC_E_FIFE = 0x11,
ZIP_INT_VEC_E_QUE0_DONE = 0x0,
ZIP_INT_VEC_E_QUE0_ERR = 0x8,
ZIP_INT_VEC_E_QUE1_DONE = 0x1,
ZIP_INT_VEC_E_QUE1_ERR = 0x9,
ZIP_INT_VEC_E_QUE2_DONE = 0x2,
ZIP_INT_VEC_E_QUE2_ERR = 0xa,
ZIP_INT_VEC_E_QUE3_DONE = 0x3,
ZIP_INT_VEC_E_QUE3_ERR = 0xb,
ZIP_INT_VEC_E_QUE4_DONE = 0x4,
ZIP_INT_VEC_E_QUE4_ERR = 0xc,
ZIP_INT_VEC_E_QUE5_DONE = 0x5,
ZIP_INT_VEC_E_QUE5_ERR = 0xd,
ZIP_INT_VEC_E_QUE6_DONE = 0x6,
ZIP_INT_VEC_E_QUE6_ERR = 0xe,
ZIP_INT_VEC_E_QUE7_DONE = 0x7,
ZIP_INT_VEC_E_QUE7_ERR = 0xf,
ZIP_INT_VEC_E_ENUM_LAST = 0x12,
};
/**
* union zip_zptr_addr_s - ZIP Generic Pointer Structure for ADDR.
*
* It is the generic format of pointers in ZIP_INST_S.
*/
union zip_zptr_addr_s {
u64 u_reg64;
struct {
#if defined(__BIG_ENDIAN_BITFIELD)
u64 reserved_49_63 : 15;
u64 addr : 49;
#elif defined(__LITTLE_ENDIAN_BITFIELD)
u64 addr : 49;
u64 reserved_49_63 : 15;
#endif
} s;
};
/**
* union zip_zptr_ctl_s - ZIP Generic Pointer Structure for CTL.
*
* It is the generic format of pointers in ZIP_INST_S.
*/
union zip_zptr_ctl_s {
u64 u_reg64;
struct