[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models |
Date: |
Thu, 9 Jul 2020 07:34:18 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
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);
- [PATCH v4 03/12] hw/misc: Add NPCM7xx Clock Controller device model, (continued)
- [PATCH v4 03/12] hw/misc: Add NPCM7xx Clock Controller device model, Havard Skinnemoen, 2020/07/07
- [PATCH v4 04/12] hw/timer: Add NPCM7xx Timer device model, Havard Skinnemoen, 2020/07/07
- [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models, Havard Skinnemoen, 2020/07/07
- Re: [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models, Havard Skinnemoen, 2020/07/08
- Re: [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models, Havard Skinnemoen, 2020/07/08
- Re: [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models, Havard Skinnemoen, 2020/07/08
- Re: [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models,
Philippe Mathieu-Daudé <=
- Re: [PATCH v4 05/12] hw/arm: Add NPCM730 and NPCM750 SoC models, Havard Skinnemoen, 2020/07/09
[PATCH v4 06/12] hw/arm: Add two NPCM7xx-based machines, Havard Skinnemoen, 2020/07/07
[PATCH v4 07/12] hw/arm: Load -bios image as a boot ROM for npcm7xx, Havard Skinnemoen, 2020/07/07
[PATCH v4 08/12] hw/nvram: NPCM7xx OTP device model, Havard Skinnemoen, 2020/07/07
[PATCH v4 09/12] hw/mem: Stubbed out NPCM7xx Memory Controller model, Havard Skinnemoen, 2020/07/07
[PATCH v4 10/12] hw/ssi: NPCM7xx Flash Interface Unit device model, Havard Skinnemoen, 2020/07/07
[PATCH v4 11/12] hw/arm: Wire up BMC boot flash for npcm750-evb and quanta-gsj, Havard Skinnemoen, 2020/07/07
[PATCH v4 12/12] docs/system: Add Nuvoton machine documentation, Havard Skinnemoen, 2020/07/07