Re: [PATCH v2 09/13] hw/riscv/fdt-common, virt.c: add create_fdt_rtc()

Philippe Mathieu-Daudé <[email protected]>
Newsgroups org.nongnu.qemu-riscv,org.nongnu.qemu-devel
Message-ID <[email protected]>
On 26/8/26 18:48, Daniel Henrique Barboza wrote:
> The soon to be added 'riscv-server-ref' board will add a rtc FDT subnode
> that is similar to what the 'virt' board users.  Put it into a helper to
> avoid copy/pasting code.
> 
> No FDT changes intended.
> 
> Signed-off-by: Daniel Henrique Barboza <[email protected]>
> ---
>   hw/riscv/fdt-common.c         | 23 +++++++++++++++++++++++
>   hw/riscv/virt.c               | 26 ++------------------------
>   include/hw/riscv/fdt-common.h |  3 +++
>   3 files changed, 28 insertions(+), 24 deletions(-)


> +void create_fdt_rtc(void *fdt, const MemMapEntry *rtc_mem,
> +                    int rtc_irq, int aia_type,
> +                    uint32_t irq_mmio_phandle)
> +{
> +    g_autofree char *name = NULL;
> +
> +    name = g_strdup_printf("/soc/rtc@%"HWADDR_PRIx,
> +                           rtc_mem->base);
> +    qemu_fdt_add_subnode(fdt, name);
> +    qemu_fdt_setprop_string(fdt, name, "compatible",
> +        "google,goldfish-rtc");
Mis-indented ;)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.