From patchwork Tue Aug 7 07:57:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 143569 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4201476ljj; Tue, 7 Aug 2018 01:04:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcq9iQJtGSmxpkutTTwXO8WIzGFpG5GWdoG1fesxo7zgKNy/1vjk6jeBTUmBogFgIeZAcqM X-Received: by 2002:a37:6251:: with SMTP id w78-v6mr16544420qkb.364.1533629048595; Tue, 07 Aug 2018 01:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533629048; cv=none; d=google.com; s=arc-20160816; b=m2NcrRjamp+4xrBhT5ogn+hFrPJQ2IPp8hdV+sLL/4KbdNtJzSZdV+X1AyLZuFSxDi qiNxfLr8W2KYxDYn4a74bMWKwrxqiyJSn2oVZ2c4cMUi4a0oEtiT+TGBpPD/7dIg2isW n+SZQynW1EYpKf5uYO4tL+3JsZhZo7PI3EL9UhsmIeU0ZwJ/oBhLsAHVRnQj/KcsLO4B zkZSQr4FhBrw8OSxXTvsCvcZoLNewhgFeFWW2ZeLa5Tro3xyqf/4cFdzXPqajKQiFxW2 iLJo9elBwVPbbNzCFWCuOOvbedK3DL7uI0urnTHuxyAJBAl7jOR8hhapBWJjesyvPsel yWkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=EllvPOZEw1edECiX0N9er7aLKQoz9Nd8QHRRtVYO/4I=; b=kJeBdG96sHJjn0AFTYHjNFYco8nmUppz7/NpILb8o5qF+n/VFffOatjNGcnEfzGgje 0DkI0xQHVlgD7NX0CY5+fiCzGQcqErkpR7G/lRFGRHU//67Zba0zdHnUH7PwM/O716hU BsF5/qEUyv0DQhOyo38GQnqqhkjzPHKY7Jf/o8zkbZicrFz6UxoPNvxNINp4lfMa6XFU kHHEZLTHi7rrq8UEjPJDO1xL9iSfKCnkmab7fxu7lLg/wQ+eF6c7FtdfScRSC3DY+Z3i U3U9kONTfBSEDqbc+dgzhZO87eJdNR5GagcGyTRasFT7v51xR+jVraOAU8W7MOgBhILA kHtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=PBgjlK9t; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u87-v6si409240qkl.29.2018.08.07.01.04.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Aug 2018 01:04:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=PBgjlK9t; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:37835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmwyO-0006jZ-4M for patch@linaro.org; Tue, 07 Aug 2018 04:04:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmwtI-0002xl-58 for qemu-devel@nongnu.org; Tue, 07 Aug 2018 03:58:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fmwtH-0005fG-Fz for qemu-devel@nongnu.org; Tue, 07 Aug 2018 03:58:52 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:41901) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fmwt8-0005cC-Fg; Tue, 07 Aug 2018 03:58:42 -0400 Received: by mail-pg1-x541.google.com with SMTP id z8-v6so7449794pgu.8; Tue, 07 Aug 2018 00:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EllvPOZEw1edECiX0N9er7aLKQoz9Nd8QHRRtVYO/4I=; b=PBgjlK9tEXncFLetaov1pBs837YkSAhe6YcyF6pG/SDh07cuRtsu8tEdyn7HFYvvJJ FDCc+AHzHRS9/mm0JLn2eiD3wbTgTbZQ4bIUuQAHZbADnv4sBsgFajyPbq+0AArKCzIH 5xXJYDbydHZljKfZfhXyNwoGdRL5w3RkqvaWNgLVtjde8WA86riBcFRkrFLXQ26XKXxe wuWRgG1PzW24jxtVO2gkl98eFJipUe7G2AILvo6zcejjfZkDSexjDrEtcN1oMjx10YvU 4WRTsmEVy3Hh90NHHRuxrXNvYGZ7nSJTctmGsw5WWB04Bklsvspulan/7Ie9NnCGkiEp ImIg== 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=EllvPOZEw1edECiX0N9er7aLKQoz9Nd8QHRRtVYO/4I=; b=tIWL/+9F81WtUfzg+zOpr0jwPgAhOnTJuhUWorB3XyImayGqRTOb9/EeAYjUAj54SZ +wZaPoFfN1ciTnkoJnfrAnYhumyh4c80qrG1R4qkHm4Y91nZUbKg4oBfFjxjWRFupK69 IrAZ9sCmLttNwR+C18lcVEB4dYFVi9XBNJ1TaKpxGjHO1zOUf2lJgABDHKWvJ5+tt7VS Zn2d8iLmjjrZuAX7a6DZ0oSzsY0gyPDM+/7VGQb+QBuJ6kOXPdfnSCi29uNOBN4qgpj8 7odZ6Cm8r6mEDQmcP+ZgmoCcH/WzMrfp9z5+RZ/p2CtL2lNK8p5M22+Z9uF2qvg5dl6Z rycg== X-Gm-Message-State: AOUpUlGDfT3TILd4er5Re7lXFfUHABjSGfOEGaJUvZJ5kyEz60gNxvwh kz20yjGMU13SNGEEDf5DEF0Az9RM X-Received: by 2002:a62:225d:: with SMTP id i90-v6mr20373221pfi.246.1533628721376; Tue, 07 Aug 2018 00:58:41 -0700 (PDT) Received: from aurora.jms.id.au ([45.124.203.18]) by smtp.gmail.com with ESMTPSA id d191-v6sm1459491pfg.172.2018.08.07.00.58.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Aug 2018 00:58:40 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Tue, 07 Aug 2018 17:28:34 +0930 From: Joel Stanley To: Peter Maydell , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Date: Tue, 7 Aug 2018 17:27:55 +0930 Message-Id: <20180807075757.7242-6-joel@jms.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180807075757.7242-1-joel@jms.id.au> References: <20180807075757.7242-1-joel@jms.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 Subject: [Qemu-devel] [PATCH 5/7] aspeed_sdmc: Handle ECC training X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is required to ensure u-boot SDRAM training completes. Signed-off-by: Joel Stanley --- hw/misc/aspeed_sdmc.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.17.1 Reviewed-by: Cédric Le Goater diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 522e01ef8c0d..89de3138aff0 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -27,6 +27,10 @@ #define R_STATUS1 (0x60 / 4) #define PHY_BUSY_STATE BIT(0) +#define R_ECC_TEST_CTRL (0x70 / 4) +#define ECC_TEST_FINISHED BIT(12) +#define ECC_TEST_FAIL BIT(13) + /* * Configuration register Ox4 (for Aspeed AST2400 SOC) * @@ -148,6 +152,11 @@ static void aspeed_sdmc_write(void *opaque, hwaddr addr, uint64_t data, /* Will never return 'busy' */ data &= ~PHY_BUSY_STATE; break; + case R_ECC_TEST_CTRL: + /* Always done, always happy */ + data |= ECC_TEST_FINISHED; + data &= ~ECC_TEST_FAIL; + break; default: break; }