Skip to content

Drive the Athena F5200 from the mpfs250 test-app under WOLFCRYPT_TEST and WOLFCRYPT_BENCHMARK - #980

Open
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:mpfs_athena_testapp
Open

dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:mpfs_athena_testapp

Conversation

@dgarske

@dgarske dgarske commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Description

With MPFS_ATHENA=1 the PolarFire SoC test application brings the engine up itself, so the stock wolfCrypt test and benchmark run against it bare metal, in the M-mode environment wolfBoot uses. It needs wolfSSL PR 12055 in lib/wolfssl.

  • test-app/app_mpfs250.c, test-app/Makefile: registration and self-test, the benchmark once per call size in MPFS_BENCH_SIZES, and the engine call count at the end, since a passing test proves nothing about offload on its own. A failed bring-up or self-test prints the failing test and halts, as the bootloader's own self-check does.
  • include/user_settings.h: WOLFSSL_USE_ALIGN for ARCH_RISCV64, as the harts trap on a misaligned access with nothing to emulate it; a static pool large enough for the benchmark's buffers; and an __ASSEMBLER__ guard on the two test-app function declarations, which the assembler otherwise reads when wolfSSL's RISC-V assembly includes this header.
  • include/user_settings.h, Athena builds: the test and benchmark build also turns on SHA-224, AES key wrap and CMAC and seeds wolfCrypt's DRBG from the engine's NRBG, so every algorithm the wolfSSL port offloads is exercised. The bootloader keeps only its image hash and cipher offloads, with the rest of the port opted out.
  • test-app/startup_riscv.c, test-app/vector_riscv.S, hal/mpfs250.c, hal/mpfs250.h: the M-mode trap handler prints the cause and halts instead of resuming at the fault; a machine-timer interrupt refreshes the five MSS watchdogs, which expire well inside a test run, with the HAL's MTIME enable and CLINT timer registers made available to the app.
  • test-app/wolfcrypt_support.c, test-app/RISCV64-mpfs250.ld, test-app/Makefile: the timebase follows the HAL's live clock (the DDR configuration runs the E51 at the PLL rate), and the stack the benchmark's SP math frames need is substituted into the linker script only for a WOLFCRYPT_TEST or WOLFCRYPT_BENCHMARK build, since the template is shared with the L2 scratchpad configurations that have no room to reserve it.
  • docs/PolarFire.md, docs/Targets.md: how to build and read it, with the measured offload.

Testing

MPFS250TS Video Kit, DDR configuration: wolfcrypt_test() complete and the benchmark at every size, each with and without the engine. The M-mode QSPI configuration runs the benchmark app with WOLFBOOT_L2SCRATCH_SIZE=512k. Against wolfSSL PR 12055 the test and benchmark builds exercise every family it offloads on the board, RSA and P-521 with WOLFBOOT_ENABLE_PK_RSA2048 and WOLFBOOT_ENABLE_PK_ECC521 added; the bootloader-only Athena build is build-checked.

@dgarske dgarske self-assigned this Nov 6, 2026

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #980

Scan targets checked: wolfboot-src, wolfboot-bugs
Not reviewed (no scan target covers them): docs/PolarFire.md, docs/Targets.md, hal/mpfs250.h, test-app/Makefile, test-app/RISCV64-mpfs250.ld, test-app/vector_riscv.S
Coverage: 5 of 5 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Max

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #980

Scan targets checked: none
Unchanged since last review (not re-run): wolfboot-src, wolfboot-bugs
Not reviewed (no scan target covers them): docs/PolarFire.md, docs/Targets.md, hal/mpfs250.h, test-app/Makefile, test-app/RISCV64-mpfs250.ld, test-app/vector_riscv.S

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

@dgarske
dgarske force-pushed the mpfs_athena_testapp branch from b71229c to ab73deb Compare November 13, 2026 16:17
Copilot AI balanced review requested due to automatic review settings November 13, 2026 16:17

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #980

Scan targets checked: wolfboot-src, wolfboot-bugs
Not reviewed (no scan target covers them): docs/PolarFire.md, docs/Targets.md, hal/mpfs250.h, test-app/Makefile, test-app/RISCV64-mpfs250.ld, test-app/vector_riscv.S
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The repeated benchmark initialization corrupts the static memory pool, and Athena self-test failures leave the device registered while allowing tests and benchmarks to continue.

2 open issues
What changed in this PR

Extends the MPFS250 test application to exercise the Athena F5200 through bare-metal wolfCrypt tests and benchmarks, using wolfSSL PR 12055.

Changes:

  • Adds Athena initialization, self-tests, engine-call reporting, and benchmarks at multiple buffer sizes.
  • Adds watchdog servicing, trap diagnostics, and HAL-based benchmark timing.
  • Updates algorithm settings, alignment, memory sizing, and build documentation.
File Description
test-app/​wolfcrypt_support.c Uses HAL clock definitions for benchmark timing.
test-app/​vector_riscv.S Routes machine-timer interrupts to a handler.
test-app/​startup_riscv.c Adds M-mode fault diagnostics and a default timer handler.
test-app/​RISCV64-mpfs250.ld Makes the application stack size configurable.
test-app/​Makefile Links Athena support and selects test/benchmark stack sizes.
test-app/​app_mpfs250.c Initializes Athena, runs sized benchmarks, reports calls, and services watchdogs.
include/​user_settings.h Configures alignment, algorithms, entropy, static pools, and assembler guards.
hal/​mpfs250.h Exposes timer registers and the MTIME enable function.
hal/​mpfs250.c Makes MTIME initialization available to M-mode applications.
docs/​Targets.md Updates the Athena capability summary.
docs/​PolarFire.md Documents build steps, memory requirements, and measured offload performance.

Review effort: Balanced

Comment thread test-app/app_mpfs250.c Resolved
Comment thread test-app/app_mpfs250.c Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The enlarged NOLOAD allocations and interrupt/watchdog changes require link-map and board validation to confirm physical scratchpad bounds, bootloader-stack separation, and watchdog timing across supported Libero configurations.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@dgarske
dgarske force-pushed the mpfs_athena_testapp branch from 282a924 to c1180f6 Compare November 13, 2026 22:33
@dgarske dgarske changed the title Drive the Athena F5200 from the mpfs250 test-app under WOLFCRYPT_TEST and WOLFCRYPT_BENCHMARK Align RISC-V SHA-256 round constants for the 8-byte loads that read them Nov 13, 2026
@dgarske dgarske changed the title Align RISC-V SHA-256 round constants for the 8-byte loads that read them Drive the Athena F5200 from the mpfs250 test-app under WOLFCRYPT_TEST and WOLFCRYPT_BENCHMARK Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants