From patchwork Tue Aug 7 07:57:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 10558301 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51C0F13B4 for ; Tue, 7 Aug 2018 08:00:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 443E229B26 for ; Tue, 7 Aug 2018 08:00:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4244D29B79; Tue, 7 Aug 2018 08:00:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B0CDE29B7E for ; Tue, 7 Aug 2018 08:00:18 +0000 (UTC) Received: from localhost ([::1]:37806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmwuf-00035k-U9 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 07 Aug 2018 04:00:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmwt5-0002nE-RT for qemu-devel@nongnu.org; Tue, 07 Aug 2018 03:58:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fmwt4-0005ba-Tg for qemu-devel@nongnu.org; Tue, 07 Aug 2018 03:58:39 -0400 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:37619) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fmwt1-0005aC-50; Tue, 07 Aug 2018 03:58:35 -0400 Received: by mail-pl0-x243.google.com with SMTP id d5-v6so6783996pll.4; Tue, 07 Aug 2018 00:58: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=SBBr+2QFo4lDT8xlNJTzO+Id2utX2pJW4S/v1I9pHbU=; b=THNI6DW+E2zggu0rxmhQ5+KS61Aoyvujj7lkMguUKtDQTc+Y/nki92f4U4d5rp558U qqVysxUqoQv72z4k2KsVcJ2v8LWwy+CP/UEssn7GwxiSpvHqx775TZWDBWf0FWBz2EKC KqRodvSCwhCNlP0hzWXfZgaMEwVzwcdHWQAZtHXwUASJtY4Angxt5929n1uXmh+DNfxT B80FtZqDkHY/UMg71JWkNq5X65rkyE7jSmwHBZE4L2oB6WAJvU7C82EyCwOuZKPhCw2C ZTF08nICFAauQVGLXfvtFLzSSN6tBc+n5ud7mB4nGs+QwrMoK0CHERCzrfn0tDDqrbx9 Xvsw== 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=SBBr+2QFo4lDT8xlNJTzO+Id2utX2pJW4S/v1I9pHbU=; b=Uf1heWzT6P5rux13DWVbXer+VNx6hSCDg8urf+HFJCZJGFLqX9FvmPy6mLOFZH+J36 Q0ifq3y+kqKj3+yTYUEYxdlYPsw40dY48Sl36HXA0rHs0oXX4OW8QxooBdombrr+b8GZ 3RrXokBN9Vuo0pjqrJpX5tntaXJhrDz1jkqFQyg9DmUANaLbG46jhR22Qjx/h6gQ18HN fVGDDfHLKP9RCMckOhw12Xl1ycXFH2/FxaoP//vjvcuGrUNb3/SvQLFXvOIQ8u3F163V +Kb7mP5MkNRK0fFT9hMXXpZQkAzBSd9FNpiJDtZ6zW8ubdTtO5uXnbFPBSDqyd8WvzVQ HcqA== X-Gm-Message-State: AOUpUlHMh5FTaPdh41l/ECM8WGS2Vh5F4kiXTKmwoosQ8fa0795K+6sQ BvQEiRwsZDK7KpsHL2Npg4UkKptd X-Google-Smtp-Source: AAOMgpeivoal9HQAdQfzCXyUhQIs4L3V/iPSLLDJKuGCn6S4YXA52E6+GwaS4EKbEJ1PJiDQBRSZgg== X-Received: by 2002:a17:902:e005:: with SMTP id ca5-v6mr16848285plb.224.1533628714139; Tue, 07 Aug 2018 00:58:34 -0700 (PDT) Received: from aurora.jms.id.au ([45.124.203.18]) by smtp.gmail.com with ESMTPSA id d191-v6sm1458902pfg.172.2018.08.07.00.58.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Aug 2018 00:58:33 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Tue, 07 Aug 2018 17:28:27 +0930 From: Joel Stanley To: Peter Maydell , =?utf-8?q?C=C3=A9dric_Le_Goate?= =?utf-8?q?r?= Date: Tue, 7 Aug 2018 17:27:54 +0930 Message-Id: <20180807075757.7242-5-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:400e:c01::243 Subject: [Qemu-devel] [PATCH 4/7] aspeed_sdmc: Init status alwlays idle 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The ast2500 SDRAM training routine busy waits on the 'init cycle busy state' bit in DDR PHY Control/Status register #1 (MCR60). This ensures the bit always reads zero, and allows training to complete with upstream u-boot on the ast2500-evb. Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater --- hw/misc/aspeed_sdmc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 9ece545c4ffa..522e01ef8c0d 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -23,6 +23,10 @@ /* Configuration Register */ #define R_CONF (0x04 / 4) +/* Control/Status Register #1 (ast2500) */ +#define R_STATUS1 (0x60 / 4) +#define PHY_BUSY_STATE BIT(0) + /* * Configuration register Ox4 (for Aspeed AST2400 SOC) * @@ -137,6 +141,17 @@ static void aspeed_sdmc_write(void *opaque, hwaddr addr, uint64_t data, g_assert_not_reached(); } } + if (s->silicon_rev == AST2500_A0_SILICON_REV || + s->silicon_rev == AST2500_A1_SILICON_REV) { + switch (addr) { + case R_STATUS1: + /* Will never return 'busy' */ + data &= ~PHY_BUSY_STATE; + break; + default: + break; + } + } s->regs[addr] = data; }