qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>,
	qemu-arm@nongnu.org, Peter Chubb <peter.chubb@nicta.com.au>,
	qemu-devel@nongnu.org,
	Jean-Christophe Dubois <jcd@tribudubois.net>
Subject: Re: [PATCH 4/8] hw/arm/fsl-imx31: Wire up watchdog
Date: Sat, 14 Mar 2020 22:50:14 +0100	[thread overview]
Message-ID: <23d19f5e-486c-dfbf-fb1f-71d99379496c@redhat.com> (raw)
In-Reply-To: <20200314172736.24528-5-linux@roeck-us.net>

On 3/14/20 6:27 PM, Guenter Roeck wrote:
> With this patch, the watchdog on i.MX31 emulations is fully operational.
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>   hw/arm/fsl-imx31.c         | 6 ++++++
>   include/hw/arm/fsl-imx31.h | 4 ++++
>   2 files changed, 10 insertions(+)
> 
> diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c
> index 55e90d104b..cec7d0dd1b 100644
> --- a/hw/arm/fsl-imx31.c
> +++ b/hw/arm/fsl-imx31.c
> @@ -63,6 +63,8 @@ static void fsl_imx31_init(Object *obj)
>           sysbus_init_child_obj(obj, "gpio[*]", &s->gpio[i], sizeof(s->gpio[i]),
>                                 TYPE_IMX_GPIO);
>       }
> +
> +    sysbus_init_child_obj(obj, "wdt", &s->wdt, sizeof(s->wdt), TYPE_IMX2_WDT);
>   }
>   
>   static void fsl_imx31_realize(DeviceState *dev, Error **errp)
> @@ -205,6 +207,10 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
>                                               gpio_table[i].irq));
>       }
>   
> +    /* Watchdog */
> +    object_property_set_bool(OBJECT(&s->wdt), true, "realized", &error_abort);
> +    sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt), 0, FSL_IMX31_WDT_ADDR);
> +
>       /* On a real system, the first 16k is a `secure boot rom' */
>       memory_region_init_rom(&s->secure_rom, NULL, "imx31.secure_rom",
>                              FSL_IMX31_SECURE_ROM_SIZE, &err);
> diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h
> index ac5ca9826a..dd8561b309 100644
> --- a/include/hw/arm/fsl-imx31.h
> +++ b/include/hw/arm/fsl-imx31.h
> @@ -25,6 +25,7 @@
>   #include "hw/timer/imx_epit.h"
>   #include "hw/i2c/imx_i2c.h"
>   #include "hw/gpio/imx_gpio.h"
> +#include "hw/watchdog/wdt_imx2.h"
>   #include "exec/memory.h"
>   #include "target/arm/cpu.h"
>   
> @@ -49,6 +50,7 @@ typedef struct FslIMX31State {
>       IMXEPITState   epit[FSL_IMX31_NUM_EPITS];
>       IMXI2CState    i2c[FSL_IMX31_NUM_I2CS];
>       IMXGPIOState   gpio[FSL_IMX31_NUM_GPIOS];
> +    IMX2WdtState   wdt;
>       MemoryRegion   secure_rom;
>       MemoryRegion   rom;
>       MemoryRegion   iram;
> @@ -87,6 +89,8 @@ typedef struct FslIMX31State {
>   #define FSL_IMX31_GPIO1_SIZE            0x4000
>   #define FSL_IMX31_GPIO2_ADDR            0x53FD0000
>   #define FSL_IMX31_GPIO2_SIZE            0x4000
> +#define FSL_IMX31_WDT_ADDR              0x53FDC000
> +#define FSL_IMX31_WDT_SIZE              0x4000
>   #define FSL_IMX31_AVIC_ADDR             0x68000000
>   #define FSL_IMX31_AVIC_SIZE             0x100
>   #define FSL_IMX31_SDRAM0_ADDR           0x80000000
> 

Missing Kconfig hunk:

-- >8 --
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 4cf8fa4967..8af023abde 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -366,6 +366,7 @@ config FSL_IMX31
      select SERIAL
      select IMX
      select IMX_I2C
+    select WDT_IMX2
      select LAN9118

  config FSL_IMX6
---

With it:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



  reply	other threads:[~2020-03-14 21:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-14 17:27 [PATCH 0/8] hw/arm: Implement i.MX watchdog support Guenter Roeck
2020-03-14 17:27 ` [PATCH 1/8] hw: Move i.MX watchdog driver to hw/watchdog Guenter Roeck
2020-03-14 21:43   ` Philippe Mathieu-Daudé
2020-03-14 21:46     ` Philippe Mathieu-Daudé
2020-03-14 22:11       ` Guenter Roeck
2020-03-14 17:27 ` [PATCH 2/8] hw/watchdog: Implement full i.MX watchdog support Guenter Roeck
2020-03-14 17:27 ` [PATCH 3/8] hw/arm/fsl-imx25: Wire up watchdog Guenter Roeck
2020-03-14 21:48   ` Philippe Mathieu-Daudé
2020-03-14 22:12     ` Guenter Roeck
2020-03-14 17:27 ` [PATCH 4/8] hw/arm/fsl-imx31: " Guenter Roeck
2020-03-14 21:50   ` Philippe Mathieu-Daudé [this message]
2020-03-14 22:12     ` Guenter Roeck
2020-03-14 17:27 ` [PATCH 5/8] hw/arm/fsl-imx6: Connect watchdog interrupts Guenter Roeck
2020-03-14 17:27 ` [PATCH 6/8] hw/arm/fsl-imx6ul: " Guenter Roeck
2020-03-14 17:27 ` [PATCH 7/8] hw/arm/fsl-imx7: Instantiate various unimplemented devices Guenter Roeck
2020-03-14 17:27 ` [PATCH 8/8] hw/arm/fsl-imx7: Connect watchdog interrupts Guenter Roeck

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=23d19f5e-486c-dfbf-fb1f-71d99379496c@redhat.com \
    --to=philmd@redhat.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=jcd@tribudubois.net \
    --cc=linux@roeck-us.net \
    --cc=peter.chubb@nicta.com.au \
    --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).