target-openrisc.rst 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .. _OpenRISC-System-emulator:
  2. OpenRISC System emulator
  3. ~~~~~~~~~~~~~~~~~~~~~~~~
  4. QEMU can emulate 32-bit OpenRISC CPUs using the ``qemu-system-or1k`` executable.
  5. OpenRISC CPUs are generally built into "system-on-chip" (SoC) designs that run
  6. on FPGAs. These SoCs are based on the same core architecture as the or1ksim
  7. (the original OpenRISC instruction level simulator) which QEMU supports. For
  8. this reason QEMU does not need to support many different boards to support the
  9. OpenRISC hardware ecosystem.
  10. The OpenRISC CPU supported by QEMU is the ``or1200``, it supports an MMU and can
  11. run linux.
  12. Choosing a board model
  13. ======================
  14. For QEMU's OpenRISC system emulation, you must specify which board model you
  15. want to use with the ``-M`` or ``--machine`` option; the default machine is
  16. ``or1k-sim``.
  17. If you intend to boot Linux, it is possible to have a single kernel image that
  18. will boot on any of the QEMU machines. To do this one would compile all required
  19. drivers into the kernel. This is possible because QEMU will create a device tree
  20. structure that describes the QEMU machine and pass a pointer to the structure to
  21. the kernel. The kernel can then use this to configure itself for the machine.
  22. However, typically users will have specific firmware images for a specific machine.
  23. If you already have a system image or a kernel that works on hardware and you
  24. want to boot with QEMU, check whether QEMU lists that machine in its ``-machine
  25. help`` output. If it is listed, then you can probably use that board model. If
  26. it is not listed, then unfortunately your image will almost certainly not boot
  27. on QEMU. (You might be able to extract the filesystem and use that with a
  28. different kernel which boots on a system that QEMU does emulate.)
  29. If you don't care about reproducing the idiosyncrasies of a particular
  30. bit of hardware, such as small amount of RAM, no PCI or other hard disk, etc.,
  31. and just want to run Linux, the best option is to use the ``virt`` board. This
  32. is a platform which doesn't correspond to any real hardware and is designed for
  33. use in virtual machines. You'll need to compile Linux with a suitable
  34. configuration for running on the ``virt`` board. ``virt`` supports PCI, virtio
  35. and large amounts of RAM.
  36. Board-specific documentation
  37. ============================
  38. ..
  39. This table of contents should be kept sorted alphabetically
  40. by the title text of each file, which isn't the same ordering
  41. as an alphabetical sort by filename.
  42. .. toctree::
  43. :maxdepth: 1
  44. openrisc/or1k-sim
  45. openrisc/virt
  46. Emulated CPU architecture support
  47. =================================
  48. .. toctree::
  49. openrisc/emulation
  50. OpenRISC CPU features
  51. =====================
  52. .. toctree::
  53. openrisc/cpu-features