From bd0b0b2d15a24d645fa8982d032087bbcff25428 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Thu, 24 Aug 2023 14:56:26 +0200 Subject: [PATCH] refactor(core): move model specific norcow config to model header [no changelog] --- core/embed/extmod/modtrezorconfig/norcow_config.h | 9 --------- core/embed/models/model_D001.h | 1 + core/embed/models/model_T1B1.h | 1 + core/embed/models/model_T2B1.h | 1 + core/embed/models/model_T2T1.h | 1 + 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/core/embed/extmod/modtrezorconfig/norcow_config.h b/core/embed/extmod/modtrezorconfig/norcow_config.h index 7b43fa41be..5104f10235 100644 --- a/core/embed/extmod/modtrezorconfig/norcow_config.h +++ b/core/embed/extmod/modtrezorconfig/norcow_config.h @@ -26,15 +26,6 @@ #define NORCOW_HEADER_LEN 0 #define NORCOW_SECTOR_COUNT 2 -#if defined TREZOR_MODEL_T || defined TREZOR_MODEL_R || \ - defined TREZOR_MODEL_DISC1 -#define NORCOW_SECTOR_SIZE (64 * 1024) -#elif defined TREZOR_MODEL_1 -#define NORCOW_SECTOR_SIZE (16 * 1024) -#else -#error Unknown Trezor model -#endif - /* * Current storage version. */ diff --git a/core/embed/models/model_D001.h b/core/embed/models/model_D001.h index bc7ec6a1c1..89ef2baf07 100644 --- a/core/embed/models/model_D001.h +++ b/core/embed/models/model_D001.h @@ -24,5 +24,6 @@ #define BOOTLOADER_IMAGE_MAXSIZE (128 * 1024 * 1) // 128 KB #define FIRMWARE_IMAGE_MAXSIZE (128 * 1024 * 13) // 1664 KB +#define NORCOW_SECTOR_SIZE (64 * 1024) #endif diff --git a/core/embed/models/model_T1B1.h b/core/embed/models/model_T1B1.h index c138b4711d..ae624ab10d 100644 --- a/core/embed/models/model_T1B1.h +++ b/core/embed/models/model_T1B1.h @@ -12,5 +12,6 @@ #define BOOTLOADER_IMAGE_MAXSIZE (32 * 1024 * 1) // 32 KB #define FIRMWARE_IMAGE_MAXSIZE (64 * 1024 * 15) // 960 KB +#define NORCOW_SECTOR_SIZE (16 * 1024) #endif diff --git a/core/embed/models/model_T2B1.h b/core/embed/models/model_T2B1.h index ce3795a37d..613fef212b 100644 --- a/core/embed/models/model_T2B1.h +++ b/core/embed/models/model_T2B1.h @@ -24,5 +24,6 @@ #define BOOTLOADER_IMAGE_MAXSIZE (128 * 1024 * 1) // 128 KB #define FIRMWARE_IMAGE_MAXSIZE (128 * 1024 * 13) // 1664 KB +#define NORCOW_SECTOR_SIZE (64 * 1024) #endif diff --git a/core/embed/models/model_T2T1.h b/core/embed/models/model_T2T1.h index 0af3ebfe34..55d217e280 100644 --- a/core/embed/models/model_T2T1.h +++ b/core/embed/models/model_T2T1.h @@ -24,5 +24,6 @@ #define BOOTLOADER_IMAGE_MAXSIZE (128 * 1024 * 1) // 128 KB #define FIRMWARE_IMAGE_MAXSIZE (128 * 1024 * 13) // 1664 KB +#define NORCOW_SECTOR_SIZE (64 * 1024) #endif