57#define PKA_RAM_BASE 0x44006000
58#define PKA_RAM_SIZE 0x800
59#define PKA_MAX_CURVE_SIZE 12
70#define PKA_APTR 0x44004000
85#define PKA_BPTR 0x44004004
100#define PKA_CPTR 0x44004008
115#define PKA_DPTR 0x4400400C
130#define PKA_ALENGTH 0x44004010
145#define PKA_BLENGTH 0x44004014
160#define PKA_SHIFT 0x44004018
173#define PKA_FUNCTION 0x4400401C
197#define PKA_COMPARE 0x44004020
206#define PKA_MSW 0x44004024
229#define PKA_DIVMSW 0x44004028
259#define PKA_SEQ_CTRL 0x440040C8
275#define PKA_OPTIONS 0x440040F4
290#define PKA_SW_REV 0x440040F8
308#define PKA_REVISION 0x440040FC
326#define PKA_APTR_APTR_M 0x000007FF
334#define PKA_APTR_APTR_S 0
340#define PKA_BPTR_BPTR_M 0x000007FF
348#define PKA_BPTR_BPTR_S 0
354#define PKA_CPTR_CPTR_M 0x000007FF
362#define PKA_CPTR_CPTR_S 0
368#define PKA_DPTR_DPTR_M 0x000007FF
376#define PKA_DPTR_DPTR_S 0
382#define PKA_ALENGTH_ALENGTH_M 0x000001FF
385#define PKA_ALENGTH_ALENGTH_S 0
391#define PKA_BLENGTH_BLENGTH_M 0x000001FF
394#define PKA_BLENGTH_BLENGTH_S 0
400#define PKA_SHIFT_NUM_BITS_TO_SHIFT_M \
407#define PKA_SHIFT_NUM_BITS_TO_SHIFT_S 0
413#define PKA_FUNCTION_STALL_RESULT \
435#define PKA_FUNCTION_STALL_RESULT_M \
437#define PKA_FUNCTION_STALL_RESULT_S 24
438#define PKA_FUNCTION_RUN 0x00008000
471#define PKA_FUNCTION_RUN_M 0x00008000
472#define PKA_FUNCTION_RUN_S 15
473#define PKA_FUNCTION_SEQUENCER_OPERATIONS_M \
491#define PKA_FUNCTION_SEQUENCER_OPERATIONS_S 12
492#define PKA_FUNCTION_COPY 0x00000800
493#define PKA_FUNCTION_COPY_M 0x00000800
494#define PKA_FUNCTION_COPY_S 11
495#define PKA_FUNCTION_COMPARE 0x00000400
496#define PKA_FUNCTION_COMPARE_M 0x00000400
497#define PKA_FUNCTION_COMPARE_S 10
498#define PKA_FUNCTION_MODULO 0x00000200
499#define PKA_FUNCTION_MODULO_M 0x00000200
500#define PKA_FUNCTION_MODULO_S 9
501#define PKA_FUNCTION_DIVIDE 0x00000100
502#define PKA_FUNCTION_DIVIDE_M 0x00000100
503#define PKA_FUNCTION_DIVIDE_S 8
504#define PKA_FUNCTION_LSHIFT 0x00000080
505#define PKA_FUNCTION_LSHIFT_M 0x00000080
506#define PKA_FUNCTION_LSHIFT_S 7
507#define PKA_FUNCTION_RSHIFT 0x00000040
508#define PKA_FUNCTION_RSHIFT_M 0x00000040
509#define PKA_FUNCTION_RSHIFT_S 6
510#define PKA_FUNCTION_SUBTRACT 0x00000020
511#define PKA_FUNCTION_SUBTRACT_M 0x00000020
512#define PKA_FUNCTION_SUBTRACT_S 5
513#define PKA_FUNCTION_ADD 0x00000010
514#define PKA_FUNCTION_ADD_M 0x00000010
515#define PKA_FUNCTION_ADD_S 4
516#define PKA_FUNCTION_MS_ONE 0x00000008
524#define PKA_FUNCTION_MS_ONE_M 0x00000008
525#define PKA_FUNCTION_MS_ONE_S 3
526#define PKA_FUNCTION_ADDSUB 0x00000002
528#define PKA_FUNCTION_ADDSUB_M 0x00000002
529#define PKA_FUNCTION_ADDSUB_S 1
530#define PKA_FUNCTION_MULTIPLY 0x00000001
531#define PKA_FUNCTION_MULTIPLY_M 0x00000001
532#define PKA_FUNCTION_MULTIPLY_S 0
538#define PKA_COMPARE_A_GREATER_THAN_B \
542#define PKA_COMPARE_A_GREATER_THAN_B_M \
544#define PKA_COMPARE_A_GREATER_THAN_B_S 2
545#define PKA_COMPARE_A_LESS_THAN_B \
548#define PKA_COMPARE_A_LESS_THAN_B_M \
550#define PKA_COMPARE_A_LESS_THAN_B_S 1
551#define PKA_COMPARE_A_EQUALS_B 0x00000001
552#define PKA_COMPARE_A_EQUALS_B_M \
554#define PKA_COMPARE_A_EQUALS_B_S 0
560#define PKA_MSW_RESULT_IS_ZERO 0x00008000
563#define PKA_MSW_RESULT_IS_ZERO_M \
565#define PKA_MSW_RESULT_IS_ZERO_S 15
566#define PKA_MSW_MSW_ADDRESS_M 0x000007FF
569#define PKA_MSW_MSW_ADDRESS_S 0
575#define PKA_DIVMSW_RESULT_IS_ZERO \
580#define PKA_DIVMSW_RESULT_IS_ZERO_M \
582#define PKA_DIVMSW_RESULT_IS_ZERO_S 15
583#define PKA_DIVMSW_MSW_ADDRESS_M \
589#define PKA_DIVMSW_MSW_ADDRESS_S 0
595#define PKA_SEQ_CTRL_RESET 0x80000000
625#define PKA_SEQ_CTRL_RESET_M 0x80000000
626#define PKA_SEQ_CTRL_RESET_S 31
627#define PKA_SEQ_CTRL_SEQUENCER_STATUS_M \
640#define PKA_SEQ_CTRL_SEQUENCER_STATUS_S 8
641#define PKA_SEQ_CTRL_SW_CONTROL_STATUS_M \
658#define PKA_SEQ_CTRL_SW_CONTROL_STATUS_S 0
664#define PKA_OPTIONS_FIRST_LNME_FIFO_DEPTH_M \
674#define PKA_OPTIONS_FIRST_LNME_FIFO_DEPTH_S 24
675#define PKA_OPTIONS_FIRST_LNME_NR_OF_PES_M \
682#define PKA_OPTIONS_FIRST_LNME_NR_OF_PES_S 16
683#define PKA_OPTIONS_MMM3A 0x00001000
686#define PKA_OPTIONS_MMM3A_M 0x00001000
687#define PKA_OPTIONS_MMM3A_S 12
688#define PKA_OPTIONS_INT_MASKING 0x00000800
697#define PKA_OPTIONS_INT_MASKING_M \
699#define PKA_OPTIONS_INT_MASKING_S 11
700#define PKA_OPTIONS_PROTECTION_OPTION_M \
709#define PKA_OPTIONS_PROTECTION_OPTION_S 8
710#define PKA_OPTIONS_PROGRAM_RAM 0x00000080
714#define PKA_OPTIONS_PROGRAM_RAM_M \
716#define PKA_OPTIONS_PROGRAM_RAM_S 7
717#define PKA_OPTIONS_SEQUENCER_CONFIGURATION_M \
722#define PKA_OPTIONS_SEQUENCER_CONFIGURATION_S 5
723#define PKA_OPTIONS_LNME_CONFIGURATION_M \
730#define PKA_OPTIONS_LNME_CONFIGURATION_S 2
731#define PKA_OPTIONS_PKCP_CONFIGURATION_M \
739#define PKA_OPTIONS_PKCP_CONFIGURATION_S 0
745#define PKA_SW_REV_FW_CAPABILITIES_M \
755#define PKA_SW_REV_FW_CAPABILITIES_S 28
756#define PKA_SW_REV_MAJOR_FW_REVISION_M \
760#define PKA_SW_REV_MAJOR_FW_REVISION_S 24
761#define PKA_SW_REV_MINOR_FW_REVISION_M \
765#define PKA_SW_REV_MINOR_FW_REVISION_S 20
766#define PKA_SW_REV_FW_PATCH_LEVEL_M \
775#define PKA_SW_REV_FW_PATCH_LEVEL_S 16
781#define PKA_REVISION_MAJOR_HW_REVISION_M \
785#define PKA_REVISION_MAJOR_HW_REVISION_S 24
786#define PKA_REVISION_MINOR_HW_REVISION_M \
790#define PKA_REVISION_MINOR_HW_REVISION_S 20
791#define PKA_REVISION_HW_PATCH_LEVEL_M \
800#define PKA_REVISION_HW_PATCH_LEVEL_S 16
801#define PKA_REVISION_COMPLEMENT_OF_BASIC_EIP_NUMBER_M \
805#define PKA_REVISION_COMPLEMENT_OF_BASIC_EIP_NUMBER_S 8
806#define PKA_REVISION_BASIC_EIP_NUMBER_M \
810#define PKA_REVISION_BASIC_EIP_NUMBER_S 0
817#define PKA_STATUS_SUCCESS 0
818#define PKA_STATUS_FAILURE 1
819#define PKA_STATUS_INVALID_PARAM 2
820#define PKA_STATUS_BUF_UNDERFLOW 3
821#define PKA_STATUS_RESULT_0 4
822#define PKA_STATUS_A_GR_B 5
825#define PKA_STATUS_A_LT_B 6
828#define PKA_STATUS_OPERATION_INPRG 7
829#define PKA_STATUS_OPERATION_NOT_INPRG 8
830#define PKA_STATUS_SIGNATURE_INVALID 9
uint8_t pka_check_status(void)
Checks the status of the PKA engine operation.
void pka_register_process_notification(struct process *p)
Registers a process to be notified of the completion of a PKA operation.
void pka_disable(void)
Disables the PKA engine.
void pka_init(void)
Enables and resets the PKA engine.
void pka_enable(void)
Enables the PKA engine.