arch/risc-v/litex: Allow FDT to be passed from previous boot change.

Allows a flattened device tree to be passed from either openSBI or the LiteX bios. The FDT is registered can be used, if supported.
This commit is contained in:
Stuart Ianna
2024-03-19 09:46:56 +11:00
committed by Xiang Xiao
parent f2437b7f6a
commit 401b3e682c
6 changed files with 45 additions and 2 deletions
@@ -22,7 +22,8 @@ Booting
Create a file, 'boot.json' in the Nuttx root directory, with the following content::
{
"nuttx.bin": "0x40000000"
"nuttx.bin": "0x40000000",
"board.dtb": "0x41ec0000"
}
Load the application over serial with::
@@ -45,6 +45,7 @@ Create a file, 'boot.json' in the Nuttx root directory, with the following conte
{
"romfs.img": "0x40C00000",
"nuttx.bin": "0x40000000",
"board.dtb": "0x41ec0000",
"opensbi.bin": "0x40f00000"
}
@@ -59,6 +59,26 @@ the source can be obtained from https://github.com/riscv-collab/riscv-gnu-toolch
Check the linked github repository for other options, including building with multilib enabled.
Device tree support
=========================
Currently, the litex port requires that the memory mapped peripheral addresses and IRQ numbers
match those generated by LiteX. Although, this approach is being phased-out in favour of
using a flattened device tree (FDT) to dynamically instantiate drivers.
Generating and compiling the device tree::
$ ./litex/tools/litex_json2dts_linux.py path/to/built/gateware/csr.json > board.dts
$ dtc -@ -I dts -O dtb board.dts -o board.dtb
Ensure the board.dtb is placed in the NuttX root directory.
If a peripheral isn't working with the LiteX generated gateware, consider checking
the addresses and IRQ numbers in
- arch/risc-v/src/litex/hardware/litex_memorymap.h
- arch/risc-v/include/litex/irq.h
Core specific information
=========================