| 1 | Microchip PolarFire SoC Icicle Kit (``microchip-icicle-kit``) |
| 2 | ============================================================= |
| 3 | |
| 4 | Microchip PolarFire SoC Icicle Kit integrates a PolarFire SoC, with one |
| 5 | SiFive's E51 plus four U54 cores and many on-chip peripherals and an FPGA. |
| 6 | |
| 7 | For more details about Microchip PolarFire SoC, please see: |
| 8 | https://www.microchip.com/en-us/products/fpgas-and-plds/system-on-chip-fpgas/polarfire-soc-fpgas |
| 9 | |
| 10 | The Icicle Kit board information can be found here: |
| 11 | https://www.microchip.com/en-us/development-tool/mpfs-icicle-kit-es |
| 12 | |
| 13 | Supported devices |
| 14 | ----------------- |
| 15 | |
| 16 | The ``microchip-icicle-kit`` machine supports the following devices: |
| 17 | |
| 18 | * 1 E51 core |
| 19 | * 4 U54 cores |
| 20 | * Core Level Interruptor (CLINT) |
| 21 | * Platform-Level Interrupt Controller (PLIC) |
| 22 | * L2 Loosely Integrated Memory (L2-LIM) |
| 23 | * DDR memory controller |
| 24 | * 5 MMUARTs |
| 25 | * 1 DMA controller |
| 26 | * 2 GEM Ethernet controllers |
| 27 | * 1 SDHC storage controller |
| 28 | |
| 29 | The memory is set to 1537 MiB by default. A sanity check on RAM size is |
| 30 | performed in the machine init routine to prompt user to increase the RAM size |
| 31 | to > 1537 MiB when less than 1537 MiB RAM is detected. |
| 32 | |
| 33 | Boot options |
| 34 | ------------ |
| 35 | |
| 36 | The ``microchip-icicle-kit`` machine provides some options to run a firmware |
| 37 | (BIOS) or a kernel image. QEMU follows below truth table to select the |
| 38 | firmware: |
| 39 | |
| 40 | ============= =========== ====================================== |
| 41 | -bios -kernel firmware |
| 42 | ============= =========== ====================================== |
| 43 | none N this is an error |
| 44 | none Y the kernel image |
| 45 | NULL, default N hss.bin |
| 46 | NULL, default Y opensbi-riscv64-generic-fw_dynamic.bin |
| 47 | other don't care the BIOS image |
| 48 | ============= =========== ====================================== |
| 49 | |
| 50 | Direct Kernel Boot |
| 51 | ------------------ |
| 52 | |
| 53 | Use the ``-kernel`` option to directly run a kernel image. When a direct |
| 54 | kernel boot is requested, a device tree blob may be specified via the ``-dtb`` |
| 55 | option. Unlike other QEMU machines, this machine does not generate a device |
| 56 | tree for the kernel. It shall be provided by the user. The user provided DTB |
| 57 | should meet the following requirements: |
| 58 | |
| 59 | * The ``/cpus`` node should contain at least one subnode for E51 and the number |
| 60 | of subnodes should match QEMU's ``-smp`` option. |
| 61 | |
| 62 | * The ``/memory`` reg size should match QEMU’s selected RAM size via the ``-m`` |
| 63 | option. |
| 64 | |
| 65 | * It should contain a node for the CLINT device with a compatible string |
| 66 | "riscv,clint0". |
| 67 | |
| 68 | When ``-bios`` is not specified or set to ``default``, the OpenSBI |
| 69 | ``fw_dynamic`` BIOS image for the ``generic`` platform is used to boot an |
| 70 | S-mode payload like U-Boot or OS kernel directly. |
| 71 | |
| 72 | For example, the following commands show building a U-Boot image from U-Boot |
| 73 | mainline v2021.07 for the Microchip Icicle Kit board: |
| 74 | |
| 75 | .. code-block:: bash |
| 76 | |
| 77 | $ export CROSS_COMPILE=riscv64-linux- |
| 78 | $ make microchip_mpfs_icicle_defconfig |
| 79 | |
| 80 | Then we can boot the machine by: |
| 81 | |
| 82 | .. code-block:: bash |
| 83 | |
| 84 | $ qemu-system-riscv64 -M microchip-icicle-kit -smp 5 -m 2G \ |
| 85 | -sd path/to/sdcard.img \ |
| 86 | -nic user,model=cadence_gem \ |
| 87 | -nic tap,ifname=tap,model=cadence_gem,script=no \ |
| 88 | -display none -serial stdio \ |
| 89 | -kernel path/to/u-boot/build/dir/u-boot.bin \ |
| 90 | -dtb path/to/u-boot/build/dir/u-boot.dtb |
| 91 | |
| 92 | CAVEATS: |
| 93 | |
| 94 | * Check the "stdout-path" property in the /chosen node in the DTB to determine |
| 95 | which serial port is used for the serial console, e.g.: if the console is set |
| 96 | to the second serial port, change to use "-serial null -serial stdio". |
| 97 | * The default U-Boot configuration uses CONFIG_OF_SEPARATE hence the ELF image |
| 98 | ``u-boot`` cannot be passed to "-kernel" as it does not contain the DTB hence |
| 99 | ``u-boot.bin`` has to be used which does contain one. To use the ELF image, |
| 100 | we need to change to CONFIG_OF_EMBED or CONFIG_OF_PRIOR_STAGE. |
| 101 | |
| 102 | Running HSS |
| 103 | ----------- |
| 104 | |
| 105 | The machine ``microchip-icicle-kit`` used to run the Hart Software Services |
| 106 | (HSS_), however, the HSS development progressed and the QEMU machine |
| 107 | implementation lacks behind. Currently, running the HSS no longer works. |
| 108 | There is missing support in the clock and memory controller devices. In |
| 109 | particular, reading from the SD card does not work. |
| 110 | |
| 111 | .. _HSS: https://github.com/polarfire-soc/hart-software-services |