Skip to content

Conversation

@dgarske
Copy link
Contributor

@dgarske dgarske commented Dec 6, 2025

Summary

This PR adds full support for the Microchip PolarFire SoC (MPFS250T) secure boot target, along with a refactoring of GPT (GUID Partition Table) code to make it reusable across multiple architectures.

Key Changes

1. New Platform: Microchip PolarFire SoC (MPFS250)

  • Architecture: RISC-V 64-bit (rv64imac) with five-core CPU cluster (1× E51 monitor core + 4× U54 application cores)
  • New HAL files:
    • hal/mpfs250.c - Hardware abstraction layer implementation (UART and uSD)
    • hal/mpfs250.h - Register definitions and hardware interfaces
    • hal/mpfs250.ld - Linker script for the platform
    • hal/mpfs.dts / hal/mpfs.dtb - Device tree source and binary
    • hal/mpfs.yaml - HSS payload generator configuration
    • hal/mpfs250.its - Example FIT image template
  • New boot files:
    • src/boot_riscv64.c - RISC-V 64-bit boot logic
    • src/boot_riscv64_start.S - Assembly startup code
    • src/vector_riscv64.S - Interrupt vector table
  • Test application: test-app/app_mpfs250.c with linker script
  • Example configuration: config/examples/polarfire_mpfs250.config

2. GPT Refactoring for Cross-Platform Use

Refactored the x86-specific GPT code into a generic, reusable implementation:

  • New generic GPT module: src/gpt.c + include/gpt.h - Platform-independent GPT parsing
  • Disk abstraction: include/disk.h - Common disk interface definitions
  • Renamed: src/x86/gpt.csrc/gpt.c (now contains generic GPT functions) and src/disk.c (now contains generic MBR/GPT handling functions)
  • Enhanced update_disk.c: Updated to work with the generic GPT interface for non-x86 targets

3. Build & CI Updates

  • Added MPFS250 to test-configs.yml workflow for automated build testing
  • Updated arch.mk with RISCV64 architecture support and MPFS250 target rules
  • Tool Makefile updates for cross-compilation compatibility

Testing

  • Build tested with example configuration
  • Added to CI build test matrix

Documentation

Added comprehensive documentation in docs/Targets.md covering:

  • Feature overview
  • Build instructions
  • HSS payload generation
  • Flashing procedures (eMMC/SD via USB-DMSC, eNVM)
  • OpenOCD debugging setup

Future Work (documented)

  1. Full HSS replacement support using wolfBoot
  2. eMMC and QSPI NOR flash driver implementations

@dgarske dgarske self-assigned this Dec 6, 2025
@dgarske dgarske force-pushed the polarfire_soc branch 9 times, most recently from 7acaf16 to f2810fb Compare December 8, 2025 23:55
@dgarske dgarske marked this pull request as ready for review December 8, 2025 23:55
@dgarske dgarske force-pushed the polarfire_soc branch 9 times, most recently from 4a9fd1c to e4bc41b Compare December 9, 2025 23:37
@dgarske dgarske force-pushed the polarfire_soc branch 3 times, most recently from 6a7be50 to 1606e3d Compare December 13, 2025 01:11
@dgarske dgarske force-pushed the polarfire_soc branch 2 times, most recently from 2d0db79 to b027fa4 Compare December 17, 2025 23:08
@dgarske dgarske force-pushed the polarfire_soc branch 3 times, most recently from 9b945e7 to c124aa1 Compare December 17, 2025 23:49
@dgarske dgarske requested a review from danielinux December 23, 2025 18:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive support for the Microchip PolarFire SoC (MPFS250T) platform and refactors GPT (GUID Partition Table) code for cross-platform reusability.

Key Changes:

  • New RISC-V 64-bit platform support for PolarFire SoC with complete HAL, boot logic, and device tree
  • Refactored GPT code from x86-specific to generic, reusable implementation with disk abstraction layer
  • Updated build system and CI for the new target

Reviewed changes

Copilot reviewed 41 out of 43 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
hal/mpfs250.* New HAL implementation for MPFS250 including register definitions, hardware abstraction, UART, and SD/MMC drivers
hal/mpfs.* Device tree source/binary and HSS payload configuration for PolarFire SoC
src/boot_riscv64* RISC-V 64-bit boot logic and assembly startup code
src/vector_riscv64.S RISC-V 64-bit interrupt vector table implementation
src/gpt.c, include/gpt.h Generic GPT parsing functions extracted from x86-specific code
src/disk.c, include/disk.h New disk abstraction layer for GPT partition handling
src/update_disk.c Updated to use generic GPT/disk interface, added FIT image and ELF loading support
test-app/app_mpfs250.c Test application for the new platform
test-app/RISCV64-mpfs250.ld Linker script for test applications
docs/Targets.md Comprehensive documentation for building, flashing, and debugging
config/examples/polarfire_mpfs250.config Example build configuration
.github/workflows/test-configs.yml CI integration for automated testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danielinux danielinux merged commit 2fc6fe8 into wolfSSL:master Dec 24, 2025
302 checks passed
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