Removing mctp-echo and adding kernel objects
diff --git a/target/ast1060-evb/mctp/BUILD.bazel b/target/ast1060-evb/mctp/BUILD.bazel index aa927ec..d5f8415 100644 --- a/target/ast1060-evb/mctp/BUILD.bazel +++ b/target/ast1060-evb/mctp/BUILD.bazel
@@ -1,6 +1,5 @@ # Licensed under the Apache-2.0 license -load("@pigweed//pw_kernel/tooling:rust_app.bzl", "rust_app") load("@pigweed//pw_kernel/tooling:system_image.bzl", "system_image", "system_image_test") load("@pigweed//pw_kernel/tooling:target_codegen.bzl", "target_codegen") load("@pigweed//pw_kernel/tooling:target_linker_script.bzl", "target_linker_script") @@ -9,28 +8,7 @@ load("//target:uart_boot_image.bzl", "uart_boot_image") # --------------------------------------------------------------------------- -# MCTP echo binary (userspace process) -# --------------------------------------------------------------------------- - -rust_app( - name = "mctp_echo", - codegen_crate_name = "app_mctp_echo", - srcs = ["mctp_echo.rs"], - edition = "2024", - system_config = ":system_config", - tags = ["kernel"], - deps = [ - "//services/mctp/api:mctp_api", - "//services/mctp/client:mctp_client", - "@pigweed//pw_kernel/syscall:syscall_user", - "@pigweed//pw_kernel/userspace", - "@pigweed//pw_log/rust:pw_log", - "@pigweed//pw_status/rust:pw_status", - ], -) - -# --------------------------------------------------------------------------- -# System image: I2C server + MCTP server + echo client +# System image: I2C server + MCTP server # --------------------------------------------------------------------------- system_image( @@ -38,7 +16,6 @@ apps = [ "//services/i2c/server:i2c_server", "//services/mctp/server:mctp_server", - ":mctp_echo", ], kernel = ":target", platform = "//target/ast1060-evb",
diff --git a/target/ast1060-evb/mctp/system.json5 b/target/ast1060-evb/mctp/system.json5 index e7fb45b..ad5675b 100644 --- a/target/ast1060-evb/mctp/system.json5 +++ b/target/ast1060-evb/mctp/system.json5
@@ -6,26 +6,24 @@ // // Memory Layout (PMSAv7-friendly, power-of-2 aligned regions): // FIXED: Kernel RAM now comes BEFORE application RAM to avoid boot crashes -// 0x00000000 - 0x00000500: Vector table + kernel annotations (1280 bytes) -// 0x00000500 - 0x00020000: Kernel flash (~127KB) +// 0x00000000 - 0x00000800: Vector table + kernel annotations (2048 bytes) +// 0x00000800 - 0x00020000: Kernel flash (~126KB) // 0x00020000 - 0x00040000: i2c_server flash (128KB) -// 0x00040000 - 0x00050000: mctp_server flash (64KB) -// 0x00050000 - 0x00060000: mctp_echo flash (64KB) -// 0x00060000 - 0x00080000: Kernel RAM (128KB) <- MOVED HERE +// 0x00040000 - 0x00060000: mctp_server flash (128KB) +// 0x00060000 - 0x00080000: Kernel RAM (128KB) // 0x00080000 - 0x00090000: i2c_server RAM (64KB) -// 0x00090000 - 0x00098000: mctp_server RAM (32KB) -// 0x00098000 - 0x000A0000: mctp_echo RAM (32KB) +// 0x00090000 - 0x000A0000: mctp_server RAM (64KB) // // Total: 0xA0000 = 640KB (fits within the 640KB usable window of the AST1060's 768KB SRAM). { arch: { type: "armv7m", vector_table_start_address: 0x00000000, - vector_table_size_bytes: 1280, // 0x500 (272 vectors + thread/stack annotations) + vector_table_size_bytes: 2048, // 0x800 (vector table + process annotations for all 3 apps) }, kernel: { - flash_start_address: 0x00000500, // After vector table + annotations - flash_size_bytes: 129792, // 0x1FB00: ends at exactly 0x20000 (128KB boundary) + flash_start_address: 0x00000800, // After vector table + annotations + flash_size_bytes: 129024, // 0x1F800: ends at exactly 0x20000 (128KB boundary) ram_start_address: 0x00060000, // Kernel RAM comes FIRST, before all app RAM ram_size_bytes: 131072, // 128KB }, @@ -45,6 +43,21 @@ name: "I2C", type: "channel_handler", // Server side of client→server channel }, + { + // AST1060 I2C2 combined master+slave interrupt (IRQ 112). + name: "I2C2_IRQ", + type: "interrupt", + irqs: [ + { + name: "i2c2", + number: 112, + }, + ], + }, + { + name: "WG", + type: "wait_group", + }, ], threads: [ { @@ -79,7 +92,7 @@ { name: "mctp_server", flash_size_bytes: 65536, // 64KB for MCTP server code - ram_size_bytes: 32768, // 32KB RAM (Router state, buffers) + ram_size_bytes: 65536, // 64KB RAM (Router state + SPDM context + buffers) processes: [ { name: "mctp server process", @@ -108,31 +121,5 @@ }, ], }, - // ──── MCTP Echo Client ──── - // Listens for MCTP type-1 messages and echoes the payload back. - { - name: "mctp_echo", - flash_size_bytes: 65536, // 64KB for echo app - ram_size_bytes: 32768, // 32KB RAM - processes: [ - { - name: "mctp echo process", - objects: [ - { - name: "MCTP", - type: "channel_initiator", // Client side: echo → MCTP server - handler_process: "mctp server process", - handler_object_name: "MCTP", - }, - ], - threads: [ - { - name: "mctp echo thread", - stack_size_bytes: 4096, // 4KB stack - }, - ], - }, - ], - }, ], }