From nobody Fri Dec 19 14:29:46 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1590088904; cv=none; d=zohomail.com; s=zohoarc; b=UHaiACqypHcOgr0JCElLA6Sq+RMaMPYsypqznwXsGc34o8lDui6P4p/aJ4c0tB+uRFqjGXWSsR6/OsVU/H1Q245rHFvhkOII9i5WL9MrEV/oZYtDtGML77ex670l1mVnP4mJlrFRsaWuAXniDUNeCgq9GQ0e7YoNt5FRIEElmyQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590088904; h=Content-Type:Content-Transfer-Encoding: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=+hbGBZsc8AF+X3waDnF16DXho47LwjO3DYv4rpJ8Ce8=; b=b7cia4laJmTFrlTVWpWY9nzSlNNV8d7UQ0cvaeNYh5fjdPogCT3fnUjF8qwIZznXu2eHL/SEnSLrEydj2DUWk9cQH6CNLXbuWnG6JWLwW8ZiVkNSTLnOa4yRZFJV5CUWzE2MKLYRu5dH25nJQu+5LoOQ/s+bPqAzXiyknjOUNhY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590088904071690.5552404411859; Thu, 21 May 2020 12:21:44 -0700 (PDT) Received: from localhost ([::1]:56368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbqlC-0003iC-Se for importer@patchew.org; Thu, 21 May 2020 15:21:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbqgD-0002TU-44 for qemu-devel@nongnu.org; Thu, 21 May 2020 15:16:33 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:33462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbqgB-0000Rc-VG for qemu-devel@nongnu.org; Thu, 21 May 2020 15:16:32 -0400 Received: by mail-wr1-x435.google.com with SMTP id l11so7810533wru.0 for ; Thu, 21 May 2020 12:16:31 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id z124sm7335100wmg.20.2020.05.21.12.16.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 12:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=+hbGBZsc8AF+X3waDnF16DXho47LwjO3DYv4rpJ8Ce8=; b=xg8AZVIs+o4OLrkktftOCo313ZSmdaO9FCHixpqR+jSPkIgh3ckslVAyJyNXrNGHJR 8aRKof89O55LGXV2ew7tAoPbZ9z+OvfsMrqS/ZYWoORFsXpVLWZdgCS0hm+JOhVLS2/R xI6nDK0yH3v6QLG4CuqDkQbQ4Rem1ffZyE0snyZWcbWa68PxvoA3Iarw7a/JNyTzpKgb TS6uoLtjy/DiEkZjw4LRSqEefq76U7zuL+qey7sOh/v2lTViaaTy9Dujwygf0lvDpmRz tBHNNyfL0EPhI++m/Da5f+IlUV/PHhu7QpMvws0gceKbA5Jruc5h2+wjfv4O1SR7+5Et hJ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+hbGBZsc8AF+X3waDnF16DXho47LwjO3DYv4rpJ8Ce8=; b=l7DKcMllhUIpz6zl6mersHvyFUGnh4cRxX9pnniyBMRrnvBxtJi7Zh5nOeQ9tT3Opz vrY67GBYke0vL8D7RuAmBojkua7XO7bf3IGSf+AbbFmpDgJTt6j8SaFt84uucDcTRYIV icsgKoBi7RNrWlgzM0Au7KXSiZEI0mp6M1LoiEJyBfcVEzCTIOtFGv7sN30n2lZg6giB 5TQG07qUDAmy4PBLw0ussFiFxsQU7Ce4J7zwCyq7dnyvDQud2qpig3QeLloXZJxRGd8+ AUa+gUOMN0iEA1U7fvESHMm1WvCZyPJDo0HO/lgheGB/RgNjE71D5xbZde8uYNyBiee5 zpcA== X-Gm-Message-State: AOAM533pFVAYy/iTMTxrEdGzoejep5cO5DJDZv24rcNXw3RmPLPU8/a7 A+o0hwISqYqf1TtDTv9m0QjHDJWZKs4G7g== X-Google-Smtp-Source: ABdhPJy1+1SY8wRwUo5QnexxzzB34QT1pYIjhbJVRncnpkYoOy750pMFNE0pm83mOJIMPr3i33KWHw== X-Received: by 2002:a5d:4806:: with SMTP id l6mr88187wrq.121.1590088590028; Thu, 21 May 2020 12:16:30 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/29] hw/arm/fsl-imx25: Wire up watchdog Date: Thu, 21 May 2020 20:15:55 +0100 Message-Id: <20200521191610.10941-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200521191610.10941-1-peter.maydell@linaro.org> References: <20200521191610.10941-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Guenter Roeck 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 Message-id: 20200517162135.110364-4-linux@roeck-us.net Signed-off-by: Peter Maydell --- include/hw/arm/fsl-imx25.h | 5 +++++ hw/arm/fsl-imx25.c | 10 ++++++++++ hw/arm/Kconfig | 1 + 3 files changed, 16 insertions(+) diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h index 5e196bbf059..9e228daceae 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 */ diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index 6f1a82ce3db..cdaa79c26bd 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/hw/arm/Kconfig b/hw/arm/Kconfig index 3d05dc8538c..8a5eb140f59 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -359,6 +359,7 @@ config FSL_IMX25 select IMX select IMX_FEC select IMX_I2C + select WDT_IMX2 select DS1338 =20 config FSL_IMX31 --=20 2.20.1