SWCU194 March 2023 CC1314R10 , CC1354P10 , CC1354R10 , CC2674P10 , CC2674R10
Table 13-28 lists the memory-mapped registers for the PKA registers. All register offset addresses not listed in Table 13-28 should be considered as reserved locations and the register contents should not be modified.
| Offset | Acronym | Register Name | Section |
|---|---|---|---|
| 0h | APTR | PKA Vector A Address | Section 13.4.1 |
| 4h | BPTR | PKA Vector B Address | Section 13.4.2 |
| 8h | CPTR | PKA Vector C Address | Section 13.4.3 |
| Ch | DPTR | PKA Vector D Address | Section 13.4.4 |
| 10h | ALENGTH | PKA Vector A Length | Section 13.4.5 |
| 14h | BLENGTH | PKA Vector B Length | Section 13.4.6 |
| 18h | SHIFT | PKA Bit Shift Value | Section 13.4.7 |
| 1Ch | FUNCTION | PKA Function | Section 13.4.8 |
| 20h | COMPARE | PKA compare result | Section 13.4.9 |
| 24h | MSW | PKA most-significant-word of result vector | Section 13.4.10 |
| 28h | DIVMSW | PKA most-significant-word of divide remainder | Section 13.4.11 |
| C8h | SEQCTRL | PKA sequencer control and status register | Section 13.4.12 |
| F4h | OPTIONS | PKA hardware options register | Section 13.4.13 |
| F8h | FWREV | PKA firmware revision and capabilities register | Section 13.4.14 |
| FCh | HWREV | PKA hardware revision register | Section 13.4.15 |
Complex bit access types are encoded to fit into small table cells. Table 13-29 shows the codes that are used for access types in this section.
| Access Type | Code | Description |
|---|---|---|
| Read Type | ||
| R | R | Read |
| Write Type | ||
| W | W | Write |
| Reset or Default Value | ||
| -n | Value after reset or the default value | |
APTR is shown in Table 13-30.
Return to the Summary Table.
PKA Vector A Address
During execution of basic PKCP operations, this register is double buffered and can be written with a new value for the next operation
when not written, the value remains intact. During the execution of sequencer-controlled complex operations, this register may not be written and its value is undefined at the conclusion of the operation. The driver software cannot rely on the written value to remain intact.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-11 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 10-0 | APTR | R/W | 0h | This register specifies the location of vector A within the PKA RAM. Vectors are identified through the location of their least-significant 32-bit word. Note that bit [0] must be zero to ensure that the vector starts at an 8-byte boundary. |
BPTR is shown in Table 13-31.
Return to the Summary Table.
PKA Vector B Address
During execution of basic PKCP operations, this register is double buffered and can be written with a new value for the next operation
when not written, the value remains intact. During the execution of sequencer-controlled complex operations, this register may not be written and its value is undefined at the conclusion of the operation. The driver software cannot rely on the written value to remain intact.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-11 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 10-0 | BPTR | R/W | 0h | This register specifies the location of vector B within the PKA RAM. Vectors are identified through the location of their least-significant 32-bit word. Note that bit [0] must be zero to ensure that the vector starts at an 8-byte boundary. |
CPTR is shown in Table 13-32.
Return to the Summary Table.
PKA Vector C Address
During execution of basic PKCP operations, this register is double buffered and can be written with a new value for the next operation
when not written, the value remains intact. During the execution of sequencer-controlled complex operations, this register may not be written and its value is undefined at the conclusion of the operation. The driver software cannot rely on the written value to remain intact.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-11 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 10-0 | CPTR | R/W | 0h | This register specifies the location of vector C within the PKA RAM. Vectors are identified through the location of their least-significant 32-bit word. Note that bit [0] must be zero to ensure that the vector starts at an 8-byte boundary. |
DPTR is shown in Table 13-33.
Return to the Summary Table.
PKA Vector D Address
During execution of basic PKCP operations, this register is double buffered and can be written with a new value for the next operation
when not written, the value remains intact. During the execution of sequencer-controlled complex operations, this register may not be written and its value is undefined at the conclusion of the operation. The driver software cannot rely on the written value to remain intact.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-11 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 10-0 | DPTR | R/W | 0h | This register specifies the location of vector D within the PKA RAM. Vectors are identified through the location of their least-significant 32-bit word. Note that bit [0] must be zero to ensure that the vector starts at an 8-byte boundary. |
ALENGTH is shown in Table 13-34.
Return to the Summary Table.
PKA Vector A Length
During execution of basic PKCP operations, this register is double buffered and can be written with a new value for the next operation
when not written, the value remains intact. During the execution of sequencer-controlled complex operations, this register may not be written and its value is undefined at the conclusion of the operation. The driver software cannot rely on the written value to remain intact.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-9 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 8-0 | ALENGTH | R/W | 0h | This register specifies the length (in 32-bit words) of Vector A. |
BLENGTH is shown in Table 13-35.
Return to the Summary Table.
PKA Vector B Length
During execution of basic PKCP operations, this register is double buffered and can be written with a new value for the next operation
when not written, the value remains intact. During the execution of sequencer-controlled complex operations, this register may not be written and its value is undefined at the conclusion of the operation. The driver software cannot rely on the written value to remain intact.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-9 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 8-0 | BLENGTH | R/W | 0h | This register specifies the length (in 32-bit words) of Vector B. |
SHIFT is shown in Table 13-36.
Return to the Summary Table.
PKA Bit Shift Value
For basic PKCP operations, modifying the contents of this register is made impossible while the operation is being performed. For the ExpMod-variable and ExpMod-CRT operations, this register is used to indicate the number of odd powers to use (directly as a value in the range 1-16). For the ModInv and ECC operations, this register is used to hold a completion code.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-5 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 4-0 | NUM_BITS_TO_SHIFT | R/W | 0h | This register specifies the number of bits to shift the input vector (in the range 0-31) during a Rshift or Lshift operation. |
FUNCTION is shown in Table 13-37.
Return to the Summary Table.
PKA Function
This register contains the control bits to start basic PKCP as well as complex sequencer operations. The run bit can be used to poll for the completion of the operation. Modifying bits [11:0] is made impossible during the execution of a basic PKCP operation.
During the execution of sequencer-controlled complex operations, this register is modified, the run and stall result bits are set to zero at the conclusion, but other bits are undefined.
NOTE: Continuously reading this register to poll the run bit is not allowed when executing complex sequencer operations (the sequencer cannot access the PKCP when this is done). Leave at least one sysclk cycle between poll operations.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-25 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 24 | STALL_RESULT | R/W | 0h | When written with a 1b, updating of the COMPARE bit, MSW and DIVMSW registers, as well as resetting the run bit is stalled beyond the point that a running operation is actually finished. Use this to allow software enough time to read results from a previous operation when the newly started operation is known to take only a short amount of time. If a result is waiting, the result registers is updated and the run bit is reset in the clock cycle following writing the stall result bit back to 0b. The Stall result function may only be used for basic PKCP operations. |
| 23-16 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 15 | RUN | R/W | 1h | The host sets this bit to instruct the PKA module to begin processing the basic PKCP or complex sequencer operation. This bit is reset low automatically when the operation is complete. After a reset, the run bit is always set to 1b. Depending on the option, program ROM or program RAM, the following applies: Program ROM - The first sequencer instruction sets the bit to 0b. This is done immediately after the hardware reset is released. Program RAM - The sequencer must set the bit to 0b. As a valid firmware may not have been loaded, the sequencer is held in software reset after the hardware reset is released (the SEQCTRL.RESET bit is set to 1b). After the FW image is loaded and the Reset bit is cleared, the sequencer starts to execute the FW. The first instruction clears the run bit. In both cases a few clock cycles are needed before the first instruction is executed and the run bit state has been propagated. |
| 14-12 | SEQUENCER_OPERATIONS | R/W | 0h | These bits select the complex sequencer operation to perform: 0x0: None 0x1: ExpMod-CRT 0x2: ECmontMUL 0x3: ECC-ADD (if available in firmware, otherwise reserved) 0x4: ExpMod-ACT2 0x5: ECC-MUL (if available in firmware, otherwise reserved) 0x6: ExpMod-variable 0x7: ModInv (if available in firmware, otherwise reserved) The encoding of these operations is determined by sequencer firmware. |
| 11 | COPY | R/W | 0h | Perform copy operation |
| 10 | COMPARE | R/W | 0h | Perform compare operation |
| 9 | MODULO | R/W | 0h | Perform modulo operation |
| 8 | DIVIDE | R/W | 0h | Perform divide operation |
| 7 | LSHIFT | R/W | 0h | Perform left shift operation |
| 6 | RSHIFT | R/W | 0h | Perform right shift operation |
| 5 | SUBTRACT | R/W | 0h | Perform subtract operation |
| 4 | ADD | R/W | 0h | Perform add operation |
| 3 | MS_ONE | R/W | 0h | Loads the location of the Most Significant one bit within the result word indicated in the MSW register into bits [4:0] of the DIVMSW.MSW_ADDRESS register - can only be used with basic PKCP operations, except for Divide, Modulo and Compare. |
| 2 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 1 | ADDSUB | R/W | 0h | Perform combined add/subtract operation |
| 0 | MULTIPLY | R/W | 0h | Perform multiply operation |
COMPARE is shown in Table 13-38.
Return to the Summary Table.
PKA compare result
This register provides the result of a basic PKCP compare operation. It is updated when the FUNCTION.RUN bit is reset at the end of that operation.
Status after a complex sequencer operation is unknown
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-3 | RESERVED | R | 0h | Ignore on read |
| 2 | A_GREATER_THAN_B | R | 0h | Vector_A is greater than Vector_B |
| 1 | A_LESS_THAN_B | R | 0h | Vector_A is less than Vector_B |
| 0 | A_EQUALS_B | R | 1h | Vector_A is equal to Vector_B |
MSW is shown in Table 13-39.
Return to the Summary Table.
PKA most-significant-word of result vector
This register indicates the (word) address in the PKA RAM where the most significant nonzero 32-bit word of the result is stored. Should be ignored for modulo operations. For basic PKCP operations, this register is updated FUNCTION.RUN bit is reset at the end of the operation. For the complex-sequencer controlled operations, updating of the final value matching the actual result is done near the end of the operation
note that the result is only meaningful if no errors were detected and that for ECC operations, this register will provide information for the x-coordinate of the result point only.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-16 | RESERVED | R | 0h | Ignore on read |
| 15 | RESULT_IS_ZERO | R | 1h | The result vector is all zeroes, ignore the address returned in bits [10:0] |
| 14-11 | RESERVED | R | 0h | Ignore on read |
| 10-0 | MSW_ADDRESS | R | 0h | Address of the most-significant nonzero 32-bit word of the result vector in PKA RAM |
DIVMSW is shown in Table 13-40.
Return to the Summary Table.
PKA most-significant-word of divide remainder
This register indicates the (32-bit word) address in the PKA RAM where the most significant nonzero 32-bit word of the remainder result for the basic divide and modulo operations is stored. Bits [4:0] are loaded with the bit number of the most-significant nonzero bit in the most-significant nonzero word when MS one control bit is set. For divide, modulo, and MS one reporting, this register is updated when FUNCTION.RUN bit is reset at the end of the operation. For the complex sequencer controlled operations, updating of bits [4:0] of this register with the most-significant bit location of the actual result is done near the end of the operation. The result is meaningful only if no errors were detected and that for ECC operations
this register provides information for the x-coordinate of the result point only.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-16 | RESERVED | R | 0h | Ignore on read |
| 15 | RESULT_IS_ZERO | R | 1h | The result vector is all zeroes, ignore the address returned in bits [10:0] |
| 14-11 | RESERVED | R | 0h | Ignore on read |
| 10-0 | MSW_ADDRESS | R | 0h | Address of the most significant nonzero 32-bit word of the remainder result vector in PKA RAM |
SEQCTRL is shown in Table 13-41.
Return to the Summary Table.
PKA sequencer control and status register
The sequencer is interfaced with the outside world through a single control and status register. With the exception of bit [31], the actual use of bits in the separate sub-fields of this register is determined by the sequencer firmware. This register need only be accessed when the sequencer program is stored in RAM. The reset value of the RESET bit depends upon the option chosen for sequencer program storage. NOTE: For Agama the sequencer firmware is executed from ROM.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31 | RESET | R/W | 0h | Option program ROM: Reset value = 0. Read/Write, reset value 0b (ZERO). Writing 1b resets the sequencer, write to 0b to restart operations again. As the reset value is 0b, the sequencer will automatically start operations executing from program ROM. This bit should always be written with zero and ignored when reading this register. Option Program RAM: Reset value =1. Read/Write, reset value 1b (ONE). When 1b, the sequencer is held in a reset state and the PKA_PROGRAM area is accessible for loading the sequencer program (while the PKA_DATA_RAM is inaccessible), write to 0b to (re)start sequencer operations and disable PKA_PROGRAM area accessibility (also enables the PKA_DATA_RAM accesses). Resetting the sequencer (in order to load other firmware) should only be done when the PKA Engine is not performing any operations (i.e. the FUNCTION.RUN bit should be zero). |
| 30-16 | RESERVED | R/W | 0h | Set to zero on write, ignore on read |
| 15-8 | SEQUENCER_STAT | R | 1h | These read-only bits can be used by the sequencer to communicate status to the outside world. Bit [8] is also used as sequencer interrupt, with the complement of this bit ORed into the FUNCTION.RUN bit. This field should always be written with zeroes and ignored when reading this register. |
| 7-0 | SW_CONTROL_STAT | R/W | 0h | These bits can be used by software to trigger sequencer operations. External logic can set these bits by writing 1b, cannot reset them by writing 0b. The sequencer can reset these bits by writing 0b, cannot set them by writing 1b. Setting the FUNCTION.RUN bit together with a nonzero sequencer operations field automatically sets bit [0] here. This field should always be written with zeroes and ignored when reading this register. |
OPTIONS is shown in Table 13-42.
Return to the Summary Table.
PKA hardware options register
This register provides the host with a means to determine the hardware configuration implemented in this PKA engine, focused on options that have an effect on software interacting with the module.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-12 | RESERVED | R | 0h | Ignore on read |
| 11 | INT_MASKING | R | 0h |
Interrupt Masking 0x0: indicates that the main interrupt output (bit [1] of the interrupts output bus) is the direct complement of the run bit in the PKA_CONTROL register 0x1 : indicates that interrupt masking logic is present for this output. Note: Reset value is undefined |
| 10-8 | PROTECTION_OPTION | R | 0h |
Protection Option 0x0: indicates no additional protection against side channel attacks 0x1: indicates the SCAP option 0x2: Reserved 0x3: indicates the PROT option Note: Reset value is undefined |
| 7 | PROGRAM_RAM | R | 0h |
Program RAM 0x1: indicates sequencer program storage in RAM 0x0: indicates sequencer program storage in ROM. Note: Reset value is undefined |
| 6-5 |
SEQUENCER_ CONFIGURATION | R | 1h |
Sequencer Configuration 0x0: Reserved 0x1 : Indicates a standard sequencer 0x2: Reserved 0x3: Reserved |
| 4-2 | RESERVED | R | 0h | Ignore on read |
| 1-0 | PKCP_CONFIGURATION | R | 0h |
PKCP Configuration 0x0 : Reserved 0x1 : Indicates a PKCP with a 16x16 multiplier 0x2: indicates a PKCP with a 32x32 multiplier 0x3 : Reserved Note: Reset value is undefined. |
FWREV is shown in Table 13-43.
Return to the Summary Table.
PKA firmware revision and capabilities register
This register allows the host access to the internal firmware revision number of the PKA Engine for software driver matching and diagnostic purposes. This register also contains a field that encodes the capabilities of the embedded firmware.
This register is written by the firmware within a few clock cycles after starting up that firmware. The hardware reset value is zero, indicating that the information has not been written yet.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-28 | FW_CAPABILITIES | R | 2h |
Firmware Capabilities 4-bit binary encoding for the functionality implemented in the firmware. 0x0: indicates basic ModExp with/without CRT. 0x1: adds Modular Inversion 0x2: value 2 adds Modular Inversion and ECC operations. 0x3-0xF : Reserved. |
| 27-24 | MAJOR_FW_REVISION | R | 1h | 4-bit binary encoding of the major firmware revision number |
| 23-20 | MINOR_FW_REVISION | R | 5h | 4-bit binary encoding of the minor firmware revision number |
| 19-16 | FW_PATCH_LEVEL | R | 0h | 4-bit binary encoding of the firmware patch level, initial release will carry value zero Patches are used to remove bugs without changing the functionality or interface of a module. |
| 15-0 | RESERVED | R | 0h | Ignore on read |
HWREV is shown in Table 13-44.
Return to the Summary Table.
PKA hardware revision register
This register allows the host access to the hardware revision number of the PKA engine for software driver matching and diagnostic purposes. It is always located at the highest address in the access space of the module and contains an encoding of the EIP number (with its complement as signature) for recognition of the hardware module.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-28 | RESERVED | R | 0h | Ignore on read |
| 27-24 | MAJOR_HW_REVISION | R | 1h | 4-bit binary encoding of the major hardware revision number |
| 23-20 | MINOR_HW_REVISION | R | 5h | 4-bit binary encoding of the minor hardware revision number |
| 19-16 | HW_PATCH_LEVEL | R | 1h | 4-bit binary encoding of the hardware patch level,
initial release will carry value zero Patches are used to remove bugs without changing the functionality or interface of a module. |
| 15-8 |
COMPLEMENT_OF_BASIC_ EIP_NUMBER |
R | E3h | Bit-by-bit logic complement of bits [7:0], EIP-28 gives 0xE3 |
| 7-0 | BASIC_EIP_NUMBER | R | 1Ch | 8-bit binary encoding of the EIP number, EIP-28 gives 0x1C |