qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 2/2] hw/mips: Add MIPS virt board
Date: Mon, 6 Mar 2023 17:51:49 +0100	[thread overview]
Message-ID: <d118e72e-852c-e80d-2180-245e99291f3a@linaro.org> (raw)
In-Reply-To: <50b4c547-7237-9b4d-2cbe-653a5a403210@linaro.org>

On 6/3/23 17:42, Philippe Mathieu-Daudé wrote:
> On 4/3/23 23:38, Jiaxun Yang wrote:
>> MIPS virt board is design to utilize existing VirtIO infrastures
>> but also comptitable with MIPS's existing internal simulation tools.
>>
>> It includes virtio-pci, virtio-mmio, pcie gpex, flash rom, fw_cfg,
>> goldfish-rtc and MIPS CPS system.
>>
>> It should be able to cooperate with any MIPS CPU cores.
>>
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> ---
>> v1:
>>   - Rename to virt board
>>   - Convert BIOS flash to ROM
>>   - Cleanups
>> v2:
>>   - Fix fdt flash
>>   - Remove UP variant
>> ---
>>   MAINTAINERS                             |   7 +
>>   configs/devices/mips-softmmu/common.mak |   1 +
>>   docs/system/target-mips.rst             |  22 +
>>   hw/mips/Kconfig                         |  17 +
>>   hw/mips/meson.build                     |   1 +
>>   hw/mips/virt.c                          | 916 ++++++++++++++++++++++++
>>   6 files changed, 964 insertions(+)
>>   create mode 100644 hw/mips/virt.c


>> +#include "qom/object.h"
>> +#include <libfdt.h>
>> +
>> +#define TYPE_MIPS_VIRT_MACHINE MACHINE_TYPE_NAME("virt")
> 
> So now every variant requires libfdt available on the host,
> otherwise building with --target-list=mips-softmmu,mipsel-softmmu
> on a host without libfdt:
> 
> ../../hw/mips/virt.c:47:10: fatal error: 'libfdt.h' file not found
> #include <libfdt.h>
>           ^~~~~~~~~~
> 
> So we can use:
> -- >8 --
> diff --git a/configs/targets/mips-softmmu.mak 
> b/configs/targets/mips-softmmu.mak
> index 7787a4d94c..a5c1db82c9 100644
> --- a/configs/targets/mips-softmmu.mak
> +++ b/configs/targets/mips-softmmu.mak
> @@ -2,3 +2,4 @@ TARGET_ARCH=mips
>   TARGET_ALIGNED_ONLY=y
>   TARGET_BIG_ENDIAN=y
>   TARGET_SUPPORTS_MTTCG=y
> +TARGET_NEED_FDT=y
> diff --git a/configs/targets/mips64-softmmu.mak 
> b/configs/targets/mips64-softmmu.mak
> index 568d66650c..398e0fc244 100644
> --- a/configs/targets/mips64-softmmu.mak
> +++ b/configs/targets/mips64-softmmu.mak
> @@ -2,3 +2,4 @@ TARGET_ARCH=mips64
>   TARGET_BASE_ARCH=mips
>   TARGET_ALIGNED_ONLY=y
>   TARGET_BIG_ENDIAN=y
> +TARGET_NEED_FDT=y
> diff --git a/configs/targets/mipsel-softmmu.mak 
> b/configs/targets/mipsel-softmmu.mak
> index c7c41f4fb7..3ddebca575 100644
> --- a/configs/targets/mipsel-softmmu.mak
> +++ b/configs/targets/mipsel-softmmu.mak
> @@ -1,3 +1,4 @@
>   TARGET_ARCH=mips
>   TARGET_ALIGNED_ONLY=y
>   TARGET_SUPPORTS_MTTCG=y
> +TARGET_NEED_FDT=y
> ---

Also missing (to get libfdt include path added to CPPFLAGS):

-- >8 --
diff --git a/hw/mips/meson.build b/hw/mips/meson.build
index 5670c939fa..a5a6c64a06 100644
--- a/hw/mips/meson.build
+++ b/hw/mips/meson.build
@@ -3,3 +3,3 @@ mips_ss.add(files('bootloader.c', 'mips_int.c'))
  mips_ss.add(when: 'CONFIG_FW_CFG_MIPS', if_true: files('fw_cfg.c'))
-mips_ss.add(when: 'CONFIG_MIPS_VIRT', if_true: files('virt.c'))
+mips_ss.add(when: 'CONFIG_MIPS_VIRT', if_true: [files('virt.c'), fdt])
  mips_ss.add(when: 'CONFIG_LOONGSON3V', if_true: 
files('loongson3_bootp.c', 'loongson3_virt.c'))
---


  reply	other threads:[~2023-03-06 16:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-04 22:38 [PATCH v2 0/2] MIPS Virt machine Jiaxun Yang
2023-03-04 22:38 ` [PATCH v2 1/2] hw/misc: Add MIPS Trickbox device Jiaxun Yang
2023-03-04 22:38 ` [PATCH v2 2/2] hw/mips: Add MIPS virt board Jiaxun Yang
2023-03-06 16:42   ` Philippe Mathieu-Daudé
2023-03-06 16:51     ` Philippe Mathieu-Daudé [this message]
2023-03-07 14:32   ` Philippe Mathieu-Daudé
2023-03-07 20:10   ` Philippe Mathieu-Daudé
2023-03-07 21:09     ` Jiaxun Yang
2023-03-07 15:01 ` [PATCH v2 0/2] MIPS Virt machine Philippe Mathieu-Daudé
2023-03-07 20:07   ` Jiaxun Yang
2023-03-07 20:14     ` Philippe Mathieu-Daudé
2023-03-07 21:07       ` Philippe Mathieu-Daudé
2023-03-07 21:21         ` Jiaxun Yang
2023-03-07 22:14           ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d118e72e-852c-e80d-2180-245e99291f3a@linaro.org \
    --to=philmd@linaro.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).