How do I emulate MPC5xxx embedded microcontroller on QEMU?

I've seen that QEMU can emulate PowerPC architectures, but in the documentation in the supported machines part I cannot find the MPC5xxx target, however it's mentioned as CPU type in the source code: https://github.com/qemu/qemu/blob/7fe7fae8b48e3f9c647fd685e5155ebc8e6fb84d/target/ppc/cpu-models.c#L220

My question would be which command line arguments do I need to give to the qemu-system-ppc binary, or else how do I compile QEMU specifically to emulate MPC5xxx target? (on Linux host) Do I need additional configuration? If yes, where do I find reference for it?

1 answer

  • answered 2021-06-10 18:56 ThinkOpenly

    I pulled the latest source:

    $ git clone https://git.qemu.org/git/qemu.git
    

    Then configured:

    $ mkdir qemu-build
    $ cd qemu-build
    $ ../qemu/configure --target=ppc-softmmu
    

    Then built:

    $ make
    

    I see these "mpc5xxx" CPU types listed:

    $ ./qemu-system-ppc -cpu help | grep mpc5
    PowerPC mpc5200_v10      PVR 80822011
    PowerPC mpc5200_v12      PVR 80822011
    PowerPC mpc52xx          (alias for mpc5200_v12)
    PowerPC mpc5200          (alias for mpc5200_v12)
    PowerPC mpc5200_v11      PVR 80822011
    PowerPC mpc5200b_v21     PVR 80822011
    PowerPC mpc5200b         (alias for mpc5200b_v21)
    PowerPC mpc5200b_v20     PVR 80822011
    

    I've never used these, but you'd use the command-line option "-cpu mpc52xx", for example.