Skip to content

OpenRISC Device Tree Generation

Stafford Horne qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 7 repliesIn review
  2. v24 patches 2 repliesSuperseded
  3. v14 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- Fix description to say devicetree "generation" not "support"
- Fix up various indentation issues.
- Use HWADDR_PRIx string formatting.
- Split device tree population out to device init.
- Do not load device tree or initrd if we have no kernel.
- Added patches to split uart initialization out to it's own function fix 2 CPU limit.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6hw/openrisc/openrisc_sim: Create machine state for or1ksimhw/openrisc/openrisc_sim.c+28 -20 replies
2/6hw/openrisc/openrisc_sim: Parameterize initializationhw/openrisc/openrisc_sim.c+34 -80 replies
3/6hw/openrisc/openrisc_sim: Use IRQ splitter when connecting UARThw/openrisc/openrisc_sim.c+24 -83 replies
4/6hw/openrisc/openrisc_sim: Increase max_cpus to 4hw/openrisc/openrisc_sim.c+5 -33 replies
5/6hw/openrisc/openrisc_sim: Add automatic device tree generationconfigs/targets/or1k-softmmu.mak hw/openrisc/openrisc_sim.c+175 -151 reply
6/6hw/openrisc/openrisc_sim: Add support for initrd loadinghw/openrisc/openrisc_sim.c+31 -00 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéPeter Maydell
1/6R-b
2/6R-b
3/6R-b R-b
4/6R-b R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/6] OpenRISC Device Tree Generation

Changes since v2:
- Fix description to say devicetree "generation" not "support"
- Fix up various indentation issues.
- Use HWADDR_PRIx string formatting.
- Split device tree population out to device init.
- Do not load device tree or initrd if we have no kernel.
- Added patches to split uart initialization out to it's own function fix 2 CPU limit.

Changes since v1:
- Fixed typos pointed out by Philippe
- Moved usage of machine state to patch 3/4
- added config dependency on FDT

This series adds device tree generation for the OpenRISC SIM hardware.

The simulator will generate an FDT and pass it to the kernel.

For example:

  qemu-system-or1k -cpu or1200 -M or1k-sim \
    -kernel /home/shorne/work/linux/vmlinux \
    -initrd /home/shorne/work/linux/initramfs.cpio.gz \
    -serial mon:stdio -nographic -gdb tcp::10001 -m 32

Using the linux kernel or1ksim_defconfig we can remove the built-in dts and the kernel will boot as expected. The real benefit here is being able to specify an external initrd which qemu will load into memory and the device tree will tell the kernel where to find it.

Tested this by booting single core and SMP kernels with 4x CPUs.

Stafford Horne (6):
hw/openrisc/openrisc_sim: Create machine state for or1ksim hw/openrisc/openrisc_sim: Parameterize initialization hw/openrisc/openrisc_sim: Use IRQ splitter when connecting UART hw/openrisc/openrisc_sim: Increase max_cpus to 4 hw/openrisc/openrisc_sim: Add automatic device tree generation hw/openrisc/openrisc_sim: Add support for initrd loading

 configs/targets/or1k-softmmu.mak |   1 +
 hw/openrisc/openrisc_sim.c       | 308 ++++++++++++++++++++++++++++---
 2 files changed, 285 insertions(+), 24 deletions(-)
Signature · 1 line
2.31.1