diff --git a/hw/arm/pebble_generic.c b/hw/arm/pebble_generic.c index 4ff56d6760668..30c6c8e7bab47 100644 --- a/hw/arm/pebble_generic.c +++ b/hw/arm/pebble_generic.c @@ -5,9 +5,9 @@ * Uses simple custom MMIO peripherals instead of MCU-specific emulation. * * Machine types: - * pebble-emery - Cortex-M33, 512KB RAM, 4MB flash + * pebble-emery - Cortex-M33, 512KB RAM, 16MB PSRAM, 4MB flash * pebble-flint - Cortex-M4, 256KB RAM, 4MB flash - * pebble-gabbro - Cortex-M33, 512KB RAM, 4MB flash + * pebble-gabbro - Cortex-M33, 512KB RAM, 16MB PSRAM, 4MB flash * * Copyright (c) 2026 Core Devices LLC * SPDX-License-Identifier: GPL-2.0-or-later @@ -46,6 +46,7 @@ static const PblGenericBoardConfig board_cfg_emery = { .board_id = PBL_BOARD_ID_EMERY, .flash_size = 4 * MiB, .ram_size = 512 * KiB, + .psram_size = 16 * MiB, .sysclk_frq = PBL_SYSCLK_FRQ, .display_width = 200, .display_height = 228, @@ -80,6 +81,7 @@ static const PblGenericBoardConfig board_cfg_gabbro = { .board_id = PBL_BOARD_ID_GABBRO, .flash_size = 4 * MiB, .ram_size = 512 * KiB, + .psram_size = 16 * MiB, .sysclk_frq = PBL_SYSCLK_FRQ, .display_width = 260, .display_height = 260, @@ -117,6 +119,13 @@ static void pbl_generic_init(MachineState *machine) cfg->ram_size, &error_fatal); memory_region_add_subregion(system_memory, PBL_SRAM_BASE, &s->sram); + /* PSRAM */ + if (cfg->psram_size) { + memory_region_init_ram(&s->psram, NULL, "pebble.psram", + cfg->psram_size, &error_fatal); + memory_region_add_subregion(system_memory, PBL_PSRAM_BASE, &s->psram); + } + /* ARMv7M CPU + NVIC */ object_initialize_child(OBJECT(s), "armv7m", &s->armv7m, TYPE_ARMV7M); armv7m = DEVICE(&s->armv7m); diff --git a/include/hw/arm/pebble_generic.h b/include/hw/arm/pebble_generic.h index 4bd986b0b824c..9eaad7274e5fa 100644 --- a/include/hw/arm/pebble_generic.h +++ b/include/hw/arm/pebble_generic.h @@ -38,6 +38,7 @@ #define PBL_FLASH_BASE 0x00000000 #define PBL_EXTFLASH_BASE 0x10000000 #define PBL_SRAM_BASE 0x20000000 +#define PBL_PSRAM_BASE 0x60000000 #define PBL_UART0_BASE 0x40000000 #define PBL_UART1_BASE 0x40001000 @@ -88,6 +89,7 @@ typedef struct { uint32_t board_id; uint32_t flash_size; /* bytes */ uint32_t ram_size; /* bytes */ + uint32_t psram_size; /* bytes */ uint32_t sysclk_frq; /* Hz */ /* Display (for Phase 2) */ uint16_t display_width; @@ -111,6 +113,7 @@ struct PblGenericMachineState { ARMv7MState armv7m; MemoryRegion flash; MemoryRegion sram; + MemoryRegion psram; Clock *sysclk; Clock *refclk;