Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF5C1C76196 for ; Mon, 3 Apr 2023 04:43:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3C9C985DFC; Mon, 3 Apr 2023 06:43:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pPP4Prob"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 129DC85E34; Mon, 3 Apr 2023 06:43:01 +0200 (CEST) Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6098C85E01 for ; Mon, 3 Apr 2023 06:42:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mibodhi@gmail.com Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-5463fa0c2bfso198659047b3.1 for ; Sun, 02 Apr 2023 21:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680496976; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dB/T9F5GasfhWBkcznD7UZ5I5Hukqbm3buDFYGxDFbM=; b=pPP4ProbcMNmn0FVfSrsv9gG0yh3vqVjJ6yU/NZzCtHq4wAH5NNEfcUt3aPkbChLYJ fqQ9RvLR1jRN4DLnC5fgN7o0+eldZDVoUmRnDjyieDN62+3/B97xaRfkoEQcn+0yRW9n 7jolMRQc9hZzwp8R+8VKEsC+JA16KbQkwiux/EMVwGE9Yw9xklEW8MvlufJo7RUfjqtl ln3Sg6o+PKrVGyd9TVK2UIzchmojnjsFw+veCWhWEepNpZ6VuJeppdg6VsR81V+jwRSz 1tE7nTKg7KxPB15pCkftkco3c7bRXylrl0/L1md93Hv6e9ECHGeXFiingZ5ThvLNeJHa LoGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680496976; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dB/T9F5GasfhWBkcznD7UZ5I5Hukqbm3buDFYGxDFbM=; b=erDvvJD7yCFnRSxaHKhzwPsVUnXtIxpooYm29/Ic9YYddJTcCvFoh1VpdCkXeeLLh5 4I4Fs4JbwkoxeLxDMAryrpDEOhJK1Ll2U1HtyQLw3R6gU4fyNODCLwMWYHOpDvUihabv uqFtBtO24l9aBp0Rc80/+30AG9wxWXjGg9mi+QT2+1L+s2+j/M5kT96Dq0fwPoIbP62s 2/fcGZovK2GUJ4G8PgVkCcW+JRv8I4Gja9s1doAtB8jGmAVZCjerZFiq3otlIFMSJhAp GAYq8tQ7ZG6K9+LhGOMI1OTQ2Gk1SPBXdwaUpH1z6UbxVXebey4iD1miHyXaWqRIpTy4 EoLQ== X-Gm-Message-State: AAQBX9ct8uygiy6ZuNUU7NE7JWGo9A0TOF40GB8WNqu1Nc+Z+rtv815l WM3g67tt4YA4rxJq9UugRn+Rtk0agF0= X-Google-Smtp-Source: AKy350ZnUufLPgG+qaJC6tmZaECMbySje1nkxslRCz4Hampzyv9qehaF3WndNe1bVbThnMWnMMNQFg== X-Received: by 2002:a0d:d496:0:b0:544:4002:58d8 with SMTP id w144-20020a0dd496000000b00544400258d8mr31996495ywd.17.1680496976704; Sun, 02 Apr 2023 21:42:56 -0700 (PDT) Received: from localhost.localdomain (76-229-100-169.lightspeed.irvnca.sbcglobal.net. [76.229.100.169]) by smtp.gmail.com with ESMTPSA id cp33-20020a05690c0e2100b00545a08184dbsm2283579ywb.107.2023.04.02.21.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 21:42:56 -0700 (PDT) From: Tony Dinh To: U-Boot Mailing List , Stefan Roese , =?UTF-8?q?Pali=20Roh=E1r?= Cc: Jaehoon Chung , Tom Rini , =?UTF-8?q?Marek=20Beh=FAn?= , Michael Trimarchi , Chris Packham , Mark Kettenis , Martin Rowe , Simon Glass , Tony Dinh Subject: [PATCH] ddr: marvell: a38x: Perform DDR training sequence again for 2nd boot Date: Sun, 2 Apr 2023 21:42:33 -0700 Message-Id: <20230403044233.25863-1-mibodhi@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean - DDR Training sequence happens very fast. The speedup in boot time is negligible by skipping the training sequence during 2nd boot or after. So remove the check and skip. - This change improves the robustness of DDR training. If u-boot crashed during DDR training, the training could be left in a limbo state, where the BootROM has recorded that it is already in a 2nd boot. The training must be repeated in this scenario to get out of this limbo state, but due to the check it cannot be performed. Signed-off-by: Tony Dinh --- drivers/ddr/marvell/a38x/mv_ddr_plat.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/ddr/marvell/a38x/mv_ddr_plat.c b/drivers/ddr/marvell/a38x/mv_ddr_plat.c index 6e7949ac72..8ec9fb0874 100644 --- a/drivers/ddr/marvell/a38x/mv_ddr_plat.c +++ b/drivers/ddr/marvell/a38x/mv_ddr_plat.c @@ -1363,13 +1363,6 @@ int mv_ddr_pre_training_soc_config(const char *ddr_type) DRAM_RESET_MASK_MASKED << DRAM_RESET_MASK_OFFS); } - /* Check if DRAM is already initialized */ - if (reg_read(REG_BOOTROM_ROUTINE_ADDR) & - (1 << REG_BOOTROM_ROUTINE_DRAM_INIT_OFFS)) { - printf("%s Training Sequence - 2nd boot - Skip\n", ddr_type); - return MV_OK; - } - /* Fix read ready phases for all SOC in reg 0x15c8 */ reg_val = reg_read(TRAINING_DBG_3_REG); -- 2.30.2