1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-28 16:21:03 +00:00

chore(core): remove useless MPU_MODE_KERNEL_SRAM

[no changelog]
This commit is contained in:
tychovrahe 2024-11-14 08:43:57 +01:00 committed by TychoVrahe
parent c50dd96783
commit 4ed70cc9bc
3 changed files with 0 additions and 12 deletions

View File

@ -43,7 +43,6 @@ typedef enum {
MPU_MODE_STORAGE, // + both storage areas (privileged RW)
MPU_MODE_ASSETS, // + assets (privileged RW)
MPU_MODE_SAES, // + unprivileged SAES code
MPU_MODE_KERNEL_SRAM, // + extra kernel SRAM (STM32F4 Only) (privileged RW)
MPU_MODE_UNUSED_FLASH, // + unused flash areas (privileged RW)
MPU_MODE_APP, // + unprivileged DMA2D (RW) & Assets (RO)
} mpu_mode_t;

View File

@ -35,13 +35,9 @@
__attribute__((section(".buf"))) uint32_t pwm_data[SAMPLES] = {0};
void consumption_mask_randomize() {
mpu_mode_t mpu_mode = mpu_reconfig(MPU_MODE_KERNEL_SRAM);
for (int i = 0; i < SAMPLES; i++) {
pwm_data[i] = rng_get() % TIMER_PERIOD;
}
mpu_restore(mpu_mode);
}
void consumption_mask_init(void) {

View File

@ -281,13 +281,6 @@ mpu_mode_t mpu_reconfig(mpu_mode_t mode) {
SET_REGION( 6, FLASH_BASE + 0x110000, SIZE_64KB, 0x00, FLASH_DATA, PRIV_RW );
break;
case MPU_MODE_KERNEL_SRAM:
DIS_REGION( 5 );
// Kernel data in DMA accessible SRAM (Privileged, Read-Write, Non-Executable)
// (overlaps with unprivileged SRAM region)
SET_REGION( 6, SRAM_BASE, SIZE_1KB, 0x00, SRAM, PRIV_RW );
break;
case MPU_MODE_UNUSED_FLASH:
// Unused Flash Area #1 (Privileged, Read-Write, Non-Executable)
SET_REGION( 5, FLASH_BASE + 0x00C000, SIZE_16KB, 0x00, FLASH_DATA, PRIV_RW );