From patchwork Tue Nov 12 06:40:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 11238619 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 5929316B1 for ; Tue, 12 Nov 2019 06:43:30 +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 2F461214E0 for ; Tue, 12 Nov 2019 06:43:30 +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="Y2s50m4X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F461214E0 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]:59454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUPth-00057m-80 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 01:43:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57893) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUPrV-0003JC-5P for qemu-devel@nongnu.org; Tue, 12 Nov 2019 01:41:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUPrU-0007M0-6K for qemu-devel@nongnu.org; Tue, 12 Nov 2019 01:41:13 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:44996) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUPrS-0007Kk-3B; Tue, 12 Nov 2019 01:41:10 -0500 Received: by mail-pl1-x643.google.com with SMTP id az9so8114328plb.11; Mon, 11 Nov 2019 22:41:10 -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=vr7OAtLxystNKN+NrjrWHkCNh0LuFiDiJrrJhFdZUC4=; b=Y2s50m4XrJwxyYZCwg/2AbvgQCUbirg5dt4UAGPRf8gcoYyGkAZatDg7Jd7koF5vfL 8ylFG/aB2RoXMg+3UIKdC9iad4ApxBLuWkf1aIfCoP15tAKa/3+5Y6kMAKjJQhAyj1Hk 604YQoKDzssLUMb/glsO8Av9GHyPF4u1xXvja3JUcas5+n74eg4UgKXiZH9yTLIhsJdL Zljnlw+sHVRiBxNN3wATc0cIwSn57CcsoxD70hVKeG/avKdbOGOKLOP6zponC+Ollwsy iyVq3z+I19zQjjE9zxCf7/pkktGyeznQbcrVLSxwy85QUE6iXBfM2Nv98r8p7+UPE6rC YAHQ== 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=vr7OAtLxystNKN+NrjrWHkCNh0LuFiDiJrrJhFdZUC4=; b=mpT8ff0FwDcFOViEmbuHx5aoPRJ74SUVleErykGCpzxpOCBuul/nDxPUAGZ4I6lLEz 1uJsgbW9BzFIoA3fL5JN6q96ubuFfME2a627QF911q2TSu26prw2Mtay5Hj642/krnzB nyLEhJqGOGfjUGvi51/j1YvPSvUQ/jhsKDd78lur3WCmsWvmi68bX8H93Ok3KSBf6RHZ 4yW2X4Dqqs2mtbdo8L5OFMc3F7Riq5Ys4t7Uq5Ek56mYk+7/+LKLgzvVLwd0WSDBynlJ I73bo5kTljSn2331iy5N549BrqgN71xrNMFeyo6mtrjcoGPB2Xk43TOCKhz3zjWB2XcX JGPw== X-Gm-Message-State: APjAAAUgNb+S0uBnWoXr+RnyqbdUUbOEmjGJbfR7jiiSuOR45SEKK+Gh saJg2/dTQhr+qgLDuyy1mqQ= X-Google-Smtp-Source: APXvYqzzs3FuqGuZtZtykUFQHOzm9dqFBjuHRsw9vLSvvwhH7olOX/bPX09CoruDjyQbQmhv7fOMxA== X-Received: by 2002:a17:902:326:: with SMTP id 35mr6518256pld.248.1573540868881; Mon, 11 Nov 2019 22:41:08 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id q8sm16375590pgg.15.2019.11.11.22.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 22:41:08 -0800 (PST) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Peter Maydell , Andrew Jeffery Subject: [PATCH 1/4] aspeed/sdmc: Make ast2600 default 1G Date: Tue, 12 Nov 2019 17:10:55 +1030 Message-Id: <20191112064058.13275-2-joel@jms.id.au> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191112064058.13275-1-joel@jms.id.au> References: <20191112064058.13275-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::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: 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. Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater --- 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 Tue Nov 12 06:40:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 11238625 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 1CF0D16B1 for ; Tue, 12 Nov 2019 06:43:53 +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 E6D45214E0 for ; Tue, 12 Nov 2019 06:43:52 +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="T25XHkQu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6D45214E0 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]:59466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUPu3-0005XN-U7 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 01:43:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57918) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUPrZ-0003LL-2o for qemu-devel@nongnu.org; Tue, 12 Nov 2019 01:41:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUPrX-0007Nm-9G for qemu-devel@nongnu.org; Tue, 12 Nov 2019 01:41:16 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:42967) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUPrV-0007MQ-0u; Tue, 12 Nov 2019 01:41:13 -0500 Received: by mail-pl1-x642.google.com with SMTP id j12so8930771plt.9; Mon, 11 Nov 2019 22:41:12 -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=hyG32yXenzdMQwklj1Cf+goAGOB3P8VjL1+e16W2tTQ=; b=T25XHkQuMFS//SzEMcFFkzcPzeHMHwW+FKXOVP+xN0WKIFl8gO9B6p6hXKp+67ICUX R6v40fhNnvTS3addm2IwaiHazkqNHvD21omuB18oDhF+4oX2C3qudc1F6Qw4BCT75yTE tDHyLao8IRlCTproIzoc+VvOSclCnnNZyhXk9CwaVxezkMoZToeFUxxUg5fEwcZHpEO1 54GytjunDddPrvyDYnu/oLaRj8g9v0XJ3riXrSiu8oH+peyHu4R0S4dTIwzyyZsYh9Rn RDYdFwGlTQDC7hbmwFzbZbpMZOoORjL2GZOdklUfdmNqBqCgXjKtXytzUWS99mw4aXCI Ga2Q== 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=hyG32yXenzdMQwklj1Cf+goAGOB3P8VjL1+e16W2tTQ=; b=OGJArxSJPVoQyfXi5Tk4/zg87P5cZ/EBPFV1549FSusrpRH0ltFiXOxuB0olJTxKxA wKwjKbqlMbBwqTwQgqmsDktx2xg7o42d9SXDqUzqbZ6vr91JX2ofj072NZ4NPuSrH8mH MDmdaYCou12o4GAhQj+Py8tyMlpPXGu2gHXazG0ehSmlaGPhl8UQdCfcys/5RHj7GZ03 nLYf3PwSExdfaO+eUZTESsQOJB+LSlfZJ1k7xb1/xqPn7GqhUp8QnOYfmfA840mmHL3g 2tohzKUwoQlUGEIDn+w++cAh7/cfsL+Ub009PWBQLBMVfM7UbeI21kx2yBmsIBIKYUuu 8SYA== X-Gm-Message-State: APjAAAU2mdOcUiP+spkzwr2M98Aa42gcD05tHYhZWA2HF591ctitxWQu IBExbBDqUqnU4IXyP3lnvthsquSNmHg= X-Google-Smtp-Source: APXvYqzvn/n4vy4/wOsgGlP3NDaFhTx244joNQdxrljeIoW1rIEzTMq+mX3dZjrpcQoYPpRH0hY86g== X-Received: by 2002:a17:902:8208:: with SMTP id x8mr30463850pln.6.1573540871933; Mon, 11 Nov 2019 22:41:11 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id q8sm16375590pgg.15.2019.11.11.22.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 22:41:11 -0800 (PST) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Peter Maydell , Andrew Jeffery Subject: [PATCH 2/4] aspeed/scu: Fix W1C behavior Date: Tue, 12 Nov 2019 17:10:56 +1030 Message-Id: <20191112064058.13275-3-joel@jms.id.au> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191112064058.13275-1-joel@jms.id.au> References: <20191112064058.13275-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: 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. Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater --- 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 Tue Nov 12 06:40:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 11238623 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 1AF4D16B1 for ; Tue, 12 Nov 2019 06:43:49 +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 E4BA6214E0 for ; Tue, 12 Nov 2019 06:43:48 +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="munbN8Jj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4BA6214E0 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]:59460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUPtz-0005Tz-SE for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 01:43:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57951) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUPrd-0003Mc-Jg for qemu-devel@nongnu.org; Tue, 12 Nov 2019 01:41:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUPrc-0007QW-Iv for qemu-devel@nongnu.org; Tue, 12 Nov 2019 01:41:21 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:39035) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUPrY-0007O0-Ld; Tue, 12 Nov 2019 01:41:16 -0500 Received: by mail-pg1-x541.google.com with SMTP id 29so11180175pgm.6; Mon, 11 Nov 2019 22:41:16 -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=j37H1qa+h9fHDfjTASOPnrg2HuSkQw6LSGgwlJ4L1BI=; b=munbN8JjSqEXfb42+yBm1Gw05N9mU52wiSskJnU7YntaW5je8OsU3VO8GqzLdAT6ZA aar8hkWM0ILovvTGBbVHpMZXgQv5h8BrU3q5wCQEUb+aPXP60KUdc7VOTua2Z4wsXBGx n3ClqjyFNmfc9TbpJgDNj1YaS9J1KG3LVGxfxg5KZW6sg8+8bOGugsRWhZVoKJXpK8Th 5Fyc6bNKU4CO7wKDyGIfaMjQ7J5SqDsM2G2Ow5Idcp/yy5yVzLQ8Dc3XCmKETM4kHOzn 5LNWoZWa2G0aTdkeCFJY/SeRCC0WODRFkEaVJLmrvK8tMLV6vSDKiMpC6ezo8EEwzu0b n7GQ== 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=j37H1qa+h9fHDfjTASOPnrg2HuSkQw6LSGgwlJ4L1BI=; b=jdMzzQ2NstfTltWQSu0HaqK4LeQR/pPmgyV5RqDUepDsztnXypgdWRxBmlTUcixvTy OHy95CfQhfqLAym4u+iC3YwMAR9NdEFQ1nZL5Oatkz358bTwYqUNUnswcLYEI+O8vgAU h5lySxRZVHM0R87s3zDIdm4VgyqOgACu2VNEwGgowOKYgtwoW7a5FrpgYCEvcpILeXUh pzx6Vtc8Jv+INrcEQdPLMUSalpm/uaLAaLtPcBXXoxGJx18iBs9ueSsPEjzHJFqnlvbe u7FbtyU008D/bNNfBoPaWjijrv7CMcLpfcMQ7JoO0jXMCFKhhSYQo1evXQtzwuIB8d3e ds+w== X-Gm-Message-State: APjAAAWXd3ShUyKME6ltEtOxuKA4PU8rXsDYaBFOY4XYnzSh9woPCTNb sTvboyxz+Kkoou+Z8sq1O4o= X-Google-Smtp-Source: APXvYqz7FOSyX/dYD2dqFlp3f5xEt1LTmd6MSzexY1TghuZzJaPxcFCVmRl2ueURCXApNW88tASDPg== X-Received: by 2002:a17:90a:e90:: with SMTP id 16mr4277177pjx.65.1573540875064; Mon, 11 Nov 2019 22:41:15 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id q8sm16375590pgg.15.2019.11.11.22.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 22:41:14 -0800 (PST) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Peter Maydell , Andrew Jeffery Subject: [PATCH 3/4] watchdog/aspeed: Improve watchdog timeout message Date: Tue, 12 Nov 2019 17:10:57 +1030 Message-Id: <20191112064058.13275-4-joel@jms.id.au> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191112064058.13275-1-joel@jms.id.au> References: <20191112064058.13275-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: 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. Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater --- 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..5697ed83325a 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 %08lx expired.\n", + s->iomem.addr); watchdog_perform_action(); timer_del(s->timer); } From patchwork Tue Nov 12 06:40: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: 11238633 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 91EEB13B1 for ; Tue, 12 Nov 2019 06:49:54 +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 6804A2084F for ; Tue, 12 Nov 2019 06:49:54 +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="dnD1fKL2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6804A2084F 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]:59518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUPzt-0002ZX-Aa for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 01:49:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57979) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUPri-0003P6-Ky for qemu-devel@nongnu.org; Tue, 12 Nov 2019 01:41:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUPrh-0007Ur-AC for qemu-devel@nongnu.org; Tue, 12 Nov 2019 01:41:26 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:37861) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUPrc-0007PL-3N; Tue, 12 Nov 2019 01:41:20 -0500 Received: by mail-pg1-x544.google.com with SMTP id z24so11189354pgu.4; Mon, 11 Nov 2019 22:41:19 -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=ViOcwrGNNJLxaLFTqLvWuJzL8hqpUFzYbRzOh1R/JSc=; b=dnD1fKL2tM9LQR9v2+PDwJjqCOdKqvguQL2/27vf/A0vw8z0ZTML8ib0yY8SMHEatk RBGJSC1Kv08ESNmJ9GsvUT4RucIk5i7O4M/2H9nZgZKgA4hAwFkrN9imHGnpJdA7SsC9 hZC7PM7EhSsyLsRqGbNOEKm6AXRgj+BvTZQmmS/K1vjwgnq3d7khBNNhXWjGW6RpXt+q 68zdZtsLwmC5tfnyd2jCIU7kEGsui9LSX4gNv8MUsYmHZsFh3ONNpgO4ZpCbtPltmg05 L5L+iV7Qgv61pKonjdAcBpIWuWgwOHvK54xGveX3Kg+MZMO85UGK4L1E60QI13+9ffMk ADSg== 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=ViOcwrGNNJLxaLFTqLvWuJzL8hqpUFzYbRzOh1R/JSc=; b=iPKD3ge1yOfFYvLTfp7tMApGf7AiBJtM5bJO4nalWUmEUgVAwqyMwS7OyG6L0OPgRc gQXgW4v9HT3OgsHORRBHkId0thgjyZkwd7vTnbUgP6gbWf2jxl9vk3NSzNpdegUM8VIn eUrLP0GCV3h2PAQoJfO94PMjRJw+R3SLA0hnL6ZsW8MyceregNoeGG2GJFGRZrqMyLqJ cIyW0XSTYGX5R2ZifbJtf5aauoH8ZQ8EFPy8pNsgCZ3uv4Pgkz2vhTTT83zkyZ6qRPCq NIv3fVqMDjzF8Pi+HYCM4EUFOi8pbY6JUwgUsVmkdO1eLua2QGFcEVsWebul8j7ZpXUx g6TQ== X-Gm-Message-State: APjAAAX3gBc2AcNhjA5mjF5uPACQBpCkzr9AbaYYVd95NheZZpJycv2V ai3iPufzGno9EvYs31pXIUY= X-Google-Smtp-Source: APXvYqzciZl4YQlwvwwd+6hxm+HSReIGwZmk9f6i8rmUwjxBG2YWkvC0H3OYDV0vdmBQP1mBbl0u7g== X-Received: by 2002:aa7:9618:: with SMTP id q24mr6313479pfg.229.1573540878044; Mon, 11 Nov 2019 22:41:18 -0800 (PST) Received: from voyager.ibm.com ([36.255.48.244]) by smtp.gmail.com with ESMTPSA id q8sm16375590pgg.15.2019.11.11.22.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 22:41:17 -0800 (PST) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Peter Maydell , Andrew Jeffery Subject: [PATCH 4/4] watchdog/aspeed: Fix AST2600 frequency behaviour Date: Tue, 12 Nov 2019 17:10:58 +1030 Message-Id: <20191112064058.13275-5-joel@jms.id.au> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191112064058.13275-1-joel@jms.id.au> References: <20191112064058.13275-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: 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: ea29711f467f ("watchdog/aspeed: Fix AST2600 control reg behaviour") Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater --- 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 5697ed83325a..f43a3bc88976 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 */