From 0aafeac20915fc2844f009cc210c76a4fec32c55 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 22 Feb 2021 17:19:18 -0800 Subject: [PATCH] Board specific flash sizes for RP2040 Stop-gap solution for #4041. Comment is there to provide info needed in the future. (We currently run the generic "safe" settings.) --- .../raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h | 3 +++ ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h | 3 +++ ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h | 3 +++ ports/raspberrypi/supervisor/internal_flash.c | 3 --- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h index 6a2d063d79..f82f6b6a74 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h @@ -12,3 +12,6 @@ // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) + +// Flash chip is GD25Q32 connected over QSPI +#define TOTAL_FLASH_SIZE 4 * 1024 * 1024 diff --git a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h index 26abe8a835..85398d5e96 100644 --- a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h @@ -12,3 +12,6 @@ // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) + +// Flash chip is GD25Q32 connected over QSPI +#define TOTAL_FLASH_SIZE 4 * 1024 * 1024 diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h index 4b0a220287..316692dd91 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h +++ b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h @@ -13,3 +13,6 @@ // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) + +// Flash chip is W25Q16JVUXIQ connected over QSPI +#define TOTAL_FLASH_SIZE 2 * 1024 * 1024 diff --git a/ports/raspberrypi/supervisor/internal_flash.c b/ports/raspberrypi/supervisor/internal_flash.c index d333830de9..95c1fdd75e 100644 --- a/ports/raspberrypi/supervisor/internal_flash.c +++ b/ports/raspberrypi/supervisor/internal_flash.c @@ -46,9 +46,6 @@ #define RESERVED_FLASH 1 * 1024 * 1024 -// TODO: Parameterize flash size based on the configured flash. -#define TOTAL_FLASH_SIZE 2 * 1024 * 1024 - // TODO: Split the caching out of supervisor/shared/external_flash so we can use it. #define SECTOR_SIZE 4096 #define NO_CACHE 0xffffffff