The following list describes the requirements for initializing the AES and associated modules.
- Enable the clock to cryptography module (that includes AES) by setting the R0 bit in the (CRYPTOCLKEN) register in the application reset and clock management module (physical address: 0x4402 50B8).
- Configure the AES µDMA channels for Context In, Context Out, Data In, and Data Out by programming the appropriate encoding value in the DMA Channel Map Select n (DMA_CHMAPn) register in the µDMA module. For more information, refer to Section 1.3.3.
- If the AES channels are configured in the µDMA, enable the required AES DMA requests by programming bits [9:5] of the AES_SYSCONFIG register, in addition to the completion interrupts in the AES DMA Interrupt Mask (DTHE_AES_IM) register.
- Specify the size of the keys by programming the KEY_SIZE bit field in the AES_CTRL register.
- Load the AES Key 1 (AES_KEY1_n) register.
- Load the AES Key 2 (AES_KEY2_n) register if it is used by the configuration mode.
- Configure the AES for the appropriate encryption or decryption mode (see Section 17.3.1.2).
- Select encryption or decryption by programming the DIRECTION bit in the AES Control (AES_CTRL) register.