diff --git a/Documentation/platforms/risc-v/mpfs/index.rst b/Documentation/platforms/risc-v/mpfs/index.rst index bb733219175..24505450e75 100644 --- a/Documentation/platforms/risc-v/mpfs/index.rst +++ b/Documentation/platforms/risc-v/mpfs/index.rst @@ -16,23 +16,38 @@ Like: https://xpack.github.io/riscv-none-embed-gcc or https://github.com/sifive/ Booting ======= -The NuttX port for now relies on HSS bootloader to carry on some hardware initializations. +The NuttX works as a standalone operating system that may initialize all the required clocks and +peripherals including DDR memory. Alternatively, the vendor's HSS bootloader may be used instead to +perform all the initialization steps. Building and flashing ===================== +Configure the NuttX project: ``./tools/configure.sh icicle:nsh`` +Run ``make`` to build the project. + +If NuttX is built as a standalone OS with the config option CONFIG_MPFS_BOOTLOADER set, it's important +to note that the image size is very limited: only (128K - 256) bytes. 256 bytes are reserved for the +header that must be prepended into the NuttX binary. This binary is called hss-envm-wrapper-bm1-dummySbic.bin +and may be found from the vendor's HSS implementation. Moreover, after prepending the 256-byte header, +the LMA section needs to be adjusted, for example:: + + riscv64-unknown-elf-objcopy -I binary -O ihex --change-section-lma *+0x20220000 nuttx.bin nuttx.hex + +The output binary nuttx.hex may be flashed with the LiberoSoc tool. +The tool is available from: https://www.microchip.com/en-us/products/fpgas-and-plds/fpga-and-soc-design-tools/fpga/libero-software-later-versions#Documents%20and%20Downloads + +There's an alternative way to use NuttX, without the CONFIG_MPFS_BOOTLOADER option set. This expects the +HSS bootloader sets up the system (memories, caches, initializes clocks etc.). First make sure that ``hss-payload-generator`` is installed. Available from: https://github.com/polarfire-soc/hart-software-services This tool is used to convert the ELF/bin to a compatible HSS payload image -Configure the NuttX project: ``./tools/configure.sh icicle:nsh`` -Run ``make`` to build the project. - Create HSS payload bin:: - hss-payload-generator -v -c hss-nuttx.yml payload.bin + hss-payload-generator -v -c hss-nuttx.yml payload.bin Debugging with OpenOCD @@ -59,7 +74,7 @@ GPIO Yes MMUART Yes Uart mode only SPI Yes I2C Yes -eMMC SD/SDIO Yes eMMC not fully tested +eMMC SD/SDIO Yes No PHY training Timers No Watchdog No RTC No