Skip to content

Commit

Permalink
chibios: mark boot2 bootlader data readonly (qmk#21986)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-8ch authored and Lorenzo Castoldi committed Dec 27, 2023
1 parent ed38588 commit e957b75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#define FLASHCMD_READ_STATUS 0x05
#define FLASHCMD_WRITE_ENABLE 0x06

extern uint8_t BOOT2_ROM[256];
static uint32_t BOOT2_ROM_RAM[64];
extern const uint8_t BOOT2_ROM[256];
static uint32_t BOOT2_ROM_RAM[64];

static ssi_hw_t *const ssi = (ssi_hw_t *)XIP_SSI_BASE;

Expand Down
12 changes: 6 additions & 6 deletions platforms/chibios/vendors/RP/stage2_bootloaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#if defined(RP2040_FLASH_AT25SF128A)

uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
0x00, 0xb5, 0x31, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21,
0x88, 0x43, 0x98, 0x60, 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2d, 0x4b,
0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61, 0x01, 0x21, 0xf0, 0x22,
Expand All @@ -40,7 +40,7 @@ uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {

#elif defined(RP2040_FLASH_GD25Q64CS)

uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
0x00, 0xb5, 0x31, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21,
0x88, 0x43, 0x98, 0x60, 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2d, 0x4b,
0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61, 0x01, 0x21, 0xf0, 0x22,
Expand All @@ -67,7 +67,7 @@ uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {

#elif defined(RP2040_FLASH_W25X10CL)

uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
0x00, 0xb5, 0x14, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61,
0x12, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60, 0x11, 0x49, 0x12, 0x48,
0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xbb, 0x21, 0x19, 0x66, 0x02, 0x21,
Expand All @@ -94,7 +94,7 @@ uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {

#elif defined(RP2040_FLASH_IS25LP080)

uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
0x00, 0xb5, 0x2b, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61,
0x29, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x28, 0x48, 0x00, 0xf0,
0x42, 0xf8, 0x28, 0x4a, 0x90, 0x42, 0x12, 0xd0, 0x06, 0x21, 0x19, 0x66,
Expand All @@ -121,7 +121,7 @@ uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {

#elif defined(RP2040_FLASH_GENERIC_03H)

uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
0x00, 0xb5, 0x0c, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61,
0x0a, 0x49, 0x19, 0x60, 0x0a, 0x49, 0x0b, 0x48, 0x01, 0x60, 0x00, 0x21,
0x59, 0x60, 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0,
Expand All @@ -148,7 +148,7 @@ uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {

#else

uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
const uint8_t BOOTLOADER_SECTION BOOT2_ROM[256] = {
0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21,
0x88, 0x43, 0x98, 0x60, 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b,
0x00, 0x21, 0x99, 0x60, 0x04, 0x21, 0x59, 0x61, 0x01, 0x21, 0xf0, 0x22,
Expand Down

0 comments on commit e957b75

Please sign in to comment.