Lines Matching +full:misc +full:- +full:latch

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * CAAM hardware register-level view
5 * Copyright 2008-2011 Freescale Semiconductor, Inc.
15 #include <linux/io-64-nonatomic-hi-lo.h>
18 * Architecture-specific register access methods
20 * CAAM's bus-addressable registers are 64 bits internally.
21 * They have been wired to be safely accessible on 32-bit
24 * can be treated as two 32-bit entities, or finally (c) if they
25 * must be treated as a single 64-bit value, then this can safely
26 * be done with two 32-bit cycles.
28 * For 32-bit operations on 64-bit values, CAAM follows the same
29 * 64-bit register access conventions as it's predecessors, in that
31 * higher address, thus, a full 64-bit write cycle requires a write
33 * which will latch/execute the write cycle.
37 * - SWRST is in bit 31 of MCFG.
38 * - MCFG begins at base+0x0000.
39 * - Bits 63-32 are a 32-bit word at base+0x0000 (numerically-lower)
40 * - Bits 31-0 are a 32-bit word at base+0x0004 (numerically-higher)
42 * (and on Power, the convention is 0-31, 32-63, I know...)
44 * Assuming a 64-bit write to this MCFG to perform a software reset
49 * Of course, since MCFG 63-32 is all zero, we could cheat and simply
51 * However, since CAAM does contain some write-and-read-intended
52 * 64-bit registers, this code defines 64-bit access methods for
54 * clean transition to 64-bit is possible when it becomes necessary.
57 * 32-bit architectures cannot enforce an atomic-64 operation,
60 * - On writes, since the HW is assumed to latch the cycle on the
61 * write of the higher-numeric-address word, then ordered
64 * - For reads, where a register contains a relevant value of more
65 * that 32 bits, the hardware employs logic to latch the other
132 * base + 0x0000 : most-significant 32 bits
133 * base + 0x0004 : least-significant 32 bits
135 * The 32-bit version of this core therefore has to write to base + 0x0004
136 * to set the 32-bit wide DMA address.
139 * base + 0x0000 : least-significant 32 bits
140 * base + 0x0004 : most-significant 32 bits
281 /* Version registers (Era 10+) e80-eff */
322 /* CHA Miscellaneous Information - AESA_MISC specific */
326 /* CHA Miscellaneous Information - PKHA_MISC specific */
330 * caam_perfmon - Performance Monitor/Secure Memory Status/
333 * Spans f00-fff wherever instantiated
396 /* Performance Monitor Registers f00-f9f */
397 u64 req_dequeued; /* PC_REQ_DEQ - Dequeued Requests */
398 u64 ob_enc_req; /* PC_OB_ENC_REQ - Outbound Encrypt Requests */
399 u64 ib_dec_req; /* PC_IB_DEC_REQ - Inbound Decrypt Requests */
400 u64 ob_enc_bytes; /* PC_OB_ENCRYPT - Outbound Bytes Encrypted */
401 u64 ob_prot_bytes; /* PC_OB_PROTECT - Outbound Bytes Protected */
402 u64 ib_dec_bytes; /* PC_IB_DECRYPT - Inbound Bytes Decrypted */
406 /* CAAM Hardware Instantiation Parameters fa0-fbf */
407 u32 cha_rev_ms; /* CRNR - CHA Rev No. Most significant half*/
408 u32 cha_rev_ls; /* CRNR - CHA Rev No. Least significant half*/
417 u32 comp_parms_ms; /* CTPR - Compile Parameters Register */
419 u32 comp_parms_ls; /* CTPR - Compile Parameters Register */
422 /* CAAM Global Status fc0-fdf */
423 u64 faultaddr; /* FAR - Fault Address */
424 u32 faultliodn; /* FALR - Fault Address LIODN */
425 u32 faultdetail; /* FADR - Fault Addr Detail */
429 u32 status; /* CSTA - CAAM Status */
432 /* Component Instantiation Parameters fe0-fff */
433 u32 rtic_id; /* RVID - RTIC Version ID */
436 u32 ccb_id; /* CCBVID - CCB Version ID */
437 u32 cha_id_ms; /* CHAVID - CHA Version ID Most Significant*/
438 u32 cha_id_ls; /* CHAVID - CHA Version ID Least Significant*/
439 u32 cha_num_ms; /* CHANUM - CHA Number Most Significant */
440 u32 cha_num_ls; /* CHANUM - CHA Number Least Significant*/
445 u32 caam_id_ms; /* CAAMVID - CAAM Version ID MS */
446 u32 caam_id_ls; /* CAAMVID - CAAM Version ID LS */
455 u32 liodn_ms; /* lock and make-trusted control bits */
456 u32 liodn_ls; /* LIODN for non-sequence and seq access */
468 u32 mode; /* RTSTMODEx - Test mode */
470 u32 reset; /* RTSTRESETx - Test reset control */
472 u32 status; /* RTSTSSTATUSx - Test status */
474 u32 errstat; /* RTSTERRSTATx - Test error status */
476 u32 errctl; /* RTSTERRCTLx - Test error control */
478 u32 entropy; /* RTSTENTROPYx - Test entropy */
480 u32 verifctl; /* RTSTVERIFCTLx - Test verification control */
482 u32 verifstat; /* RTSTVERIFSTATx - Test verification status */
484 u32 verifdata; /* RTSTVERIFDx - Test verification data */
486 u32 xkey; /* RTSTXKEYx - Test XKEY */
488 u32 oscctctl; /* RTSTOSCCTCTLx - Test osc. counter control */
490 u32 oscct; /* RTSTOSCCTx - Test oscillator counter */
492 u32 oscctstat; /* RTSTODCCTSTATx - Test osc counter status */
494 u32 ofifo[4]; /* RTSTOFIFOx - Test output FIFO */
501 #define RTMCTL_PRGM BIT(16) /* 1 -> program mode, 0 -> run mode */
512 u32 rtmctl; /* misc. control register */
513 u32 rtscmisc; /* statistical check misc. register */
547 * caam_ctrl - basic core configuration
563 /* Basic Configuration Section 000-01f */
570 /* Bus Access Configuration Section 010-11f */
572 struct masterid jr_mid[4]; /* JRxLIODNR - JobR LIODN setup */
574 u32 jrstart; /* JRSTART - Job Ring Start Register */
575 struct masterid rtic_mid[4]; /* RTICxLIODNR - RTIC LIODN setup */
577 u32 deco_rsr; /* DECORSR - Deco Request Source */
579 u32 deco_rq; /* DECORR - DECO Request */
580 struct partid deco_mid[5]; /* DECOxLIODNR - 1 per DECO */
583 /* DECO Availability/Reset Section 120-3ff */
584 u32 deco_avail; /* DAR - DECO availability */
585 u32 deco_reset; /* DRR - DECO reset */
588 /* Key Encryption/Decryption Configuration 400-5ff */
589 /* Read/Writable only while in Non-secure mode */
590 u32 kek[KEK_KEY_SIZE]; /* JDKEKR - Key Encryption Key */
591 u32 tkek[TKEK_KEY_SIZE]; /* TDKEKR - Trusted Desc KEK */
592 u32 tdsk[TDSK_KEY_SIZE]; /* TDSKR - Trusted Desc Signing Key */
594 u64 sknonce; /* SKNR - Secure Key Nonce */
597 /* RNG Test/Verification/Debug Access 600-7ff */
606 /* Version registers - introduced with era 10 e80-eff */
608 /* Performance Monitor f00-fff */
617 #define MCFGR_WDFAIL 0x20000000 /* DECO watchdog force-fail */
619 #define MCFGR_LONG_PTR 0x00010000 /* Use >32-bit desc addressing */
646 #define MCFGR_LARGE_BURST 0x00000004 /* 128/256-byte burst size */
647 #define MCFGR_BURST_64 0x00000001 /* 64-byte burst size */
656 * caam_job_ring - direct job ring setup
657 * 1-4 possible per instantiation, base + 1000/2000/3000/4000
662 u64 inpring_base; /* IRBAx - Input desc ring baseaddr */
664 u32 inpring_size; /* IRSx - Input ring size */
666 u32 inpring_avail; /* IRSAx - Input ring room remaining */
668 u32 inpring_jobadd; /* IRJAx - Input ring jobs added */
671 u64 outring_base; /* ORBAx - Output status ring base addr */
673 u32 outring_size; /* ORSx - Output ring size */
675 u32 outring_rmvd; /* ORJRx - Output ring jobs removed */
677 u32 outring_used; /* ORSFx - Output ring slots full */
681 u32 jroutstatus; /* JRSTAx - JobR output status */
683 u32 jrintstatus; /* JRINTx - JobR interrupt status */
684 u32 rconfig_hi; /* JRxCFG - Ring configuration */
689 u32 inp_rdidx; /* IRRIx - Input ring read index */
691 u32 out_wtidx; /* ORWIx - Output ring write index */
695 u32 jrcommand; /* JRCRx - JobR command */
699 /* Version registers - introduced with era 10 e80-eff */
701 /* Performance Monitor f00-fff */
707 * jrstatus - Job Ring Output Status
826 * caam_assurance - Assurance Controller View
848 u32 status; /* RSTA - Status */
850 u32 cmd; /* RCMD - Command */
852 u32 ctrl; /* RCTL - Control */
854 u32 throttle; /* RTHR - Throttle */
856 u64 watchdog; /* RWDOG - Watchdog Timer */
858 u32 rend; /* REND - Endian corrections */
862 struct rtic_block memblk[4]; /* Memory Blocks A-D */
866 struct rtic_memhash hash[4]; /* Block hash values A-D */
871 * caam_queue_if - QI configuration and control
876 u32 qi_control_hi; /* QICTL - QI Control */
879 u32 qi_status; /* QISTA - QI Status */
880 u32 qi_deq_cfg_hi; /* QIDQC - QI Dequeue Configuration */
882 u32 qi_enq_cfg_hi; /* QISEQC - QI Enqueue Command */
887 /* QI control bits - low word */
892 /* QI control bits - high word */
921 /* deco_sg_table - DECO view of scatter/gather table */
924 u32 elen; /* E, F bits + 30-bit length */
925 u32 bpid_offset; /* Buffer Pool ID + 16-bit length */
929 * caam_deco - descriptor controller - CHA cluster block
939 u32 cls1_mode; /* CxC1MR - Class 1 Mode */
941 u32 cls1_keysize; /* CxC1KSR - Class 1 Key Size */
942 u32 cls1_datasize_hi; /* CxC1DSR - Class 1 Data Size */
945 u32 cls1_icvsize; /* CxC1ICVSR - Class 1 ICV size */
947 u32 cha_ctrl; /* CCTLR - CHA control */
949 u32 irq_crtl; /* CxCIRQ - CCB interrupt done/error/clear */
951 u32 clr_written; /* CxCWR - Clear-Written */
952 u32 ccb_status_hi; /* CxCSTA - CCB Status/Error */
955 u32 aad_size; /* CxAADSZR - Current AAD Size */
957 u32 cls1_iv_size; /* CxC1IVSZR - Current Class 1 IV Size */
959 u32 pkha_a_size; /* PKASZRx - Size of PKHA A */
961 u32 pkha_b_size; /* PKBSZRx - Size of PKHA B */
963 u32 pkha_n_size; /* PKNSZRx - Size of PKHA N */
965 u32 pkha_e_size; /* PKESZRx - Size of PKHA E */
967 u32 cls1_ctx[16]; /* CxC1CTXR - Class 1 Context @100 */
969 u32 cls1_key[8]; /* CxC1KEYR - Class 1 Key @200 */
971 u32 cls2_mode; /* CxC2MR - Class 2 Mode */
973 u32 cls2_keysize; /* CxX2KSR - Class 2 Key Size */
974 u32 cls2_datasize_hi; /* CxC2DSR - Class 2 Data Size */
977 u32 cls2_icvsize; /* CxC2ICVSZR - Class 2 ICV Size */
979 u32 cls2_ctx[18]; /* CxC2CTXR - Class 2 Context @500 */
981 u32 cls2_key[32]; /* CxC2KEYR - Class2 Key @600 */
983 u32 inp_infofifo_hi; /* CxIFIFO - Input Info FIFO @7d0 */
986 u64 inp_datafifo; /* CxDFIFO - Input Data FIFO */
988 u64 out_datafifo; /* CxOFIFO - Output Data FIFO */
990 u32 jr_ctl_hi; /* CxJRR - JobR Control Register @800 */
992 u64 jr_descaddr; /* CxDADR - JobR Descriptor Address */
994 u32 op_status_hi; /* DxOPSTA - DECO Operation Status */
997 u32 liodn; /* DxLSR - DECO LIODN Status - non-seq */
998 u32 td_liodn; /* DxLSR - DECO LIODN Status - trustdesc */
1000 u64 math[4]; /* DxMTH - Math register */
1002 struct deco_sg_table gthr_tbl[4]; /* DxGTR - Gather Tables */
1004 struct deco_sg_table sctr_tbl[4]; /* DxSTR - Scatter Tables */
1006 u32 descbuf[64]; /* DxDESB - Descriptor buffer */
1011 u32 desc_dbg; /* DxDDR - DECO Debug Register */
1015 u32 dbg_exec; /* DxDER - DECO Debug Exec Register */