From nobody Mon Apr 29 21:08:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584206924; cv=none; d=zohomail.com; s=zohoarc; b=lv6G5bid9hx2NuNxQs8P4agZhybESlapWM2eGkEPjfw5M7epx/6PMgdAt0vmg7m6/GZjG07RQ72A0Ksj6VBn9gprh0Dk5wmNauGNnF6HnTK2Y+s/wqmtKCQaCPt33dQ+ChR2gZHJBQMP8cOGV48OWKWM0ZpPgAyTHTkNrtxZhEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584206924; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=c8+NrFQrAejVqIlPEDdLPF0zMrwlZfTWj58V1G1hCUA=; b=OMrXSfiRO1V7ocYECi5ti4VkSLVALnggxrT9M79/n0dvpcMIVFqtqbO87T87/E/wGOzbrmUcRmN/0AAcGUAEK9vBrr2LfBGbZKnWowSOQsYABwo40Z81bUi9AcvYyfoCGiGzW9E3S2fzA5HC0Cmn+uEEHu2PINSDlbfKo6xvHG0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584206923889720.2007570710115; Sat, 14 Mar 2020 10:28:43 -0700 (PDT) Received: from localhost ([::1]:46736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAaX-000143-UO for importer@patchew.org; Sat, 14 Mar 2020 13:28:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42919) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAZb-0007ph-3F for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDAZZ-0005HN-QS for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:43 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:34855) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDAZZ-0005Ck-L2; Sat, 14 Mar 2020 13:27:41 -0400 Received: by mail-pj1-x1041.google.com with SMTP id mq3so6013306pjb.0; Sat, 14 Mar 2020 10:27:41 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 31sm5067556pgt.2.2020.03.14.10.27.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Mar 2020 10:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=c8+NrFQrAejVqIlPEDdLPF0zMrwlZfTWj58V1G1hCUA=; b=dbGR7lsQPCDshwtJzx3Drr6UAo6Y2pGWsFHRrTfhNI66LFd27ReqQXyEobLrLjWUm+ awxge4BdHKq5ABtwOqJy/BBSM6Q+Z4Bl/5kZiw1mKWhkMdVdqy6mGfKD4TuLA+bcTlFl 3okIeaC2QO8w3friQaZYtVyFRZ3flegwzLf/Ys7jfa2+PBZYBTMn7OPL+Uwbp0TDI7dD HvvNth4GzwT+3qeRw87ZFoF/G8e9xC9+whumuwRxNz0dyLunnzWGojYX6SVWCx2sHgT8 7U9ZvDRpZRYRMvoM7qM5OFUVOjF/2yv3ldPk4Z2QMZ+jJ/AucctIpV+APX4hPrwFBORX jUFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=c8+NrFQrAejVqIlPEDdLPF0zMrwlZfTWj58V1G1hCUA=; b=XC/sLKbilfvZcGB+jQrW2Nrd778hHJ0oqpgEvUlpGJ0uZv11qbxFTfZjc/rXS52tdC ERkJMA6ai/VTERVb9MS3DMUci/noK+ef5Tcr+0i8ku5q58SLHNz4vU0/L5JFr2hPUXuB f8gDa9QeUMblUfa4vS8JXFUQupE4o8QkFxCkPCu2gU4G2odXZTL93Ax/R1I/g6ySTFE7 /bvtvAvSdIHXBJP8tZCYKlIQqNm+SpCZ57LdLIowlAjVaS0X2+NYEH6AKhuZTWxgXhKb jsFhHPcr29E5zas5RrLln9bGy0t6T8r1JR2u3UKLO0p0Qe5/YChQKVN2mA+Qp8/8F0CE 8yyw== X-Gm-Message-State: ANhLgQ1JgVIG8mjFGmzYlXQi8NqV36FOACv40iV00uLfVNpEr1DYckXx 8FgJUmqCWfuU97bI3HGffCo= X-Google-Smtp-Source: ADFU+vvyws8tljqxmR2rM/DH5asTs/OyQlrZu/48h3C0kWgirMsDQG/NEMI9aICeH/IStgMpIOai4g== X-Received: by 2002:a17:90a:21ac:: with SMTP id q41mr16370472pjc.41.1584206860560; Sat, 14 Mar 2020 10:27:40 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH 1/8] hw: Move i.MX watchdog driver to hw/watchdog Date: Sat, 14 Mar 2020 10:27:29 -0700 Message-Id: <20200314172736.24528-2-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200314172736.24528-1-linux@roeck-us.net> References: <20200314172736.24528-1-linux@roeck-us.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1041 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , qemu-devel@nongnu.org, Jean-Christophe Dubois , qemu-arm@nongnu.org, Peter Chubb , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 2 ++ hw/misc/Makefile.objs | 1 - hw/watchdog/Kconfig | 5 +++++ hw/watchdog/Makefile.objs | 1 + hw/{misc/imx2_wdt.c =3D> 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 =3D> watchdog/wdt_imx2.h} | 0 9 files changed, 12 insertions(+), 5 deletions(-) rename hw/{misc/imx2_wdt.c =3D> watchdog/wdt_imx2.c} (98%) rename include/hw/{misc/imx2_wdt.h =3D> 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 =20 i.MX31 (kzm) M: Peter Chubb 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) +=3D imx6_ccm.o common-obj-$(CONFIG_IMX) +=3D imx6ul_ccm.o obj-$(CONFIG_IMX) +=3D imx6_src.o common-obj-$(CONFIG_IMX) +=3D imx7_ccm.o -common-obj-$(CONFIG_IMX) +=3D imx2_wdt.o common-obj-$(CONFIG_IMX) +=3D imx7_snvs.o common-obj-$(CONFIG_IMX) +=3D imx7_gpr.o common-obj-$(CONFIG_IMX) +=3D 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 =20 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) +=3D wdt_i6300esb.o common-obj-$(CONFIG_WDT_IB700) +=3D wdt_ib700.o common-obj-$(CONFIG_WDT_DIAG288) +=3D wdt_diag288.o common-obj-$(CONFIG_ASPEED_SOC) +=3D wdt_aspeed.o +common-obj-$(CONFIG_WDT_IMX) +=3D 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" =20 -#include "hw/misc/imx2_wdt.h" +#include "hw/watchdog/wdt_imx2.h" =20 #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 --=20 2.17.1 From nobody Mon Apr 29 21:08:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584206926; cv=none; d=zohomail.com; s=zohoarc; b=Trfg8tuZFtMTNvhBFd0xCsV5l9Rd63MbD8zycScyt6663SOpcHUgUb8PKu3zzjjJbsKoaAplmEKfFHe9J7LubqV0YKBMViwLmWRppNoLEcU5gpBcRMRUM73XhPuBvny4tbJAS/hjmdlXUMW0gx5XFFUhc8+Mesxg6df5fc5d6SM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584206926; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=AjHZ7Orhg2us4PqU0ungCcpMTvWnWDW+BzE4hfc2SsE=; b=VNgQ9keb18k83QGRDUTD+xbehN6ywyZflS5HImBZpWNphwSrL6N07+lvSOgQOpqczDa4uMDk2pjvDL99Mwzkm3PQUsz/ZTyYm/MdHYjAVb0a2DoTIlE2xDntNLE0XJuNiAp+cnKO1H9cyBiv4i3YhCwn7TwXLpbWITynUrUCjfk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584206926365643.809993091134; Sat, 14 Mar 2020 10:28:46 -0700 (PDT) Received: from localhost ([::1]:46738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAab-00019c-47 for importer@patchew.org; Sat, 14 Mar 2020 13:28:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42962) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAZc-0007qI-T4 for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDAZb-0005QJ-3e for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:44 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:41733) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDAZa-0005LU-TG; Sat, 14 Mar 2020 13:27:43 -0400 Received: by mail-pg1-x544.google.com with SMTP id b1so6915381pgm.8; Sat, 14 Mar 2020 10:27:42 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id w124sm11770758pfd.71.2020.03.14.10.27.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Mar 2020 10:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=AjHZ7Orhg2us4PqU0ungCcpMTvWnWDW+BzE4hfc2SsE=; b=YkVN8bmC59flSpmuiD87VDk/4mLg+86kMqZtenkePOdwn7ECAE4Znb0dLMW4p8apm1 FNCmSky8ZsqRBX6ekpEFTDfHKT//Co2f4ZaY71nX/AQW6lDjkA93ooCmBDTzhpwyyG+s 8Q3RU9T/gzimpwvZyyaBuAbHK2qI0R6ckqqSUYdn0JDzVOG+2L3QdZ4nUa1/nFhq09Nr /HN4t//tSvxvFRLELxdY0xgwCPH80M0eglf/0rdRLidE+MSDysGyG8GXh8SCdjTe0+kT v5QMRJAnTBiNGvu++51k1MIqhfll3HZxMoSIUBUJ6/UhyPmgaCLzZZh3TwaTcypAJKUy Gfaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=AjHZ7Orhg2us4PqU0ungCcpMTvWnWDW+BzE4hfc2SsE=; b=JC5opA6Sw/MRF98/1DslK+qLWxKrk0QkYN+rdAt/zcz+OjZ3vUOY8Nt53GKsZpR8dF 43A6fXfxRyVjOj9MkttCdW+V3H/h3rlejLQvnozed+f7mVpSZurAIW2a7gGkjpfbLxhT rwew7SZYepP35+Yq6njoiqeAB/RMZL6DNFsnkYY7WybeOK6b7Kusv6QVPntpe3kMXvXZ SLxl5SFdkNgMt0kixi9aSdfbRAz3VOr10uv50WdcDOBizlo9AUyyVoAVEFm0Rb1xMyLu zDmukOQ0B/CRRYZ0fjLandZkWv/lsBc6qXSo81hPYCVfe5ZxUBG2G22kYTKFxnWyE6Zh hiEg== X-Gm-Message-State: ANhLgQ3dHyxYn4AArYWkkAfRIsZ8vVc89ug19zfN6O2eDKZUscXqtNfm zrEwWmanYUS0Ic1H01at+zc= X-Google-Smtp-Source: ADFU+vvMv3dmoqZ6zs+pWB43dms9gWE4jvd05RxLfWZGN/B81txTc0/GVo6Sbg7UqIiBOhn0JC4dMw== X-Received: by 2002:a63:a504:: with SMTP id n4mr18519904pgf.373.1584206861925; Sat, 14 Mar 2020 10:27:41 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH 2/8] hw/watchdog: Implement full i.MX watchdog support Date: Sat, 14 Mar 2020 10:27:30 -0700 Message-Id: <20200314172736.24528-3-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200314172736.24528-1-linux@roeck-us.net> References: <20200314172736.24528-1-linux@roeck-us.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , qemu-devel@nongnu.org, Jean-Christophe Dubois , qemu-arm@nongnu.org, Peter Chubb , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Implement full support for the watchdog in i.MX systems. Pretimeout support is optional because the watchdog hardware on i.MX31 does not support pretimeouts. Signed-off-by: Guenter Roeck --- hw/watchdog/Makefile.objs | 2 +- hw/watchdog/wdt_imx2.c | 196 +++++++++++++++++++++++++++++++-- include/hw/watchdog/wdt_imx2.h | 49 ++++++++- 3 files changed, 232 insertions(+), 15 deletions(-) diff --git a/hw/watchdog/Makefile.objs b/hw/watchdog/Makefile.objs index dd9b37f642..631b711d86 100644 --- a/hw/watchdog/Makefile.objs +++ b/hw/watchdog/Makefile.objs @@ -4,4 +4,4 @@ common-obj-$(CONFIG_WDT_IB6300ESB) +=3D wdt_i6300esb.o common-obj-$(CONFIG_WDT_IB700) +=3D wdt_ib700.o common-obj-$(CONFIG_WDT_DIAG288) +=3D wdt_diag288.o common-obj-$(CONFIG_ASPEED_SOC) +=3D wdt_aspeed.o -common-obj-$(CONFIG_WDT_IMX) +=3D wdt_imx2.o +common-obj-$(CONFIG_WDT_IMX2) +=3D wdt_imx2.o diff --git a/hw/watchdog/wdt_imx2.c b/hw/watchdog/wdt_imx2.c index ad1ef02e9e..f5339f3590 100644 --- a/hw/watchdog/wdt_imx2.c +++ b/hw/watchdog/wdt_imx2.c @@ -13,24 +13,157 @@ #include "qemu/bitops.h" #include "qemu/module.h" #include "sysemu/watchdog.h" +#include "migration/vmstate.h" +#include "hw/qdev-properties.h" =20 #include "hw/watchdog/wdt_imx2.h" =20 -#define IMX2_WDT_WCR_WDA BIT(5) /* -> External Reset WDOG_B */ -#define IMX2_WDT_WCR_SRS BIT(4) /* -> Software Reset Signal */ +static void imx2_wdt_interrupt(void *opaque) +{ + IMX2WdtState *s =3D IMX2_WDT(opaque); + + s->wicr |=3D IMX2_WDT_WICR_WTIS; + qemu_set_irq(s->irq, 1); +} =20 -static uint64_t imx2_wdt_read(void *opaque, hwaddr addr, - unsigned int size) +static void imx2_wdt_expired(void *opaque) { + IMX2WdtState *s =3D IMX2_WDT(opaque); + + s->wrsr =3D IMX2_WDT_WRSR_TOUT; + + /* Perform watchdog action if watchdog is enabled */ + if (s->wcr & IMX2_WDT_WCR_WDE) { + watchdog_perform_action(); + } +} + +static void imx2_wdt_reset(DeviceState *dev) +{ + IMX2WdtState *s =3D IMX2_WDT(dev); + + s->wcr =3D IMX2_WDT_WCR_WDA | IMX2_WDT_WCR_SRS; + s->wsr =3D 0; + s->wrsr &=3D ~(IMX2_WDT_WRSR_TOUT | IMX2_WDT_WRSR_SFTW); + s->wicr =3D 4; + s->wmcr =3D IMX2_WDT_WMCR_PDE; +} + +static uint64_t imx2_wdt_read(void *opaque, hwaddr addr, unsigned int size) +{ + IMX2WdtState *s =3D IMX2_WDT(opaque); + + switch (addr) { + case IMX2_WDT_WCR: + return s->wcr; + case IMX2_WDT_WSR: + return s->wsr; + case IMX2_WDT_WRSR: + return s->wrsr; + case IMX2_WDT_WICR: + return s->wicr; + case IMX2_WDT_WMCR: + return s->wmcr; + } return 0; } =20 +static void imx_wdt2_update_itimer(IMX2WdtState *s, bool start) +{ + bool running =3D (s->wcr & IMX2_WDT_WCR_WDE) && (s->wcr & IMX2_WDT_WCR= _WT); + bool enabled =3D s->wicr & IMX2_WDT_WICR_WIE; + + ptimer_transaction_begin(s->itimer); + if (start || !enabled) { + ptimer_stop(s->itimer); + } + if (running && enabled) { + int count =3D ptimer_get_count(s->timer); + int pretimeout =3D s->wicr & IMX2_WDT_WICR_WICT; + + /* + * Only (re-)start pretimeout timer if its counter value is larger + * than 0. Otherwise it will fire right away and we'll get an + * interrupt loop. + */ + if (count > pretimeout) { + ptimer_set_count(s->itimer, count - pretimeout); + if (start) { + ptimer_run(s->itimer, 1); + } + } + } + ptimer_transaction_commit(s->itimer); +} + +static void imx_wdt2_update_timer(IMX2WdtState *s, bool start) +{ + ptimer_transaction_begin(s->timer); + if (start) { + ptimer_stop(s->timer); + } + if ((s->wcr & IMX2_WDT_WCR_WDE) && (s->wcr & IMX2_WDT_WCR_WT)) { + int count =3D (s->wcr & IMX2_WDT_WCR_WT) >> 8; + + ptimer_set_count(s->timer, count); + if (start) { + ptimer_run(s->timer, 1); + } + } + ptimer_transaction_commit(s->timer); + if (s->pretimeout_support) { + imx_wdt2_update_itimer(s, start); + } +} + static void imx2_wdt_write(void *opaque, hwaddr addr, uint64_t value, unsigned int size) { - if (addr =3D=3D IMX2_WDT_WCR && - (~value & (IMX2_WDT_WCR_WDA | IMX2_WDT_WCR_SRS))) { - watchdog_perform_action(); + IMX2WdtState *s =3D IMX2_WDT(opaque); + + switch (addr) { + case IMX2_WDT_WCR: + s->wcr =3D value; + if (!(value & IMX2_WDT_WCR_SRS)) { + s->wrsr =3D IMX2_WDT_WRSR_SFTW; + } + if (!(value & (IMX2_WDT_WCR_WDA | IMX2_WDT_WCR_SRS)) || + (!(value & IMX2_WDT_WCR_WT) && (value & IMX2_WDT_WCR_WDE))) { + watchdog_perform_action(); + } + s->wcr |=3D IMX2_WDT_WCR_SRS; + imx_wdt2_update_timer(s, true); + break; + case IMX2_WDT_WSR: + if (s->wsr =3D=3D IMX2_WDT_SEQ1 && value =3D=3D IMX2_WDT_SEQ2) { + imx_wdt2_update_timer(s, false); + } + s->wsr =3D value; + break; + case IMX2_WDT_WRSR: + break; + case IMX2_WDT_WICR: + if (!s->pretimeout_support) { + return; + } + /* The pretimeout value is write-once */ + if (s->pretimeout_locked) { + value &=3D ~IMX2_WDT_WICR_WICT; + s->wicr &=3D (IMX2_WDT_WICR_WTIS | IMX2_WDT_WICR_WICT); + } else { + s->wicr &=3D IMX2_WDT_WICR_WTIS; + } + s->wicr |=3D value & (IMX2_WDT_WICR_WIE | IMX2_WDT_WICR_WICT); + if (value & IMX2_WDT_WICR_WTIS) { + s->wicr &=3D ~IMX2_WDT_WICR_WTIS; + qemu_set_irq(s->irq, 0); + } + imx_wdt2_update_itimer(s, true); + s->pretimeout_locked =3D true; + break; + case IMX2_WDT_WMCR: + s->wmcr =3D value & IMX2_WDT_WMCR_PDE; + break; } } =20 @@ -45,28 +178,67 @@ static const MemoryRegionOps imx2_wdt_ops =3D { * real device but in practice there is no reason for a guest * to access this device unaligned. */ - .min_access_size =3D 4, - .max_access_size =3D 4, + .min_access_size =3D 2, + .max_access_size =3D 2, .unaligned =3D false, }, }; =20 +static const VMStateDescription vmstate_imx2_wdt =3D { + .name =3D "imx2.wdt", + .fields =3D (VMStateField[]) { + VMSTATE_PTIMER(timer, IMX2WdtState), + VMSTATE_PTIMER(itimer, IMX2WdtState), + VMSTATE_BOOL(pretimeout_locked, IMX2WdtState), + VMSTATE_UINT16(wcr, IMX2WdtState), + VMSTATE_UINT16(wsr, IMX2WdtState), + VMSTATE_UINT16(wrsr, IMX2WdtState), + VMSTATE_UINT16(wmcr, IMX2WdtState), + VMSTATE_UINT16(wicr, IMX2WdtState), + VMSTATE_END_OF_LIST() + } +}; + static void imx2_wdt_realize(DeviceState *dev, Error **errp) { IMX2WdtState *s =3D IMX2_WDT(dev); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); =20 memory_region_init_io(&s->mmio, OBJECT(dev), &imx2_wdt_ops, s, - TYPE_IMX2_WDT".mmio", - IMX2_WDT_REG_NUM * sizeof(uint16_t)); - sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio); + TYPE_IMX2_WDT, + IMX2_WDT_MMIO_SIZE); + sysbus_init_mmio(sbd, &s->mmio); + sysbus_init_irq(sbd, &s->irq); + + s->timer =3D ptimer_init(imx2_wdt_expired, s, PTIMER_POLICY_DEFAULT); + ptimer_transaction_begin(s->timer); + ptimer_set_freq(s->timer, 2); + ptimer_set_limit(s->timer, 0xff, 1); + ptimer_transaction_commit(s->timer); + if (s->pretimeout_support) { + s->itimer =3D ptimer_init(imx2_wdt_interrupt, s, PTIMER_POLICY_DEF= AULT); + ptimer_transaction_begin(s->itimer); + ptimer_set_freq(s->itimer, 2); + ptimer_set_limit(s->itimer, 0xff, 1); + ptimer_transaction_commit(s->itimer); + } } =20 +static Property imx2_wdt_properties[] =3D { + DEFINE_PROP_BOOL("pretimeout-support", IMX2WdtState, pretimeout_suppor= t, + false), +}; + static void imx2_wdt_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 + device_class_set_props(dc, imx2_wdt_properties); dc->realize =3D imx2_wdt_realize; + dc->reset =3D imx2_wdt_reset; + dc->vmsd =3D &vmstate_imx2_wdt; + dc->desc =3D "i.MX watchdog timer"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); } =20 diff --git a/include/hw/watchdog/wdt_imx2.h b/include/hw/watchdog/wdt_imx2.h index b91b002528..bed7aa6835 100644 --- a/include/hw/watchdog/wdt_imx2.h +++ b/include/hw/watchdog/wdt_imx2.h @@ -12,22 +12,67 @@ #ifndef IMX2_WDT_H #define IMX2_WDT_H =20 +#include "qemu/bitops.h" #include "hw/sysbus.h" +#include "hw/irq.h" +#include "hw/ptimer.h" =20 #define TYPE_IMX2_WDT "imx2.wdt" #define IMX2_WDT(obj) OBJECT_CHECK(IMX2WdtState, (obj), TYPE_IMX2_WDT) =20 enum IMX2WdtRegisters { - IMX2_WDT_WCR =3D 0x0000, - IMX2_WDT_REG_NUM =3D 0x0008 / sizeof(uint16_t) + 1, + IMX2_WDT_WCR =3D 0x0000, /* Control Register */ + IMX2_WDT_WSR =3D 0x0002, /* Service Register */ + IMX2_WDT_WRSR =3D 0x0004, /* Reset Status Register */ + IMX2_WDT_WICR =3D 0x0006, /* Interrupt Control Register */ + IMX2_WDT_WMCR =3D 0x0008, /* Misc Register */ }; =20 +#define IMX2_WDT_MMIO_SIZE 0x000a + +/* Control Register definitions */ +#define IMX2_WDT_WCR_WT (0xFF << 8) /* Watchdog Timeout Field */ +#define IMX2_WDT_WCR_WDA BIT(5) /* WDOG Assertion */ +#define IMX2_WDT_WCR_SRS BIT(4) /* Software Reset Signal */ +#define IMX2_WDT_WCR_WDT BIT(3) /* WDOG Timeout Assertion */ +#define IMX2_WDT_WCR_WDE BIT(2) /* Watchdog Enable */ +#define IMX2_WDT_WCR_WDZST BIT(0) /* Watchdog Timer Suspend */ + +/* Service Register definitions */ +#define IMX2_WDT_SEQ1 0x5555 /* service sequence 1 */ +#define IMX2_WDT_SEQ2 0xAAAA /* service sequence 2 */ + +/* Reset Status Register definitions */ +#define IMX2_WDT_WRSR_TOUT BIT(1) /* Reset due to Timeout */ +#define IMX2_WDT_WRSR_SFTW BIT(0) /* Reset due to Timeout */ + +/* Interrupt Control Register definitions */ +#define IMX2_WDT_WICR_WIE BIT(15) /* Interrupt Enable */ +#define IMX2_WDT_WICR_WTIS BIT(14) /* Interrupt Status */ +#define IMX2_WDT_WICR_WICT 0xff /* Interrupt Timeout */ + +/* Misc Control Register definitions */ +#define IMX2_WDT_WMCR_PDE BIT(0) /* Power-Down Enable */ =20 typedef struct IMX2WdtState { /* */ SysBusDevice parent_obj; =20 + /*< public >*/ MemoryRegion mmio; + qemu_irq irq; + + struct ptimer_state *timer; + struct ptimer_state *itimer; + + bool pretimeout_support; + bool pretimeout_locked; + + uint16_t wcr; + uint16_t wsr; + uint16_t wrsr; + uint16_t wicr; + uint16_t wmcr; } IMX2WdtState; =20 #endif /* IMX2_WDT_H */ --=20 2.17.1 From nobody Mon Apr 29 21:08:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584206934; cv=none; d=zohomail.com; s=zohoarc; b=VCsSmVfBkSzjP+8S/ltehOncQfeV7YkJddqVHWMkgoMOPtuZbbthbG9JUD0Bh6iRB8jUrnhKv9G7CXuAgw6zT7IRSphrZtCqxqKxXQhu5VAeseiQ7QwHJ3lpALGa1XreNDcPCpPGaTZOaDtGDRpulIWvDcU/QQw2G+qo00Yya3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584206934; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=HN3zdF18nSNliLofSN6voNm+WsQM7L0BuBkedKHtwLw=; b=MkzbMumWAkyO6a7kp2+lLopF9VgAw6kVHHMJEgaEqZAYOH+1oKyZmmsGss1iVrTTjzMcMLOerEuUblX9WtV+rI4d/TxGeXyvjDL44jspsmnu2me0Zr4/3jLvaJ+v7frpp93ZQI5qjbdNyiLuVQHwm1qyExSn7cMCh6kIdWNobeM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584206934007187.37544632900335; Sat, 14 Mar 2020 10:28:54 -0700 (PDT) Received: from localhost ([::1]:46740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAai-0001So-Qe for importer@patchew.org; Sat, 14 Mar 2020 13:28:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42978) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAZd-0007qu-Hc for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDAZc-0005WS-GX for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:45 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:54683) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDAZc-0005UR-B4; Sat, 14 Mar 2020 13:27:44 -0400 Received: by mail-pj1-x1041.google.com with SMTP id np16so5743931pjb.4; Sat, 14 Mar 2020 10:27:44 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id z15sm27100787pfg.152.2020.03.14.10.27.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Mar 2020 10:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=HN3zdF18nSNliLofSN6voNm+WsQM7L0BuBkedKHtwLw=; b=IG6rV90oUXWJdqJ0XEbdo7jHS9d6bVQL1fzUYLrebniIy0GJzLjoC70OJnXJxDxd6n rqtfWD39u2Fa8Vk97Wri4iv8kOZJtmRefzsyDr8Ga6zvh7z/1DnZSkkuJLC67IE/afOe agR/N0AT8TN5wUl6/wvdDX524zK4uxJ5oh4gHByOw5msFFQB/GFELg0uxBC9XRkvNGpK uCGlodNBGK1gGqEd38R/nS1OKdWeJIbQl3kFTge3EonSzbn3uMzESwtKqTE7YQBHobYE aqOv9rUt7Szhr6av3PRS76aAVhktUOgLayDxdaLVEtxtSTFq8+p1x0+pYWsoz2yHMp2Z p2Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=HN3zdF18nSNliLofSN6voNm+WsQM7L0BuBkedKHtwLw=; b=GjUWnLj397ouS21JwOUCi8gOpycHPnzpU4MrQ8deOeoTLCPQYf8i3E9rgW2G9mSSGQ dWNFZ0czKR7nEAkIedgzGgxFbmrw0Q55osjmTU1hvcGUy6jZLXjnKcpFhViAiV5Udnc0 yGgoZcaAbiKbw+DwfvHfd0DSBpRjdlHZKcDVcL8XcHNQ6GpPNN39/ON+bl9lGD771kVR /DqAL9K9S8//QssD5vgrvQmExYTTKXlol2ltfU4MefhlsdB7h7K+ilMxzYxm0ZtZy++x bGoPQmXB+drrl2YLisDg3EIftQQ4ZzNhPyZ33AZFpxMkt2CFzDSU4YDpb3L77Kb3E0a/ k6iw== X-Gm-Message-State: ANhLgQ0xo5OyluMw6qIkXM3crkPxqUlNY800TcceucBiaPkoB82SEPUr iaRdSd8yjYHlOu+w08ogQLE= X-Google-Smtp-Source: ADFU+vsu+av9RdSYDBFXK+8UyOQNdUZNH7x1AIOvTTP1sdiqC26U4SNpkLWBUZNYJ6/vqBCakuIoOw== X-Received: by 2002:a17:902:864c:: with SMTP id y12mr18700120plt.8.1584206863308; Sat, 14 Mar 2020 10:27:43 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH 3/8] hw/arm/fsl-imx25: Wire up watchdog Date: Sat, 14 Mar 2020 10:27:31 -0700 Message-Id: <20200314172736.24528-4-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200314172736.24528-1-linux@roeck-us.net> References: <20200314172736.24528-1-linux@roeck-us.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1041 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , qemu-devel@nongnu.org, Jean-Christophe Dubois , qemu-arm@nongnu.org, Peter Chubb , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With this commit, the watchdog on imx25-pdk is fully operational, including pretimeout support. Signed-off-by: Guenter Roeck Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/fsl-imx25.c | 10 ++++++++++ include/hw/arm/fsl-imx25.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index a3f829f436..7d5aab562d 100644 --- a/hw/arm/fsl-imx25.c +++ b/hw/arm/fsl-imx25.c @@ -87,6 +87,7 @@ static void fsl_imx25_init(Object *obj) TYPE_CHIPIDEA); } =20 + sysbus_init_child_obj(obj, "wdt", &s->wdt, sizeof(s->wdt), TYPE_IMX2_W= DT); } =20 static void fsl_imx25_realize(DeviceState *dev, Error **errp) @@ -302,6 +303,15 @@ static void fsl_imx25_realize(DeviceState *dev, Error = **errp) usb_table[i].irq)); } =20 + /* Watchdog */ + object_property_set_bool(OBJECT(&s->wdt), true, "pretimeout-support", + &error_abort); + object_property_set_bool(OBJECT(&s->wdt), true, "realized", &error_abo= rt); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt), 0, FSL_IMX25_WDT_ADDR); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt), 0, + qdev_get_gpio_in(DEVICE(&s->avic), + FSL_IMX25_WDT_IRQ)); + /* initialize 2 x 16 KB ROM */ memory_region_init_rom(&s->rom[0], NULL, "imx25.rom0", FSL_IMX25_ROM0_SIZE, &err); diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h index 5e196bbf05..9e228dacea 100644 --- a/include/hw/arm/fsl-imx25.h +++ b/include/hw/arm/fsl-imx25.h @@ -29,6 +29,7 @@ #include "hw/gpio/imx_gpio.h" #include "hw/sd/sdhci.h" #include "hw/usb/chipidea.h" +#include "hw/watchdog/wdt_imx2.h" #include "exec/memory.h" #include "target/arm/cpu.h" =20 @@ -60,6 +61,7 @@ typedef struct FslIMX25State { IMXGPIOState gpio[FSL_IMX25_NUM_GPIOS]; SDHCIState esdhc[FSL_IMX25_NUM_ESDHCS]; ChipideaState usb[FSL_IMX25_NUM_USBS]; + IMX2WdtState wdt; MemoryRegion rom[2]; MemoryRegion iram; MemoryRegion iram_alias; @@ -229,6 +231,8 @@ typedef struct FslIMX25State { #define FSL_IMX25_GPIO1_SIZE 0x4000 #define FSL_IMX25_GPIO2_ADDR 0x53FD0000 #define FSL_IMX25_GPIO2_SIZE 0x4000 +#define FSL_IMX25_WDT_ADDR 0x53FDC000 +#define FSL_IMX25_WDT_SIZE 0x4000 #define FSL_IMX25_USB1_ADDR 0x53FF4000 #define FSL_IMX25_USB1_SIZE 0x0200 #define FSL_IMX25_USB2_ADDR 0x53FF4400 @@ -268,5 +272,6 @@ typedef struct FslIMX25State { #define FSL_IMX25_ESDHC2_IRQ 8 #define FSL_IMX25_USB1_IRQ 37 #define FSL_IMX25_USB2_IRQ 35 +#define FSL_IMX25_WDT_IRQ 55 =20 #endif /* FSL_IMX25_H */ --=20 2.17.1 From nobody Mon Apr 29 21:08:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584207021; cv=none; d=zohomail.com; s=zohoarc; b=Sggp4bO3aE0he8Xf9PncGZSLIsvG5wwjoiCcShR04nsVQjwb8OS3T5KkavdYUZSql7qlc7JyLYM15ZGT8pw6K4nGdnkaH1eqdAyXUywPkUD0fDnYb9a3oeOCvD22CNvVhme67OkN3DnM/CH6dxvp3qE2V6kibyEHtb6cgBh6dpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584207021; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=subG/z3bNILDIEvYewk5eSNFesd3qE7G7IFPvac0eEI=; b=ewJ9G2oRAgvWuMG6K1AsuPUaCylo5bycYPxkDhpwx0yUhIKBHTzn08vXmfX3XglRNQmdoZ5UiQeqiwmA89+Xw9pxyQsQPGzmLhCktxs8tjFKzBQWeRU8oe2trIK5ciR6bD9dXGHYHpm1mvdK/dALjFFY0TDMDtKtXFkyphG3Dog= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584207021257641.9052265282576; Sat, 14 Mar 2020 10:30:21 -0700 (PDT) Received: from localhost ([::1]:46772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAc8-0004eS-7v for importer@patchew.org; Sat, 14 Mar 2020 13:30:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43013) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAZf-0007uK-8R for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDAZe-0005fe-0r for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:47 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:35297) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDAZd-0005bN-RT; Sat, 14 Mar 2020 13:27:45 -0400 Received: by mail-pl1-x644.google.com with SMTP id g6so5823204plt.2; Sat, 14 Mar 2020 10:27:45 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id f3sm52268026pgg.46.2020.03.14.10.27.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Mar 2020 10:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=subG/z3bNILDIEvYewk5eSNFesd3qE7G7IFPvac0eEI=; b=NI3wVZCblmZ2Xq7P/3SbzDIFFrpFEZPoLDLihtIsO8fF9+E5br8dg+2PSuNlN4hdxM cPmD6Tp43fwsFayfn87VB0Vr3VuWfKNDUbIymOCzueuv5CXu72AA59SxLIr6VqMJu3Th vVQX2ko4QE5Ye+8nimEnswtoGoRcdi5/+B24DRRtgb4KCziVI+Hh+RGbZTLNL0mdERII JHkHlmC3mLWRINdSft8y+pBu+xmkKi8ZOKNk3w926ZLXZ4GdfIM3obTxU4wDYCmql1Yo SbIvbXZyOCE3dQy+tUGh869Df5Np/7WIp1y2IWUIocwxWkUFut4qyrt5cc62dRQYLBPd RH7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=subG/z3bNILDIEvYewk5eSNFesd3qE7G7IFPvac0eEI=; b=dYb8EB97V2fTT+2MU63B8X6JdqszHS6ZuVp+mVoA1DK5SkzYVSp2F9r9YFiCNKhAIu plQYL3xsoAKAJzSWnFcRYi8dXR79KK8xt6y92JB8diiLaxJCed7gIVf+LJYHEKMLGCSw vxIp16DH+lz8CZVM6VbRdaoUt+T5lIAaOw3emKLwVCr6VoTshk4DkSJZDV7qqcwfrwri MpFQvuNfEEBjAaoGVxXvjv43OhcKqmP45DyarSSDB61vZ0EZc+ekwBDDf/DKSFHXFAs3 Qg63+eV/18x//QP53DRTDlFP8eI2fCJ4ZuHl8Cvg1E6YOnG2Me1X+nMnUF2wcaxv6X7w PPmA== X-Gm-Message-State: ANhLgQ0pr9X1EWNN0YECyO4eSZG02IfO+/PRKfHRf377rf79W6WmPDVd TOJ3Ei0EAQelxzhytro+z8A= X-Google-Smtp-Source: ADFU+vu5kx8vBZXKOpz4inqal6ve8z3KD7WNh3fFc8ZdROVKASHMa5g7lTzl5dgJ0W2YpkYlGl7L7g== X-Received: by 2002:a17:90a:1f0b:: with SMTP id u11mr2578087pja.18.1584206864938; Sat, 14 Mar 2020 10:27:44 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH 4/8] hw/arm/fsl-imx31: Wire up watchdog Date: Sat, 14 Mar 2020 10:27:32 -0700 Message-Id: <20200314172736.24528-5-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200314172736.24528-1-linux@roeck-us.net> References: <20200314172736.24528-1-linux@roeck-us.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , qemu-devel@nongnu.org, Jean-Christophe Dubois , qemu-arm@nongnu.org, Peter Chubb , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With this patch, the watchdog on i.MX31 emulations is fully operational. Signed-off-by: Guenter Roeck Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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_W= DT); } =20 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)); } =20 + /* Watchdog */ + object_property_set_bool(OBJECT(&s->wdt), true, "realized", &error_abo= rt); + 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" =20 @@ -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 --=20 2.17.1 From nobody Mon Apr 29 21:08:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584207012; cv=none; d=zohomail.com; s=zohoarc; b=ZLjb3uNWb22VlhLgYYJQiwMWhLyYuNjMVs4uAFzfK5c6Zbh4Ca3+IIflRGHKebM8MFil6vKKRxA1PKAAvXButcG4J/20QXKFx9ByL98HaYCK9OsDS8czzX2c6pOnFCdj4Edw6csPqN8wVMt1Py0Ut0kX9ZaDPLx/RVvQ0Sfc0Xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584207012; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=7TmW4s4JB9EMXPFhnrWNp7SZXHVbJpUn5YaMe/I2UDc=; b=e9VlNZvOhLYR8dyL8xh74milk+FHnDxvYg9u8oCpdDqE0lLwmtLq6WdzTuJ3KGp2kxjoQNryIjDpnUbg2UFZwrXXHBmApQMtmUeh97zWv/0OmrAzjox6Kri/9Iw221+Htj88Q7eGUp+JjQp0Sf8vNRJrM4x9gATD7o4q1vTjyEQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584207012336218.83916762323474; Sat, 14 Mar 2020 10:30:12 -0700 (PDT) Received: from localhost ([::1]:46770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAbz-0004U1-A2 for importer@patchew.org; Sat, 14 Mar 2020 13:30:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43036) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAZg-0007xL-DP for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDAZf-0005pH-Am for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:48 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:39258) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDAZf-0005kg-4m; Sat, 14 Mar 2020 13:27:47 -0400 Received: by mail-pg1-x544.google.com with SMTP id b22so930154pgb.6; Sat, 14 Mar 2020 10:27:47 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c201sm16745005pfc.73.2020.03.14.10.27.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Mar 2020 10:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7TmW4s4JB9EMXPFhnrWNp7SZXHVbJpUn5YaMe/I2UDc=; b=MbaBZBD0xxWU9k7ksA4PNKnBsSjdpcq/sqrQETnHUk/0UUCI6B3bXM6GqhZTBFRsDA hWJdiJMoDNkOjZrZs4YDkScSj1YRGA+L+aamRCpBYNjkBwO9rv/qYmPZobdRx31z485O yKrOAAoW3T6k7eDvMH7c0eW6d7uW/9C58qXxhVAW4EmZYGNhjQK3REs257kC3JndWMVm TcFThPqmUfqamcvQo+1OsgPKYL0Oazn/lcyC91FJpfZUhFsvSeSVTGaGiqHP17uPNxFJ 1m+D4IxGx1CK65Fn7+rUxQZ0ggrRdcGDjGdFWUFSMIqTaQjG2EsUzPt1U9zd8jK5pOIP xEeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7TmW4s4JB9EMXPFhnrWNp7SZXHVbJpUn5YaMe/I2UDc=; b=kh2QcDaRSAcPGH1nBYLjkFcrTErTY/lpFFy6p3ejvs/15Vb2NkxQb9RdrdAm6AHd+l euFM+Wr/2vE5cFTqVlXQWV2jHIXvLQbCC6ZpG4Vllhf0goFa+6DhnD4/8/58n/LJI+Ib XehugNtijTGt4whjpElh771AmHSyrww0yv3IrCFR3nLxn9d6g4lkX9iGvgFVSvD3Zdys wfCFqSFfvc5ahGC49na+vCka5LC7T21edGmniqugxHn/FDy8RyL4trphlJQWvjHcdoW3 QqrcsZ7cisqoBgCBtzivjMVIXdT2F4UrJAop9/hOZ5dvzeO8EQGNVimCpcL1xoQNUytm Ehzw== X-Gm-Message-State: ANhLgQ2f7gvTLJoUYxBX9jkVk6Rv48ANbUcdB8cbF2LqKDLaXlaXxxqR NoS0K/rhI9/p6ac5p0SEMrs= X-Google-Smtp-Source: ADFU+vuN3goJ+jg/kFW2zbYRzMRrN51X8xt6DI4WHN9mbRBmaYKKB3ogK5tJ7L1W+B814BXcWf3nMw== X-Received: by 2002:a63:309:: with SMTP id 9mr18829326pgd.193.1584206866335; Sat, 14 Mar 2020 10:27:46 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH 5/8] hw/arm/fsl-imx6: Connect watchdog interrupts Date: Sat, 14 Mar 2020 10:27:33 -0700 Message-Id: <20200314172736.24528-6-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200314172736.24528-1-linux@roeck-us.net> References: <20200314172736.24528-1-linux@roeck-us.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , qemu-devel@nongnu.org, Jean-Christophe Dubois , qemu-arm@nongnu.org, Peter Chubb , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With this patch applied, the watchdog in the sabrelite emulation is fully operational, including pretimeout support. Signed-off-by: Guenter Roeck --- hw/arm/fsl-imx6.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index ecc62855f2..b266d40881 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -397,11 +397,20 @@ static void fsl_imx6_realize(DeviceState *dev, Error = **errp) FSL_IMX6_WDOG1_ADDR, FSL_IMX6_WDOG2_ADDR, }; + static const int FSL_IMX6_WDOGn_IRQ[FSL_IMX6_NUM_WDTS] =3D { + FSL_IMX6_WDOG1_IRQ, + FSL_IMX6_WDOG2_IRQ, + }; =20 + object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-sup= port", + &error_abort); object_property_set_bool(OBJECT(&s->wdt[i]), true, "realized", &error_abort); =20 sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX6_WDOGn_ADDR= [i]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0, + qdev_get_gpio_in(DEVICE(&s->a9mpcore), + FSL_IMX6_WDOGn_IRQ[i])); } =20 /* ROM memory */ --=20 2.17.1 From nobody Mon Apr 29 21:08:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584207131; cv=none; d=zohomail.com; s=zohoarc; b=DG1IgEnHeWosKdgMBmA7r9FKXAMUsNQjgu3pX35pNmaSUKyDu1cwHMbzua8vLCQXrUnH+/6ThpJg+swpwSV94+KlV93clGEkO432C9+YsvyJfuHRke4eSZoO1YF6X+sZmwFQ4mfXSifiU+ofJikQCGothHyp2ds3+TKRKaO+tlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584207131; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=uMwnmEuF5Y8jPd9tVsNDLLbIXVTOBvYkJ9PsjsTPLY4=; b=Q2CjVjSMp/pWaza9xUheBCvfF5Kwv7ZJSzqjPaCNeMb2KPlpPPO4vrcNQYoxnTPpCjSRF8OoUlP97s2yRa1aAUpwpA2NDLIVPVD8s/kjPj1XPE7cKq4U8IZ0UYuZnWp6RIZheiGZsesJXjg2llS3un6DVrKtp8TPW/0woMpNjuw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584207131009548.7621206056001; Sat, 14 Mar 2020 10:32:11 -0700 (PDT) Received: from localhost ([::1]:46816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAdu-0006wB-00 for importer@patchew.org; Sat, 14 Mar 2020 13:32:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43067) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAZh-0007yw-SE for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDAZg-00060x-VY for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:49 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:38850) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDAZg-0005xe-Q2; Sat, 14 Mar 2020 13:27:48 -0400 Received: by mail-pf1-x444.google.com with SMTP id z5so7234199pfn.5; Sat, 14 Mar 2020 10:27:48 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id p14sm57780824pgm.49.2020.03.14.10.27.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Mar 2020 10:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=uMwnmEuF5Y8jPd9tVsNDLLbIXVTOBvYkJ9PsjsTPLY4=; b=ZHL1LiwTHs6mJZrtUcuXit7WZZkpwd2l3Yg0GvM22XqDdFmELwaMh1Pk2Nr+lCqzSZ DinyRKKOL3AFqIQJyr8wovp8LqsBqIoHtz/D2ER8zoDkWNcDTjR92WAmvOMZtgriRni/ Zd9na3E8Emu0Ebj+FAhTnnmDiYKYlqkVsEcyiYK6B/0zTBhc/Q/WPugeuARRrTmPtHlL LJcP8qZOOSJ/H2ujf1fi5TM/bxbUmKP33Fc3/fyhR4OuPusq5Z+UDc5QeRRRnR05IwU9 VAQ7audGgdd+d/xVanun6FlG3GdG4DtNHgBnSljVxgTjL+TZRb+/IaXbm1dEip33a3N7 79/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=uMwnmEuF5Y8jPd9tVsNDLLbIXVTOBvYkJ9PsjsTPLY4=; b=iYFc9xUN8XAXiH2NCo8CFaMxh25Ubs7165bossG1AtrQbyID96hT7r7lNysC1gWx7V cORpBuxZxOl4xuXLJBlDV570pHAWuabkmH4YgFwZC58A8M7S3wt9kKnvkuDIpYs+ue7+ 1fbTlchXnmze4EnLTqCT/mEtTpmZYFWmScf18XGFsAGswrShntVCO7QQdTyJwfP1WyFA C32Iz2pcirmFRogX82X16vAR3EfOiGngNC7dJjhXfQsAJ36I0U8oVt/bkgVY7GgkWacY YPP+CG3BhG3ieXrCmZwpWirw38Pio7Vfr1RjkMAh7al9qMj4jV0w7XD2/yeYIbohkXAA lB6w== X-Gm-Message-State: ANhLgQ2nWe7Ks/Rn1EBDU+F5iDg05R04mlgVqoB+r0v+X0YzH/3VCbQF LBsUroqrs8obiGjAxjtf7y4= X-Google-Smtp-Source: ADFU+vsneYpS+YnmNqsU6ljnbrjTAEoPywgsK56hwOBBeNT0l7PpY+NE+fJJNasG0GryvwnrZgEc4Q== X-Received: by 2002:a63:770d:: with SMTP id s13mr18575417pgc.7.1584206867782; Sat, 14 Mar 2020 10:27:47 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH 6/8] hw/arm/fsl-imx6ul: Connect watchdog interrupts Date: Sat, 14 Mar 2020 10:27:34 -0700 Message-Id: <20200314172736.24528-7-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200314172736.24528-1-linux@roeck-us.net> References: <20200314172736.24528-1-linux@roeck-us.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , qemu-devel@nongnu.org, Jean-Christophe Dubois , qemu-arm@nongnu.org, Peter Chubb , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With this commit, the watchdog on mcimx6ul-evk is fully operational, including pretimeout support. Signed-off-by: Guenter Roeck --- hw/arm/fsl-imx6ul.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c index c405b68d1d..8d3b91dd85 100644 --- a/hw/arm/fsl-imx6ul.c +++ b/hw/arm/fsl-imx6ul.c @@ -496,12 +496,22 @@ static void fsl_imx6ul_realize(DeviceState *dev, Erro= r **errp) FSL_IMX6UL_WDOG2_ADDR, FSL_IMX6UL_WDOG3_ADDR, }; + static const int FSL_IMX6UL_WDOGn_IRQ[FSL_IMX6UL_NUM_WDTS] =3D { + FSL_IMX6UL_WDOG1_IRQ, + FSL_IMX6UL_WDOG2_IRQ, + FSL_IMX6UL_WDOG3_IRQ, + }; =20 + object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-sup= port", + &error_abort); object_property_set_bool(OBJECT(&s->wdt[i]), true, "realized", &error_abort); =20 sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX6UL_WDOGn_ADDR[i]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0, + qdev_get_gpio_in(DEVICE(&s->a7mpcore), + FSL_IMX6UL_WDOGn_IRQ[i])); } =20 /* --=20 2.17.1 From nobody Mon Apr 29 21:08:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584207200; cv=none; d=zohomail.com; s=zohoarc; b=ZHnJF/1mmsuYU1RAAIvcf2XGH+24JqWwyzNHPOGNHkAvEQbjazDIHJTj4timTp3yppnm0dsEU2N8pDo7ht4SNMl/T9hpNcuO60j1tM7yBaXnEidMbTIkdS3N5duAnnr0UOC+HlHfX1Kb9OjhiCtobz22oAQCUwdtrT0FhrYCFDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584207200; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=2n/COS3qYgLsHbDGJU6WOfdiW+A/GtOTi3uv6vUIC3g=; b=BLSpG8TsTkEKW8oxfRFma7acnBWJUecZECweMSsVi+Lc304so4BJV3niUiLO5gsDVnK2bCS3nVQKqVkmJZC+JEPS/+xhhOAkQgdNDljS22MlIf9Mw4SwYlTVGo+kZLyUxFR2hetCd/Ngv5tp0nNGChpduv2M8fPJ2btYMlHZwFU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584207200160597.835436716391; Sat, 14 Mar 2020 10:33:20 -0700 (PDT) Received: from localhost ([::1]:46830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAf1-00083w-6i for importer@patchew.org; Sat, 14 Mar 2020 13:33:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43102) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAZj-00082t-84 for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDAZi-00065i-5T for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:51 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:46700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDAZh-00061R-VS; Sat, 14 Mar 2020 13:27:50 -0400 Received: by mail-pf1-x444.google.com with SMTP id c19so7217362pfo.13; Sat, 14 Mar 2020 10:27:49 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id k8sm25559727pfk.1.2020.03.14.10.27.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Mar 2020 10:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=2n/COS3qYgLsHbDGJU6WOfdiW+A/GtOTi3uv6vUIC3g=; b=AoySPURPuyVp2LwWXvkOn2cxOBeeTh6zfa6lXZOsVNCagJDUg7XRbSGlxYfPNr28Fj edKcVq40zFd1SRhRy5J5/X67SEPROC9LWyPKmQd5a352cILk31JgAyTOwKZzPIic9/WA v3GB+ScypneSOBGBdwI0ZxarqsjOZoIu4AMc0fT3JGV0KYkcdjbtMh4TrzAjzIAqCTsp GMtgZ6WoELZap5xp/saBu89aA0PfMkL5EhkZ9wWgtztiVWEu1+MoZgfka/ATHQDUlQ8y XJcN9Pk/ICFwnwSvk4/FTsRzHac+eKVeXMK49fma7viqguBORKjJrorfu+5dHc0WKdZ2 0e1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=2n/COS3qYgLsHbDGJU6WOfdiW+A/GtOTi3uv6vUIC3g=; b=U48AjTZSCRvuYAUeG861bbeb6UTuyVBcOe7mtd2GloZd5gD7NdWQZ4MAPEzbE0QTry vm3+MbEa01qLIBIzsXhFqiDn6jXLhspcn1ChQzMIhM02BUyJwR2vYCwHXGHc42qER++r Rdf8hF7sa2XhZu5yrARsjPH/U1CQERqKLi/xFh0l3/F6SFZ0Ux8lUnFRrqV4+BMl0GxJ hORnP3+U40mjPzwRue56pCNPjpsTEqEGcLpzq2Nva3SA/FtcN2O/WQ1Ozgxxbv/Qdson d2ic1g18UQzx6R+EOCtXLSPvfnti4612UdXHl/VJqgqMoXKb9Bk8b13uYAC0iyx/b3Kx cw6Q== X-Gm-Message-State: ANhLgQ09MYwUjeMtpnERlgQ/BoWw69MbeTyuEd4agXIuqkCCkDYNCDSf BBnHS1fd7GEOu7/rmzmiidI= X-Google-Smtp-Source: ADFU+vsyrtRKvB7VzSW3PqpUQXMEXMCTxtz7wWpN5HWmYnmtcIWYwm/b9Jitx3ey8yeBbP1kTL+XGQ== X-Received: by 2002:a62:447:: with SMTP id 68mr19788701pfe.174.1584206869187; Sat, 14 Mar 2020 10:27:49 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH 7/8] hw/arm/fsl-imx7: Instantiate various unimplemented devices Date: Sat, 14 Mar 2020 10:27:35 -0700 Message-Id: <20200314172736.24528-8-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200314172736.24528-1-linux@roeck-us.net> References: <20200314172736.24528-1-linux@roeck-us.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , qemu-devel@nongnu.org, Jean-Christophe Dubois , qemu-arm@nongnu.org, Peter Chubb , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Instantiating PWM, CAN, CAAM, and OCOTP devices is necessary to avoid crashes when booting mainline Linux. Signed-off-by: Guenter Roeck --- hw/arm/fsl-imx7.c | 24 ++++++++++++++++++++++++ include/hw/arm/fsl-imx7.h | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c index 119b281a50..29382776b2 100644 --- a/hw/arm/fsl-imx7.c +++ b/hw/arm/fsl-imx7.c @@ -459,6 +459,30 @@ static void fsl_imx7_realize(DeviceState *dev, Error *= *errp) */ create_unimplemented_device("sdma", FSL_IMX7_SDMA_ADDR, FSL_IMX7_SDMA_= SIZE); =20 + /* + * CAAM + */ + create_unimplemented_device("caam", FSL_IMX7_CAAM_ADDR, FSL_IMX7_CAAM_= SIZE); + + /* + * PWM + */ + create_unimplemented_device("pwm1", FSL_IMX7_PWM1_ADDR, FSL_IMX7_PWMn_= SIZE); + create_unimplemented_device("pwm2", FSL_IMX7_PWM2_ADDR, FSL_IMX7_PWMn_= SIZE); + create_unimplemented_device("pwm3", FSL_IMX7_PWM3_ADDR, FSL_IMX7_PWMn_= SIZE); + create_unimplemented_device("pwm4", FSL_IMX7_PWM4_ADDR, FSL_IMX7_PWMn_= SIZE); + + /* + * CAN + */ + create_unimplemented_device("can1", FSL_IMX7_CAN1_ADDR, FSL_IMX7_CANn_= SIZE); + create_unimplemented_device("can2", FSL_IMX7_CAN2_ADDR, FSL_IMX7_CANn_= SIZE); + + /* + * OCOTP + */ + create_unimplemented_device("octop", FSL_IMX7_OCOTP_ADDR, + FSL_IMX7_OCOTP_SIZE); =20 object_property_set_bool(OBJECT(&s->gpr), true, "realized", &error_abort); diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index 3a0041c4c2..47826da2b7 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -113,6 +113,9 @@ enum FslIMX7MemoryMap { FSL_IMX7_IOMUXC_GPR_ADDR =3D 0x30340000, FSL_IMX7_IOMUXCn_SIZE =3D 0x1000, =20 + FSL_IMX7_OCOTP_ADDR =3D 0x30350000, + FSL_IMX7_OCOTP_SIZE =3D 0x10000, + FSL_IMX7_ANALOG_ADDR =3D 0x30360000, FSL_IMX7_SNVS_ADDR =3D 0x30370000, FSL_IMX7_CCM_ADDR =3D 0x30380000, @@ -124,11 +127,24 @@ enum FslIMX7MemoryMap { FSL_IMX7_ADC2_ADDR =3D 0x30620000, FSL_IMX7_ADCn_SIZE =3D 0x1000, =20 + FSL_IMX7_PWM1_ADDR =3D 0x30660000, + FSL_IMX7_PWM2_ADDR =3D 0x30670000, + FSL_IMX7_PWM3_ADDR =3D 0x30680000, + FSL_IMX7_PWM4_ADDR =3D 0x30690000, + FSL_IMX7_PWMn_SIZE =3D 0x10000, + FSL_IMX7_PCIE_PHY_ADDR =3D 0x306D0000, FSL_IMX7_PCIE_PHY_SIZE =3D 0x10000, =20 FSL_IMX7_GPC_ADDR =3D 0x303A0000, =20 + FSL_IMX7_CAAM_ADDR =3D 0x30900000, + FSL_IMX7_CAAM_SIZE =3D 0x40000, + + FSL_IMX7_CAN1_ADDR =3D 0x30A00000, + FSL_IMX7_CAN2_ADDR =3D 0x30A10000, + FSL_IMX7_CANn_SIZE =3D 0x10000, + FSL_IMX7_I2C1_ADDR =3D 0x30A20000, FSL_IMX7_I2C2_ADDR =3D 0x30A30000, FSL_IMX7_I2C3_ADDR =3D 0x30A40000, --=20 2.17.1 From nobody Mon Apr 29 21:08:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584207027; cv=none; d=zohomail.com; s=zohoarc; b=O/kDJ4aCznOatRUQojjRQkmqSOKOgqhSxJ10w+MtkqXIBKzO1zJgKMlgOQbwP3NLkuBa3qkNk3Hb4i/995wlSFO6m4p2P46ZxtmWmFOBgyiR6NYByoBXm7u7MbXTlbbI3eNfYH9LwATI8/4MbJq84LPjrLqA2/Klizf5qR4+d7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584207027; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=2yvrzU4TfZKPLfKcAijb7xS2WSEBvTCKiwAF8gWuxus=; b=OsofBNF+4PiZScnxWAbay8Kw8MRSImRAwJITx+NU3pPCxw+lX2sDHmhQ8ouZkYR/raEAJ3GGr5Bt9WxOFwHrh2HUbfKTTfoxVBvfaOxReamgC45ihJbBtb70Q2ZsihpAaEYHVD6myNRePqNyXb0Wl4QbXVrBks7K9d08pFTe0nQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584207027878697.7285616336138; Sat, 14 Mar 2020 10:30:27 -0700 (PDT) Received: from localhost ([::1]:46780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAcD-0004pe-Rp for importer@patchew.org; Sat, 14 Mar 2020 13:30:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43128) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDAZk-00086s-Jo for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDAZj-0006At-HE for qemu-devel@nongnu.org; Sat, 14 Mar 2020 13:27:52 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:33785) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDAZj-00068E-B9; Sat, 14 Mar 2020 13:27:51 -0400 Received: by mail-pf1-x444.google.com with SMTP id n7so7243349pfn.0; Sat, 14 Mar 2020 10:27:51 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id g19sm61543370pfh.134.2020.03.14.10.27.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Mar 2020 10:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=2yvrzU4TfZKPLfKcAijb7xS2WSEBvTCKiwAF8gWuxus=; b=iBdvXm6Kp49rDZXAqy0db/ArZEH7T9otnlsN3BUzh5zl7wbHdta3ie5yDW1fE/qjA8 mDxlEkSYSn78d5Ec1gUJsPbQBH0Y9TkvSV0kwfnYdaVe5tS9O1Yy9e5XAxIe77BAVGk+ WDuNpF2RNX+JHQinZPuKzf4Et4nPb/nuZfRFtsRJjP6yjnqq2b6Budlsjzcm+VrQ5FIX nvSsnlpoviPc5trI+ZVzWNo20beIebaf/Bf7g0w/HJu8pZnCP9njKhcXLIJy1Ft59mn0 hi/hZtZMejzkeqN1Cp8DQFT+DrELqdPXXthibuBAcL+d9nYBpXSyxWuolIUOiSP66xKe Cgqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=2yvrzU4TfZKPLfKcAijb7xS2WSEBvTCKiwAF8gWuxus=; b=LGGtFJGWTNeIPTpNTJNN9ZZZH5P/bib8ojt0HV7yOlAmE2Jm7OIho+s7WGp2OTVlZM CkUHLt9OwVs13BJQpa1YTjRy2ObXOrV+9jaltsp1YdqdZIX7hExwUvcFjK4Ox08uF5JX lHEwBDoYFYTzRS8kT9gaip70K0dGY9r1rwaUwcaL6MEHJANjOUa5mA/NJ83KbmAcRFSf kfL8A9Z78EtytHVKzb9C6aiERAj7/nvJngeOX3OibJgLKHP+Mu5++MKxFt23ptWevAVL QAhMqpRpTVdLBAQyV/FBKsPyPfpjuoVEISsJZONzou5QfXWJbOO2vMWI7MCVyNXuPeOv PlRQ== X-Gm-Message-State: ANhLgQ3lwnK8cMi3fLnjZ/WJM7px5NiEbHTVzuVyI6d2hNz090/QXa0E Q3DkwOnZsqdR5KhmlJxce7A= X-Google-Smtp-Source: ADFU+vtLewS5G4NuIpA3nj3oljUuFDksk8gmeHvKa5p843ExmPZkvwVhNENjanfcbUYsy6gUJZtOpQ== X-Received: by 2002:a62:1417:: with SMTP id 23mr18441250pfu.55.1584206870508; Sat, 14 Mar 2020 10:27:50 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH 8/8] hw/arm/fsl-imx7: Connect watchdog interrupts Date: Sat, 14 Mar 2020 10:27:36 -0700 Message-Id: <20200314172736.24528-9-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200314172736.24528-1-linux@roeck-us.net> References: <20200314172736.24528-1-linux@roeck-us.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , qemu-devel@nongnu.org, Jean-Christophe Dubois , qemu-arm@nongnu.org, Peter Chubb , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" i.MX7 supports watchdog pretimeout interupts. With this commit, the watchdog in mcimx7d-sabre is fully operational, including pretimeout support. Signed-off-by: Guenter Roeck --- hw/arm/fsl-imx7.c | 11 +++++++++++ include/hw/arm/fsl-imx7.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c index 29382776b2..6c539c8b23 100644 --- a/hw/arm/fsl-imx7.c +++ b/hw/arm/fsl-imx7.c @@ -447,11 +447,22 @@ static void fsl_imx7_realize(DeviceState *dev, Error = **errp) FSL_IMX7_WDOG3_ADDR, FSL_IMX7_WDOG4_ADDR, }; + static const int FSL_IMX7_WDOGn_IRQ[FSL_IMX7_NUM_WDTS] =3D { + FSL_IMX7_WDOG1_IRQ, + FSL_IMX7_WDOG2_IRQ, + FSL_IMX7_WDOG3_IRQ, + FSL_IMX7_WDOG4_IRQ, + }; =20 + object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-sup= port", + &error_abort); object_property_set_bool(OBJECT(&s->wdt[i]), true, "realized", &error_abort); =20 sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX7_WDOGn_ADDR= [i]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0, + qdev_get_gpio_in(DEVICE(&s->a7mpcore), + FSL_IMX7_WDOGn_IRQ[i])); } =20 /* diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index 47826da2b7..da977f9ffb 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -228,6 +228,11 @@ enum FslIMX7IRQs { FSL_IMX7_USB2_IRQ =3D 42, FSL_IMX7_USB3_IRQ =3D 40, =20 + FSL_IMX7_WDOG1_IRQ =3D 78, + FSL_IMX7_WDOG2_IRQ =3D 79, + FSL_IMX7_WDOG3_IRQ =3D 10, + FSL_IMX7_WDOG4_IRQ =3D 109, + FSL_IMX7_PCI_INTA_IRQ =3D 125, FSL_IMX7_PCI_INTB_IRQ =3D 124, FSL_IMX7_PCI_INTC_IRQ =3D 123, --=20 2.17.1