From nobody Tue May 7 15:55:41 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=1584912202; cv=none; d=zohomail.com; s=zohoarc; b=RP9enPtS1zC10qK2gMnTUOT/Q7Q8zGNb0hN9MKus7AjP+Mbi9tPlP7jLATkJFE9zKdgfHrdC4x/+P+XkcfJeJgiES8x6Lj44AVPKTWB0KOY1Fve9o83KVSN4wRjOsTkR+G93zfVhZtM2EaKaUbxqGiBESlgx2uai1UowKRHIFig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584912202; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aIlmyDfdth7SAn67SG8RyrbI+6hwH3DxUxITR9eGiI8=; b=OK2WHqyM0fsPEnF0y9BI4nXzfbVMFy0vqQWrJJNzCWNgqlytvn/En0cJdU7K510mDYz7ugtLhKVEmL1VVuMem9LGDuyT7y81FjsLXqsWCHffw1eLZMwW9rdxS8tf1CCxR/98hm4N5rGnb0eQPuPBIvqCy5rPoIz3SRrQgJorYxA= 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 1584912202396659.3834022710244; Sun, 22 Mar 2020 14:23:22 -0700 (PDT) Received: from localhost ([::1]:49980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG841-0007Sg-00 for importer@patchew.org; Sun, 22 Mar 2020 17:23:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42806) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG80K-0002sQ-SX for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG80I-0002jB-5q for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:32 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:52483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG80H-0002ie-8K; Sun, 22 Mar 2020 17:19:29 -0400 Received: by mail-pj1-x1043.google.com with SMTP id ng8so5158246pjb.2; Sun, 22 Mar 2020 14:19:29 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id o15sm4748075pjp.41.2020.03.22.14.19.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 14:19:27 -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 :mime-version:content-transfer-encoding; bh=aIlmyDfdth7SAn67SG8RyrbI+6hwH3DxUxITR9eGiI8=; b=kXSyFC6fv2PF+3Gh0Ab8xkerrmfB18WpsaxXdiVtlLWEbnm2YX87qOuiLXsNeeBphN ciMrP8vzIUmqIvTKf1zLvlVdHJoBfM3g5daH07NyL89iSrEldPIOlbHE7VjFxcnPGKRA hwPuWYQspdmx9XAR3j+oCh7coB2UILHCRB8/3Y//eXey4ykvXHmzpK9QFcW3uLQ/PdB6 +ATL3X/ErjTpSpculKpSE0U3tvYtKp52p39rlMyzYIyqDYIWIShhNADk2OZa7ZK9XmXP mXxbvn2GAty/5DdBp46+pl07VvRMz4bnWo/dPD2QS8UxvsiOu/9rKoBthu9gcas6E+wU CbjQ== 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:mime-version:content-transfer-encoding; bh=aIlmyDfdth7SAn67SG8RyrbI+6hwH3DxUxITR9eGiI8=; b=Y0UAJb6yn+sx/EV5EFloxEA+Ohmc/1Zis4jXDLKQ816E02H2jTr4xe1Rhfadyz902V 2b1a2dOCsgOlL7HISjPF5+9+kux1QTv8GMfdmtX56faxxElB32RSGO27KP0VenmQtlY6 mKIB6gy2+/B0/VkrST+5yEryeDxdO9KpFueDP6YmFX1bfBQHJQRLr7dWCVb2QkLOixTI pA6gVaQ6F/i481SYrBk+sqKMEgyR23oPegnuKZWT2dt1CiRClGoyYCAQV08/wCRk/JTD U1DmaJaFAMZXUt9Xm+yyqxm0pxencx0LHY9bETtqXbQ3M5TwdLZk5NzQF7eqqp42ck4Y ExzA== X-Gm-Message-State: ANhLgQ31WacjRl9Z2afqox0zQYWNxijNmSZURKc3yzLK5mlWbMmsgPmo Rjd7jgySSgD4NWxklrQkEvg= X-Google-Smtp-Source: ADFU+vt3AYNJRYBF9GNXWstM9RtTR5nVukWS98dE4fUxfsIwoACm73qvkdUpOX0F3q6QtpMv+NbSFw== X-Received: by 2002:a17:90b:11d6:: with SMTP id gv22mr22717760pjb.31.1584911968074; Sun, 22 Mar 2020 14:19:28 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH v2 1/8] hw: Move i.MX watchdog driver to hw/watchdog Date: Sun, 22 Mar 2020 14:19:12 -0700 Message-Id: <20200322211919.11335-2-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200322211919.11335-1-linux@roeck-us.net> References: <20200322211919.11335-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1043 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) 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. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Guenter Roeck --- v2: Instead of auto-selecting WDT_IMX2 if IMX is enabled, select it=20 explicitly for each emulation using it. In Makefile, fix CONFIG_WDT_IMX -> CONFIG_WDT_IMX2 Added Philippe's Reviewed-by: tag MAINTAINERS | 2 ++ hw/arm/Kconfig | 3 +++ hw/misc/Makefile.objs | 1 - hw/watchdog/Kconfig | 3 +++ 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 10 files changed, 13 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 2b46f3c6a8..1c36f36aad 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -620,8 +620,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/arm/Kconfig b/hw/arm/Kconfig index 188419dc1e..adf401e827 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -374,6 +374,7 @@ config FSL_IMX6 select IMX_FEC select IMX_I2C select IMX_USBPHY + select WDT_IMX2 select SDHCI =20 config ASPEED_SOC @@ -411,6 +412,7 @@ config FSL_IMX7 select IMX select IMX_FEC select IMX_I2C + select WDT_IMX2 select PCI_EXPRESS_DESIGNWARE select SDHCI select UNIMP @@ -424,6 +426,7 @@ config FSL_IMX6UL select IMX select IMX_FEC select IMX_I2C + select WDT_IMX2 select SDHCI select UNIMP =20 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..293209b291 100644 --- a/hw/watchdog/Kconfig +++ b/hw/watchdog/Kconfig @@ -14,3 +14,6 @@ config WDT_IB700 =20 config WDT_DIAG288 bool + +config WDT_IMX2 + bool diff --git a/hw/watchdog/Makefile.objs b/hw/watchdog/Makefile.objs index 3f536d1cad..631b711d86 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_IMX2) +=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 973bcb72f7..1ebd751324 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 1a0bab8daa..37c89cc5f9 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 Tue May 7 15:55:41 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=1584912085; cv=none; d=zohomail.com; s=zohoarc; b=F5Iy+7ciBTAn+I0TLsHKyszITSCKcTmdWbA+9g/A+jwzl6vqFda742ijdyYwBIr5tbWTjXTFzXc/7ABTwu+SM69+3oKHEYuKzh0AMreZw14KnOn6iFr0Bf2MMvulwESvY/nsU+cfWjtvtkr2wpnlVfpGrJc+iZc/IKNo5f+tdOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584912085; 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=ZgsMGDELhEF4+TgSqBXZBt/v6x4+MShoKiq5mNYxWWg=; b=FYFXE1QAAv7aoMbtEPw7pwUROe6VE7ThSpOHyvb3S+BXSysSLWl+QM2g+sBRv1HaXHbbvuxMcK9sqHjltBXTSQhGDO9wEmPw1hBzWXMVXMvWP0xWC3qlGuOv5+raKdwAIolVtyUXhzYM/kMz4Cm7Yi+t7/FljDFNzBF7mKyoLGE= 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 1584912085112624.7724907661377; Sun, 22 Mar 2020 14:21:25 -0700 (PDT) Received: from localhost ([::1]:49946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG827-0004hU-JN for importer@patchew.org; Sun, 22 Mar 2020 17:21:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42823) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG80M-0002sR-L0 for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG80K-0002k8-Qe for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:34 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:37564) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG80J-0002j6-1v; Sun, 22 Mar 2020 17:19:31 -0400 Received: by mail-pl1-x641.google.com with SMTP id x1so978020plm.4; Sun, 22 Mar 2020 14:19:30 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id f6sm11992971pfk.99.2020.03.22.14.19.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 14:19:29 -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=ZgsMGDELhEF4+TgSqBXZBt/v6x4+MShoKiq5mNYxWWg=; b=A25hrsUrd/dKrtFHB5tKa2BzGOw5+Hx3G87LBJdA0z3XnaKrWzxAVg+0j5XHIXyVYu n7w9rgv3mvOr7VQSkulLA8prfYEfUNEQZY+QbFjQ6tBJ5tGrHOzo2LhiHmb7xl4HvenT m+CaVpfn8K60oGL4+S25dhDG1i4hF1FGGg9InVXB/1rdIpDHMZKHxtKD3dA3GSG0WYKQ q+9+jztvBMdlSCeI8wfkSXDUPrAA9rhbsQYhRXlW0CWev7WCzQAFabQkdve8eCnbzSCV ke4qr+ZtO0Hea9X6ndC/LNGLmfgcJnq1uo9vMQ5PoyvrmZ10TkkT+lmPTPNmP4ZnnO5S tLIQ== 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=ZgsMGDELhEF4+TgSqBXZBt/v6x4+MShoKiq5mNYxWWg=; b=oonyrJDho8VzeLLmJTnTfRmMagcAE3c+c7wt0Jf8kGhkwAXD3nv4fpOCLsEKcAEN30 yCN2dqe6Ykci0Az+mPKEnCP8V8zSIwrDp960NeprvC8gl6j/WyKcQFIGBgGppVsKJo15 N8OGReAnDk+MFEG0mdeS8+iLgWA+F3AZE6mmQXcfMy8MYoT32ib/5PlKSjuwaTSgfgV+ 1Vk6DcZQmCsFwdCF6zNyFjWAFRk6hb4QaiNXkhYbTlOtOfeRbMB0OKKK43YbSGFNP+5d kmOARQhQbvxxDcorLEIoRw3kaZsuQnRaFqd63h40kfrRfkdEmGsesSDkYk1oKqB6zsjM eE3w== X-Gm-Message-State: ANhLgQ1vjIOiclyfgi757J/dHtoIH3xwZmSpNMcSEiLk8lNFIBeKvq4f qbpdGduAXKdQwL/uOKJzZYk= X-Google-Smtp-Source: ADFU+vstY6i3J5txkInGpGH7IwzCdYCiRYZgT5fAwYYG20/u08QYVju2dkW1ACorAMIC3tkWccReHQ== X-Received: by 2002:a17:90b:1b05:: with SMTP id nu5mr8439811pjb.110.1584911969517; Sun, 22 Mar 2020 14:19:29 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH v2 2/8] hw/watchdog: Implement full i.MX watchdog support Date: Sun, 22 Mar 2020 14:19:13 -0700 Message-Id: <20200322211919.11335-3-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200322211919.11335-1-linux@roeck-us.net> References: <20200322211919.11335-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::641 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 --- v2: Fixup of CONFIG_WDT_IMX -> CONFIG_WDT_IMX2 moved to patch 1/8 hw/watchdog/wdt_imx2.c | 196 +++++++++++++++++++++++++++++++-- include/hw/watchdog/wdt_imx2.h | 49 ++++++++- 2 files changed, 231 insertions(+), 14 deletions(-) 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 Tue May 7 15:55:41 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=1584912293; cv=none; d=zohomail.com; s=zohoarc; b=Pd9BPBNcroNyseLHMp2hGEGzb9Ybq/Ls+5lcZZWRvVKhmqD6Xh3gLF+vEvzKbeJzOxuvP3k/x0/tYQAZsavQU7G5W/1MLpHz7CxrWJ98zKuWlIY3Zmp8VHGtsNLZP0SUb4EB7O1qk1BX3TGmdy2c/P8dSYirc1QLxdCcWT3ioz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584912293; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/KJgg3GQUYAWBtiiHqyoNKWjmdOXcRV798ZDLG19ILg=; b=Rl15eFGDIVdGIlQCZQ7mNtzmoFTpH40IkMkFCRfeS18uCziE6AV8vtdn3hrhJEIY0J2TsLfG1xfYguED4DPACjPkmVbJEkOVO46x+CJuV72Dg9OMdHMchKTOuWRRIfPD4e0/CnpQFXxb5fcDIfm6IbVtF88eXfXD1Wmic0zbUfU= 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 1584912293530346.7207096398133; Sun, 22 Mar 2020 14:24:53 -0700 (PDT) Received: from localhost ([::1]:50004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG85U-0000vO-9F for importer@patchew.org; Sun, 22 Mar 2020 17:24:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42841) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG80O-0002tX-HP for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG80M-0002ke-4D for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:36 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:35973) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG80K-0002jf-Q9; Sun, 22 Mar 2020 17:19:32 -0400 Received: by mail-pl1-x643.google.com with SMTP id g2so5002201plo.3; Sun, 22 Mar 2020 14:19:31 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id y30sm11707064pff.67.2020.03.22.14.19.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 14:19:30 -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 :mime-version:content-transfer-encoding; bh=/KJgg3GQUYAWBtiiHqyoNKWjmdOXcRV798ZDLG19ILg=; b=e80G1yMo8g4WpgqVlt8ECnyB1a18hfmd19HHCr/2hV9y3jpmb2WLC7/QgEKqTGv9gJ pfWgsxsMFHixa6ISPY96SXO+FVAhq4w67Owz3J9josn6Se37FBDSnUDsm6w/jsRDQamc dBouPjVwcuNt6cK851fSYqwlwgPWsYMfFRzpCdUz9On1GUNcwadE42hMyhTw1Ps80vYq DH4gVKAeBtsxMjScDvqW1E+gJa+qBG32WQFWt0dtIBGRsCaNqs6lAfUHnDGLeeSoATot yxiw14lHKxovQklVVmBsPJsKYZ+xqCcslrfGOEsuvXsE55c22pb5dbXkZ8FopKIH3d8K AdFQ== 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:mime-version:content-transfer-encoding; bh=/KJgg3GQUYAWBtiiHqyoNKWjmdOXcRV798ZDLG19ILg=; b=smDldahdZIF4nChogucUIXHewBa5f0tjxoSrpZ1jGk8IQ7LJixdRVppbbEl0HoKxWz bQSbhjW0qZyN/fkLUzN80CActB2qTmn2sQMT+98XkdhyCnvzYW/E6E7GLtuvDXmfV8mD 0qKTFelGM2gCVYVxpDLg1EEu6VboHR7G3K52hqUF+eL4+prSfFxJcEciBH7AFhzgtAkv ih8Hz43dkcRRkW4ZuEN9fUO6tdlhG6g6421ejYpnVWfa2p2d3Z/BJs9OWg9kNPCDi8yA 7kDEZyBM9UHyh8lXCF4ePWN6JX416aIsoMlokSOuYtlRa+P4PvHBI8wVMw6XEJBMapJY ntGg== X-Gm-Message-State: ANhLgQ29trN5x14qxxFhfLY8tTJpXaez9rK6kiScRIOfN2d3xYDhVQ6Q h1Ubp9ydkZ1RNX0k0yIHEfc= X-Google-Smtp-Source: ADFU+vvjZy8hNuOyN8RNJriCJgNggK+iD8o7l4o7e3y/aSjt1iKrhBv6rCd+JhHut9k9X0W6H9tDzA== X-Received: by 2002:a17:90a:2149:: with SMTP id a67mr21943829pje.190.1584911970883; Sun, 22 Mar 2020 14:19:30 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH v2 3/8] hw/arm/fsl-imx25: Wire up watchdog Date: Sun, 22 Mar 2020 14:19:14 -0700 Message-Id: <20200322211919.11335-4-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200322211919.11335-1-linux@roeck-us.net> References: <20200322211919.11335-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::643 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) With this commit, the watchdog on imx25-pdk is fully operational, including pretimeout support. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Guenter Roeck --- v2: Select WDT_IMX2 explicitly Added Philippe's Reviewed-by: tag hw/arm/Kconfig | 1 + hw/arm/fsl-imx25.c | 10 ++++++++++ include/hw/arm/fsl-imx25.h | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index adf401e827..54a49aeabd 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 =20 config FSL_IMX31 diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index 6f1a82ce3d..cdaa79c26b 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], OBJECT(dev), "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 Tue May 7 15:55:41 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=1584912203; cv=none; d=zohomail.com; s=zohoarc; b=L8g2vm5DOBqnGgTNye8hzNR8hGThKYJmV6GjaZOyT3Ahlp6lAT5FtUcdqC4hxLfi/CMEEa4g+KBiuKL+8nt1bHvPgwjwY1KV2HSOQwXIvZ/Pz44FX2LPsCkgaWR0FDNqXS3HLBbFDtyR5tWh4mvnwg1wUYioNJjdlJICkw6nOFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584912203; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yJSNMH7F2JV82ctJF/qnhkJrlNBkApOpJ7cdZGhHOO8=; b=BVgNAzVzg6Oxu+FlmSpduNce5YQaDLk58/vEC+PYwHyxh2uJa7RZfqJBLBqhU2L5lBCMkvjxdWYSIkHR9Ci7CxYKx0279XuOBNjxmq57OT6lFW7QWrh6fnsxGH2VjzZC2kzTMA0pCUHAAz71TGeCt9I7vzM9pKoUoaYVC2zN348= 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 1584912203573782.7057946029715; Sun, 22 Mar 2020 14:23:23 -0700 (PDT) Received: from localhost ([::1]:49984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG842-0007Ul-6E for importer@patchew.org; Sun, 22 Mar 2020 17:23:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42839) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG80O-0002tW-HQ for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG80M-0002kx-Lk for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:36 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:37566) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG80M-0002jy-44; Sun, 22 Mar 2020 17:19:34 -0400 Received: by mail-pl1-x643.google.com with SMTP id x1so978053plm.4; Sun, 22 Mar 2020 14:19:32 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id f64sm12030420pfb.72.2020.03.22.14.19.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 14:19:31 -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 :mime-version:content-transfer-encoding; bh=yJSNMH7F2JV82ctJF/qnhkJrlNBkApOpJ7cdZGhHOO8=; b=VugeFxnjOCdQElNIcmmGZWHigkfdENFH70/Qhq41d1VWtv/BFrHz4NPUl90PT348yP 4sjLSYOZktLgum6p84RfhpK10agrmOtsOxjNGa4q2OraQcw9s0U2p6q5FtjunfDqaDDj sCIlzXCK3QHgV1wzXcQg41VYm46NTomO4V6fnC8oypVMc9WUrUWBDJ+ZRfaHMPTUM13X lIthN+Ffc6cMf6tuMuR3s96NfozAA2eK9gKb4k2WNuMJMd1ffqgIWArj//OvuXbou9TL kiySJLBRnykO9l8dqSnnwMXWmAwLEAUKCoRSsDktMVgxtGAAwnGrFk1/Ixp0myiT7dk8 3IKQ== 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:mime-version:content-transfer-encoding; bh=yJSNMH7F2JV82ctJF/qnhkJrlNBkApOpJ7cdZGhHOO8=; b=NlX7tn/7+PovQ0MeV3T8Qt0u7jSpNAP0dZqh5VWSDVGFSiBVOjyReAQQPAGpZJ2dYV F7fTBy8HVI11kmtubAwitm1tUmU2PU7z0I4Ej7MldrZ0d307g5way1cW7i962mqwl1Fu cedL4CrzGb7cdfx3lNW6IbCPq8dTjsd0UBpu5mPFBvkRJmNrfCeNZ63ELGRzrJZ/FwhO Ei/c5mrfv8gLMkx9rfsi5agHt98vpZtISosRmPKvTZehF6+bi+LO6pSj2cJkhakmJey3 yUNjKBAfGdAKvP/HiybtlKNyaFgTATZuPXaxJ9mUarCCp4evZUquCrUyS5ffY8N64e2a 53Gg== X-Gm-Message-State: ANhLgQ13fPYfiI1s7d/EL8ujuPjwxayLl71LkswIG+iNEZcLLqIhxx87 FfHDIYO7VKiCcQ7Qr+PAw34= X-Google-Smtp-Source: ADFU+vtZDA6xcJllt8OlY89q2EtKeMMijLLy8Osov68QCMZh2dIZ3T+m+2R3csFBu5HCP0XFXJE0GQ== X-Received: by 2002:a17:90a:3589:: with SMTP id r9mr21582090pjb.196.1584911972250; Sun, 22 Mar 2020 14:19:32 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH v2 4/8] hw/arm/fsl-imx31: Wire up watchdog Date: Sun, 22 Mar 2020 14:19:15 -0700 Message-Id: <20200322211919.11335-5-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200322211919.11335-1-linux@roeck-us.net> References: <20200322211919.11335-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::643 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) With this patch, the watchdog on i.MX31 emulations is fully operational. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Guenter Roeck --- v2: Select WDT_IMX2 explicitly Added Philippe's Reviewed-by: tag hw/arm/Kconfig | 1 + hw/arm/fsl-imx31.c | 6 ++++++ include/hw/arm/fsl-imx31.h | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 54a49aeabd..9c77f4cbb4 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 =20 config FSL_IMX6 diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c index 8472d2e911..1e7959863d 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, OBJECT(dev), "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 Tue May 7 15:55:41 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=1584912289; cv=none; d=zohomail.com; s=zohoarc; b=n0CyZbYXjZmBwtc4GUXhFHQJhBG85s4ahXK5PiJ5dUfiimag4WWp4iq4An8gq3CN2ro/iEr8IG4VcHSRYaf+ZOej+/3xdYpxGN3z7zZy+NaqGKZQlcpBXdkPGbBS4rQSpcmLs1n7IPC5HjwoH7rxybrWTyP+gMsMs3uOQ3Rs9DA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584912289; 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=DftWBiWkjHoKVvHzazigRJcybZQA/gcmEJAYkticqjM=; b=IAmHJ/XX1fLt9y/NfBmidlhr9YbZCze9aKrGg5RLbbmxYsK+gGe8j5dKGY1t5IH+6LufSGcCzBPGyeIPMjDKKd8oXKoIeplIoakJ73zpYJN2sYS8IJKou05HUYd9BduhfhOczFnDHK7ErjtIEgRR4n+Oh2FttxvkTwsuUJU1mhg= 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 1584912289382945.4799421634165; Sun, 22 Mar 2020 14:24:49 -0700 (PDT) Received: from localhost ([::1]:50002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG85Q-0000qw-3r for importer@patchew.org; Sun, 22 Mar 2020 17:24:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42866) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG80Q-0002uW-DC for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG80O-0002lV-EW for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:37 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:45420) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG80M-0002kX-Jb; Sun, 22 Mar 2020 17:19:34 -0400 Received: by mail-pf1-x443.google.com with SMTP id j10so6439773pfi.12; Sun, 22 Mar 2020 14:19:34 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id k189sm10446306pgc.24.2020.03.22.14.19.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 14:19:33 -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=DftWBiWkjHoKVvHzazigRJcybZQA/gcmEJAYkticqjM=; b=WaIOtcCb17Zog3YpnvEEY/8+Dn5U/BnaF56cBLZ+i2QYTG7xapW5WfZZhPDPGVG9wz oGEcO+7WMmYdCu+WC6IBPykiPTjuu5IqK/iZ4rIEBjHzY8PoyLhvPbngQreesWdGJtWT pAJfhNW3RVAkN3jgBa/7wWyi49YR+hjg7wMMW33YXy3NWSCZ7KogUOjzKS5cyKMdyebh yqN6FqdfCAcWxj1TAfetgDBvMcDfahAyS431/rkDIRqUjx6DQf5SMexTY6DZIaC94Vq0 QDjHCwS9zLkZX6pAZsmpiv21l9F9RGqHvhPvxwn5+vElcJY5BezvMC83ep6p/tN8y25D uFlg== 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=DftWBiWkjHoKVvHzazigRJcybZQA/gcmEJAYkticqjM=; b=hsZCnovk6Itmb0uFTw02M8Gk/XK6thvYCQPD1HBTwRhqEzFYRHLlqXp51avyKX/9pl 9DPoRDP9/YIVjOwrnD76oPA7vuy6MWFGGVAqeNrnbq78cvK2x4bsGNnLR76HUr8kBNph rJaHyPCUU7PY7NxSgRpwGY7YkfAXFVGhJqNj1CHK5M5rzEVl5eXi0JN+Bsq9k4lH0Rcd ePJHp5SRTp+dD8Ka2iXOz1lqhPWSIRwhjr+ssJXjD9oW1Zygzs2w4TD0lTTGn1R2C/gS l6MZpsRRoYssL5Yo3DjCPKWSWxGtziDxtbumR38QfDlL9jneMwdhgb5qFtfbgMJ00E2q YF2g== X-Gm-Message-State: ANhLgQ2IBNtdByE6mbOM3TXaZhFadxbkPHxsbxXXaTE/fMhgA7atObez DE4Rk0VIdUtbgy8jf7Up3Rg= X-Google-Smtp-Source: ADFU+vt5eHLnkiRDN8cuMIeckZZIYPenSzzpJieobSC++It0NtSPhKZaSVljBf3+ZbEXduRG4wVpkA== X-Received: by 2002:aa7:9af8:: with SMTP id y24mr21912508pfp.91.1584911973602; Sun, 22 Mar 2020 14:19:33 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH v2 5/8] hw/arm/fsl-imx6: Connect watchdog interrupts Date: Sun, 22 Mar 2020 14:19:16 -0700 Message-Id: <20200322211919.11335-6-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200322211919.11335-1-linux@roeck-us.net> References: <20200322211919.11335-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::443 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2: No change 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 13f1bf23a6..f58c85aa8c 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -433,11 +433,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 Tue May 7 15:55:41 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=1584912086; cv=none; d=zohomail.com; s=zohoarc; b=HMecNL3jnObYAFoDl7Uw+4W1iBW7vDaoQgw2Nk38DQSy4tSVFyWZqQiOHrx/WoxUrJi+U9QyUfvS5f3j0627iG5wLzgphR8/nyR1s1X/6rb8LrawDZPJeqb4KcepCGVREieMewQ99Mh6ip5SJeMHmrFM93mutu6Phsk2izdNWkY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584912086; 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=PfacgAp0cXzOj1kL/UZ/1/dmJdoHTLFW9eigbgqFIs8=; b=dHR2VC0A4lCkvATz5Ss4liWuAa6j1UyoGGn55MKhiP6GQjrc7g1OA94+nfpdbG3doGCyDwqkuftotikMx0XsRDVzVbIz4YGW/vXmjU0XIGB4wp1ebv68qA36+l5SYXvKPTvFhiAco7HVAPO29bjWeaL3Vr5mHJZGph+VUh6qVFw= 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 1584912086159463.47137295924335; Sun, 22 Mar 2020 14:21:26 -0700 (PDT) Received: from localhost ([::1]:49948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG828-0004i5-TD for importer@patchew.org; Sun, 22 Mar 2020 17:21:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42897) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG80S-0002v0-6D for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG80Q-0002mT-9j for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:39 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:38493) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG80O-0002lG-Fm; Sun, 22 Mar 2020 17:19:37 -0400 Received: by mail-pl1-x641.google.com with SMTP id w3so5001296plz.5; Sun, 22 Mar 2020 14:19:35 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id p7sm10670091pjp.1.2020.03.22.14.19.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 14:19:34 -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=PfacgAp0cXzOj1kL/UZ/1/dmJdoHTLFW9eigbgqFIs8=; b=XWoPxDSyUzpDM4V2euFaFTZNpqmdfaqF3Hkq4CalfIc5T2KgPLknkCaN6V4aEfb7Az 0BkcMSCvMClaCBqqiIq/mKQxxLxXumarzzvNPwZZHeN/Mmz0C+Wekj22FWRy4RID4uHr VbhJDlOPTzZPv4RUlVeO+bhpQOglW07YLtJyPpLqkUytErYYAtgf43UMBAW6/s7k1vYX linmEsr5sGHd737Z/pZrnX97b473z1H0unGoNdroYgUqaZlNL99EAtKkX8zgog9je7/0 jvO9Nm1MTOqAIwLE05lCURODEszlv44vwPGHQFTTUekjvBU0WVdG/g4JTRaB3i/fLYSz rOPQ== 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=PfacgAp0cXzOj1kL/UZ/1/dmJdoHTLFW9eigbgqFIs8=; b=ORvu4VfRXj885pTiI5UgPZPZekJqEPPtbkLQxUep4qovnvqxEmUI1OY9VUFIjlOA/M l5oJv7egsAETpYTMENpw3Xkl/MdJboGXJXhepILRDo77LAX6hIUWIC9tG3s9NsnKjLQB GvqfFC6hNfngp/BlnZvL58WguhCRvcyfTLmka5riTt3d+PLJZTTwH3wXGDT8ytTtEQTg xyFqaAxI/rP2kwRbkOjaCiN4cSg+w4GwWgnKCTNXpDFi32ueFpCRcly0v1hH8iifuzLJ 2k1VYupqAK6uD6UR2Cmocopk6ibJXBi7zcnXDv3J+NG6VclMvPW4aRurIl+pDfn4x9z7 /Onw== X-Gm-Message-State: ANhLgQ3hnhwVO22zhKzLYudiAQ7qmvP82ZCupgZE6Aleh/QvSUY3FD3M Laxom68FJvaTVfDksTQw+Mk= X-Google-Smtp-Source: ADFU+vtBHCq/ep+XB4WunTPqPGtkvjH/6o6nGPQTkrVttTpxp6SN/g1hvIqNckISTc9IJMV29obNxg== X-Received: by 2002:a17:90b:909:: with SMTP id bo9mr10327895pjb.125.1584911975115; Sun, 22 Mar 2020 14:19:35 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH v2 6/8] hw/arm/fsl-imx6ul: Connect watchdog interrupts Date: Sun, 22 Mar 2020 14:19:17 -0700 Message-Id: <20200322211919.11335-7-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200322211919.11335-1-linux@roeck-us.net> References: <20200322211919.11335-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::641 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2: No change 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 56dfd7cecc..3ecb212da6 100644 --- a/hw/arm/fsl-imx6ul.c +++ b/hw/arm/fsl-imx6ul.c @@ -531,12 +531,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 Tue May 7 15:55:41 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=1584912384; cv=none; d=zohomail.com; s=zohoarc; b=MDFzysMV1MAvBFLxc65vmBno1dlB3ZppBHdcg+nOlVjD+ZfzfBUAWmj/7HeXVzFpo/mZwpcgIA6GD2TVU0QNgTe2rtrVM59H1xWXGTRkN4xoIsknhTM85JklOQIX5jO1TFAKQMdiIeal1zYSXKfVuuFh1oQ0TkxL7P90l14t+IM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584912384; 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=8hrUyZuUOd4fuzydcZbAphAtvryaQ5y5r6qpUUi+dwg=; b=IlNFP2akQwsAPdccHKUQqqI3C4rmuC7z3CDwfOvj7Z+ilWYXN7y3+0sdqrOY+VFRM1V3yzBI6v/QiIh31Wj/ZclB6EtzqFvFXk9q8nc7eBvrJNEJTsb9yMX8Gi8kvhHPqXNHZmBw0SbuCj7Owa5ceAori6FkQLNaZpqn4KkJrKA= 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 1584912384805532.8122401214723; Sun, 22 Mar 2020 14:26:24 -0700 (PDT) Received: from localhost ([::1]:50030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG86x-0002Yv-KN for importer@patchew.org; Sun, 22 Mar 2020 17:26:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42899) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG80S-0002v6-6q for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG80Q-0002mk-BY for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:39 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:43855) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG80Q-0002m2-63; Sun, 22 Mar 2020 17:19:38 -0400 Received: by mail-pg1-x543.google.com with SMTP id u12so6092618pgb.10; Sun, 22 Mar 2020 14:19:37 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 64sm11493454pfd.48.2020.03.22.14.19.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 14:19:36 -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=8hrUyZuUOd4fuzydcZbAphAtvryaQ5y5r6qpUUi+dwg=; b=SrZilAhJXD8X7npbDGQ1EiuoT7zM7wT05/FhTM02+MwlmnnHhFlnk52IXR4DsjuaOC YG55A1HbUq6Z2eTXG0lFUWM+lxQnqwiui1DaIafQIPq6eIM9+06KtSgGVbA2r24GBGf2 Y+8oRFeiaERtmxI4Ybomkct51hKg5jciV/JLx0jEwRJHkBep2OUxkAgdt8TdfJDGyCs1 E41sn4FW63U94yKlUg8xeXW6vUxFbmkuPhwRhI8HAXdXOHZhP/u4AS22qPoLdQXvFXfB OirzIxcYA3u0VL3RGInxK+lK501+9VziODkZrCvx+udbSsYTaADCGNhf+u66yyUqQgrW 3E4A== 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=8hrUyZuUOd4fuzydcZbAphAtvryaQ5y5r6qpUUi+dwg=; b=Lb0mFP3KaZ5bHLhxG3l1PstAeN6vp1ZeFxBcH/I3ZPfTIjnKQSVaUes7Mbcpp9lPeE Kp2zBnNDFFClkJHP3PIpqVRg2h6Q2zqj0UGHU63DPt0v6JjIYM0Y4vtkq6L2ie7Tlqwl jqJYGBoAfgbxQlwAoQRU87Lo8MNqcBTbGAUBndv/e/c65TXyfEFs0UFNkf4FCyMVfVIi /tSM91b720Movohw1IKF1Kau8FvU33k5FZLhv+DuhTKTKMhGSXcn6Y3c+Swc8v+Gn9g+ fytnX3cu2vedv4RwiSPf4hC5M6USFWY9MxPflZf6RNFqxeJB7tZhtY/FHYy+Ltp/mSJ8 +ukg== X-Gm-Message-State: ANhLgQ0eXDlZehTA1JSIRZ132kB7pXpY2FHvrooWCvp+VgsI9HIWSuUy LY9PMtHNSIms6nHdLeIev6o= X-Google-Smtp-Source: ADFU+vtlmVaDBjd0xd2Q98nD37VgjUZJyuukWL2tSHReHUHT6j+rMSN2qM700hKmir9bS+AqpBZ0Ig== X-Received: by 2002:a62:7d11:: with SMTP id y17mr20723291pfc.127.1584911976552; Sun, 22 Mar 2020 14:19:36 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH v2 7/8] hw/arm/fsl-imx7: Instantiate various unimplemented devices Date: Sun, 22 Mar 2020 14:19:18 -0700 Message-Id: <20200322211919.11335-8-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200322211919.11335-1-linux@roeck-us.net> References: <20200322211919.11335-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::543 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 Reviewed-by: Peter Maydell --- v2: "octop" -> "ocotp" 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..d6cf7c48ce 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("ocotp", 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 Tue May 7 15:55:41 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=1584912459; cv=none; d=zohomail.com; s=zohoarc; b=eeLIxF4Bqww76D/pe/ZAOLAJieR/LRZG/Fp7JasZBdHjl5aaebTlNf8co0B/v+/0XYBieiCNz+mP2gNqiwc6chSLs/MROYiyi6b2K3X4hf8N4yV3BsI9dauoKkDBvKBKNpxLlAW7Qk4e9nt1oJfxrC34ogliZkEx03u9sxdQppI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584912459; 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=RjKWvLSfme9/CvcRWOHB/MHVHAgog5y4v9UlHjSka88=; b=j0GtQ9NWYGCPVyEu22xwOxe9VmusvhbUsk4LiDAmZMgXriquM0jFsopXi1q/K6z1VbeqYEBJoc00vWfJcPkE0Ygloe3KPv6LQwvyyvrp+iL5pSYhxqO/NMVaQw2Ko7rQ3X3vHsV/OiGOKxX3TTrAj7Sl9cgNbR3KVvUd1NzMfMc= 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 1584912459502665.5161399195067; Sun, 22 Mar 2020 14:27:39 -0700 (PDT) Received: from localhost ([::1]:50040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG88A-0003d1-4k for importer@patchew.org; Sun, 22 Mar 2020 17:27:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42933) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG80U-0002vj-3x for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG80S-0002nm-86 for qemu-devel@nongnu.org; Sun, 22 Mar 2020 17:19:42 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:35974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG80S-0002mK-0A; Sun, 22 Mar 2020 17:19:40 -0400 Received: by mail-pl1-x641.google.com with SMTP id g2so5002316plo.3; Sun, 22 Mar 2020 14:19:38 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id i6sm11604887pfe.62.2020.03.22.14.19.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 14:19:37 -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=RjKWvLSfme9/CvcRWOHB/MHVHAgog5y4v9UlHjSka88=; b=KOLjVnHk1+FvrdaM95vLN6WPWJER60T+K8FtowdkzJOd+E4DsXLjdImJT9X+0kGxwO hLGLi7crGemAyCoyWu+nniHlDEQbhuDo4NZtUAvoMxiKZMdn7jVJVyjy1ikM7d41kab2 YIf2BuQ0E99PCZ4HkfTFUuJM01nIPJ1LDGGWE4dzlFyrmZXe49t51M96CKgJp00upaS/ e5IBwjWVs9ncGmtk6o9TauQq+pdkfcn0W3ZVhNklShFgz3yZaktgMyAAwTo7Roj04NZf /3s2rKeXFTiN1mbZFbPTxdt0dVzmEyET27teyS5YZ9pLufsaT2Mm6Q2XWDT2EqVthVUp +t+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=RjKWvLSfme9/CvcRWOHB/MHVHAgog5y4v9UlHjSka88=; b=XpZrtwVxa0u8Jqnf6+seq5VUGHNZ8M2b7BeW9B5jriraX0627/l7GKoiwE+KEUxLfS QPbjtICyTzKK7nLUCgt78gOjgJd2b+U2+mBdR0WJD275t6jVnZJSt3iq6eF6QA5ZaP9l FIKJIpbXtt5x6V8on1EUL9K375twInMkznKFrKWUAed7uf3DSKRIHnbMQBdWvVaWGGZE ALU7FiowuTUmXA6pZPhAXH6TaI5tZX5oTzFTFXtFZmOnCl4qpbeoFFKl4bP3+tpbU44V m+wZTl5qZFTPPxOgH2oVQZr8EUbd7BjedAQc90JUbp9plDqCSa4rkozVaSCBJDZSDxg/ 35yQ== X-Gm-Message-State: ANhLgQ2BKaoNsxdgOOTQyspbLS0tSuE3BawftJek/Ye4+yPFqSb7A9Bg 7fHjgk1zK8aqq7VXZXy5GkQ= X-Google-Smtp-Source: ADFU+vvdGRUERgGzQ3GIJjAzU1bdfIyBMLNiRPaWoxFeNdodFny+wPNCtHv6nzaR/KRDSoo+RCKK6g== X-Received: by 2002:a17:902:9f95:: with SMTP id g21mr18297457plq.66.1584911977824; Sun, 22 Mar 2020 14:19:37 -0700 (PDT) From: Guenter Roeck To: Peter Maydell Subject: [PATCH v2 8/8] hw/arm/fsl-imx7: Connect watchdog interrupts Date: Sun, 22 Mar 2020 14:19:19 -0700 Message-Id: <20200322211919.11335-9-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200322211919.11335-1-linux@roeck-us.net> References: <20200322211919.11335-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::641 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 Reviewed-by: Peter Maydell --- v2: No change 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 d6cf7c48ce..89c3b64c06 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