qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Havard Skinnemoen <hskinnemoen@google.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: CS20 KFTing <kfting@nuvoton.com>, qemu-arm <qemu-arm@nongnu.org>,
	Joel Stanley <joel@jms.id.au>,
	QEMU Developers <qemu-devel@nongnu.org>,
	IS20 Avi Fishman <Avi.Fishman@nuvoton.com>
Subject: Re: [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models
Date: Thu, 9 Jul 2020 07:34:18 +0200	[thread overview]
Message-ID: <af879fd1-dea8-a3f2-d3fb-13be24c0b740@amsat.org> (raw)
In-Reply-To: <CAFQmdRZdUKvmi_eKdtCnR8uP63sRP9X0Z7oxZES56mtSz_=7FA@mail.gmail.com>

On 7/9/20 2:06 AM, Havard Skinnemoen wrote:
> On Wed, Jul 8, 2020 at 11:13 AM Havard Skinnemoen
> <hskinnemoen@google.com> wrote:
>> On Wed, Jul 8, 2020 at 10:31 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>> On 7/7/20 8:47 PM, Havard Skinnemoen wrote:
>>>> +typedef struct NPCM7xxClass {
>>>> +    DeviceClass         parent;
>>>
>>> Similar comment that elsewhere on this series, if NPCM7xxClass not used
>>> outside of npcm7xx.c, keep it local.
>>
>> OK, will do.
> 
> Turns out it is used in npcm7xx_boards.c, so it has to stay where it is.

Indeed:

static void npcm7xx_load_kernel(MachineState *machine,
                                NPCM7xxState *soc)
{
    NPCM7xxClass *sc = NPCM7XX_GET_CLASS(soc);

    npcm7xx_binfo.ram_size = machine->ram_size;
    npcm7xx_binfo.nb_cpus = sc->num_cpus;

    arm_load_kernel(&soc->cpu[0], machine, &npcm7xx_binfo);
}

This is fine.

Just thinking loudly, we traditionally add the load_kernel() code
in the machine, because it is often specific to Linux guest, and
the SoC doesn't need to know about the guest OS.

hw/arm/boot.c contains helpers also useful for firmwares.

The SoC has a link to the DRAM so can get its size.
All the arm_boot_info fields are specific to this SoC.
So we could move a lot of code to npcm7xx.c, only declaring:

  void npcm7xx_load_kernel(MachineState *machine,
                           NPCM7xxState *soc);


  reply	other threads:[~2020-07-09  5:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 18:47 [PATCH v4 00/12] Add Nuvoton NPCM730/NPCM750 SoCs and two BMC machines Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 01/12] npcm7xx: Add config symbol Havard Skinnemoen
2020-07-08 16:56   ` Philippe Mathieu-Daudé
2020-07-08 16:58     ` Havard Skinnemoen
2020-07-08 17:04       ` Philippe Mathieu-Daudé
2020-07-07 18:47 ` [PATCH v4 02/12] hw/misc: Add NPCM7xx System Global Control Registers device model Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 03/12] hw/misc: Add NPCM7xx Clock Controller " Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 04/12] hw/timer: Add NPCM7xx Timer " Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models Havard Skinnemoen
2020-07-08 17:31   ` Philippe Mathieu-Daudé
2020-07-08 17:56     ` Philippe Mathieu-Daudé
2020-07-09  0:23       ` Havard Skinnemoen
2020-07-09  5:17         ` Philippe Mathieu-Daudé
2020-07-08 18:13     ` Havard Skinnemoen
2020-07-08 21:47       ` Havard Skinnemoen
2020-07-09  0:06       ` Havard Skinnemoen
2020-07-09  5:34         ` Philippe Mathieu-Daudé [this message]
2020-07-09  7:23           ` Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 06/12] hw/arm: Add two NPCM7xx-based machines Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 07/12] hw/arm: Load -bios image as a boot ROM for npcm7xx Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 08/12] hw/nvram: NPCM7xx OTP device model Havard Skinnemoen
2020-07-08  8:54   ` Philippe Mathieu-Daudé
2020-07-08 17:04     ` Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 09/12] hw/mem: Stubbed out NPCM7xx Memory Controller model Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 10/12] hw/ssi: NPCM7xx Flash Interface Unit device model Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 11/12] hw/arm: Wire up BMC boot flash for npcm750-evb and quanta-gsj Havard Skinnemoen
2020-07-07 18:47 ` [PATCH v4 12/12] docs/system: Add Nuvoton machine documentation Havard Skinnemoen

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=af879fd1-dea8-a3f2-d3fb-13be24c0b740@amsat.org \
    --to=f4bug@amsat.org \
    --cc=Avi.Fishman@nuvoton.com \
    --cc=hskinnemoen@google.com \
    --cc=joel@jms.id.au \
    --cc=kfting@nuvoton.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --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).