From patchwork Wed Nov 13 00:51:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 11240621 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7202214E5 for ; Wed, 13 Nov 2019 00:57:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 47D682084F for ; Wed, 13 Nov 2019 00:57:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cjZLePDo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47D682084F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUgyb-0005Fu-C4 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 19:57:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54263) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUgtN-0001Oe-Rh for qemu-devel@nongnu.org; Tue, 12 Nov 2019 19:52:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUgtM-0005I7-VF for qemu-devel@nongnu.org; Tue, 12 Nov 2019 19:52:17 -0500 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:37720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUgtK-0005HW-VW; Tue, 12 Nov 2019 19:52:15 -0500 Received: by mail-pg1-x542.google.com with SMTP id z24so172447pgu.4; Tue, 12 Nov 2019 16:52:14 -0800 (PST) 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=lmFvZZZEGHi/jNPzB8Fjz4VckveQEY65n8jFgmWLQrs=; b=cjZLePDojxTtnAfrXn6gz0h083D/nJMCELvufI7vORDlrOAy0wWlMh6k2DjlsgGfQn ZXEFkMAKYM2JmqLMdNbYcJ0jFRryIRyXMlMOr2nqsn6hXUB2OlK1xYQcDZEoU9UV+oTq mcapQVvF1cfnOsAzCrQIm6IJI4irBOZGPcJXqNLK9ax3gbEtKOqrs+mdJcaIUDU7npIt zBRFypimS5uj00visXxZnnrlqVrf7kXksV+Y0XA4rXSgK7zccKIfSk3qlLizi/3vbFi0 MtHxsfpJkDYZQDcF+viTfyXZyV81fNKE048APNTy6lWFTswCL1iNh5ym165ujTExXiLI Xn8g== 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=lmFvZZZEGHi/jNPzB8Fjz4VckveQEY65n8jFgmWLQrs=; b=ezetE7p+GxlOL1xf/yNrNnQKuKTpweSEBWbWDrYoyzEHEA+IaRILmDx7iB0kAOfFxU T65jqHHOZtPsnJtGC9PoL1xJpy3RnzUEnjOj1Tc4Hy5rfkHNrtkBLLxgHIpG4zO9sUMb dvT4fGPJcjrGhHDoud5bjGHI6sNi0HYP5l8vgcTU7YfyXTa1apOzzJaZEV48Zx0PKxf7 Bd19KX0aozLJCHM+e0HBdI99IEyrenwzL31aNxDaeUQmyhs9a0KlxTscX30W/Gt9vZbh PXdDTc4ECNZd3adyj+CwUVeoOcHHMkgHkOLsJf3zylmwUF9xzpgXgCyuc6xa/iKi7ZMi HLmw== X-Gm-Message-State: APjAAAUam6bSoelSHfamNAdnB3lyAlrjfHMoU9Cs9dPO2XxyConatHzh e611UT8ybP/oaj1VQOqxKSQ= X-Google-Smtp-Source: APXvYqy3swK84ZQosXBDvPju/0PxJ/OHldwWE98YcEkKr5UYVjGLZb6S/ZvDgeDgBUzZpM5NNYxrzw== X-Received: by 2002:a65:5542:: with SMTP id t2mr478788pgr.74.1573606333758; Tue, 12 Nov 2019 16:52:13 -0800 (PST) Received: from voyager.ozlabs.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id i13sm169848pfo.39.2019.11.12.16.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 16:52:13 -0800 (PST) From: Joel Stanley To: Peter Maydell , =?utf-8?q?C=C3=A9dric_Le_Goate?= =?utf-8?q?r?= Subject: [PATCH v2 1/4] aspeed/sdmc: Make ast2600 default 1G Date: Wed, 13 Nov 2019 11:21:58 +1030 Message-Id: <20191113005201.19005-2-joel@jms.id.au> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191113005201.19005-1-joel@jms.id.au> References: <20191113005201.19005-1-joel@jms.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 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: Andrew Jeffery , qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Most boards have this much. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley Reviewed-by: Alex Bennée --- hw/misc/aspeed_sdmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index f3a63a2e01db..2df3244b53c8 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -208,10 +208,10 @@ static int ast2600_rambits(AspeedSDMCState *s) } /* use a common default */ - warn_report("Invalid RAM size 0x%" PRIx64 ". Using default 512M", + warn_report("Invalid RAM size 0x%" PRIx64 ". Using default 1024M", s->ram_size); - s->ram_size = 512 << 20; - return ASPEED_SDMC_AST2600_512MB; + s->ram_size = 1024 << 20; + return ASPEED_SDMC_AST2600_1024MB; } static void aspeed_sdmc_reset(DeviceState *dev) From patchwork Wed Nov 13 00:51:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 11240619 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B054B13B1 for ; Wed, 13 Nov 2019 00:54:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 83A0A21872 for ; Wed, 13 Nov 2019 00:54:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NawExmep" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83A0A21872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUgvh-0003JU-Lw for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 19:54:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54300) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUgtR-0001SH-CL for qemu-devel@nongnu.org; Tue, 12 Nov 2019 19:52:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUgtQ-0005JA-CE for qemu-devel@nongnu.org; Tue, 12 Nov 2019 19:52:21 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:41377) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUgtO-0005IL-33; Tue, 12 Nov 2019 19:52:18 -0500 Received: by mail-pl1-x642.google.com with SMTP id d29so276768plj.8; Tue, 12 Nov 2019 16:52:18 -0800 (PST) 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=JHNUboLiwnMy8/zIcCYpOfkRFQBDDIonvvSVwq8TfVc=; b=NawExmepWfryxT3Y/BhVLWQa2IGjmfPs+mdklEQWUOPEdzj5gosO64tZi2xG+reloB 5vgMpEC48H0yB2HLEZueLFc0Y8PzNtwGDUN+r12fBJtqaML0b1QaC0e1TeTAZvuFPWPV gotPJl8ZggkteY9LvZc2/Cb4WsXTVpqyU6GZRAfmh+gxzy2n7jrHWrzISIrlF2DfB3p+ wnI1k9Zxiw8Nuo9cg/yqs0tqVdS2geIl/fyyLKG6UmC02tKE0/hRSoP7eb+UscROQ4ol Aj9FdHH/VPji1e0375IS5DIK0MsdyEJHTbcgIxdshBDd7zISJSqOVM8yaPc5gf5QuApH 74Mg== 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=JHNUboLiwnMy8/zIcCYpOfkRFQBDDIonvvSVwq8TfVc=; b=ozPSR6HrXySNaN7qUMZ2zUKFmzRKNqqjhrp3L/NdSjpRZSIMLz9IIOhRNgKKbGDFiI dKSH4jLXBHmzR/34xVIPiL0UqWeV68ENVhvcMiMyLB/rNrxdMjfcOUwQCZBACRkA7uoS tYRQPiyQ68QWGpNzMzy51t7qpYTB8sjj6VLFbmQ1bbraeRY3Ge9tMg6sM/Lo7QpoXk+s HvHUmE7dvNCu3YNHYQIaaYq5Ebpt8t1QepO7tBudlKnd3d+Tp2VM96XugYhtkSMP9kD7 KBlSrw1Z54kv0717TGt2axJk2wddqsjiMphrHCEa8fCrIMnahQ9oIovS1eCxQWjTYPta Pzrg== X-Gm-Message-State: APjAAAXbZyB2RSYfn4jj86089Wae12t6EIhKetHRNWHvzA1+Z1n7tbPX yX+AxqjwS1Lkr1xqYDykEeo= X-Google-Smtp-Source: APXvYqzM7/J537U86vTXGOlt9055IM+EFcJoDvodefwEEVtVww0mJLKDt6Vcz6Rc7pUn2KtrQJW82A== X-Received: by 2002:a17:902:ff0f:: with SMTP id f15mr747220plj.52.1573606336867; Tue, 12 Nov 2019 16:52:16 -0800 (PST) Received: from voyager.ozlabs.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id i13sm169848pfo.39.2019.11.12.16.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 16:52:16 -0800 (PST) From: Joel Stanley To: Peter Maydell , =?utf-8?q?C=C3=A9dric_Le_Goate?= =?utf-8?q?r?= Subject: [PATCH v2 2/4] aspeed/scu: Fix W1C behavior Date: Wed, 13 Nov 2019 11:21:59 +1030 Message-Id: <20191113005201.19005-3-joel@jms.id.au> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191113005201.19005-1-joel@jms.id.au> References: <20191113005201.19005-1-joel@jms.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 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: Andrew Jeffery , qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This models the clock write one to clear registers, and fixes up some incorrect behavior in all of the write to clear registers. There was also a typo in one of the register definitions. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley Reviewed-by: Alex Bennée --- hw/misc/aspeed_scu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c index 717509bc5460..aac4645f8c3c 100644 --- a/hw/misc/aspeed_scu.c +++ b/hw/misc/aspeed_scu.c @@ -98,7 +98,7 @@ #define AST2600_CLK_STOP_CTRL TO_REG(0x80) #define AST2600_CLK_STOP_CTRL_CLR TO_REG(0x84) #define AST2600_CLK_STOP_CTRL2 TO_REG(0x90) -#define AST2600_CLK_STOP_CTR2L_CLR TO_REG(0x94) +#define AST2600_CLK_STOP_CTRL2_CLR TO_REG(0x94) #define AST2600_SDRAM_HANDSHAKE TO_REG(0x100) #define AST2600_HPLL_PARAM TO_REG(0x200) #define AST2600_HPLL_EXT TO_REG(0x204) @@ -532,11 +532,12 @@ static uint64_t aspeed_ast2600_scu_read(void *opaque, hwaddr offset, return s->regs[reg]; } -static void aspeed_ast2600_scu_write(void *opaque, hwaddr offset, uint64_t data, +static void aspeed_ast2600_scu_write(void *opaque, hwaddr offset, uint64_t data64, unsigned size) { AspeedSCUState *s = ASPEED_SCU(opaque); int reg = TO_REG(offset); + uint32_t data = data64; if (reg >= ASPEED_AST2600_SCU_NR_REGS) { qemu_log_mask(LOG_GUEST_ERROR, @@ -563,15 +564,19 @@ static void aspeed_ast2600_scu_write(void *opaque, hwaddr offset, uint64_t data, /* fall through */ case AST2600_SYS_RST_CTRL: case AST2600_SYS_RST_CTRL2: + case AST2600_CLK_STOP_CTRL: + case AST2600_CLK_STOP_CTRL2: /* W1S (Write 1 to set) registers */ s->regs[reg] |= data; return; case AST2600_SYS_RST_CTRL_CLR: case AST2600_SYS_RST_CTRL2_CLR: + case AST2600_CLK_STOP_CTRL_CLR: + case AST2600_CLK_STOP_CTRL2_CLR: case AST2600_HW_STRAP1_CLR: case AST2600_HW_STRAP2_CLR: /* W1C (Write 1 to clear) registers */ - s->regs[reg] &= ~data; + s->regs[reg - 1] &= ~data; return; case AST2600_RNG_DATA: From patchwork Wed Nov 13 00:52:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 11240617 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4151B14E5 for ; Wed, 13 Nov 2019 00:54:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15E4C21872 for ; Wed, 13 Nov 2019 00:54:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lePXLF7A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15E4C21872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUgvc-0003Cg-59 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 19:54:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54322) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUgtT-0001VD-Vq for qemu-devel@nongnu.org; Tue, 12 Nov 2019 19:52:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUgtT-0005K0-1P for qemu-devel@nongnu.org; Tue, 12 Nov 2019 19:52:23 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:43754) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUgtQ-0005JE-VB; Tue, 12 Nov 2019 19:52:21 -0500 Received: by mail-pg1-x544.google.com with SMTP id l24so150809pgh.10; Tue, 12 Nov 2019 16:52:20 -0800 (PST) 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=aNfFczhM8NYMoBpUcEwP04hyJCPiYk7J/QnyzWmI2l8=; b=lePXLF7AcSFkiDMl6Or4EyDx6Sa5+DayZIMfs8WYoO61KhqXFZdHA2BYG+jWj6t87l O/mtH/omXWKOtO2Ogig7yUxIj6Naq/nHLm1HmZGb4vCWyKrnE11m558QfaKmvdlTPey9 T8EHF42FPTUJRX/lPWYfuJbWyqTv672XJkC+elSQMZvGWJcy0yxl2VI0/SG+AJwB7ETH Ul+zQFBO0w0x4VcxpRkP5aYxLkFnj4TIlfS+XoANp1BlJK/NvKqgaiwPwdXMyp8js4Y0 WOUJb0UgJghKvEyJAOw5UfvMW0NfZzq1sNR+HHdux8V0J9/JGdLzajnO46uBoIPN/snP Na9w== 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=aNfFczhM8NYMoBpUcEwP04hyJCPiYk7J/QnyzWmI2l8=; b=Q1vbK9lK/Ch28B2KwpOTurG6wEWTOWBIvDjotey71hDJqLa/hUkYAsrN2MmX8oxsXe bOXBgSo72TlRU/uAfk2XWXjw+McVtLMVabLymcex8/gtEugA7slz5Bk0sjMMxxBIuNYo yLRUMKSumM54JhSEWSuTko49BvB6k9oOXYjHsUBIaQskpLK1u8lLXBPGAJp85v7jsYO0 ptGKpqMh+pZJR7l7fy9xtyWszGxWhPauypZV88iXdROykva2C/GFJWlUME4+61gd+lq1 /hwXRx8XpM1brb8e50LKqXzkSMPO/Q21tdRGp/a4h2U6DkLApYOKiRD5BLeD9Tczg6s4 87Og== X-Gm-Message-State: APjAAAUBl5o/IzLpERqr5TXkryCdk4uJDQq4O1vfUqs/ec/sHSs8an9r EPdR15AyQXvCFnqdSNHgTF8= X-Google-Smtp-Source: APXvYqzaZR0YirggX2ER41wzyMX4gPg5r9s+OsA6a96F3FNdJBFn5QwMH4cEhhdv8wBdx/9qQ67MVA== X-Received: by 2002:aa7:9314:: with SMTP id 20mr897065pfj.231.1573606339846; Tue, 12 Nov 2019 16:52:19 -0800 (PST) Received: from voyager.ozlabs.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id i13sm169848pfo.39.2019.11.12.16.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 16:52:19 -0800 (PST) From: Joel Stanley To: Peter Maydell , =?utf-8?q?C=C3=A9dric_Le_Goate?= =?utf-8?q?r?= Subject: [PATCH v2 3/4] watchdog/aspeed: Improve watchdog timeout message Date: Wed, 13 Nov 2019 11:22:00 +1030 Message-Id: <20191113005201.19005-4-joel@jms.id.au> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191113005201.19005-1-joel@jms.id.au> References: <20191113005201.19005-1-joel@jms.id.au> MIME-Version: 1.0 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: Andrew Jeffery , qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Users benefit from knowing which watchdog timer has expired. The address of the watchdog's registers unambiguously indicates which has expired, so log that. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley Reviewed-by: Alex Bennée --- v2: Use HWADDR_PRIx --- hw/watchdog/wdt_aspeed.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c index 145be6f99ce2..8787c5ad0f97 100644 --- a/hw/watchdog/wdt_aspeed.c +++ b/hw/watchdog/wdt_aspeed.c @@ -219,7 +219,8 @@ static void aspeed_wdt_timer_expired(void *dev) return; } - qemu_log_mask(CPU_LOG_RESET, "Watchdog timer expired.\n"); + qemu_log_mask(CPU_LOG_RESET, "Watchdog timer %" HWADDR_PRIx " expired.\n", + s->iomem.addr); watchdog_perform_action(); timer_del(s->timer); } From patchwork Wed Nov 13 00:52:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 11240625 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17C621515 for ; Wed, 13 Nov 2019 01:02:20 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D98AA21E6F for ; Wed, 13 Nov 2019 01:02:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AmedqT/y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D98AA21E6F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUh34-0007Kk-SK for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 20:02:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54352) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUgta-0001Y6-4r for qemu-devel@nongnu.org; Tue, 12 Nov 2019 19:52:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUgtY-0005LH-Uc for qemu-devel@nongnu.org; Tue, 12 Nov 2019 19:52:30 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:38606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUgtU-0005K8-1P; Tue, 12 Nov 2019 19:52:24 -0500 Received: by mail-pg1-x541.google.com with SMTP id 15so169623pgh.5; Tue, 12 Nov 2019 16:52:23 -0800 (PST) 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=69JEq1ljDXyHeKt9u+I4iV39ni/MWZMig/OklbPPAFo=; b=AmedqT/ypEk0jFibhlPxFaz1RYCARtLfspAqPXQ2kQJfniym7juPQGVAcuWGuag11L 4Bw+qgzs9yWYtMnTjzin1fJmWntop5jw7Fm+HH7tC8JQRzciC9rWudA3MQ+LDxdrz5U1 YauVmLH6tnmdB3RXNbd6+ec5KM7Vo8YuJSmcHB811Vlo5odm5JTLBaDOYqGZvsbPQJml 3niV6NQQNbMWXh7DlGGOdW46axI8wxoKopecw3aCt1iyT1TXQXiU2AnMeSuuXbewkOny Fl7/KXwyQGtrTs6EyAZ0qbZ4RogOA5VZuPM9Gows6aAsQx6T/eU3kcAjt3UTFoePLfJ7 uYwg== 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=69JEq1ljDXyHeKt9u+I4iV39ni/MWZMig/OklbPPAFo=; b=KuNA2ROQ+pG6VKwdwXFgcSEzVLbm4TZAQs0YeFq5g9n+sCVpC08lsAi9oQI1YlrqnV o9bVpNuSqC1db4ltnKp2EJw7f+p4IRv97mNa2Aq/GmYkrGKovEBreZ6ehkG1jUHe7i1F E0FqVWbx77ifqjDx+VW6VBaJzaoVZ8WvR6PgIaLx+owTBoJaw4ePcUZ597Pk+wewPXOA AuXtQXJlJd8SDwL38BuydoCzXi6YvMxryU2r/KVztaTPmvKsI5EfrwbPb8PbaWJVfeEf 7VjLBHZoCL44O1LP/H1zdSckmxPHwEb8e+7NuWQ9Si2wNpVMaIcT2t2pVv/+TeZeGuqk f9pQ== X-Gm-Message-State: APjAAAVTLvddvFUocB0KFp394/8lPPNmquFu84X/gYOxzEP+We+mNq4Q cEeKP4QoNQ1j3ZOb0j3RprU= X-Google-Smtp-Source: APXvYqw5PXQN99bT0X3yFG5Qvc8C/cy/do4EhrEVIV6IfSExcICJDfI9deCrxc2aLvHMN+uJugLSeA== X-Received: by 2002:a17:90a:8083:: with SMTP id c3mr937501pjn.92.1573606342926; Tue, 12 Nov 2019 16:52:22 -0800 (PST) Received: from voyager.ozlabs.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id i13sm169848pfo.39.2019.11.12.16.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 16:52:22 -0800 (PST) From: Joel Stanley To: Peter Maydell , =?utf-8?q?C=C3=A9dric_Le_Goate?= =?utf-8?q?r?= Subject: [PATCH v2 4/4] watchdog/aspeed: Fix AST2600 frequency behaviour Date: Wed, 13 Nov 2019 11:22:01 +1030 Message-Id: <20191113005201.19005-5-joel@jms.id.au> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191113005201.19005-1-joel@jms.id.au> References: <20191113005201.19005-1-joel@jms.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 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: Andrew Jeffery , qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The AST2600 control register sneakily changed the meaning of bit 4 without anyone noticing. It no longer controls the 1MHz vs APB clock select, and instead always runs at 1MHz. The AST2500 was always 1MHz too, but it retained bit 4, making it read only. We can model both using the same fixed 1MHz calculation. Fixes: 6b2b2a703cad ("hw: wdt_aspeed: Add AST2600 support") Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley Reviewed-by: Alex Bennée --- v2: Fix Fixes line in commit message --- hw/watchdog/wdt_aspeed.c | 21 +++++++++++++++++---- include/hw/watchdog/wdt_aspeed.h | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c index 8787c5ad0f97..9a8a2200fd8e 100644 --- a/hw/watchdog/wdt_aspeed.c +++ b/hw/watchdog/wdt_aspeed.c @@ -93,11 +93,11 @@ static uint64_t aspeed_wdt_read(void *opaque, hwaddr offset, unsigned size) } -static void aspeed_wdt_reload(AspeedWDTState *s, bool pclk) +static void aspeed_wdt_reload(AspeedWDTState *s) { uint64_t reload; - if (pclk) { + if (!(s->regs[WDT_CTRL] & WDT_CTRL_1MHZ_CLK)) { reload = muldiv64(s->regs[WDT_RELOAD_VALUE], NANOSECONDS_PER_SECOND, s->pclk_freq); } else { @@ -109,6 +109,16 @@ static void aspeed_wdt_reload(AspeedWDTState *s, bool pclk) } } +static void aspeed_wdt_reload_1mhz(AspeedWDTState *s) +{ + uint64_t reload = s->regs[WDT_RELOAD_VALUE] * 1000ULL; + + if (aspeed_wdt_is_enabled(s)) { + timer_mod(s->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + reload); + } +} + + static void aspeed_wdt_write(void *opaque, hwaddr offset, uint64_t data, unsigned size) { @@ -130,13 +140,13 @@ static void aspeed_wdt_write(void *opaque, hwaddr offset, uint64_t data, case WDT_RESTART: if ((data & 0xFFFF) == WDT_RESTART_MAGIC) { s->regs[WDT_STATUS] = s->regs[WDT_RELOAD_VALUE]; - aspeed_wdt_reload(s, !(s->regs[WDT_CTRL] & WDT_CTRL_1MHZ_CLK)); + awc->wdt_reload(s); } break; case WDT_CTRL: if (enable && !aspeed_wdt_is_enabled(s)) { s->regs[WDT_CTRL] = data; - aspeed_wdt_reload(s, !(data & WDT_CTRL_1MHZ_CLK)); + awc->wdt_reload(s); } else if (!enable && aspeed_wdt_is_enabled(s)) { s->regs[WDT_CTRL] = data; timer_del(s->timer); @@ -283,6 +293,7 @@ static void aspeed_2400_wdt_class_init(ObjectClass *klass, void *data) awc->offset = 0x20; awc->ext_pulse_width_mask = 0xff; awc->reset_ctrl_reg = SCU_RESET_CONTROL1; + awc->wdt_reload = aspeed_wdt_reload; } static const TypeInfo aspeed_2400_wdt_info = { @@ -317,6 +328,7 @@ static void aspeed_2500_wdt_class_init(ObjectClass *klass, void *data) awc->ext_pulse_width_mask = 0xfffff; awc->reset_ctrl_reg = SCU_RESET_CONTROL1; awc->reset_pulse = aspeed_2500_wdt_reset_pulse; + awc->wdt_reload = aspeed_wdt_reload_1mhz; } static const TypeInfo aspeed_2500_wdt_info = { @@ -336,6 +348,7 @@ static void aspeed_2600_wdt_class_init(ObjectClass *klass, void *data) awc->ext_pulse_width_mask = 0xfffff; /* TODO */ awc->reset_ctrl_reg = AST2600_SCU_RESET_CONTROL1; awc->reset_pulse = aspeed_2500_wdt_reset_pulse; + awc->wdt_reload = aspeed_wdt_reload_1mhz; } static const TypeInfo aspeed_2600_wdt_info = { diff --git a/include/hw/watchdog/wdt_aspeed.h b/include/hw/watchdog/wdt_aspeed.h index dfedd7662dd1..819c22993a6e 100644 --- a/include/hw/watchdog/wdt_aspeed.h +++ b/include/hw/watchdog/wdt_aspeed.h @@ -47,6 +47,7 @@ typedef struct AspeedWDTClass { uint32_t ext_pulse_width_mask; uint32_t reset_ctrl_reg; void (*reset_pulse)(AspeedWDTState *s, uint32_t property); + void (*wdt_reload)(AspeedWDTState *s); } AspeedWDTClass; #endif /* WDT_ASPEED_H */