From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Guenter Roeck <linux@roeck-us.net>,
Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Beniamino Galvani <b.galvani@gmail.com>,
Strahinja Jankovic <strahinja.p.jankovic@gmail.com>,
qemu-devel@nongnu.org, qemu-arm@nongnu.org,
Li Guang <lig.fnst@cn.fujitsu.com>,
Strahinja Jankovic <strahinja.p.jankovic@gmail.com>,
Niek Linnenbank <nieklinnenbank@gmail.com>
Subject: Re: [PATCH v2 3/3] hw/arm: Add watchdog timer to Allwinner H40 and Bananapi board
Date: Tue, 16 Jan 2024 11:04:20 +0100 [thread overview]
Message-ID: <7551e55e-89b3-40de-a3b4-60e158d00295@linaro.org> (raw)
In-Reply-To: <20240115182757.1095012-4-linux@roeck-us.net>
Hi,
(Cc'ing Li, Strahinja and Niek)
On 15/1/24 19:27, Guenter Roeck wrote:
> Add watchdog timer support to Allwinner-H40 and Bananapi.
> The watchdog timer is added as an overlay to the Timer
> module memory map.
I'm confused by these registers from TYPE_AW_A10_PIT
and the TYPE_AW_WDT implementation you are using:
#define AW_A10_PIT_WDOG_CONTROL 0x90
#define AW_A10_PIT_WDOG_MODE 0x94
Do we have 2 implementations of the same peripheral?
Should we instanciate AW_WDT within AW_A10_PIT?
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> docs/system/arm/bananapi_m2u.rst | 2 +-
> hw/arm/Kconfig | 1 +
> hw/arm/allwinner-r40.c | 8 ++++++++
> include/hw/arm/allwinner-r40.h | 3 +++
> 4 files changed, 13 insertions(+), 1 deletion(-)
> diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c
> index 534be4a735..a28e5b3886 100644
> --- a/hw/arm/allwinner-r40.c
> +++ b/hw/arm/allwinner-r40.c
> @@ -53,6 +53,7 @@ const hwaddr allwinner_r40_memmap[] = {
> [AW_R40_DEV_OHCI2] = 0x01c1c400,
> [AW_R40_DEV_CCU] = 0x01c20000,
> [AW_R40_DEV_PIT] = 0x01c20c00,
> + [AW_R40_DEV_WDT] = 0x01c20c90,
> [AW_R40_DEV_UART0] = 0x01c28000,
> [AW_R40_DEV_UART1] = 0x01c28400,
> [AW_R40_DEV_UART2] = 0x01c28800,
> @@ -279,6 +280,8 @@ static void allwinner_r40_init(Object *obj)
> object_property_add_alias(obj, "clk1-freq", OBJECT(&s->timer),
> "clk1-freq");
>
> + object_initialize_child(obj, "wdt", &s->wdt, TYPE_AW_WDT_SUN4I);
> +
> object_initialize_child(obj, "ccu", &s->ccu, TYPE_AW_R40_CCU);
>
> for (int i = 0; i < AW_R40_NUM_MMCS; i++) {
> @@ -545,6 +548,11 @@ static void allwinner_r40_realize(DeviceState *dev, Error **errp)
> sysbus_connect_irq(SYS_BUS_DEVICE(&s->emac), 0,
> qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_EMAC));
>
> + /* WDT */
> + sysbus_realize(SYS_BUS_DEVICE(&s->wdt), &error_fatal);
> + sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->wdt), 0,
> + allwinner_r40_memmap[AW_R40_DEV_WDT], 1);
> +
next prev parent reply other threads:[~2024-01-16 10:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-15 18:27 [PATCH v2 0/3] hw/arm: Add support for USB, SATA, and watchdog to Allwinner R40 Guenter Roeck
2024-01-15 18:27 ` [PATCH v2 1/3] hw/arm: Add EHCI/OHCI controllers to Allwinner R40 and Bananapi board Guenter Roeck
2024-01-16 9:56 ` Philippe Mathieu-Daudé
2024-01-15 18:27 ` [PATCH v2 2/3] hw/arm: Add AHCI/SATA controller " Guenter Roeck
2024-01-15 18:27 ` [PATCH v2 3/3] hw/arm: Add watchdog timer to Allwinner H40 " Guenter Roeck
2024-01-16 10:04 ` Philippe Mathieu-Daudé [this message]
2024-01-16 15:32 ` Guenter Roeck
2024-01-17 22:43 ` Strahinja Jankovic
2024-01-19 16:57 ` [PATCH v2 0/3] hw/arm: Add support for USB, SATA, and watchdog to Allwinner R40 Peter Maydell
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=7551e55e-89b3-40de-a3b4-60e158d00295@linaro.org \
--to=philmd@linaro.org \
--cc=b.galvani@gmail.com \
--cc=lig.fnst@cn.fujitsu.com \
--cc=linux@roeck-us.net \
--cc=nieklinnenbank@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=strahinja.p.jankovic@gmail.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 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).