Skip to content

Commit 6547a74

Browse files
dgarskedanielinux
authored andcommitted
Documentation cleanups
1 parent 5f51e0f commit 6547a74

File tree

2 files changed

+62
-53
lines changed

2 files changed

+62
-53
lines changed

docs/Targets.md

Lines changed: 55 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -799,9 +799,9 @@ The PolarFire SoC is a 64-bit RISC-V SoC featuring a five-core CPU cluster (1×
799799
`hal/mpfs250.ld` - Linker script for the platform
800800
`hal/mpfs.dts` / `hal/mpfs.dtb` - Device tree source and binary
801801
`hal/mpfs.yaml` - HSS payload generator configuration
802-
`hal/mpfs250.its` - For creating new FIT images with Kernel and DTB
802+
`hal/mpfs250.its` - Example FIT image creation template
803803

804-
### Building PolarFire SoC
804+
### PolarFire SoC Building wolfBoot
805805

806806
All build settings come from .config file. For this platform use `TARGET=mpfs250` and `ARCH=RISCV64`.
807807

@@ -826,6 +826,10 @@ make
826826
sudo cp hss-payload-generator /usr/local/bin/
827827
```
828828

829+
The HSS MMC boot source looks for GPT with GUID "21686148-6449-6E6F-744E-656564454649" or sector "0" if no GPT found. That GUID is the default "BIOS" boot partition.
830+
831+
The resulting image from `hss-payload-generator` can be directly placed into GPT BIOS partition.
832+
829833
Use this command to assemble a bootable wolfboot image:
830834

831835
```sh
@@ -837,24 +841,20 @@ Any customizations to the Device Tree can be made in mpfs.dts and it can be reco
837841
Example one-shot command:
838842

839843
```sh
840-
cp ./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
844+
cp ./config/examples/polarfire_mpfs250.config .config && make clean && make wolfboot.elf && size wolfboot.elf && hss-payload-generator -vvv -c ./hal/mpfs.yaml wolfboot.bin
841845
```
842846

843-
### Flashing PolarFire SoC
844-
845-
The HSS MMC boot source looks for GPT with GUID "21686148-6449-6E6F-744E-656564454649" or sector "0" if no GPT found. That GUID is the default "BIOS" boot partition.
846-
847-
The 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:
847+
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. Use `lsblk` to locate the boot partition and replace /dev/sdc1 in the example:
848848

849849
```sh
850850
sudo dd if=wolfboot.bin of=/dev/sdc1 bs=512 && sudo cmp wolfboot.bin /dev/sdc1
851851
```
852852

853-
### PolarFire testing
853+
Note:
854854

855-
This section describes how to build the test-application, create a custom uSD with required partitions and copying signing test-application to uSD partitions.
855+
### PolarFire testing
856856

857-
To use your own application (Linux FIT Image, ELF, etc) just replace test-app/image.elf with your own file (example "fitImage").
857+
This section describes how to build the test-application, create a custom uSD with required partitions and copying signed test-application to uSD partitions.
858858

859859
1) Partition uSD card (replace /dev/sdc with your actual media, find using `lsblk`):
860860

@@ -914,52 +914,52 @@ Device Start End Sectors Size Type
914914
```
915915

916916
2) Build, Sign and copy images
917+
917918
```sh
918919
# make test-app
919920
make test-app/image.elf
920921

921922
# Sign test-app/image with version 1
922923
./tools/keytools/sign --ecc384 --sha384 test-app/image.elf wolfboot_signing_private_key.der 1
923924
sudo dd if=test-app/image_v1_signed.bin of=/dev/sdc2 bs=512 && sudo cmp test-app/image_v1_signed.bin /dev/sdc2
925+
```
924926

925-
# OR
927+
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.
926928

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
929+
### PolarFire building Yocto-SDK Linux
930930

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
931+
See:
932+
* https://github.com/linux4microchip/meta-mchp/blob/scarthgap/meta-mchp-common/README.md
933+
* https://github.com/linux4microchip/meta-mchp/blob/scarthgap/meta-mchp-polarfire-soc/README.md
934+
935+
Building mchp-base-image Yocto Linux:
936+
937+
```sh
938+
cd yocto-dev-polarfire/
939+
export TEMPLATECONF=${TEMPLATECONF:-../meta-mchp/meta-mchp-polarfire-soc/meta-mchp-polarfire-soc-bsp/conf/templates/default}
940+
source openembedded-core/oe-init-build-env
941+
# A Microchip base image with standard Linux utilities, as well as some Microchip apps and examples
942+
MACHINE=mpfs-video-kit bitbake mchp-base-image
943+
OR
944+
# A Microchip base image with additional support for software development, including toolchains and debug tools
945+
MACHINE=mpfs-video-kit bitbake mchp-base-image-sdk
934946
```
935947

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.
948+
Build images are output to: `./tmp-glibc/deploy/images/mpfs-video-kit/`
937949

938-
### FIT Image Creation (decompress Linux Kernel Image)
950+
#### Building custom FIT image, signing and coping to SDCard
939951

940952
```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
953+
# Extract GZIP compressed linux kernel to wolfboot root
954+
gzip -cdvk ../yocto-dev-polarfire/build/tmp-glibc/work/mpfs_video_kit-oe-linux/linux-mchp/6.12.22+git/build/linux.bin > kernel.bin
955+
956+
# Create custom FIT image
957+
mkimage -f hal/mpfs250.its fitImage
958958
FIT description: PolarFire SoC MPFS250T
959-
Created: Mon Dec 22 15:29:32 2025
959+
Created: Tue Dec 23 11:29:02 2025
960960
Image 0 (kernel-1)
961-
Description: Kernel Image
962-
Created: Mon Dec 22 15:29:32 2025
961+
Description: Linux Kernel
962+
Created: Tue Dec 23 11:29:02 2025
963963
Type: Kernel Image
964964
Compression: uncompressed
965965
Data Size: 19745280 Bytes = 19282.50 KiB = 18.83 MiB
@@ -971,24 +971,34 @@ Created: Mon Dec 22 15:29:32 2025
971971
Hash value: 800ce147fa91f367ec620936a59a1035c49971ed4b9080c96bdc547471e80487
972972
Image 1 (fdt-1)
973973
Description: Flattened Device Tree blob
974-
Created: Mon Dec 22 15:29:32 2025
974+
Created: Tue Dec 23 11:29:02 2025
975975
Type: Flat Device Tree
976976
Compression: uncompressed
977977
Data Size: 19897 Bytes = 19.43 KiB = 0.02 MiB
978978
Architecture: RISC-V
979979
Load Address: 0x8a000000
980980
Hash algo: sha256
981981
Hash value: 0b4efca8c0607c9a8f4f9a00ccb7691936e019f3181aab45e6d52dae91975039
982-
Default Configuration: 'conf@1'
983-
Configuration 0 (conf@1)
984-
Description: PolarFire SoC MPFS250T
982+
Default Configuration: 'conf1'
983+
Configuration 0 (conf1)
984+
Description: Linux kernel and FDT blob
985985
Kernel: kernel-1
986986
FDT: fdt-1
987987
Hash algo: sha256
988988
Hash value: unavailable
989+
990+
# Sign FIT image with version 1
991+
./tools/keytools/sign --ecc384 --sha384 fitImage wolfboot_signing_private_key.der 1
992+
993+
# Copy signed FIT image to both OFP A/B partitions
994+
sudo dd if=fitImage_v1_signed.bin of=/dev/sdc2 bs=512 status=progress && sudo cmp fitImage_v1_signed.bin /dev/sdc2
995+
sudo dd if=fitImage_v1_signed.bin of=/dev/sdc3 bs=512 status=progress && sudo cmp fitImage_v1_signed.bin /dev/sdc3
996+
997+
# Copy root file system
998+
sudo dd if=../yocto-dev-polarfire/build/tmp-glibc/deploy/images/mpfs-video-kit/mchp-base-image-sdk-mpfs-video-kit.rootfs.ext4 of=/dev/sdb4 bs=512 status=progress
989999
```
9901000

991-
### Debugging PolarFire Soc
1001+
### PolarFire Soc Debugging
9921002

9931003
Start GDB server:
9941004

@@ -1063,7 +1073,6 @@ Booting at 80200000
10631073
...
10641074
```
10651075

1066-
10671076
### PolarFire TODO
10681077

10691078
* Add eMMC/SD features:

hal/mpfs250.its

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
images {
88
kernel-1 {
9-
description = "Kernel Image";
9+
description = "Linux Kernel";
1010
data = /incbin/("../kernel.bin");
1111
type = "kernel";
1212
arch = "riscv";
1313
os = "linux";
1414
compression = "none";
1515
load = <0x80200000>;
1616
entry = <0x80200000>;
17-
hash {
17+
hash-1 {
1818
algo = "sha256";
1919
};
2020
};
@@ -25,18 +25,18 @@
2525
arch = "riscv";
2626
compression = "none";
2727
load = <0x8a000000>;
28-
hash {
28+
hash-1 {
2929
algo = "sha256";
3030
};
3131
};
3232
};
3333
configurations {
34-
default = "conf@1";
35-
conf@1 {
36-
description = "PolarFire SoC MPFS250T";
34+
default = "conf1";
35+
conf1 {
36+
description = "Linux kernel and FDT blob";
3737
kernel = "kernel-1";
3838
fdt = "fdt-1";
39-
hash {
39+
hash-1 {
4040
algo = "sha256";
4141
};
4242
};

0 commit comments

Comments
 (0)