stdlib: Add chosen node to the device tree of RISC-V board

This enables two things,
- /chosen/stdout-path is now default to uart@10000000, meaning
the linux kernel's boot console will be redirected to uart.
- /chosen/bootargs now contains the boot arguments obtained from
gem5's library. This allows passing the boot arguments to the
linux kernel via the device tree.

Change-Id: I53821d85f619e6276da85f41c972c041eaaf3280
Signed-off-by: Hoa Nguyen <hn@hnpl.org>
This commit is contained in:
Hoa Nguyen
2023-10-05 23:15:27 -07:00
parent 46a9d85215
commit e8fd8303fb

View File

@@ -259,6 +259,12 @@ class RiscvBoard(AbstractSystemBoard, KernelDiskWorkload):
)
root.append(node)
node = FdtNode(f"chosen")
bootargs = " ".join(self.get_default_kernel_args())
node.append(FdtPropertyStrings("bootargs", [bootargs]))
node.append(FdtPropertyStrings("stdout-path", ["/uart@10000000"]))
root.append(node)
# See Documentation/devicetree/bindings/riscv/cpus.txt for details.
cpus_node = FdtNode("cpus")
cpus_state = FdtState(addr_cells=1, size_cells=0)