@@ -799,7 +799,10 @@ All build settings come from .config file. For this platform use `TARGET=mpfs250
799799See example configuration at ` config/examples/polarfire_mpfs250.config ` .
800800
801801``` sh
802+ # Setup .config (build settings)
802803cp config/examples/polarfire_mpfs250.config .config
804+
805+ # build boot loader
803806make wolfboot.elf
804807```
805808
@@ -822,13 +825,48 @@ hss-payload-generator -vvv -c ./hal/mpfs.yaml wolfboot.bin
822825
823826Any customizations to the Device Tree can be made in mpfs.dts and it can be recompiled using: ` dtc -I dts -O dtb mpfs.dts -o mpfs.dtb `
824827
825-
826828Example one-shot command:
827829
828830``` sh
829831cp ./config/examples/polarfire_mpfs250.config .config && make clean && make wolfboot.elf && size wolfboot.elf && hss-payload-generator -vvv -c ./hal/mpfs.yaml wolfboot.bin && file wolfboot.bin && ls -la wolfboot.bin
830832```
831833
834+ #### Build PolarFire test-application, sign it and apply to uSD
835+
836+ ``` sh
837+ # make test-app
838+ make test-app/image.elf
839+
840+ # assemble GPT image
841+ dd if=/dev/zero of=app.bin bs=1M count=64
842+ /sbin/fdisk app.bin << EOF
843+ g
844+ n
845+ 1
846+
847+ +16M
848+ n
849+
850+
851+ +16M
852+ x
853+ n
854+ 1
855+ OFP_A
856+ n
857+ 2
858+ OFP_B
859+ r
860+ w
861+ EOF
862+
863+ cp test-app/image.elf image.bin
864+ tools/keytools/sign $SIGN $HASH image.bin wolfboot_signing_private_key.der 1
865+ tools/keytools/sign $SIGN $HASH image.bin wolfboot_signing_private_key.der 2
866+ dd if=image_v1_signed.bin of=app.bin bs=512 seek=2048 conv=notrunc
867+ dd if=image_v2_signed.bin of=app.bin bs=512 seek=34816 conv=notrunc
868+ ```
869+
832870### Flashing PolarFire SoC
833871
834872
@@ -879,10 +917,9 @@ set architecture riscv:rv64
879917### PolarFire Example Boot Output
880918
881919```
882- wolfBoot Version: 2.7.0 (Dec 17 2025 11:59:22)
883- disk_open: drv = 0
920+ wolfBoot Version: 2.7.0 (Dec 17 2025 17:03:55)
884921mmc_set_timeout: timeout_val 500000 (12)
885- mmc_set_clock: clock_khz : 400, freq_khz : 400
922+ mmc_set_clock: requested khz : 400, actual khz : 400
886923mmc_send_cmd: cmd_index: 0, cmd_arg: 00000000, resp_type: 0
887924mmc_send_cmd: cmd_index: 8, cmd_arg: 00000100, resp_type: 9
888925mmc_init: xpc:0, si8r:1, max_ma (3.3v:128 1.8v:128)
@@ -908,17 +945,79 @@ mmc_send_cmd: cmd_index: 6, cmd_arg: 00000002, resp_type: 1
908945mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
909946mmc_send_cmd: cmd_index: 16, cmd_arg: 00000008, resp_type: 1
910947mmc_send_cmd: cmd_index: 55, cmd_arg: AAAA0000, resp_type: 1
911- mmc_block_read: cmd_index: 51, block_addr: 00000000, dst 0x801FFCE0, sz: 8
948+ mmc_read: cmd_index: 51, block_addr: 00000000, dst 0x801FFCD0, sz: 8
949+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
950+ mmc_read: status: 0
951+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
952+ mmc_read: cmd_index: 6, block_addr: 00000001, dst 0x801FFC38, sz: 64
953+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
954+ mmc_read: status: 0
955+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
956+ mmc_read: cmd_index: 6, block_addr: 80000001, dst 0x801FFC38, sz: 64
957+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
958+ mmc_read: status: 0
959+ mmc_set_clock: requested khz: 50000, actual khz: 50000
960+ Reading MBR...
961+ disk_read: drv:0, start:0, count:512, dst:0x801FF918
962+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
963+ mmc_read: cmd_index: 17, block_addr: 00000000, dst 0x801FF918, sz: 512
912964mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
965+ mmc_read: status: 0
966+ Found GPT PTE at sector 1
967+ Found valid boot signature in MBR
968+ disk_read: drv:0, start:512, count:512, dst:0x801FF918
969+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
970+ mmc_read: cmd_index: 17, block_addr: 00000001, dst 0x801FF918, sz: 512
971+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
972+ mmc_read: status: 0
973+ Valid GPT partition table
974+ Current LBA: 0x1
975+ Backup LBA: 0x3B723FF
976+ Max number of partitions: 128
977+ Software limited: only allowing up to 16 partitions per disk.
978+ Disk size: 1850178048
979+ disk_read: drv:0, start:1024, count:128, dst:0x801FF818
980+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
981+ mmc_read: cmd_index: 17, block_addr: 00000002, dst 0x801FF588, sz: 512
913982mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
914- mmc_block_read: cmd_index: 6, block_addr: 00000001, dst 0x801FFC48, sz: 64
983+ mmc_read: status: 0
984+ disk0.p0 (0_3FFFE00h@ 0_400000)
985+ disk_read: drv:0, start:1152, count:128, dst:0x801FF818
915986mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
987+ mmc_read: cmd_index: 17, block_addr: 00000002, dst 0x801FF588, sz: 512
916988mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
917- mmc_block_read: cmd_index: 6, block_addr: 80000001, dst 0x801FFC48, sz: 64
989+ mmc_read: status: 0
990+ disk0.p1 (0_3FFFE00h@ 0_400000)
991+ disk_read: drv:0, start:1280, count:128, dst:0x801FF818
918992mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
919- mmc_set_clock: clock_khz: 50000, freq_khz: 50000
993+ mmc_read: cmd_index: 17, block_addr: 00000002, dst 0x801FF588, sz: 512
994+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
995+ mmc_read: status: 0
996+ disk0.p2 (0_3FFFE00h@ 0_400000)
997+ disk_read: drv:0, start:1408, count:128, dst:0x801FF818
998+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
999+ mmc_read: cmd_index: 17, block_addr: 00000002, dst 0x801FF588, sz: 512
1000+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1001+ mmc_read: status: 0
1002+ disk0.p3 (0_3FFFE00h@ 0_400000)
1003+ disk_read: drv:0, start:1536, count:128, dst:0x801FF818
1004+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1005+ mmc_read: cmd_index: 17, block_addr: 00000003, dst 0x801FF588, sz: 512
1006+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1007+ mmc_read: status: 0
1008+ Total partitions on disk0: 4
9201009Checking primary OS image in 0,1...
1010+ disk_read: drv:0, start:4194304, count:512, dst:0x801FFDA0
1011+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1012+ mmc_read: cmd_index: 17, block_addr: 00002000, dst 0x801FFDA0, sz: 512
1013+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1014+ mmc_read: status: 0
9211015Checking secondary OS image in 0,2...
1016+ disk_read: drv:0, start:4194304, count:512, dst:0x801FFDA0
1017+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1018+ mmc_read: cmd_index: 17, block_addr: 00002000, dst 0x801FFDA0, sz: 512
1019+ mmc_send_cmd: cmd_index: 13, cmd_arg: AAAA0000, resp_type: 1
1020+ mmc_read: status: 0
9221021No valid OS image found in either partition 1 or 2
9231022wolfBoot: PANIC!
9241023```
0 commit comments