mbox series

[v2,0/2] MIPS Virt machine

Message ID 20230304223803.55764-1-jiaxun.yang@flygoat.com (mailing list archive)
Headers show
Series MIPS Virt machine | expand

Message

Jiaxun Yang March 4, 2023, 10:38 p.m. UTC
Hi there,

This patchset is to add a new machine type for MIPS architecture, which
is purely a VirtIO machine.

It is design to utilize existing VirtIO infrastures but also comptitable
with MIPS's existing internal simulation tools.

It should be able to cooperate with any MIPS core and boot Generic MIPS
kernel.

Kernel patch available at: https://lore.kernel.org/linux-mips/20230304221524.47160-1-jiaxun.yang@flygoat.com/

Thanks

Jiaxun Yang (2):
  hw/misc: Add MIPS Trickbox device
  hw/mips: Add MIPS virt board

 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 ++++++++++++++++++++++++
 hw/misc/Kconfig                         |   3 +
 hw/misc/meson.build                     |   1 +
 hw/misc/mips_trickbox.c                 |  97 +++
 hw/misc/trace-events                    |   4 +
 include/hw/misc/mips_trickbox.h         |  41 ++
 11 files changed, 1110 insertions(+)
 create mode 100644 hw/mips/virt.c
 create mode 100644 hw/misc/mips_trickbox.c
 create mode 100644 include/hw/misc/mips_trickbox.h

Comments

Philippe Mathieu-Daudé March 7, 2023, 3:01 p.m. UTC | #1
On 4/3/23 23:38, Jiaxun Yang wrote:
> Hi there,
> 
> This patchset is to add a new machine type for MIPS architecture, which
> is purely a VirtIO machine.

> Jiaxun Yang (2):
>    hw/misc: Add MIPS Trickbox device
>    hw/mips: Add MIPS virt board
Thanks, applied with following changes:

- remove pointless mask in mips_trickbox_write(),
- declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE(),
- declare machine type using DEFINE_TYPES(),
- do not select PCI in Kconfig,
- compile virt.o using fdt flags in meson.build,
- use HWADDR_PRIx,
- name MachineState variable 'ms',
- fix conflict in docs/system/target-mips.rst,
- fix style
Jiaxun Yang March 7, 2023, 8:07 p.m. UTC | #2
> 2023年3月7日 15:01,Philippe Mathieu-Daudé <philmd@linaro.org> 写道:
> 
> On 4/3/23 23:38, Jiaxun Yang wrote:
>> Hi there,
>> This patchset is to add a new machine type for MIPS architecture, which
>> is purely a VirtIO machine.
> 
>> Jiaxun Yang (2):
>>  hw/misc: Add MIPS Trickbox device
>>  hw/mips: Add MIPS virt board
> Thanks, applied with following changes:

Thanks for those clean-ups!

> 
> - remove pointless mask in mips_trickbox_write(),
> - declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE(),
> - declare machine type using DEFINE_TYPES(),
> - do not select PCI in Kconfig,

Hmm, PCI is sort of mandatory for this machine, any reason not to select it?

> - compile virt.o using fdt flags in meson.build,
> - use HWADDR_PRIx,
> - name MachineState variable 'ms',
> - fix conflict in docs/system/target-mips.rst,
> - fix style

Thanks.
- Jiaxun
Philippe Mathieu-Daudé March 7, 2023, 8:14 p.m. UTC | #3
On 7/3/23 21:07, Jiaxun Yang wrote:
> 
> 
>> 2023年3月7日 15:01,Philippe Mathieu-Daudé <philmd@linaro.org> 写道:
>>
>> On 4/3/23 23:38, Jiaxun Yang wrote:
>>> Hi there,
>>> This patchset is to add a new machine type for MIPS architecture, which
>>> is purely a VirtIO machine.
>>
>>> Jiaxun Yang (2):
>>>   hw/misc: Add MIPS Trickbox device
>>>   hw/mips: Add MIPS virt board
>> Thanks, applied with following changes:
> 
> Thanks for those clean-ups!
> 
>>
>> - remove pointless mask in mips_trickbox_write(),
>> - declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE(),
>> - declare machine type using DEFINE_TYPES(),
>> - do not select PCI in Kconfig,
> 
> Hmm, PCI is sort of mandatory for this machine, any reason not to select it?

The machine itself doesn't expose a PCI bus directly, it
is exposed by the PCI_EXPRESS_GENERIC_BRIDGE.

We have PCI_EXPRESS_GENERIC_BRIDGE -> PCI_EXPRESS -> PCI.
Philippe Mathieu-Daudé March 7, 2023, 9:07 p.m. UTC | #4
On 7/3/23 21:14, Philippe Mathieu-Daudé wrote:
> On 7/3/23 21:07, Jiaxun Yang wrote:
>>
>>
>>> 2023年3月7日 15:01,Philippe Mathieu-Daudé <philmd@linaro.org> 写道:
>>>
>>> On 4/3/23 23:38, Jiaxun Yang wrote:
>>>> Hi there,
>>>> This patchset is to add a new machine type for MIPS architecture, which
>>>> is purely a VirtIO machine.
>>>
>>>> Jiaxun Yang (2):
>>>>   hw/misc: Add MIPS Trickbox device
>>>>   hw/mips: Add MIPS virt board
>>> Thanks, applied with following changes:
>>
>> Thanks for those clean-ups!

Unfortunately I have to drop this due to the libfdt
dependency, which fails the --disable-fdt job:
https://gitlab.com/philmd/qemu/-/jobs/3890587748
Jiaxun Yang March 7, 2023, 9:21 p.m. UTC | #5
> 2023年3月7日 21:07,Philippe Mathieu-Daudé <philmd@linaro.org> 写道:
> 
> On 7/3/23 21:14, Philippe Mathieu-Daudé wrote:
>> On 7/3/23 21:07, Jiaxun Yang wrote:
>>> 
>>> 
>>>> 2023年3月7日 15:01,Philippe Mathieu-Daudé <philmd@linaro.org> 写道:
>>>> 
>>>> On 4/3/23 23:38, Jiaxun Yang wrote:
>>>>> Hi there,
>>>>> This patchset is to add a new machine type for MIPS architecture, which
>>>>> is purely a VirtIO machine.
>>>> 
>>>>> Jiaxun Yang (2):
>>>>>   hw/misc: Add MIPS Trickbox device
>>>>>   hw/mips: Add MIPS virt board
>>>> Thanks, applied with following changes:
>>> 
>>> Thanks for those clean-ups!
> 
> Unfortunately I have to drop this due to the libfdt
> dependency, which fails the --disable-fdt job:
> https://gitlab.com/philmd/qemu/-/jobs/3890587748

Perhaps we should just select TARGET_NEED_FDT for all MIPS variants?

Thanks
- Jiaxun
Philippe Mathieu-Daudé March 7, 2023, 10:14 p.m. UTC | #6
On 7/3/23 22:21, Jiaxun Yang wrote:
>> 2023年3月7日 21:07,Philippe Mathieu-Daudé <philmd@linaro.org> 写道:
>> On 7/3/23 21:14, Philippe Mathieu-Daudé wrote:
>>> On 7/3/23 21:07, Jiaxun Yang wrote:
>>>>> 2023年3月7日 15:01,Philippe Mathieu-Daudé <philmd@linaro.org> 写道:
>>>>> On 4/3/23 23:38, Jiaxun Yang wrote:
>>>>>> Hi there,
>>>>>> This patchset is to add a new machine type for MIPS architecture, which
>>>>>> is purely a VirtIO machine.
>>>>>
>>>>>> Jiaxun Yang (2):
>>>>>>    hw/misc: Add MIPS Trickbox device
>>>>>>    hw/mips: Add MIPS virt board
>>>>> Thanks, applied with following changes:
>>>>
>>>> Thanks for those clean-ups!
>>
>> Unfortunately I have to drop this due to the libfdt
>> dependency, which fails the --disable-fdt job:
>> https://gitlab.com/philmd/qemu/-/jobs/3890587748
> 
> Perhaps we should just select TARGET_NEED_FDT for all MIPS variants?

Yes, but then the 'build-without-defaults' job which cover
mips64-softmmu fails:

../../meson.build:2809:2: ERROR: Problem encountered: fdt not available 
but required by targets mipsel-softmmu

It is easy to update the job, but these are too many changes and
the gitlab change need to be reviewed.