@@ -792,6 +792,15 @@ The PolarFire SoC is a 64-bit RISC-V SoC featuring a five-core CPU cluster (1×
792792* Low power consumption
793793* External flash support
794794
795+ ### PolarFire SoC Files
796+
797+ ` hal/mpfs250.c ` - Hardware abstraction layer implementation (UART and uSD)
798+ ` hal/mpfs250.h ` - Register definitions and hardware interfaces
799+ ` hal/mpfs250.ld ` - Linker script for the platform
800+ ` hal/mpfs.dts ` / ` hal/mpfs.dtb ` - Device tree source and binary
801+ ` hal/mpfs.yaml ` - HSS payload generator configuration
802+ ` hal/mpfs250.its ` - For creating new FIT images with Kernel and DTB
803+
795804### Building PolarFire SoC
796805
797806All build settings come from .config file. For this platform use ` TARGET=mpfs250 ` and ` ARCH=RISCV64 ` .
@@ -837,18 +846,20 @@ The HSS MMC boot source looks for GPT with GUID "21686148-6449-6E6F-744E-6565644
837846
838847The resulting image from ` hss-payload-generator ` can be directly placed into GPT BIOS partition. The HSS tinyCLI supports the ` USBDMSC ` command to mount the eMMC or SD card as a USB device. You can then use "dd" to copy the boot image to the BOOT partition 2. Example:
839848
840- ```
841- sudo dd if=wolfboot.bin of=/dev/sdc2 bs=512
849+ ``` sh
850+ sudo dd if=wolfboot.bin of=/dev/sdc1 bs=512 && sudo cmp wolfboot.bin /dev/sdc1
842851```
843852
844853### PolarFire testing
845854
846855This section describes how to build the test-application, create a custom uSD with required partitions and copying signing test-application to uSD partitions.
847856
848- To use your own application (Linux FIT Image, ELF, etc) just replace test-app/image.elf with your own filename .
857+ To use your own application (Linux FIT Image, ELF, etc) just replace test-app/image.elf with your own file (example "fitImage") .
849858
8508591 ) Partition uSD card (replace /dev/sdc with your actual media, find using ` lsblk ` ):
851860
861+ Note: adjust +64M for larger OFP A/B
862+
852863``` sh
853864sudo fdisk /dev/sdc << EOF
854865g
@@ -906,17 +917,76 @@ Device Start End Sectors Size Type
906917``` sh
907918# make test-app
908919make test-app/image.elf
909- # Sign image with version 1
920+
921+ # Sign test-app/image with version 1
910922./tools/keytools/sign --ecc384 --sha384 test-app/image.elf wolfboot_signing_private_key.der 1
911- # Copy signed image to both OFP partitions
912- sudo dd if=image_v1_signed.bin of=/dev/sdc2 bs=512
913- sudo dd if=image_v1_signed.bin of=/dev/sdc3 bs=512
923+ sudo dd if=test-app/image_v1_signed.bin of=/dev/sdc2 bs=512 && sudo cmp test-app/image_v1_signed.bin /dev/sdc2
924+
925+ # OR
914926
915- # Copy wolfBoot to BIOS boot partition
916- sudo dd if=wolfboot.bin of=/dev/sdc1 bs=512
927+ # Sign FIT image with version 1
928+ ./tools/keytools/sign --ecc384 --sha384 fitImage wolfboot_signing_private_key.der 1
929+ sudo dd if=fitImage_v1_signed.bin of=/dev/sdc2 bs=512 && sudo cmp fitImage_v1_signed.bin /dev/sdc2
930+
931+ # Copy root file system
932+ sudo fdisk -l mchp-base-image-mpfs-video-kit.rootfs-20250725105640.wic
933+ sudo dd if=mchp-base-image-mpfs-video-kit.rootfs-20250725105640.wic skip=155648 of=/dev/sdc4 bs=512 count=944898 status=progress
917934```
918935
919- 3 ) Insert SDCARD into PolarFire and let HSS start wolfBoot. You may need to use ` boot sdcard ` or configure/build HSS to disable MMC / enable SDCARD.
936+ 4 ) Insert SDCARD into PolarFire and let HSS start wolfBoot. You may need to use ` boot sdcard ` or configure/build HSS to disable MMC / enable SDCARD.
937+
938+ ### FIT Image Creation (decompress Linux Kernel Image)
939+
940+ ``` sh
941+ $ dumpimage -l fitImage
942+ $ dumpimage -T flat_dt -p 0 fitImage -o kernel.gz
943+ Extracted:
944+ Image 0 (kernel-1)
945+ Description: Linux kernel
946+ Created: Tue Jul 22 03:04:20 2025
947+ Type: Kernel Image
948+ Compression: gzip compressed
949+ Data Size: 5831831 Bytes = 5695.15 KiB = 5.56 MiB
950+ Architecture: RISC-V
951+ OS: Linux
952+ Load Address: 0x80200000
953+ Entry Point: 0x80200000
954+ Hash algo: sha256
955+ Hash value: 296034c3100d21e6edc417d2406c9d27ec6578fa03c4e333307d0b0b65e0092b
956+ $ gzip -cdvk kernel.gz > kernel.bin
957+ $ mkimage -f hal/mpfs250.its fitImageNew
958+ FIT description: PolarFire SoC MPFS250T
959+ Created: Mon Dec 22 15:29:32 2025
960+ Image 0 (kernel-1)
961+ Description: Kernel Image
962+ Created: Mon Dec 22 15:29:32 2025
963+ Type: Kernel Image
964+ Compression: uncompressed
965+ Data Size: 19745280 Bytes = 19282.50 KiB = 18.83 MiB
966+ Architecture: RISC-V
967+ OS: Linux
968+ Load Address: 0x80200000
969+ Entry Point: 0x80200000
970+ Hash algo: sha256
971+ Hash value: 800ce147fa91f367ec620936a59a1035c49971ed4b9080c96bdc547471e80487
972+ Image 1 (fdt-1)
973+ Description: Flattened Device Tree blob
974+ Created: Mon Dec 22 15:29:32 2025
975+ Type: Flat Device Tree
976+ Compression: uncompressed
977+ Data Size: 19897 Bytes = 19.43 KiB = 0.02 MiB
978+ Architecture: RISC-V
979+ Load Address: 0x8a000000
980+ Hash algo: sha256
981+ Hash value: 0b4efca8c0607c9a8f4f9a00ccb7691936e019f3181aab45e6d52dae91975039
982+ Default Configuration: ' conf@1'
983+ Configuration 0 (conf@1)
984+ Description: PolarFire SoC MPFS250T
985+ Kernel: kernel-1
986+ FDT: fdt-1
987+ Hash algo: sha256
988+ Hash value: unavailable
989+ ```
920990
921991### Debugging PolarFire Soc
922992
@@ -946,117 +1016,66 @@ set architecture riscv:rv64
9461016### PolarFire Example Boot Output
9471017
9481018```
949- wolfBoot Version: 2.7.0 (Dec 17 2025 17:03:55)
950- mmc_set_timeout: timeout_val 500000 (12)
951- mmc_set_clock: requested khz: 400, actual khz: 400
952- mmc_send_cmd: cmd_index: 0, cmd_arg: 00000000, resp_type: 0
953- mmc_send_cmd: cmd_index: 8, cmd_arg: 00000100, resp_type: 9
954- mmc_init: xpc:0, si8r:1, max_ma (3.3v:128 1.8v:128)
955- mmc_send_cmd: cmd_index: 55, cmd_arg: 00000000, resp_type: 1
956- mmc_send_cmd: cmd_index: 41, cmd_arg: 00000000, resp_type: 4
957- ocr_reg: 0x40FF8000
958- mmc_init: sending OCR arg: 0x41200000
959- mmc_send_cmd: cmd_index: 55, cmd_arg: 00000000, resp_type: 1
960- mmc_send_cmd: cmd_index: 41, cmd_arg: 41200000, resp_type: 4
961- ocr_reg: 0x40FF8000
962- mmc_send_cmd: cmd_index: 55, cmd_arg: 00000000, resp_type: 1
963- mmc_send_cmd: cmd_index: 41, cmd_arg: 41200000, resp_type: 4
964- ocr_reg: 0xC1FF8000
965- mmc_send_cmd: cmd_index: 2, cmd_arg: 00000000, resp_type: 3
966- mmc_send_cmd: cmd_index: 3, cmd_arg: 00000000, resp_type: 8
967- mmc_init: rca: 43690
968- mmc_send_cmd: cmd_index: 9, cmd_arg: AAAA0000, resp_type: 3
969- mmc_init: sector size: 512
970- mmc_init: sector count: 62333952
971- mmc_send_cmd: cmd_index: 7, cmd_arg: AAAA0000, resp_type: 2
972- mmc_send_cmd: cmd_index: 55, cmd_arg: AAAA0000, resp_type: 1
973- mmc_send_cmd: cmd_index: 6, cmd_arg: 00000002, resp_type: 1
974- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
975- mmc_send_cmd: cmd_index: 16, cmd_arg: 00000008, resp_type: 1
976- mmc_send_cmd: cmd_index: 55, cmd_arg: AAAA0000, resp_type: 1
977- mmc_read: cmd_index: 51, block_addr: 00000000, dst 0x801FFCD0, sz: 8
978- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
979- mmc_read: status: 0
980- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
981- mmc_read: cmd_index: 6, block_addr: 00000001, dst 0x801FFC38, sz: 64
982- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
983- mmc_read: status: 0
984- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
985- mmc_read: cmd_index: 6, block_addr: 80000001, dst 0x801FFC38, sz: 64
986- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
987- mmc_read: status: 0
988- mmc_set_clock: requested khz: 50000, actual khz: 50000
1019+ wolfBoot Version: 2.7.0 (Dec 22 2025 14:14:37)
9891020Reading MBR...
990- disk_read: drv:0, start:0, count:512, dst:0x801FF918
991- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
992- mmc_read: cmd_index: 17, block_addr: 00000000, dst 0x801FF918, sz: 512
993- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
994- mmc_read: status: 0
9951021Found GPT PTE at sector 1
9961022Found valid boot signature in MBR
997- disk_read: drv:0, start:512, count:512, dst:0x801FF918
998- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
999- mmc_read: cmd_index: 17, block_addr: 00000001, dst 0x801FF918, sz: 512
1000- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1001- mmc_read: status: 0
10021023Valid GPT partition table
10031024Current LBA: 0x1
10041025Backup LBA: 0x3B723FF
10051026Max number of partitions: 128
10061027Software limited: only allowing up to 16 partitions per disk.
1007- Disk size: 1850178048
1008- disk_read: drv:0, start:1024, count:128, dst:0x801FF818
1009- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1010- mmc_read: cmd_index: 17, block_addr: 00000002, dst 0x801FF588, sz: 512
1011- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1012- mmc_read: status: 0
1013- disk0.p0 (0_3FFFE00h@ 0_400000)
1014- disk_read: drv:0, start:1152, count:128, dst:0x801FF818
1015- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1016- mmc_read: cmd_index: 17, block_addr: 00000002, dst 0x801FF588, sz: 512
1017- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1018- mmc_read: status: 0
1019- disk0.p1 (0_3FFFE00h@ 0_400000)
1020- disk_read: drv:0, start:1280, count:128, dst:0x801FF818
1021- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1022- mmc_read: cmd_index: 17, block_addr: 00000002, dst 0x801FF588, sz: 512
1023- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1024- mmc_read: status: 0
1025- disk0.p2 (0_3FFFE00h@ 0_400000)
1026- disk_read: drv:0, start:1408, count:128, dst:0x801FF818
1027- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1028- mmc_read: cmd_index: 17, block_addr: 00000002, dst 0x801FF588, sz: 512
1029- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1030- mmc_read: status: 0
1031- disk0.p3 (0_3FFFE00h@ 0_400000)
1032- disk_read: drv:0, start:1536, count:128, dst:0x801FF818
1033- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1034- mmc_read: cmd_index: 17, block_addr: 00000003, dst 0x801FF588, sz: 512
1035- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1036- mmc_read: status: 0
1028+ Disk size: 1849146880
1029+ disk0.p0 (0_7FFE00h@ 0_100000)
1030+ disk0.p1 (0_3FFFE00h@ 0_900000)
1031+ disk0.p2 (0_3FFFE00h@ 0_4900000)
1032+ disk0.p3 (7_65AFFE00h@ 0_8900000)
10371033Total partitions on disk0: 4
10381034Checking primary OS image in 0,1...
1039- disk_read: drv:0, start:4194304, count:512, dst:0x801FFDA0
1040- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1041- mmc_read: cmd_index: 17, block_addr: 00002000, dst 0x801FFDA0, sz: 512
1042- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1043- mmc_read: status: 0
10441035Checking secondary OS image in 0,2...
1045- disk_read: drv:0, start:4194304, count:512, dst:0x801FFDA0
1046- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1047- mmc_read: cmd_index: 17, block_addr: 00002000, dst 0x801FFDA0, sz: 512
1048- mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1049- mmc_read: status: 0
1050- No valid OS image found in either partition 1 or 2
1051- wolfBoot: PANIC!
1036+ Versions, A:1 B:1
1037+ Load address 0x8E000000
1038+ Attempting boot from P:A
1039+ Boot partition: 0x801FFDA0 (sz 19767000, ver 0x1, type 0x601)
1040+ Loading image from disk...done.
1041+ Boot partition: 0x8E000000 (sz 19767000, ver 0x1, type 0x601)
1042+ Checking image integrity...done.
1043+ Verifying image signature...done.
1044+ Firmware Valid.
1045+ Flattened uImage Tree: Version 17, Size 19767000
1046+ Loading Image kernel-1: 0x8E0002C8 -> 0x80200000 (19745280 bytes)
1047+ Image kernel-1: 0x80200000 (19745280 bytes)
1048+ Loading Image fdt-1: 0x8F2D4DCC -> 0x8A000000 (19897 bytes)
1049+ Image fdt-1: 0x8A000000 (19897 bytes)
1050+ Loading DTS: 0x8A000000 -> 0x8A000000 (19897 bytes)
1051+ Loading elf at 0x80200000
1052+ Invalid elf, falling back to raw binary
1053+ Booting at 80200000
1054+ [ 0.000000] Linux version 6.12.22-linux4microchip+fpga-2025.07-g032a7095303a (oe-user@oe-host) (riscv64-oe-linux-gcc (GCC) 13.3.0, GNU ld (GNU Binutils) 2.42.0.20240723) #1 SMP Tue Jul 22 10:04:20 UTC 2025
1055+ [ 0.000000] Machine model: Microchip PolarFire-SoC VIDEO Kit
1056+ [ 0.000000] SBI specification v1.0 detected
1057+ [ 0.000000] SBI implementation ID=0x8 Version=0x10002
1058+ [ 0.000000] SBI TIME extension detected
1059+ [ 0.000000] SBI IPI extension detected
1060+ [ 0.000000] SBI RFENCE extension detected
1061+ [ 0.000000] SBI SRST extension detected
1062+ [ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000020100000 (options '115200n8')
1063+ ...
10521064```
10531065
10541066
10551067### PolarFire TODO
10561068
1057- 1 ) Add support for full HSS replacement using wolfboot.
1058- 2 ) Add support for eMMC and QSPI NOR flash
1059-
1069+ * Add eMMC/SD features:
1070+ - Multi-block read (CMD18 support)
1071+ - DMA read support
1072+ - Write support
1073+ - eMMC support (not just SD)
1074+ * Add support for reading serial number and modifying ethernet MAC in device tree
1075+ * Add support for QSPI NOR flash
1076+ * Add support for full HSS replacement using wolfboot
1077+ - Machine level assembly startup
1078+ - DDR driver
10601079
10611080
10621081## STM32F7
0 commit comments