|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Decryption On The Fly (DOTF) register layout for the Renesas RA8D2. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_dotf_regs_t |
| Per-channel DOTF register window. More... | |
Functions | |
| static volatile ra8_dotf_regs_t * | ra8_dotf_regs (uint8_t channel) |
| Get pointer to DOTF channel channel. | |
Decryption On The Fly (DOTF) register layout for the Renesas RA8D2.
The RA8D2 has two DOTF channels which transparently decrypt read data on the AXI side of the matching xSPI / OSPI controller using an AES core in CTR mode. DOTF0 covers reads from XSPI0 (memory mapped at 0x8000_0000..0x9FFF_FFFF) and DOTF1 covers XSPI1 (0x7000_0000..0x7FFF_FFFF). Each channel exposes a tiny register window:
| Offset | Name | Width | Purpose |
|---|---|---|---|
| 0x000 | CONVAREAST | 32 | Conversion area start address (4 KB align) |
| 0x004 | CONVAREAD | 32 | Conversion area end address (4 KB align) |
| 0x080 | REG00 | 32 | AES core / side-channel control bits |
| 0x08C | REG03 | 32 | AES IV / counter staging register |
Two channels at base 0x4026_8800 and 0x4026_8900 (S alias) with the matching 0x5026_88xx non-secure aliases. Spacing is 0x100 bytes per channel. Both channels share MSTPCRB bits with their xSPI partner – see ra8_mstp.h (k_ra8_mstp_ospi0 releases MSTPB16 which clocks both XSPI0 and DOTF0). HUM Ch 45.6.1 p 3050 explicitly says "DOTF operation can be disabled or enabled using Module Stop Control Register B (MSTPCRB). The DOTF module is initially stopped after reset."
Layout source: cross-referenced against the Renesas FSP CMSIS header R7KA8D2KF_core0.h lines 31125..31188 (R_DOTF_Type, total size 0x90) and the HUM register descriptions on pages 3049..3050.
The bottom 12 bits of the 32-bit address registers are reserved. The hardware multiplies the stored value by 0x1000 (4 KB) to derive the actual byte address, so any region must be 4 KB aligned and is sized at 4 KB granularity. Hardware reset value of CONVAREAD's reserved field is 0xFFF (HUM 45.3.2 p 3049 "These bits are read as 1.").
name them in Ch 45)
REG00 is the umbrella control register exposed via the DOTF APB window. HUM Ch 45 only documents that REG00 is the "AES core / side-channel control" word; the bit positions are taken from the FSP CMSIS R_DOTF_REG00_b bit-field (R7KA8D2KF_core0.h lines 31157..31176) and the FSP reference driver (r_ospi_b.c line 156 OSPI_B_PRV_DOTF_REG00_RESET_VALUE = 0x22000000 and line 1651 REG00 = ... | R_DOTF_REG00_B09_Msk).
The reset-plus-enable pattern that FSP writes is 0x2200_0000 | (1U << 9). The constant 0x2200_0000 decomposes as:
Bit positions and helper masks for re-keying / rotating the key size are exported here so the driver can write a different key size (192 / 256 bit) without re-deriving the magic constant.
REG03 is a 32-bit FIFO-style register: writing four 32-bit words in big-endian order loads the 128-bit IV. Per HUM 45.1 p 3048 the counter is {IV[127:28], Address[31:4]} – i.e. the bottom 28 bits of the IV are overwritten by the AXI address and only the top 100 bits of the IV are programmable. The driver still accepts a full 128-bit IV and forwards every word to REG03; the hardware silently drops the low bits at AES counter generation time.
Definition in file ra8_dotf_regs.h.
| enum ra8_dotf_addr_t : uintptr_t |
DOTF channel base addresses on the peripheral bus.
Per HUM Ch 45.3.1 p 3049 the secure alias is at 0x4026_8800 + 0x0100 * n and the NS alias is at 0x5026_8800 + 0x0100 * n for n = 0, 1. The driver only exposes the secure alias; NS reads are governed by the OSPI TZF policy and are out of scope.
Definition at line 102 of file ra8_dotf_regs.h.
| enum ra8_dotf_align_t : uint32_t |
4 KB granularity values for CONVAREAST / CONVAREAD.
| Enumerator | |
|---|---|
| k_ra8_dotf_addr_granule | 4 KB region granule. |
| k_ra8_dotf_addr_mask | High 20 bits are the value. |
| k_ra8_dotf_addr_low_mask | Low 12 bits read as 0/1 (HUM). |
Definition at line 145 of file ra8_dotf_regs.h.
| enum ra8_dotf_limits_t : uint8_t |
Channel count + alignment limits.
Definition at line 133 of file ra8_dotf_regs.h.
| enum ra8_dotf_reg00_bit_t : uint8_t |
REG00 control-bit positions.
Names mirror FSP R_DOTF_REG00_b (R7KA8D2KF_core0.h lines 31157..31176). HUM Ch 45 does not give the bits symbolic names; positions are kept verbatim against FSP so the driver can be cross-checked against vendor reference code.
Definition at line 161 of file ra8_dotf_regs.h.
| enum ra8_dotf_reg00_mask_t : uint32_t |
REG00 bit-field masks (32-bit).
The reset-plus-enable pattern that FSP writes is 0x2200_0000 | (1U << 9). The constant 0x2200_0000 sets:
The driver writes this exact pattern when a region is activated and writes 0 to disable. ra8_dotf_set_key_size uses the size masks below to swap to a 192-bit / 256-bit key.
Definition at line 187 of file ra8_dotf_regs.h.
| enum ra8_dotf_xspi_window_t : uint32_t |
XSPI memory-mapped windows that DOTF channels decrypt over.
Per HUM Ch 45.3 p 3049 ("Image of decryption area setting") DOTF0 decrypts AXI reads inside the XSPI0 window (0x8000_0000..0x9FFF_FFFF) and DOTF1 covers XSPI1 (0x7000_0000..0x7FFF_FFFF). Conversion-area start / end values passed to ra8_dotf_set_region MUST land inside the matching channel's window.
Definition at line 122 of file ra8_dotf_regs.h.
|
inlinestatic |
Get pointer to DOTF channel channel.
| [in] | channel | Channel index (0 or 1). |
Definition at line 236 of file ra8_dotf_regs.h.
References k_ra8_dotf0_base_addr, k_ra8_dotf_channel_count, and k_ra8_dotf_stride.
Referenced by ra8_dotf_clear_status(), ra8_dotf_deinit(), ra8_dotf_disable(), ra8_dotf_enable(), ra8_dotf_get_status(), ra8_dotf_init(), ra8_dotf_install_key(), ra8_dotf_rotate_key(), ra8_dotf_run_self_test(), ra8_dotf_select_region(), ra8_dotf_set_iv(), ra8_dotf_set_key_size(), and ra8_dotf_set_sca_level().