Home | History | Annotate | Line # | Download | only in dev
      1 /*	$NetBSD: octeon_cop2reg.h,v 1.2 2020/06/18 13:52:08 simonb Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2008 Internet Initiative Japan, Inc.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  *
     16  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26  * SUCH DAMAGE.
     27  */
     28 
     29 /*
     30  * Cavium-Specific Instruction Summary
     31  * Cavium Networks-Specific Instruction Description
     32  *
     33  * DMFC2 / DMTC2 instructions
     34  */
     35 
     36 #ifndef _OCTEON_COP2REG_H_
     37 #define _OCTEON_COP2REG_H_
     38 
     39 /* 3DES */
     40 
     41 #define	CVM_MF_3DES_IV			0x0084	/* Load IV from 3DES Unit */
     42 #define	CVM_MF_3DES_KEY			0x0080	/* Load Key from 3DES Unit */
     43 #define	CVM_MF_3DES_RESULT		0x0088	/* Load Result from 3DES Unit */
     44 #define	CVM_MT_3DES_DEC			0x408e	/* 3DES Decrypt */
     45 #define	CVM_MT_3DES_DEC_CBC		0x408c	/* 3DES CBC Decrypt */
     46 #define	CVM_MT_3DES_ENC			0x408a	/* 3DES Encrypt */
     47 #define	CVM_MT_3DES_ENC_CBC		0x4088	/* 3DES CBC Encrypt */
     48 #define	CVM_MT_3DES_IV			0x0084	/* Load IV into 3DES Unit */
     49 #define	CVM_MT_3DES_KEY			0x0080	/* Load Key into 3DES Unit */
     50 #define	CVM_MT_3DES_RESULT		0x0098	/* Load Result into 3DES Unit */
     51 
     52 /* AES */
     53 
     54 #define	CVM_MF_AES_INP0			0x0111	/* Load INP0 from AES Unit */
     55 #define	CVM_MF_AES_IV			0x0102	/* Load IV from AES Unit */
     56 #define	CVM_MF_AES_KEY			0x0104	/* Load Key from AES Unit */
     57 #define	CVM_MF_AES_KEYLENGTH		0x0110	/* Load Keylength from AES Unit */
     58 #define	CVM_MF_AES_RESINP		0x0100	/* Load Result/Input from AES Unit */
     59 #define	CVM_MT_AES_DEC_CBC0		0x010c	/* AES CBC Decrypt (part 1) */
     60 #define	CVM_MT_AES_DEC_CBC1		0x310d	/* AES CBC Decrypt (part 2) */
     61 #define	CVM_MT_AES_DEC0			0x010e	/* AES Decrypt (part 1) */
     62 #define	CVM_MT_AES_DEC1			0x310f	/* AES Decrypt (part 2) */
     63 #define	CVM_MT_AES_ENC_CBC0		0x0108	/* AES CBC Encrypt (part 1) */
     64 #define	CVM_MT_AES_ENC_CBC1		0x3109	/* AES CBC Encrypt (part 2) */
     65 #define	CVM_MT_AES_ENC0			0x010a	/* AES Encrypt (part 1) */
     66 #define	CVM_MT_AES_ENC1			0x310b	/* AES Encrypt (part 2) */
     67 #define	CVM_MT_AES_IV			0x0102	/* Load IV into AES Unit */
     68 #define	CVM_MT_AES_KEY			0x0104	/* Load Key into AES Unit */
     69 #define	CVM_MT_AES_KEYLENGTH		0x0110	/* Load Keylength into AES Unit */
     70 #define	CVM_MT_AES_RESINP		0x0100	/* Load Result/Input into AES Unit */
     71 
     72 /* CRC */
     73 
     74 #define	CVM_MF_CRC_IV			0x0201	/* Load IV from CRC Unit */
     75 #define	CVM_MF_CRC_IV_REFLECT		0x0203	/* Load IV from CRC Unit Reflected */
     76 #define	CVM_MF_CRC_LEN			0x0202	/* Load Length from CRC Unit */
     77 #define	CVM_MF_CRC_POLYNOMIAL		0x0200	/* Load Polynomial from CRC Unit */
     78 #define	CVM_MT_CRC_BYTE			0x0204	/* CRC for a Byte */
     79 #define	CVM_MT_CRC_BYTE_REFLECT		0x0214	/* CRC for a Byte Reflected */
     80 #define	CVM_MT_CRC_DWORD		0x1207	/* CRC for a Double-word */
     81 #define	CVM_MT_CRC_DWORD_REFLECT	0x1217	/* CRC for a Double-word Reflected */
     82 #define	CVM_MT_CRC_HALF			0x0205	/* CRC for a Halfword */
     83 #define	CVM_MT_CRC_HALF_REFLECT		0x0215	/* CRC for a Halfword Reflected */
     84 #define	CVM_MT_CRC_IV			0x0201	/* Load IV into CRC Unit */
     85 #define	CVM_MT_CRC_IV_REFLECT		0x0211	/* Load IV into CRC Unit Reflected */
     86 #define	CVM_MT_CRC_LEN			0x1202	/* Load Length into CRC Unit */
     87 #define	CVM_MT_CRC_POLYNOMIAL		0x4200	/* Load Polynomial into CRC Unit */
     88 #define	CVM_MT_CRC_POLYNOMIAL_REFLECT	0x4210	/* Load Polynomial into CRC Unit Reflected */
     89 #define	CVM_MT_CRC_VAR			0x1208	/* CRC for Variable Length */
     90 #define	CVM_MT_CRC_VAR_REFLECT		0x1218	/* CRC for Variable Length Reflected */
     91 #define	CVM_MT_CRC_WORD			0x0206	/* CRC for a Word */
     92 #define	CVM_MT_CRC_WORD_REFLECT		0x0216	/* CRC for a Word Reflected */
     93 
     94 /* GFM */
     95 
     96 #define	CVM_MF_GFM_MUL			0x0258	/* Load Multiplier from GFM Unit */
     97 #define	CVM_MF_GFM_RESINP		0x025a	/* Load Result/Input from GFM Unit */
     98 #define	CVM_MF_GFM_POLY			0x025e	/* Load Polynomial from GFM Unit */
     99 #define	CVM_MT_GFM_MUL			0x0258	/* Load Multiplier into GFM Unit */
    100 #define	CVM_MT_GFM_RESINP		0x025a	/* Load Result/Input into GFM Unit */
    101 #define	CVM_MT_GFM_XOR0			0x025c	/* XOR into GFM Unit */
    102 #define	CVM_MT_GFM_XORMUL1		0x425d	/* XOR and GFM Multiply */
    103 #define	CVM_MT_GFM_POLY			0x025e	/* Load Polynomial into GFM Unit */
    104 
    105 /* Hash */
    106 
    107 #define	CVM_MF_HSH_DAT			0x0040	/* Load Data from HSH Unit (narrow mode) */
    108 #define	CVM_MF_HSH_DATW			0x0240	/* Load Data from HSH Unit (wide mode) */
    109 #define	CVM_MF_HSH_IV			0x0048	/* Load IV from HSH Unit (narrow mode) */
    110 #define	CVM_MF_HSH_IVW			0x0250	/* Load IV from HSH Unit (wide mode) */
    111 #define	CVM_MT_HSH_DAT			0x0040	/* Load Data into HSH Unit (narrow mode) */
    112 #define	CVM_MT_HSH_DATW			0x0240	/* Load Data into HSH Unit (wide mode) */
    113 #define	CVM_MT_HSH_IV			0x0048	/* Load IV into HSH Unit (narrow mode) */
    114 #define	CVM_MT_HSH_IVW			0x0250	/* Load IV into HSH Unit (wide mode) */
    115 #define	CVM_MT_HSH_STANDARD5		0x4047	/* MD5 Hash */
    116 #define	CVM_MT_HSH_STARTSHA		0x4057	/* SHA-1 Hash */
    117 #define	CVM_MT_HSH_STARTSHA256		0x404f	/* SHA-256 Hash */
    118 #define	CVM_MT_HSH_STARTSHA512		0x424f	/* SHA-512 Hash */
    119 
    120 /* KASUMI */
    121 
    122 #define	CVM_MF_KAS_KEY			0x0080	/* Load Key from KASUMI Unit */
    123 #define	CVM_MT_KAS_ENC_CBC		0x4089	/* KASUMI CBC Encrypt */
    124 #define	CVM_MT_KAS_ENC			0x408b	/* KASUMI Encrypt */
    125 #define	CVM_MT_KAS_KEY			0x0080	/* Load Key into KASUMI Unit */
    126 #define	CVM_MT_KAS_RESULT		0x0098	/* Load Result into KASUMI Unit */
    127 
    128 #endif /* _OCTEON_COP2REG_H_ */
    129