1d4e28f0eSBin MengMicrochip PolarFire SoC Icicle Kit (``microchip-icicle-kit``) 2d4e28f0eSBin Meng============================================================= 3d4e28f0eSBin Meng 4d4e28f0eSBin MengMicrochip PolarFire SoC Icicle Kit integrates a PolarFire SoC, with one 5d4e28f0eSBin MengSiFive's E51 plus four U54 cores and many on-chip peripherals and an FPGA. 6d4e28f0eSBin Meng 7d4e28f0eSBin MengFor more details about Microchip PolarFire SoC, please see: 8*dd07ab11SSebastian Huberhttps://www.microchip.com/en-us/products/fpgas-and-plds/system-on-chip-fpgas/polarfire-soc-fpgas 9d4e28f0eSBin Meng 10d4e28f0eSBin MengThe Icicle Kit board information can be found here: 11*dd07ab11SSebastian Huberhttps://www.microchip.com/en-us/development-tool/mpfs-icicle-kit-es 12d4e28f0eSBin Meng 13d4e28f0eSBin MengSupported devices 14d4e28f0eSBin Meng----------------- 15d4e28f0eSBin Meng 16d4e28f0eSBin MengThe ``microchip-icicle-kit`` machine supports the following devices: 17d4e28f0eSBin Meng 18d4e28f0eSBin Meng* 1 E51 core 19d4e28f0eSBin Meng* 4 U54 cores 20d4e28f0eSBin Meng* Core Level Interruptor (CLINT) 21d4e28f0eSBin Meng* Platform-Level Interrupt Controller (PLIC) 22d4e28f0eSBin Meng* L2 Loosely Integrated Memory (L2-LIM) 23d4e28f0eSBin Meng* DDR memory controller 24d4e28f0eSBin Meng* 5 MMUARTs 25d4e28f0eSBin Meng* 1 DMA controller 26d4e28f0eSBin Meng* 2 GEM Ethernet controllers 27d4e28f0eSBin Meng* 1 SDHC storage controller 28d4e28f0eSBin Meng 29*dd07ab11SSebastian HuberThe memory is set to 1537 MiB by default. A sanity check on RAM size is 30*dd07ab11SSebastian Huberperformed in the machine init routine to prompt user to increase the RAM size 31*dd07ab11SSebastian Huberto > 1537 MiB when less than 1537 MiB RAM is detected. 32*dd07ab11SSebastian Huber 33d4e28f0eSBin MengBoot options 34d4e28f0eSBin Meng------------ 35d4e28f0eSBin Meng 36*dd07ab11SSebastian HuberThe ``microchip-icicle-kit`` machine provides some options to run a firmware 37*dd07ab11SSebastian Huber(BIOS) or a kernel image. QEMU follows below truth table to select the 38*dd07ab11SSebastian Huberfirmware: 39143897b5SBin Meng 40*dd07ab11SSebastian Huber============= =========== ====================================== 41*dd07ab11SSebastian Huber-bios -kernel firmware 42*dd07ab11SSebastian Huber============= =========== ====================================== 43*dd07ab11SSebastian Hubernone N this is an error 44*dd07ab11SSebastian Hubernone Y the kernel image 45*dd07ab11SSebastian HuberNULL, default N hss.bin 46*dd07ab11SSebastian HuberNULL, default Y opensbi-riscv64-generic-fw_dynamic.bin 47*dd07ab11SSebastian Huberother don't care the BIOS image 48*dd07ab11SSebastian Huber============= =========== ====================================== 49d4e28f0eSBin Meng 506165dcb5SBin MengDirect Kernel Boot 516165dcb5SBin Meng------------------ 526165dcb5SBin Meng 53*dd07ab11SSebastian HuberUse the ``-kernel`` option to directly run a kernel image. When a direct 54*dd07ab11SSebastian Huberkernel boot is requested, a device tree blob may be specified via the ``-dtb`` 55*dd07ab11SSebastian Huberoption. Unlike other QEMU machines, this machine does not generate a device 56*dd07ab11SSebastian Hubertree for the kernel. It shall be provided by the user. The user provided DTB 57*dd07ab11SSebastian Hubershould meet the following requirements: 586165dcb5SBin Meng 59*dd07ab11SSebastian Huber* The ``/cpus`` node should contain at least one subnode for E51 and the number 60*dd07ab11SSebastian Huber of subnodes should match QEMU's ``-smp`` option. 61*dd07ab11SSebastian Huber 62*dd07ab11SSebastian Huber* The ``/memory`` reg size should match QEMU’s selected RAM size via the ``-m`` 63*dd07ab11SSebastian Huber option. 64*dd07ab11SSebastian Huber 65*dd07ab11SSebastian Huber* It should contain a node for the CLINT device with a compatible string 66*dd07ab11SSebastian Huber "riscv,clint0". 67*dd07ab11SSebastian Huber 68*dd07ab11SSebastian HuberWhen ``-bios`` is not specified or set to ``default``, the OpenSBI 69*dd07ab11SSebastian Huber``fw_dynamic`` BIOS image for the ``generic`` platform is used to boot an 70*dd07ab11SSebastian HuberS-mode payload like U-Boot or OS kernel directly. 716165dcb5SBin Meng 726165dcb5SBin MengFor example, the following commands show building a U-Boot image from U-Boot 736165dcb5SBin Mengmainline v2021.07 for the Microchip Icicle Kit board: 746165dcb5SBin Meng 756165dcb5SBin Meng.. code-block:: bash 766165dcb5SBin Meng 776165dcb5SBin Meng $ export CROSS_COMPILE=riscv64-linux- 786165dcb5SBin Meng $ make microchip_mpfs_icicle_defconfig 796165dcb5SBin Meng 806165dcb5SBin MengThen we can boot the machine by: 816165dcb5SBin Meng 826165dcb5SBin Meng.. code-block:: bash 836165dcb5SBin Meng 846165dcb5SBin Meng $ qemu-system-riscv64 -M microchip-icicle-kit -smp 5 -m 2G \ 856165dcb5SBin Meng -sd path/to/sdcard.img \ 866165dcb5SBin Meng -nic user,model=cadence_gem \ 876165dcb5SBin Meng -nic tap,ifname=tap,model=cadence_gem,script=no \ 886165dcb5SBin Meng -display none -serial stdio \ 896165dcb5SBin Meng -kernel path/to/u-boot/build/dir/u-boot.bin \ 906165dcb5SBin Meng -dtb path/to/u-boot/build/dir/u-boot.dtb 916165dcb5SBin Meng 926165dcb5SBin MengCAVEATS: 936165dcb5SBin Meng 946165dcb5SBin Meng* Check the "stdout-path" property in the /chosen node in the DTB to determine 956165dcb5SBin Meng which serial port is used for the serial console, e.g.: if the console is set 966165dcb5SBin Meng to the second serial port, change to use "-serial null -serial stdio". 976165dcb5SBin Meng* The default U-Boot configuration uses CONFIG_OF_SEPARATE hence the ELF image 986165dcb5SBin Meng ``u-boot`` cannot be passed to "-kernel" as it does not contain the DTB hence 996165dcb5SBin Meng ``u-boot.bin`` has to be used which does contain one. To use the ELF image, 1006165dcb5SBin Meng we need to change to CONFIG_OF_EMBED or CONFIG_OF_PRIOR_STAGE. 1016165dcb5SBin Meng 102*dd07ab11SSebastian HuberRunning HSS 103*dd07ab11SSebastian Huber----------- 104*dd07ab11SSebastian Huber 105*dd07ab11SSebastian HuberThe machine ``microchip-icicle-kit`` used to run the Hart Software Services 106*dd07ab11SSebastian Huber(HSS_), however, the HSS development progressed and the QEMU machine 107*dd07ab11SSebastian Huberimplementation lacks behind. Currently, running the HSS no longer works. 108*dd07ab11SSebastian HuberThere is missing support in the clock and memory controller devices. In 109*dd07ab11SSebastian Huberparticular, reading from the SD card does not work. 110*dd07ab11SSebastian Huber 111d4e28f0eSBin Meng.. _HSS: https://github.com/polarfire-soc/hart-software-services 112