From aac3559453530752dc4c0d16236a5dc366fb3404 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Wed, 13 Nov 2024 13:38:27 +0100 Subject: [PATCH] chore(core): move storage sectors to end of flash on U5G models [no changelog] --- core/embed/models/D002/memory.ld | 25 +++++++++++++------------ core/embed/models/D002/model_D002.h | 29 +++++++++++++++-------------- core/embed/models/T3W1/memory.ld | 24 ++++++++++++------------ core/embed/models/T3W1/model_T3W1.h | 28 ++++++++++++++-------------- 4 files changed, 54 insertions(+), 52 deletions(-) diff --git a/core/embed/models/D002/memory.ld b/core/embed/models/D002/memory.ld index 223c58c11..ac3aef5c8 100644 --- a/core/embed/models/D002/memory.ld +++ b/core/embed/models/D002/memory.ld @@ -20,20 +20,21 @@ BOOTLOADER_START = 0xc014000; BOOTLOADER_MAXSIZE = 0x30000; BOOTLOADER_SECTOR_START = 0xa; BOOTLOADER_SECTOR_END = 0x21; -STORAGE_1_START = 0xc044000; -STORAGE_1_MAXSIZE = 0x20000; -STORAGE_1_SECTOR_START = 0x22; -STORAGE_1_SECTOR_END = 0x31; -STORAGE_2_START = 0xc064000; -STORAGE_2_MAXSIZE = 0x20000; -STORAGE_2_SECTOR_START = 0x32; -STORAGE_2_SECTOR_END = 0x41; -FIRMWARE_START = 0xc084000; +FIRMWARE_START = 0xc044000; FIRMWARE_MAXSIZE = 0x36c000; -FIRMWARE_SECTOR_START = 0x42; -FIRMWARE_SECTOR_END = 0x1f7; -KERNEL_START = 0xc084000; +FIRMWARE_SECTOR_START = 0x22; +FIRMWARE_SECTOR_END = 0x1d7; +KERNEL_START = 0xc044000; KERNEL_MAXSIZE = 0x80000; +KERNEL_U_FLASH_SIZE = 0x200; +STORAGE_1_START = 0xc3b0000; +STORAGE_1_MAXSIZE = 0x20000; +STORAGE_1_SECTOR_START = 0x1d8; +STORAGE_1_SECTOR_END = 0x1e7; +STORAGE_2_START = 0xc3d0000; +STORAGE_2_MAXSIZE = 0x20000; +STORAGE_2_SECTOR_START = 0x1e8; +STORAGE_2_SECTOR_END = 0x1f7; ASSETS_START = 0xc3f0000; ASSETS_MAXSIZE = 0x10000; ASSETS_SECTOR_START = 0x1f8; diff --git a/core/embed/models/D002/model_D002.h b/core/embed/models/D002/model_D002.h index b8b2414aa..8797c9102 100644 --- a/core/embed/models/D002/model_D002.h +++ b/core/embed/models/D002/model_D002.h @@ -61,22 +61,23 @@ #define BOOTLOADER_SECTOR_START 0x0A #define BOOTLOADER_SECTOR_END 0x21 -#define STORAGE_1_START 0x0C044000 -#define STORAGE_1_MAXSIZE (16 * 8 * 1024) // 128 kB -#define STORAGE_1_SECTOR_START 0x22 -#define STORAGE_1_SECTOR_END 0x31 - -#define STORAGE_2_START 0x0C064000 -#define STORAGE_2_MAXSIZE (16 * 8 * 1024) // 128 kB -#define STORAGE_2_SECTOR_START 0x32 -#define STORAGE_2_SECTOR_END 0x41 - -#define FIRMWARE_START 0x0C084000 +#define FIRMWARE_START 0x0C044000 #define FIRMWARE_MAXSIZE (438 * 8 * 1024) // 3504 kB -#define FIRMWARE_SECTOR_START 0x42 -#define FIRMWARE_SECTOR_END 0x1F7 -#define KERNEL_START 0x0C084000 +#define FIRMWARE_SECTOR_START 0x22 +#define FIRMWARE_SECTOR_END 0x1D7 +#define KERNEL_START 0x0C044000 #define KERNEL_MAXSIZE (512 * 1024) // 512 kB +#define KERNEL_U_FLASH_SIZE 512 + +#define STORAGE_1_START 0x0C3B0000 +#define STORAGE_1_MAXSIZE (16 * 8 * 1024) // 128 kB +#define STORAGE_1_SECTOR_START 0x1D8 +#define STORAGE_1_SECTOR_END 0x1E7 + +#define STORAGE_2_START 0x0C3D0000 +#define STORAGE_2_MAXSIZE (16 * 8 * 1024) // 128 kB +#define STORAGE_2_SECTOR_START 0x1E8 +#define STORAGE_2_SECTOR_END 0x1F7 #define ASSETS_START 0x0C3F0000 #define ASSETS_MAXSIZE (8 * 8 * 1024) // 64 kB diff --git a/core/embed/models/T3W1/memory.ld b/core/embed/models/T3W1/memory.ld index 9ef66cb15..ac3aef5c8 100644 --- a/core/embed/models/T3W1/memory.ld +++ b/core/embed/models/T3W1/memory.ld @@ -20,21 +20,21 @@ BOOTLOADER_START = 0xc014000; BOOTLOADER_MAXSIZE = 0x30000; BOOTLOADER_SECTOR_START = 0xa; BOOTLOADER_SECTOR_END = 0x21; -STORAGE_1_START = 0xc044000; -STORAGE_1_MAXSIZE = 0x20000; -STORAGE_1_SECTOR_START = 0x22; -STORAGE_1_SECTOR_END = 0x31; -STORAGE_2_START = 0xc064000; -STORAGE_2_MAXSIZE = 0x20000; -STORAGE_2_SECTOR_START = 0x32; -STORAGE_2_SECTOR_END = 0x41; -FIRMWARE_START = 0xc084000; +FIRMWARE_START = 0xc044000; FIRMWARE_MAXSIZE = 0x36c000; -FIRMWARE_SECTOR_START = 0x42; -FIRMWARE_SECTOR_END = 0x1f7; -KERNEL_START = 0xc084000; +FIRMWARE_SECTOR_START = 0x22; +FIRMWARE_SECTOR_END = 0x1d7; +KERNEL_START = 0xc044000; KERNEL_MAXSIZE = 0x80000; KERNEL_U_FLASH_SIZE = 0x200; +STORAGE_1_START = 0xc3b0000; +STORAGE_1_MAXSIZE = 0x20000; +STORAGE_1_SECTOR_START = 0x1d8; +STORAGE_1_SECTOR_END = 0x1e7; +STORAGE_2_START = 0xc3d0000; +STORAGE_2_MAXSIZE = 0x20000; +STORAGE_2_SECTOR_START = 0x1e8; +STORAGE_2_SECTOR_END = 0x1f7; ASSETS_START = 0xc3f0000; ASSETS_MAXSIZE = 0x10000; ASSETS_SECTOR_START = 0x1f8; diff --git a/core/embed/models/T3W1/model_T3W1.h b/core/embed/models/T3W1/model_T3W1.h index ceb6cdc21..14ce79cb1 100644 --- a/core/embed/models/T3W1/model_T3W1.h +++ b/core/embed/models/T3W1/model_T3W1.h @@ -67,24 +67,24 @@ #define BOOTLOADER_SECTOR_START 0x0A #define BOOTLOADER_SECTOR_END 0x21 -#define STORAGE_1_START 0x0C044000 -#define STORAGE_1_MAXSIZE (16 * 8 * 1024) // 128 kB -#define STORAGE_1_SECTOR_START 0x22 -#define STORAGE_1_SECTOR_END 0x31 - -#define STORAGE_2_START 0x0C064000 -#define STORAGE_2_MAXSIZE (16 * 8 * 1024) // 128 kB -#define STORAGE_2_SECTOR_START 0x32 -#define STORAGE_2_SECTOR_END 0x41 - -#define FIRMWARE_START 0x0C084000 +#define FIRMWARE_START 0x0C044000 #define FIRMWARE_MAXSIZE (438 * 8 * 1024) // 3504 kB -#define FIRMWARE_SECTOR_START 0x42 -#define FIRMWARE_SECTOR_END 0x1F7 -#define KERNEL_START 0x0C084000 +#define FIRMWARE_SECTOR_START 0x22 +#define FIRMWARE_SECTOR_END 0x1D7 +#define KERNEL_START 0x0C044000 #define KERNEL_MAXSIZE (512 * 1024) // 512 kB #define KERNEL_U_FLASH_SIZE 512 +#define STORAGE_1_START 0x0C3B0000 +#define STORAGE_1_MAXSIZE (16 * 8 * 1024) // 128 kB +#define STORAGE_1_SECTOR_START 0x1D8 +#define STORAGE_1_SECTOR_END 0x1E7 + +#define STORAGE_2_START 0x0C3D0000 +#define STORAGE_2_MAXSIZE (16 * 8 * 1024) // 128 kB +#define STORAGE_2_SECTOR_START 0x1E8 +#define STORAGE_2_SECTOR_END 0x1F7 + #define ASSETS_START 0x0C3F0000 #define ASSETS_MAXSIZE (8 * 8 * 1024) // 64 kB #define ASSETS_SECTOR_START 0x1F8