1Microchip PolarFire SoC Icicle Kit (``microchip-icicle-kit``) 2============================================================= 3 4Microchip PolarFire SoC Icicle Kit integrates a PolarFire SoC, with one 5SiFive's E51 plus four U54 cores and many on-chip peripherals and an FPGA. 6 7For more details about Microchip PolarFire SoC, please see: 8https://www.microchip.com/en-us/products/fpgas-and-plds/system-on-chip-fpgas/polarfire-soc-fpgas 9 10The Icicle Kit board information can be found here: 11https://www.microchip.com/en-us/development-tool/mpfs-icicle-kit-es 12 13Supported devices 14----------------- 15 16The ``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 29The memory is set to 1537 MiB by default. A sanity check on RAM size is 30performed in the machine init routine to prompt user to increase the RAM size 31to > 1537 MiB when less than 1537 MiB RAM is detected. 32 33Boot options 34------------ 35 36The ``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 38firmware: 39 40============= =========== ====================================== 41-bios -kernel firmware 42============= =========== ====================================== 43none N this is an error 44none Y the kernel image 45NULL, default N hss.bin 46NULL, default Y opensbi-riscv64-generic-fw_dynamic.bin 47other don't care the BIOS image 48============= =========== ====================================== 49 50Direct Kernel Boot 51------------------ 52 53Use the ``-kernel`` option to directly run a kernel image. When a direct 54kernel boot is requested, a device tree blob may be specified via the ``-dtb`` 55option. Unlike other QEMU machines, this machine does not generate a device 56tree for the kernel. It shall be provided by the user. The user provided DTB 57should 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 68When ``-bios`` is not specified or set to ``default``, the OpenSBI 69``fw_dynamic`` BIOS image for the ``generic`` platform is used to boot an 70S-mode payload like U-Boot or OS kernel directly. 71 72For example, the following commands show building a U-Boot image from U-Boot 73mainline 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 80Then 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 92CAVEATS: 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 102Running HSS 103----------- 104 105The machine ``microchip-icicle-kit`` used to run the Hart Software Services 106(HSS_), however, the HSS development progressed and the QEMU machine 107implementation lacks behind. Currently, running the HSS no longer works. 108There is missing support in the clock and memory controller devices. In 109particular, reading from the SD card does not work. 110 111.. _HSS: https://github.com/polarfire-soc/hart-software-services 112