From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Peter Maydell <peter.maydell@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Yoshinori Sato" <ysato@users.sourceforge.jp>,
"open list:Block layer core" <qemu-block@nongnu.org>,
"QEMU Trivial" <qemu-trivial@nongnu.org>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Max Reitz" <mreitz@redhat.com>,
"Michael Walle" <michael@walle.cc>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH 1/4] hw/sh4/Kconfig: Rename CONFIG_SH4 -> CONFIG_SH4_DEVICES
Date: Sun, 21 Feb 2021 19:07:06 +0100 [thread overview]
Message-ID: <56febf1b-db70-d934-615d-88a9ff0cdaaf@amsat.org> (raw)
In-Reply-To: <CAFEAcA-CYk2XpngH_r3adYmb2t=39wfJA0pae8jmcOPCgofOvw@mail.gmail.com>
On 2/8/21 9:22 PM, Peter Maydell wrote:
> On Mon, 8 Feb 2021 at 20:04, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>
>> We want to be able to use the 'SH4' config for architecture
>> specific features. As CONFIG_SH4 is only used to select
>> peripherals, rename it CONFIG_SH4_DEVICES.
>>
>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> hw/block/meson.build | 2 +-
>> hw/char/meson.build | 2 +-
>> hw/intc/meson.build | 2 +-
>> hw/sh4/Kconfig | 6 +++---
>> hw/timer/meson.build | 2 +-
>> 5 files changed, 7 insertions(+), 7 deletions(-)
>
> We could if we wished be more fine-grained about this, eg by
> adding new CONFIG options for each device:
> CONFIG_TC58128
> CONFIG_SH_SERIAL
> CONFIG_SH_INTC
> CONFIG_SH_TIMER
> CONFIG_SH_PCI
>
> and then in hw/sh4/Kconfig
> * config SH7750:
> add 'select SH_SERIAL', 'select SH_INTC', 'select SH_TIMER'
> * config R2D:
> add 'select SH7750' (it's a pre-existing bug that it doesn't, since
> r2d.c has a call to sh7750_init(). Harmless at the moment because
> nothing actually uses CONFIG_SH7750 -- hw/sh4/meson.build always
> compiles sh7750.c and sh7750_regnames.c unconditionally...)
> add 'select SH_PCI' (and make hw/sh4/meson.build build sh_pci.c
> only if it is set...)
> * config SHIX
> add 'select TC58128'
OK.
> Do we have a general preference for how fine-grained we go with the
> Kconfig switches ? Looking at the arm code, in some cases we have
> a CONFIG_ for the SoC that uses 'select' to turn on a separate
> CONFIG_ for each device (the STM32 SoCs are done this way), and
> in some cases we just have the meson.build use the SoC's CONFIG_*
> to control whether we compile its devices (the Xilinx and Exynos4
> SoCs are done this way). When reviewing new code it would be helpful
> to know whether to suggest doing it one way or the other :-)
My view is:
- Use fine granularity with shared/reusable models, so if someone
wants to build a QEMU for a single machine, it is possible (using
--without-default-devices and a specific target config.mak).
Example: STM32F205_SOC and STM32F405_SOC
- For some (family of) SoC, a single switch is acceptable. In
particular when all models are implemented in the same source file.
Example: ASPEED_SOC
- Do not look at hw/i386/Kconfig
I have an old branch where I was generating a .dot of the Kconfig tree
for easier visualization, fine granularity was helpful. I'll try to
update it.
Regards,
Phil.
next prev parent reply other threads:[~2021-02-21 18:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 13:50 [PATCH 0/4] hw/{lm32,sh4}: Kconfig cleanups Philippe Mathieu-Daudé
2021-02-08 13:50 ` [PATCH 1/4] hw/sh4/Kconfig: Rename CONFIG_SH4 -> CONFIG_SH4_DEVICES Philippe Mathieu-Daudé
2021-02-08 20:22 ` Peter Maydell
2021-02-21 18:07 ` Philippe Mathieu-Daudé [this message]
2021-02-21 18:10 ` Philippe Mathieu-Daudé
2021-02-08 13:50 ` [PATCH 2/4] hw/lm32/Kconfig: Introduce CONFIG_LM32_EVR for lm32-evr/uclinux boards Philippe Mathieu-Daudé
2021-02-08 13:50 ` [PATCH 3/4] hw/lm32/Kconfig: Rename CONFIG_LM32 -> CONFIG_LM32_DEVICES Philippe Mathieu-Daudé
2021-02-08 13:50 ` [PATCH 4/4] hw/lm32/Kconfig: Have MILKYMIST select LM32_DEVICES 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=56febf1b-db70-d934-615d-88a9ff0cdaaf@amsat.org \
--to=f4bug@amsat.org \
--cc=alex.bennee@linaro.org \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=michael@walle.cc \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=ysato@users.sourceforge.jp \
/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).