Lines Matching +full:axi +full:- +full:max +full:- +full:burst +full:- +full:len
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
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
76 #define caam_to_cpu(len) \ argument
77 static inline u##len caam##len ## _to_cpu(u##len val) \
80 return le##len ## _to_cpu((__force __le##len)val); \
82 return be##len ## _to_cpu((__force __be##len)val); \
85 #define cpu_to_caam(len) \ argument
86 static inline u##len cpu_to_caam##len(u##len val) \
89 return (__force u##len)cpu_to_le##len(val); \
91 return (__force u##len)cpu_to_be##len(val); \
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 */
432 u32 status; /* CSTA - CAAM Status */
435 /* Component Instantiation Parameters fe0-fff */
436 u32 rtic_id; /* RVID - RTIC Version ID */
439 u32 ccb_id; /* CCBVID - CCB Version ID */
440 u32 cha_id_ms; /* CHAVID - CHA Version ID Most Significant*/
441 u32 cha_id_ls; /* CHAVID - CHA Version ID Least Significant*/
442 u32 cha_num_ms; /* CHANUM - CHA Number Most Significant */
443 u32 cha_num_ls; /* CHANUM - CHA Number Least Significant*/
448 u32 caam_id_ms; /* CAAMVID - CAAM Version ID MS */
449 u32 caam_id_ls; /* CAAMVID - CAAM Version ID LS */
458 u32 liodn_ms; /* lock and make-trusted control bits */
459 u32 liodn_ls; /* LIODN for non-sequence and seq access */
465 u32 mode; /* RTSTMODEx - Test mode */
467 u32 reset; /* RTSTRESETx - Test reset control */
469 u32 status; /* RTSTSSTATUSx - Test status */
471 u32 errstat; /* RTSTERRSTATx - Test error status */
473 u32 errctl; /* RTSTERRCTLx - Test error control */
475 u32 entropy; /* RTSTENTROPYx - Test entropy */
477 u32 verifctl; /* RTSTVERIFCTLx - Test verification control */
479 u32 verifstat; /* RTSTVERIFSTATx - Test verification status */
481 u32 verifdata; /* RTSTVERIFDx - Test verification data */
483 u32 xkey; /* RTSTXKEYx - Test XKEY */
485 u32 oscctctl; /* RTSTOSCCTCTLx - Test osc. counter control */
487 u32 oscct; /* RTSTOSCCTx - Test oscillator counter */
489 u32 oscctstat; /* RTSTODCCTSTATx - Test osc counter status */
491 u32 ofifo[4]; /* RTSTOFIFOx - Test output FIFO */
498 #define RTMCTL_PRGM BIT(16) /* 1 -> program mode, 0 -> run mode */
513 u32 rtpkrmax; /* PRGM=1: poker max. limit register */
530 u32 rtfrqmax; /* PRGM=1: freq. count max. limit register */
554 * caam_ctrl - basic core configuration
570 /* Basic Configuration Section 000-01f */
577 /* Bus Access Configuration Section 010-11f */
579 struct masterid jr_mid[4]; /* JRxLIODNR - JobR LIODN setup */
581 u32 jrstart; /* JRSTART - Job Ring Start Register */
582 struct masterid rtic_mid[4]; /* RTICxLIODNR - RTIC LIODN setup */
584 u32 deco_rsr; /* DECORSR - Deco Request Source */
586 u32 deco_rq; /* DECORR - DECO Request */
587 struct masterid deco_mid[16]; /* DECOxLIODNR - 1 per DECO */
589 /* DECO Availability/Reset Section 120-3ff */
590 u32 deco_avail; /* DAR - DECO availability */
591 u32 deco_reset; /* DRR - DECO reset */
594 /* Key Encryption/Decryption Configuration 400-5ff */
595 /* Read/Writable only while in Non-secure mode */
596 u32 kek[KEK_KEY_SIZE]; /* JDKEKR - Key Encryption Key */
597 u32 tkek[TKEK_KEY_SIZE]; /* TDKEKR - Trusted Desc KEK */
598 u32 tdsk[TDSK_KEY_SIZE]; /* TDSKR - Trusted Desc Signing Key */
600 u64 sknonce; /* SKNR - Secure Key Nonce */
603 /* RNG Test/Verification/Debug Access 600-7ff */
612 /* Version registers - introduced with era 10 e80-eff */
614 /* Performance Monitor f00-fff */
623 #define MCFGR_WDFAIL 0x20000000 /* DECO watchdog force-fail */
625 #define MCFGR_LONG_PTR 0x00010000 /* Use >32-bit desc addressing */
633 /* AXI read cache control */
640 /* AXI write cache control */
647 /* AXI pipeline depth */
651 #define MCFGR_AXIPRI 0x00000008 /* Assert AXI priority sideband */
652 #define MCFGR_LARGE_BURST 0x00000004 /* 128/256-byte burst size */
653 #define MCFGR_BURST_64 0x00000001 /* 64-byte burst size */
662 * caam_job_ring - direct job ring setup
663 * 1-4 possible per instantiation, base + 1000/2000/3000/4000
668 u64 inpring_base; /* IRBAx - Input desc ring baseaddr */
670 u32 inpring_size; /* IRSx - Input ring size */
672 u32 inpring_avail; /* IRSAx - Input ring room remaining */
674 u32 inpring_jobadd; /* IRJAx - Input ring jobs added */
677 u64 outring_base; /* ORBAx - Output status ring base addr */
679 u32 outring_size; /* ORSx - Output ring size */
681 u32 outring_rmvd; /* ORJRx - Output ring jobs removed */
683 u32 outring_used; /* ORSFx - Output ring slots full */
687 u32 jroutstatus; /* JRSTAx - JobR output status */
689 u32 jrintstatus; /* JRINTx - JobR interrupt status */
690 u32 rconfig_hi; /* JRxCFG - Ring configuration */
695 u32 inp_rdidx; /* IRRIx - Input ring read index */
697 u32 out_wtidx; /* ORWIx - Output ring write index */
701 u32 jrcommand; /* JRCRx - JobR command */
705 /* Version registers - introduced with era 10 e80-eff */
707 /* Performance Monitor f00-fff */
713 * jrstatus - Job Ring Output Status
832 * caam_assurance - Assurance Controller View
854 u32 status; /* RSTA - Status */
856 u32 cmd; /* RCMD - Command */
858 u32 ctrl; /* RCTL - Control */
860 u32 throttle; /* RTHR - Throttle */
862 u64 watchdog; /* RWDOG - Watchdog Timer */
864 u32 rend; /* REND - Endian corrections */
868 struct rtic_block memblk[4]; /* Memory Blocks A-D */
872 struct rtic_memhash hash[4]; /* Block hash values A-D */
877 * caam_queue_if - QI configuration and control
882 u32 qi_control_hi; /* QICTL - QI Control */
885 u32 qi_status; /* QISTA - QI Status */
886 u32 qi_deq_cfg_hi; /* QIDQC - QI Dequeue Configuration */
888 u32 qi_enq_cfg_hi; /* QISEQC - QI Enqueue Command */
893 /* QI control bits - low word */
898 /* QI control bits - high word */
927 /* deco_sg_table - DECO view of scatter/gather table */
930 u32 elen; /* E, F bits + 30-bit length */
931 u32 bpid_offset; /* Buffer Pool ID + 16-bit length */
935 * caam_deco - descriptor controller - CHA cluster block
945 u32 cls1_mode; /* CxC1MR - Class 1 Mode */
947 u32 cls1_keysize; /* CxC1KSR - Class 1 Key Size */
948 u32 cls1_datasize_hi; /* CxC1DSR - Class 1 Data Size */
951 u32 cls1_icvsize; /* CxC1ICVSR - Class 1 ICV size */
953 u32 cha_ctrl; /* CCTLR - CHA control */
955 u32 irq_crtl; /* CxCIRQ - CCB interrupt done/error/clear */
957 u32 clr_written; /* CxCWR - Clear-Written */
958 u32 ccb_status_hi; /* CxCSTA - CCB Status/Error */
961 u32 aad_size; /* CxAADSZR - Current AAD Size */
963 u32 cls1_iv_size; /* CxC1IVSZR - Current Class 1 IV Size */
965 u32 pkha_a_size; /* PKASZRx - Size of PKHA A */
967 u32 pkha_b_size; /* PKBSZRx - Size of PKHA B */
969 u32 pkha_n_size; /* PKNSZRx - Size of PKHA N */
971 u32 pkha_e_size; /* PKESZRx - Size of PKHA E */
973 u32 cls1_ctx[16]; /* CxC1CTXR - Class 1 Context @100 */
975 u32 cls1_key[8]; /* CxC1KEYR - Class 1 Key @200 */
977 u32 cls2_mode; /* CxC2MR - Class 2 Mode */
979 u32 cls2_keysize; /* CxX2KSR - Class 2 Key Size */
980 u32 cls2_datasize_hi; /* CxC2DSR - Class 2 Data Size */
983 u32 cls2_icvsize; /* CxC2ICVSZR - Class 2 ICV Size */
985 u32 cls2_ctx[18]; /* CxC2CTXR - Class 2 Context @500 */
987 u32 cls2_key[32]; /* CxC2KEYR - Class2 Key @600 */
989 u32 inp_infofifo_hi; /* CxIFIFO - Input Info FIFO @7d0 */
992 u64 inp_datafifo; /* CxDFIFO - Input Data FIFO */
994 u64 out_datafifo; /* CxOFIFO - Output Data FIFO */
996 u32 jr_ctl_hi; /* CxJRR - JobR Control Register @800 */
998 u64 jr_descaddr; /* CxDADR - JobR Descriptor Address */
1000 u32 op_status_hi; /* DxOPSTA - DECO Operation Status */
1003 u32 liodn; /* DxLSR - DECO LIODN Status - non-seq */
1004 u32 td_liodn; /* DxLSR - DECO LIODN Status - trustdesc */
1006 u64 math[4]; /* DxMTH - Math register */
1008 struct deco_sg_table gthr_tbl[4]; /* DxGTR - Gather Tables */
1010 struct deco_sg_table sctr_tbl[4]; /* DxSTR - Scatter Tables */
1012 u32 descbuf[64]; /* DxDESB - Descriptor buffer */
1017 u32 desc_dbg; /* DxDDR - DECO Debug Register */
1021 u32 dbg_exec; /* DxDER - DECO Debug Exec Register */