From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: Joel Stanley <joel@jms.id.au>,
Alistair Francis <alistair.francis@wdc.com>,
Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Cc: "Weiwei Li" <liwei1518@gmail.com>,
"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
"Chao Liu" <chao.liu@processmission.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Anirudh Srinivasan" <asrinivasan@oss.tenstorrent.com>,
"Michael Ellerman" <mpe@kernel.org>,
"Portia Stephens" <portias@oss.tenstorrent.com>,
"Cédric Le Goater" <clg@kaod.org>,
qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH v3 15/16] hw/riscv/atlantis: Extract an Atlantis SoC device
Date: Fri, 4 Sep 2026 12:48:47 +0200 [thread overview]
Message-ID: <284df847-4ea7-497c-9d86-32c19a3d603e@oss.qualcomm.com> (raw)
In-Reply-To: <5d681d59-4a2f-4068-b36d-4ca40ab7b921@oss.qualcomm.com>
On 4/9/26 12:47, Philippe Mathieu-Daudé wrote:
> On 3/9/26 07:51, Joel Stanley wrote:
>> Introduce TYPE_TT_ATLANTIS_SOC and move the hart array, AIA, ACLINT,
>> boot ROM, UART and I2C controllers into the new TTAtlantisSoCState. The
>> machine keeps ownership of RAM, device tree generation, firmware
>> loading, and the board-level I2C slaves.
>>
>> This makes it easier to compose the SoC into a more complex machine in
>> the future.
>>
>> Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
>> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
>> Signed-off-by: Joel Stanley <joel@jms.id.au>
>> ---
>> include/hw/riscv/tt_atlantis.h | 21 ++++-
>> hw/riscv/tt_atlantis.c | 144 +++++++++++++++++++++++----------
>> 2 files changed, 119 insertions(+), 46 deletions(-)
>
>
>> -struct TTAtlantisState {
>> +struct TTAtlantisSoCState {
>> /*< private >*/
>
> While here please drop these legacy private/public comments (QOM
> style doesn't want them anymore).
>
>> - MachineState parent;
>> + DeviceState parent;
>> /*< public >*/
>> - Notifier machine_done;
>> const MemMapEntry *memmap;
>> MemoryRegion *memory;
>> @@ -39,6 +41,19 @@ struct TTAtlantisState {
>> DesignWareI2CState i2c[TT_ATL_NUM_I2C];
>> UnimplementedDeviceState uart1;
>> MemoryRegion bootrom;
>> +
>> + uint32_t num_harts;
>> + char *cpu_type;
>> +};
>> +
>> +struct TTAtlantisState {
>> + /*< private >*/
>> + MachineState parent;
>> +
>> + /*< public >*/
>
> (Ditto).
>
>> + Notifier machine_done;
>> +
>> + TTAtlantisSoCState soc;
>> };
>
>
>> +static void tt_atlantis_soc_realize(DeviceState *dev, Error **errp)
>> +{
>> + TTAtlantisSoCState *s = TT_ATLANTIS_SOC(dev);
>> ram_addr_t lo_ram_size, ram_size;
>> - int hart_count = machine->smp.cpus;
>> + int hart_count = s->num_harts;
>> s->memory = get_system_memory();
>
> For machine layer this was OK but now this is SOC layer and might be
> provided by machine layer via linked property. IOW this should be
> handled like s->dram below.
(Sorry I'm just noticing the next patch exactly addresses that).
>> - s->dram = machine->ram;
>> + if (!s->dram) {
>> + error_setg(errp, "'dram' link is not set");
>> + return;
>> + }
>> ram_size = memory_region_size(s->dram);
>> s->memmap = tt_atlantis_memmap;
>> - object_initialize_child(OBJECT(machine), "soc", &s->cpus,
>> - TYPE_RISCV_HART_ARRAY);
>> - object_property_set_str(OBJECT(&s->cpus), "cpu-type", machine-
>> >cpu_type,
>> + /* CPUs */
>> + object_property_set_str(OBJECT(&s->cpus), "cpu-type", s->cpu_type,
>> &error_abort);
>> object_property_set_int(OBJECT(&s->cpus), "hartid-base", 0,
>> &error_abort);
>> @@ -505,7 +524,9 @@ static void tt_atlantis_machine_init(MachineState
>> *machine)
>> object_property_set_int(OBJECT(&s->cpus), "resetvec",
>> s->memmap[TT_ATL_BOOTROM].base,
>> &error_abort);
>> - sysbus_realize(SYS_BUS_DEVICE(&s->cpus), &error_fatal);
>> + if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpus), errp)) {
>> + return;
>> + }
>
> Patch LGTM otherwise, thanks!
>
next prev parent reply other threads:[~2026-09-04 10:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 5:51 [PATCH v3 00/16] hw/riscv: Socify Atlantis Joel Stanley
2026-09-03 5:51 ` [PATCH v3 01/16] hw/riscv/aia: Take a MemoryRegion for the created devices Joel Stanley
2026-09-03 6:06 ` Chao Liu via
2026-09-03 6:06 ` Chao Liu via qemu development
2026-09-03 5:51 ` [PATCH v3 02/16] hw/intc/riscv_aclint: " Joel Stanley
2026-09-03 5:51 ` [PATCH v3 03/16] hw/intc/riscv_imsic: Take a MemoryRegion for the created device Joel Stanley
2026-09-03 5:51 ` [PATCH v3 04/16] hw/intc/riscv_aplic: " Joel Stanley
2026-09-03 5:51 ` [PATCH v3 05/16] hw/intc/sifive_plic: " Joel Stanley
2026-09-03 6:07 ` Chao Liu via qemu development
2026-09-03 6:07 ` Chao Liu via
2026-09-03 5:51 ` [PATCH v3 06/16] hw/riscv/cps: Map interrupt controllers in SoC container Joel Stanley
2026-09-03 5:51 ` [PATCH v3 07/16] hw/riscv/atlantis: Make UART unimp region a SoC device Joel Stanley
2026-09-03 5:51 ` [PATCH v3 08/16] hw/riscv/atlantis: Remove unused fdt_size Joel Stanley
2026-09-03 5:51 ` [PATCH v3 09/16] hw/riscv/atlantis: Rename hart array 'soc' to 'cpus' Joel Stanley
2026-09-03 5:51 ` [PATCH v3 10/16] hw/riscv/atlantis: Rework device tree creation Joel Stanley
2026-09-03 5:51 ` [PATCH v3 11/16] hw/riscv/atlantis: Use local reference for system memory Joel Stanley
2026-09-03 5:51 ` [PATCH v3 12/16] hw/riscv/atlantis: Decouple RAM size from MachineState Joel Stanley
2026-09-03 5:51 ` [PATCH v3 13/16] hw/riscv/atlantis: Make TTAtlantisState own memory containers Joel Stanley
2026-09-03 5:51 ` [PATCH v3 14/16] hw/riscv: Add property to hart array to allow private memory Joel Stanley
2026-09-04 10:42 ` Philippe Mathieu-Daudé
2026-09-07 7:27 ` Joel Stanley
2026-09-03 5:51 ` [PATCH v3 15/16] hw/riscv/atlantis: Extract an Atlantis SoC device Joel Stanley
2026-09-04 10:47 ` Philippe Mathieu-Daudé
2026-09-04 10:48 ` Philippe Mathieu-Daudé [this message]
2026-09-07 7:16 ` Joel Stanley
2026-09-03 5:51 ` [PATCH v3 16/16] hw/riscv/atlantis: Map the SoC through a memory container Joel Stanley
2026-09-03 23:35 ` [PATCH v3 00/16] hw/riscv: Socify Atlantis Alistair Francis
2026-09-04 10:49 ` 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=284df847-4ea7-497c-9d86-32c19a3d603e@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=alistair.francis@wdc.com \
--cc=asrinivasan@oss.tenstorrent.com \
--cc=chao.liu@processmission.com \
--cc=clg@kaod.org \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=joel@jms.id.au \
--cc=liwei1518@gmail.com \
--cc=mpe@kernel.org \
--cc=npiggin@gmail.com \
--cc=portias@oss.tenstorrent.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=zhiwei_liu@linux.alibaba.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.