Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions hw/arm/pebble_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions include/hw/arm/pebble_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -111,6 +113,7 @@ struct PblGenericMachineState {
ARMv7MState armv7m;
MemoryRegion flash;
MemoryRegion sram;
MemoryRegion psram;

Clock *sysclk;
Clock *refclk;
Expand Down