Commit Graph

18 Commits

Author SHA1 Message Date
iceman1001 b097e10aa3 this commit refactors the signature checks. First we introduce a common pm3 generic private / public key pair in order to allow for users to self sign their own modded device. The verification checks now looks at both hard coded public keys. If a vendor wants to add their own public key thus allowing for a simple way for us to identify their devices they can now do so. The downside is that the firmware mismatch detection becomes a bit dodgy. mem info; mem info -v; mem info -s -p <filename.pem>; mem info -s -p <filename.pem> -w contains the changes. OBS! when -w be careful to not overwrite your genuine RDV4 signature. As always, with great power comes great responsibility 2025-09-25 19:44:36 +02:00
Piotr Rzeszut d9a3e4f050 Refactor keys in flash statistics to check for files 2024-12-26 01:11:46 +01:00
ANTodorov bd803ce8fd rework to use smart SPI flash detection
Check JEDEC ID is in range between 0x0001 ... 0xFFFE,
Compare the output from 0x90 and 0x9F,
Then the size from the JEDEC ID

Otherwise fall-back to 256 kB

Extend the spi_flash_decode.py to handle more (known) SPI flash ICs
2024-12-03 09:40:57 +02:00
ANTodorov 639f16ba3b added JEDEC information for SPI flash W25Q64JV
added some "extrapolated" but logical matches by Manufacturer/Device ID only

some reordering
2024-11-28 11:04:32 +02:00
iceman1001 2ad635ce57 style 2024-11-20 23:32:02 +01:00
ANTodorov 76aaef96cc rework addressing the review comments
Reverted 'mfr_id' to 'manufacturer_id'
Moved devices table definition to flashmem.h
Single global variable 'spi_flash_pages64k'
The local structure holding the actual device data is used in firmware.c only

difference in code:
```
   text    data     bss     dec     hex filename
 223189  138560    6067  367816   59cc8 ./armsrc/obj/fullimage.elf <-- c9e751d darkside: fix backdoor support

 223437  138624    6075  368136   59e08 ./armsrc/obj/fullimage.elf <-- this commit
 ======================================
   +248     +64      +8    +320
```
2024-11-20 14:10:02 +02:00
ANTodorov f3fa732062 refactor spi flash detection 2024-11-19 09:35:26 +02:00
ANTodorov 68e354d7ef fix failed spi flash detection
fallback to 4 pages when SPI IC is unknown
some code styling
remove some unused code
2024-11-18 11:45:21 +02:00
ANTodorov 48ec109a1e use all spi flash v0.1
* introduced a new communication command CMD_FLASHMEM_PAGES64K to get the number of 64k pages
* "the last page" is a special, holding the dicts and some other stuff, relocated to there
* raised timeout when wiping a mem page (W25Q16 looks a bit slower than W25X20BV)
* loop all pages in Flash_WipeMemory()
2024-11-17 19:03:15 +02:00
Def ea797602f4 32mbit flash identification 2024-10-13 17:58:19 +03:00
Philippe Teuwen 2685ad0dc0 More flash identifications 2024-10-13 02:11:40 +02:00
libin-ka c7e5363ada Update flashmem.h
add W25Q16 devid

Signed-off-by: libin-ka <46210417+libin-ka@users.noreply.github.com>
2024-10-05 19:13:58 +08:00
ANTodorov 7ffab48e77 show SPI flash JEDEC data
Signed-off-by: ANTodorov <ANTodorov@users.noreply.github.com>
2024-10-02 14:11:34 +03:00
iceman1001 475bbe183d some generic devices has other sizes of flash 2023-02-18 22:02:20 +01:00
Henry Gabryjelski c531bd0f65 make style updates 2023-02-18 12:20:43 -08:00
Henry Gabryjelski 229454963b standardize flash uniqueID to big-endian 2023-02-18 12:16:50 -08:00
Henry Gabryjelski 48ca513a96 updates from make style 2023-02-17 17:27:07 -08:00
Henry Gabryjelski 44676bde72 Bootrom: Enable serial number from flash
* Add `.ramfunc` section to bootrom loader script
* exclude spiffs functionality from flashmem.h/flashmem.c
   (allows bootrom to use flashmem)
* hide unused tick.h / flashmem.h functions from bootrom
   (not technically necessary; see comments)
* bootrom: add source files, include path, and defines when
  `PLATFORM_DEFS` defines `WITH_FLASH`
* Define `AS_BOOTROM` to indicate code is building for bootrom
2023-02-17 17:07:13 -08:00