Nuclei-Software / nuclei-linux-sdk

Nuclei RISC-V Linux Software Development Kit
Apache License 2.0
38 stars 9 forks source link

Uboot SPL Support in Nuclei Linux SDK #24

Open fanghuaqi opened 3 months ago

fanghuaqi commented 3 months ago

We have introduced a new branch called dev_nuclei_6.6_v2_spl to provide support for uboot spl.

[!NOTE]

  • Currently only CORE=ux900fd BOOT_MODE=sd is supported, other configurations are not yet supported.
  • Nuclei CPU need to configured with L2 cache or your SoC have a SRAM can be used to run uboot spl
  • AMP is not supported in this branch.

With new introduced uboot spl, now boot process changed:

freeloader -> opensbi + uboot -> kernel -> freeloader -> uboot-spl -> opensbi + uboot -> kernel

The freeloader now assumed ddr is not yet initialized, so we have to copy uboot-spl from a fixed address in xip spiflash to a shared memory(here we use L2 cache CLM feature to provide a Cluster Local Memory), and then go to uboot spl, and let uboot spl to initialize ddr memory, and in uboot spl, you can do far more things than what you can do in freeloader.

And then uboot spl will initialize ddr memory, and load opensbi + uboot + dtb .composed uboot FIT image from fixed address in xip spiflash, and got to opensbi.

And in opensbi, it will disable L2 cache CLM feature, and enable L2 cache, and then go to Uboot, and uboot will load kernel and rootfs image, and boot linux kernel.