diff mbox series

[1/8] hw: Move i.MX watchdog driver to hw/watchdog

Message ID 20200314172736.24528-2-linux@roeck-us.net
State New
Headers show
Series hw/arm: Implement i.MX watchdog support | expand

Commit Message

Guenter Roeck March 14, 2020, 5:27 p.m. UTC
In preparation for a full implementation, move i.MX watchdog driver
from hw/misc to hw/watchdog. While at it, add the watchdog files
to MAINTAINERS.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 MAINTAINERS                                         | 2 ++
 hw/misc/Makefile.objs                               | 1 -
 hw/watchdog/Kconfig                                 | 5 +++++
 hw/watchdog/Makefile.objs                           | 1 +
 hw/{misc/imx2_wdt.c => watchdog/wdt_imx2.c}         | 2 +-
 include/hw/arm/fsl-imx6.h                           | 2 +-
 include/hw/arm/fsl-imx6ul.h                         | 2 +-
 include/hw/arm/fsl-imx7.h                           | 2 +-
 include/hw/{misc/imx2_wdt.h => watchdog/wdt_imx2.h} | 0
 9 files changed, 12 insertions(+), 5 deletions(-)
 rename hw/{misc/imx2_wdt.c => watchdog/wdt_imx2.c} (98%)
 rename include/hw/{misc/imx2_wdt.h => watchdog/wdt_imx2.h} (100%)

Comments

Philippe Mathieu-Daudé March 14, 2020, 9:43 p.m. UTC | #1
Hi Guenter,

On 3/14/20 6:27 PM, Guenter Roeck wrote:
> In preparation for a full implementation, move i.MX watchdog driver
> from hw/misc to hw/watchdog. While at it, add the watchdog files
> to MAINTAINERS.
> 
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>   MAINTAINERS                                         | 2 ++
>   hw/misc/Makefile.objs                               | 1 -
>   hw/watchdog/Kconfig                                 | 5 +++++
>   hw/watchdog/Makefile.objs                           | 1 +
>   hw/{misc/imx2_wdt.c => watchdog/wdt_imx2.c}         | 2 +-
>   include/hw/arm/fsl-imx6.h                           | 2 +-
>   include/hw/arm/fsl-imx6ul.h                         | 2 +-
>   include/hw/arm/fsl-imx7.h                           | 2 +-
>   include/hw/{misc/imx2_wdt.h => watchdog/wdt_imx2.h} | 0
>   9 files changed, 12 insertions(+), 5 deletions(-)
>   rename hw/{misc/imx2_wdt.c => watchdog/wdt_imx2.c} (98%)
>   rename include/hw/{misc/imx2_wdt.h => watchdog/wdt_imx2.h} (100%)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 32867bc636..d1197014e8 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -603,8 +603,10 @@ S: Odd Fixes
>   F: hw/arm/fsl-imx25.c
>   F: hw/arm/imx25_pdk.c
>   F: hw/misc/imx25_ccm.c
> +F: hw/watchdog/wdt_imx2.c
>   F: include/hw/arm/fsl-imx25.h
>   F: include/hw/misc/imx25_ccm.h
> +F: include/hw/watchdog/wdt_imx2.h
>   
>   i.MX31 (kzm)
>   M: Peter Chubb <peter.chubb@nicta.com.au>
> diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs
> index 68aae2eabb..b25181b711 100644
> --- a/hw/misc/Makefile.objs
> +++ b/hw/misc/Makefile.objs
> @@ -44,7 +44,6 @@ common-obj-$(CONFIG_IMX) += imx6_ccm.o
>   common-obj-$(CONFIG_IMX) += imx6ul_ccm.o
>   obj-$(CONFIG_IMX) += imx6_src.o
>   common-obj-$(CONFIG_IMX) += imx7_ccm.o
> -common-obj-$(CONFIG_IMX) += imx2_wdt.o
>   common-obj-$(CONFIG_IMX) += imx7_snvs.o
>   common-obj-$(CONFIG_IMX) += imx7_gpr.o
>   common-obj-$(CONFIG_IMX) += imx_rngc.o
> diff --git a/hw/watchdog/Kconfig b/hw/watchdog/Kconfig
> index 2118d897c9..2c225b4b17 100644
> --- a/hw/watchdog/Kconfig
> +++ b/hw/watchdog/Kconfig
> @@ -14,3 +14,8 @@ config WDT_IB700
>   
>   config WDT_DIAG288
>       bool
> +
> +config WDT_IMX2
> +    bool
> +    default y
> +    depends on IMX

- it does not depend of IMX (you could use it in another SoC)
- since it is not user-creatable, it is pointless as a default device.

Instead, select it in each iMX SoC:

-- >8 --
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index e5a876c8d1..cdb01c4e03 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -358,6 +358,7 @@ config FSL_IMX25
      select IMX
      select IMX_FEC
      select IMX_I2C
+    select WDT_IMX2
      select DS1338

  config FSL_IMX31
@@ -365,6 +366,7 @@ config FSL_IMX31
      select SERIAL
      select IMX
      select IMX_I2C
+    select WDT_IMX2
      select LAN9118

  config FSL_IMX6
@@ -373,6 +375,7 @@ config FSL_IMX6
      select IMX
      select IMX_FEC
      select IMX_I2C
+    select WDT_IMX2
      select SDHCI

---

With this hunk amended (and removing "default y" and "depends on IMX"):
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> diff --git a/hw/watchdog/Makefile.objs b/hw/watchdog/Makefile.objs
> index 3f536d1cad..dd9b37f642 100644
> --- a/hw/watchdog/Makefile.objs
> +++ b/hw/watchdog/Makefile.objs
> @@ -4,3 +4,4 @@ common-obj-$(CONFIG_WDT_IB6300ESB) += wdt_i6300esb.o
>   common-obj-$(CONFIG_WDT_IB700) += wdt_ib700.o
>   common-obj-$(CONFIG_WDT_DIAG288) += wdt_diag288.o
>   common-obj-$(CONFIG_ASPEED_SOC) += wdt_aspeed.o
> +common-obj-$(CONFIG_WDT_IMX) += wdt_imx2.o
> diff --git a/hw/misc/imx2_wdt.c b/hw/watchdog/wdt_imx2.c
> similarity index 98%
> rename from hw/misc/imx2_wdt.c
> rename to hw/watchdog/wdt_imx2.c
> index 2aedfe803a..ad1ef02e9e 100644
> --- a/hw/misc/imx2_wdt.c
> +++ b/hw/watchdog/wdt_imx2.c
> @@ -14,7 +14,7 @@
>   #include "qemu/module.h"
>   #include "sysemu/watchdog.h"
>   
> -#include "hw/misc/imx2_wdt.h"
> +#include "hw/watchdog/wdt_imx2.h"
>   
>   #define IMX2_WDT_WCR_WDA    BIT(5)      /* -> External Reset WDOG_B */
>   #define IMX2_WDT_WCR_SRS    BIT(4)      /* -> Software Reset Signal */
> diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h
> index 60eadccb42..5b02dc1f4b 100644
> --- a/include/hw/arm/fsl-imx6.h
> +++ b/include/hw/arm/fsl-imx6.h
> @@ -21,7 +21,7 @@
>   #include "hw/cpu/a9mpcore.h"
>   #include "hw/misc/imx6_ccm.h"
>   #include "hw/misc/imx6_src.h"
> -#include "hw/misc/imx2_wdt.h"
> +#include "hw/watchdog/wdt_imx2.h"
>   #include "hw/char/imx_serial.h"
>   #include "hw/timer/imx_gpt.h"
>   #include "hw/timer/imx_epit.h"
> diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h
> index eda389aec7..91c746918a 100644
> --- a/include/hw/arm/fsl-imx6ul.h
> +++ b/include/hw/arm/fsl-imx6ul.h
> @@ -24,7 +24,7 @@
>   #include "hw/misc/imx7_snvs.h"
>   #include "hw/misc/imx7_gpr.h"
>   #include "hw/intc/imx_gpcv2.h"
> -#include "hw/misc/imx2_wdt.h"
> +#include "hw/watchdog/wdt_imx2.h"
>   #include "hw/gpio/imx_gpio.h"
>   #include "hw/char/imx_serial.h"
>   #include "hw/timer/imx_gpt.h"
> diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
> index 706aef2e7e..3a0041c4c2 100644
> --- a/include/hw/arm/fsl-imx7.h
> +++ b/include/hw/arm/fsl-imx7.h
> @@ -26,7 +26,7 @@
>   #include "hw/misc/imx7_snvs.h"
>   #include "hw/misc/imx7_gpr.h"
>   #include "hw/misc/imx6_src.h"
> -#include "hw/misc/imx2_wdt.h"
> +#include "hw/watchdog/wdt_imx2.h"
>   #include "hw/gpio/imx_gpio.h"
>   #include "hw/char/imx_serial.h"
>   #include "hw/timer/imx_gpt.h"
> diff --git a/include/hw/misc/imx2_wdt.h b/include/hw/watchdog/wdt_imx2.h
> similarity index 100%
> rename from include/hw/misc/imx2_wdt.h
> rename to include/hw/watchdog/wdt_imx2.h
>
Philippe Mathieu-Daudé March 14, 2020, 9:46 p.m. UTC | #2
On 3/14/20 10:43 PM, Philippe Mathieu-Daudé wrote:
> Hi Guenter,
> 
> On 3/14/20 6:27 PM, Guenter Roeck wrote:
>> In preparation for a full implementation, move i.MX watchdog driver
>> from hw/misc to hw/watchdog. While at it, add the watchdog files
>> to MAINTAINERS.
>>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>>   MAINTAINERS                                         | 2 ++
>>   hw/misc/Makefile.objs                               | 1 -
>>   hw/watchdog/Kconfig                                 | 5 +++++
>>   hw/watchdog/Makefile.objs                           | 1 +
>>   hw/{misc/imx2_wdt.c => watchdog/wdt_imx2.c}         | 2 +-
>>   include/hw/arm/fsl-imx6.h                           | 2 +-
>>   include/hw/arm/fsl-imx6ul.h                         | 2 +-
>>   include/hw/arm/fsl-imx7.h                           | 2 +-
>>   include/hw/{misc/imx2_wdt.h => watchdog/wdt_imx2.h} | 0
>>   9 files changed, 12 insertions(+), 5 deletions(-)
>>   rename hw/{misc/imx2_wdt.c => watchdog/wdt_imx2.c} (98%)
>>   rename include/hw/{misc/imx2_wdt.h => watchdog/wdt_imx2.h} (100%)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 32867bc636..d1197014e8 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -603,8 +603,10 @@ S: Odd Fixes
>>   F: hw/arm/fsl-imx25.c
>>   F: hw/arm/imx25_pdk.c
>>   F: hw/misc/imx25_ccm.c
>> +F: hw/watchdog/wdt_imx2.c
>>   F: include/hw/arm/fsl-imx25.h
>>   F: include/hw/misc/imx25_ccm.h
>> +F: include/hw/watchdog/wdt_imx2.h
>>   i.MX31 (kzm)
>>   M: Peter Chubb <peter.chubb@nicta.com.au>
>> diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs
>> index 68aae2eabb..b25181b711 100644
>> --- a/hw/misc/Makefile.objs
>> +++ b/hw/misc/Makefile.objs
>> @@ -44,7 +44,6 @@ common-obj-$(CONFIG_IMX) += imx6_ccm.o
>>   common-obj-$(CONFIG_IMX) += imx6ul_ccm.o
>>   obj-$(CONFIG_IMX) += imx6_src.o
>>   common-obj-$(CONFIG_IMX) += imx7_ccm.o
>> -common-obj-$(CONFIG_IMX) += imx2_wdt.o
>>   common-obj-$(CONFIG_IMX) += imx7_snvs.o
>>   common-obj-$(CONFIG_IMX) += imx7_gpr.o
>>   common-obj-$(CONFIG_IMX) += imx_rngc.o
>> diff --git a/hw/watchdog/Kconfig b/hw/watchdog/Kconfig
>> index 2118d897c9..2c225b4b17 100644
>> --- a/hw/watchdog/Kconfig
>> +++ b/hw/watchdog/Kconfig
>> @@ -14,3 +14,8 @@ config WDT_IB700
>>   config WDT_DIAG288
>>       bool
>> +
>> +config WDT_IMX2
>> +    bool
>> +    default y
>> +    depends on IMX
> 
> - it does not depend of IMX (you could use it in another SoC)
> - since it is not user-creatable, it is pointless as a default device.
> 
> Instead, select it in each iMX SoC:
> 
> -- >8 --
> diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
> index e5a876c8d1..cdb01c4e03 100644
> --- a/hw/arm/Kconfig
> +++ b/hw/arm/Kconfig
> @@ -358,6 +358,7 @@ config FSL_IMX25
>       select IMX
>       select IMX_FEC
>       select IMX_I2C
> +    select WDT_IMX2
>       select DS1338
> 
>   config FSL_IMX31
> @@ -365,6 +366,7 @@ config FSL_IMX31
>       select SERIAL
>       select IMX
>       select IMX_I2C
> +    select WDT_IMX2
>       select LAN9118
> 
>   config FSL_IMX6
> @@ -373,6 +375,7 @@ config FSL_IMX6
>       select IMX
>       select IMX_FEC
>       select IMX_I2C
> +    select WDT_IMX2
>       select SDHCI
> 
> ---

Corrected hunk:

-- >8 --
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index e5a876c8d1..c662d5f1e0 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -373,6 +373,7 @@ config FSL_IMX6
      select IMX
      select IMX_FEC
      select IMX_I2C
+    select WDT_IMX2
      select SDHCI

  config ASPEED_SOC
@@ -410,6 +411,7 @@ config FSL_IMX7
      select IMX
      select IMX_FEC
      select IMX_I2C
+    select WDT_IMX2
      select PCI_EXPRESS_DESIGNWARE
      select SDHCI
      select UNIMP
@@ -423,6 +425,7 @@ config FSL_IMX6UL
      select IMX
      select IMX_FEC
      select IMX_I2C
+    select WDT_IMX2
      select SDHCI
      select UNIMP

---

> 
> With this hunk amended (and removing "default y" and "depends on IMX"):
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
>> diff --git a/hw/watchdog/Makefile.objs b/hw/watchdog/Makefile.objs
>> index 3f536d1cad..dd9b37f642 100644
>> --- a/hw/watchdog/Makefile.objs
>> +++ b/hw/watchdog/Makefile.objs
>> @@ -4,3 +4,4 @@ common-obj-$(CONFIG_WDT_IB6300ESB) += wdt_i6300esb.o
>>   common-obj-$(CONFIG_WDT_IB700) += wdt_ib700.o
>>   common-obj-$(CONFIG_WDT_DIAG288) += wdt_diag288.o
>>   common-obj-$(CONFIG_ASPEED_SOC) += wdt_aspeed.o
>> +common-obj-$(CONFIG_WDT_IMX) += wdt_imx2.o
>> diff --git a/hw/misc/imx2_wdt.c b/hw/watchdog/wdt_imx2.c
>> similarity index 98%
>> rename from hw/misc/imx2_wdt.c
>> rename to hw/watchdog/wdt_imx2.c
>> index 2aedfe803a..ad1ef02e9e 100644
>> --- a/hw/misc/imx2_wdt.c
>> +++ b/hw/watchdog/wdt_imx2.c
>> @@ -14,7 +14,7 @@
>>   #include "qemu/module.h"
>>   #include "sysemu/watchdog.h"
>> -#include "hw/misc/imx2_wdt.h"
>> +#include "hw/watchdog/wdt_imx2.h"
>>   #define IMX2_WDT_WCR_WDA    BIT(5)      /* -> External Reset WDOG_B */
>>   #define IMX2_WDT_WCR_SRS    BIT(4)      /* -> Software Reset Signal */
>> diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h
>> index 60eadccb42..5b02dc1f4b 100644
>> --- a/include/hw/arm/fsl-imx6.h
>> +++ b/include/hw/arm/fsl-imx6.h
>> @@ -21,7 +21,7 @@
>>   #include "hw/cpu/a9mpcore.h"
>>   #include "hw/misc/imx6_ccm.h"
>>   #include "hw/misc/imx6_src.h"
>> -#include "hw/misc/imx2_wdt.h"
>> +#include "hw/watchdog/wdt_imx2.h"
>>   #include "hw/char/imx_serial.h"
>>   #include "hw/timer/imx_gpt.h"
>>   #include "hw/timer/imx_epit.h"
>> diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h
>> index eda389aec7..91c746918a 100644
>> --- a/include/hw/arm/fsl-imx6ul.h
>> +++ b/include/hw/arm/fsl-imx6ul.h
>> @@ -24,7 +24,7 @@
>>   #include "hw/misc/imx7_snvs.h"
>>   #include "hw/misc/imx7_gpr.h"
>>   #include "hw/intc/imx_gpcv2.h"
>> -#include "hw/misc/imx2_wdt.h"
>> +#include "hw/watchdog/wdt_imx2.h"
>>   #include "hw/gpio/imx_gpio.h"
>>   #include "hw/char/imx_serial.h"
>>   #include "hw/timer/imx_gpt.h"
>> diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
>> index 706aef2e7e..3a0041c4c2 100644
>> --- a/include/hw/arm/fsl-imx7.h
>> +++ b/include/hw/arm/fsl-imx7.h
>> @@ -26,7 +26,7 @@
>>   #include "hw/misc/imx7_snvs.h"
>>   #include "hw/misc/imx7_gpr.h"
>>   #include "hw/misc/imx6_src.h"
>> -#include "hw/misc/imx2_wdt.h"
>> +#include "hw/watchdog/wdt_imx2.h"
>>   #include "hw/gpio/imx_gpio.h"
>>   #include "hw/char/imx_serial.h"
>>   #include "hw/timer/imx_gpt.h"
>> diff --git a/include/hw/misc/imx2_wdt.h b/include/hw/watchdog/wdt_imx2.h
>> similarity index 100%
>> rename from include/hw/misc/imx2_wdt.h
>> rename to include/hw/watchdog/wdt_imx2.h
>>
Guenter Roeck March 14, 2020, 10:11 p.m. UTC | #3
Hi Philippe,

On 3/14/20 2:46 PM, Philippe Mathieu-Daudé wrote:

[ ... ]

> Corrected hunk:
> 
> -- >8 --
> diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
> index e5a876c8d1..c662d5f1e0 100644
> --- a/hw/arm/Kconfig
> +++ b/hw/arm/Kconfig
> @@ -373,6 +373,7 @@ config FSL_IMX6
>      select IMX
>      select IMX_FEC
>      select IMX_I2C
> +    select WDT_IMX2
>      select SDHCI
> 
>  config ASPEED_SOC
> @@ -410,6 +411,7 @@ config FSL_IMX7
>      select IMX
>      select IMX_FEC
>      select IMX_I2C
> +    select WDT_IMX2
>      select PCI_EXPRESS_DESIGNWARE
>      select SDHCI
>      select UNIMP
> @@ -423,6 +425,7 @@ config FSL_IMX6UL
>      select IMX
>      select IMX_FEC
>      select IMX_I2C
> +    select WDT_IMX2
>      select SDHCI
>      select UNIMP
> 

Done. I also fixed

>> +common-obj-$(CONFIG_WDT_IMX) += wdt_imx2.o

to

>> +common-obj-$(CONFIG_WDT_IMX2) += wdt_imx2.o

in patch 1/8 (that had slipped to patch 2/8).

Thanks a lot for the feedback,

Guenter
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index 32867bc636..d1197014e8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -603,8 +603,10 @@  S: Odd Fixes
 F: hw/arm/fsl-imx25.c
 F: hw/arm/imx25_pdk.c
 F: hw/misc/imx25_ccm.c
+F: hw/watchdog/wdt_imx2.c
 F: include/hw/arm/fsl-imx25.h
 F: include/hw/misc/imx25_ccm.h
+F: include/hw/watchdog/wdt_imx2.h
 
 i.MX31 (kzm)
 M: Peter Chubb <peter.chubb@nicta.com.au>
diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs
index 68aae2eabb..b25181b711 100644
--- a/hw/misc/Makefile.objs
+++ b/hw/misc/Makefile.objs
@@ -44,7 +44,6 @@  common-obj-$(CONFIG_IMX) += imx6_ccm.o
 common-obj-$(CONFIG_IMX) += imx6ul_ccm.o
 obj-$(CONFIG_IMX) += imx6_src.o
 common-obj-$(CONFIG_IMX) += imx7_ccm.o
-common-obj-$(CONFIG_IMX) += imx2_wdt.o
 common-obj-$(CONFIG_IMX) += imx7_snvs.o
 common-obj-$(CONFIG_IMX) += imx7_gpr.o
 common-obj-$(CONFIG_IMX) += imx_rngc.o
diff --git a/hw/watchdog/Kconfig b/hw/watchdog/Kconfig
index 2118d897c9..2c225b4b17 100644
--- a/hw/watchdog/Kconfig
+++ b/hw/watchdog/Kconfig
@@ -14,3 +14,8 @@  config WDT_IB700
 
 config WDT_DIAG288
     bool
+
+config WDT_IMX2
+    bool
+    default y
+    depends on IMX
diff --git a/hw/watchdog/Makefile.objs b/hw/watchdog/Makefile.objs
index 3f536d1cad..dd9b37f642 100644
--- a/hw/watchdog/Makefile.objs
+++ b/hw/watchdog/Makefile.objs
@@ -4,3 +4,4 @@  common-obj-$(CONFIG_WDT_IB6300ESB) += wdt_i6300esb.o
 common-obj-$(CONFIG_WDT_IB700) += wdt_ib700.o
 common-obj-$(CONFIG_WDT_DIAG288) += wdt_diag288.o
 common-obj-$(CONFIG_ASPEED_SOC) += wdt_aspeed.o
+common-obj-$(CONFIG_WDT_IMX) += wdt_imx2.o
diff --git a/hw/misc/imx2_wdt.c b/hw/watchdog/wdt_imx2.c
similarity index 98%
rename from hw/misc/imx2_wdt.c
rename to hw/watchdog/wdt_imx2.c
index 2aedfe803a..ad1ef02e9e 100644
--- a/hw/misc/imx2_wdt.c
+++ b/hw/watchdog/wdt_imx2.c
@@ -14,7 +14,7 @@ 
 #include "qemu/module.h"
 #include "sysemu/watchdog.h"
 
-#include "hw/misc/imx2_wdt.h"
+#include "hw/watchdog/wdt_imx2.h"
 
 #define IMX2_WDT_WCR_WDA    BIT(5)      /* -> External Reset WDOG_B */
 #define IMX2_WDT_WCR_SRS    BIT(4)      /* -> Software Reset Signal */
diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h
index 60eadccb42..5b02dc1f4b 100644
--- a/include/hw/arm/fsl-imx6.h
+++ b/include/hw/arm/fsl-imx6.h
@@ -21,7 +21,7 @@ 
 #include "hw/cpu/a9mpcore.h"
 #include "hw/misc/imx6_ccm.h"
 #include "hw/misc/imx6_src.h"
-#include "hw/misc/imx2_wdt.h"
+#include "hw/watchdog/wdt_imx2.h"
 #include "hw/char/imx_serial.h"
 #include "hw/timer/imx_gpt.h"
 #include "hw/timer/imx_epit.h"
diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h
index eda389aec7..91c746918a 100644
--- a/include/hw/arm/fsl-imx6ul.h
+++ b/include/hw/arm/fsl-imx6ul.h
@@ -24,7 +24,7 @@ 
 #include "hw/misc/imx7_snvs.h"
 #include "hw/misc/imx7_gpr.h"
 #include "hw/intc/imx_gpcv2.h"
-#include "hw/misc/imx2_wdt.h"
+#include "hw/watchdog/wdt_imx2.h"
 #include "hw/gpio/imx_gpio.h"
 #include "hw/char/imx_serial.h"
 #include "hw/timer/imx_gpt.h"
diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
index 706aef2e7e..3a0041c4c2 100644
--- a/include/hw/arm/fsl-imx7.h
+++ b/include/hw/arm/fsl-imx7.h
@@ -26,7 +26,7 @@ 
 #include "hw/misc/imx7_snvs.h"
 #include "hw/misc/imx7_gpr.h"
 #include "hw/misc/imx6_src.h"
-#include "hw/misc/imx2_wdt.h"
+#include "hw/watchdog/wdt_imx2.h"
 #include "hw/gpio/imx_gpio.h"
 #include "hw/char/imx_serial.h"
 #include "hw/timer/imx_gpt.h"
diff --git a/include/hw/misc/imx2_wdt.h b/include/hw/watchdog/wdt_imx2.h
similarity index 100%
rename from include/hw/misc/imx2_wdt.h
rename to include/hw/watchdog/wdt_imx2.h