From patchwork Mon Apr 9 10:12:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 896222 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="phUQc6+s"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40KR331pzYz9s1p for ; Mon, 9 Apr 2018 20:13:33 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9FD4FC21DF8; Mon, 9 Apr 2018 10:13:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 047BDC21C50; Mon, 9 Apr 2018 10:13:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AE937C21C50; Mon, 9 Apr 2018 10:13:14 +0000 (UTC) Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by lists.denx.de (Postfix) with ESMTPS id B2DB9C21C27 for ; Mon, 9 Apr 2018 10:13:13 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id b6-v6so4802526pla.11 for ; Mon, 09 Apr 2018 03:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YiWQ/lnrRSCVrWmHlfnnQBtE2cSCylnQ0Buja6AUlro=; b=phUQc6+saGbmLhqIGTgHfT9elFcFs55YxZXdzmRW5XgHm1asbnRgDR1vs0jnjTjEcS RgeSAJlm+LcojByCqBVa0H+L9PDe22HEnKbtFTtK/Oea9n5tA6eGTEggjeYeMXQYe1+4 Duq0mRe0BhTDwlq46VpX+c5OYP/waUKwRD32hmWpqg1YCDk3t01QZoeKGWF8fo+EA5ke IgL3oNqKebBANVO3VJVsmZtKevk0o15sFTQw3cvADIwvi24bZiaNAkguOr2RSCl9r7Uy NsrldwicHkil5z9Cbj+ncjEqLIXvCqKYQ15mFeKaaiPtpVcv74yy2hJGtN7wMYmLOlub ny1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YiWQ/lnrRSCVrWmHlfnnQBtE2cSCylnQ0Buja6AUlro=; b=V9GhBESFWP7pUjWR0FbSHo8WBA0c104S+z2SK2ZNBCkes2STyQdXpU1bD/3kOKxIb2 KC9dJaTkGDdcEZcdHsYRw8sKuxc7bNwXhFlVHqAykKwfgAADapeFqc1HgZoCM8zhiPx0 oy+9bkl5k1PmAisgRUpgiJys2J9Sw/qRgR5Mb3cBWpriL7b4er+j0gZujeJ422TpZW0i 5OooLZSazqDhQtRoK1uyuJiq89S1sBluWBq8I6ja9ENRGmiE7L0ZpbfTxPNifffgpWTs bYGjnghop0QslUHZQJ2QLp/SIcUXD+U9QX+znOdJFzLz8+2jgG9YLjH2eo9Q4PzhPNcu 4TlQ== X-Gm-Message-State: AElRT7GLg53Ll555cNKyD3sh3ZykLTYs6K0ej67a232vblqGokI9wtT1 z+8PyRwaV7auV8euXQgjYaG1nFni X-Google-Smtp-Source: AIpwx4+xm1mc4xiUfLsle1pBVoea9ga4E5Yx2aMII8pHwape0tzBdllwIA87RRN8usZmCOM5rv5zVw== X-Received: by 2002:a17:902:7b96:: with SMTP id w22-v6mr36284719pll.116.1523268791889; Mon, 09 Apr 2018 03:13:11 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc ([2001:df5:b000:22:3a2c:4aff:fe70:2b02]) by smtp.gmail.com with ESMTPSA id x76sm35138681pfi.151.2018.04.09.03.13.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 03:13:11 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Mon, 9 Apr 2018 22:12:51 +1200 Message-Id: <20180409101257.3899-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.16.2 Cc: Prafulla Wadaskar , Luka Perkov , "xypron.glpk@gmx.de" , Chris Packham , Tuan Pham , Victor Axelrod , Stefan Roese , Chris Packham Subject: [U-Boot] [PATCH v2 0/6] ARM: mvebu: a38x: updates to ddr training code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This series updates the ddr training code in u-boot with the latest publicly available version from Marvell which can be found at https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git (mv_ddr-armada-17.10 branch). I've tried to make the delta as small as possible without breaking bisect-ability. The first 2 patches have already been sent as http://patchwork.ozlabs.org/patch/894866/ and http://patchwork.ozlabs.org/patch/894865/ The bulk of the changes are in patch 4. Naturally this doesn't pass checkpatch.pl but I'm erring on the side of being able to diff with the upstream source. Also due to it's size this patch may not make it to the mailing list so the full series can be retrieved from the mv-ddr branch of https://github.com/cpackham/u-boot.git. I've tested this series on the db-88f6820-amc board and on a custom board that is not upstream (yet). I've also build tested the other a38x boards. More testing on actual hardware would be greatly appreciated. Changes in v2: - remove unused #include Chris Packham (6): ARM: mvebu: a38x: move definition of PEX_CFG_DIRECT_ACCESS ARM: mvebu: a38x: move sys_env_device_rev_get ARM: mvebu: a38x: remove some unused code ARM: mvebu: a38x: sync ddr training code with upstream ARM: mvebu: a38x: restore support for setting timing ARM: mvebu: a38x: use non-zero size for ddr scrubbing arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h | 1 + arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c | 26 +- arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h | 1 - board/CZ.NIC/turris_omnia/turris_omnia.c | 38 +- board/Marvell/db-88f6820-amc/db-88f6820-amc.c | 21 +- board/Marvell/db-88f6820-gp/db-88f6820-gp.c | 21 +- board/gdsys/a38x/controlcenterdc.c | 22 +- board/solidrun/clearfog/clearfog.c | 21 +- drivers/ddr/marvell/a38x/Makefile | 10 +- drivers/ddr/marvell/a38x/ddr3_a38x.c | 737 ---------- drivers/ddr/marvell/a38x/ddr3_a38x.h | 93 -- drivers/ddr/marvell/a38x/ddr3_a38x_mc_static.h | 226 --- drivers/ddr/marvell/a38x/ddr3_a38x_topology.h | 22 - drivers/ddr/marvell/a38x/ddr3_a38x_training.c | 40 - drivers/ddr/marvell/a38x/ddr3_debug.c | 742 ++++++---- drivers/ddr/marvell/a38x/ddr3_hws_hw_training.c | 148 -- drivers/ddr/marvell/a38x/ddr3_hws_hw_training.h | 49 - .../ddr/marvell/a38x/ddr3_hws_hw_training_def.h | 464 ------ drivers/ddr/marvell/a38x/ddr3_hws_sil_training.h | 17 - drivers/ddr/marvell/a38x/ddr3_init.c | 798 ++--------- drivers/ddr/marvell/a38x/ddr3_init.h | 300 +--- drivers/ddr/marvell/a38x/ddr3_logging_def.h | 10 +- drivers/ddr/marvell/a38x/ddr3_patterns_64bit.h | 1 + drivers/ddr/marvell/a38x/ddr3_topology_def.h | 6 +- drivers/ddr/marvell/a38x/ddr3_training.c | 1491 +++++++++++--------- drivers/ddr/marvell/a38x/ddr3_training_bist.c | 548 +++++-- .../marvell/a38x/ddr3_training_centralization.c | 108 +- drivers/ddr/marvell/a38x/ddr3_training_db.c | 267 +++- drivers/ddr/marvell/a38x/ddr3_training_hw_algo.c | 98 +- drivers/ddr/marvell/a38x/ddr3_training_ip.h | 19 +- drivers/ddr/marvell/a38x/ddr3_training_ip_bist.h | 6 +- drivers/ddr/marvell/a38x/ddr3_training_ip_db.h | 71 +- drivers/ddr/marvell/a38x/ddr3_training_ip_def.h | 34 +- drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c | 1134 +++++++++------ drivers/ddr/marvell/a38x/ddr3_training_ip_engine.h | 9 +- drivers/ddr/marvell/a38x/ddr3_training_ip_flow.h | 305 +--- drivers/ddr/marvell/a38x/ddr3_training_ip_prv_if.h | 17 +- drivers/ddr/marvell/a38x/ddr3_training_ip_static.h | 31 - drivers/ddr/marvell/a38x/ddr3_training_leveling.c | 1347 ++++++++++-------- drivers/ddr/marvell/a38x/ddr3_training_leveling.h | 2 +- drivers/ddr/marvell/a38x/ddr3_training_pbs.c | 201 +-- drivers/ddr/marvell/a38x/ddr3_training_static.c | 539 ------- drivers/ddr/marvell/a38x/ddr_ml_wrapper.h | 149 ++ drivers/ddr/marvell/a38x/ddr_topology_def.h | 84 +- drivers/ddr/marvell/a38x/mv_ddr_build_message.c | 1 + drivers/ddr/marvell/a38x/mv_ddr_common.c | 48 + drivers/ddr/marvell/a38x/mv_ddr_common.h | 21 + drivers/ddr/marvell/a38x/mv_ddr_plat.c | 1451 +++++++++++++++++++ drivers/ddr/marvell/a38x/mv_ddr_plat.h | 237 ++++ drivers/ddr/marvell/a38x/mv_ddr_regs.h | 447 ++++++ drivers/ddr/marvell/a38x/mv_ddr_spd.c | 378 +++++ drivers/ddr/marvell/a38x/mv_ddr_spd.h | 290 ++++ drivers/ddr/marvell/a38x/mv_ddr_sys_env_lib.c | 103 ++ drivers/ddr/marvell/a38x/mv_ddr_sys_env_lib.h | 118 ++ drivers/ddr/marvell/a38x/mv_ddr_topology.c | 198 +++ drivers/ddr/marvell/a38x/mv_ddr_topology.h | 130 ++ drivers/ddr/marvell/a38x/seq_exec.h | 65 + drivers/ddr/marvell/a38x/silicon_if.h | 17 - drivers/ddr/marvell/a38x/xor.c | 185 ++- drivers/ddr/marvell/a38x/xor.h | 3 +- 60 files changed, 7998 insertions(+), 5968 deletions(-) delete mode 100644 drivers/ddr/marvell/a38x/ddr3_a38x.c delete mode 100644 drivers/ddr/marvell/a38x/ddr3_a38x.h delete mode 100644 drivers/ddr/marvell/a38x/ddr3_a38x_mc_static.h delete mode 100644 drivers/ddr/marvell/a38x/ddr3_a38x_topology.h delete mode 100644 drivers/ddr/marvell/a38x/ddr3_a38x_training.c delete mode 100644 drivers/ddr/marvell/a38x/ddr3_hws_hw_training.c delete mode 100644 drivers/ddr/marvell/a38x/ddr3_hws_hw_training.h delete mode 100644 drivers/ddr/marvell/a38x/ddr3_hws_hw_training_def.h delete mode 100644 drivers/ddr/marvell/a38x/ddr3_hws_sil_training.h delete mode 100644 drivers/ddr/marvell/a38x/ddr3_training_ip_static.h delete mode 100644 drivers/ddr/marvell/a38x/ddr3_training_static.c create mode 100644 drivers/ddr/marvell/a38x/ddr_ml_wrapper.h create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_build_message.c create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_common.c create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_common.h create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_plat.c create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_plat.h create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_regs.h create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_spd.c create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_spd.h create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_sys_env_lib.c create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_sys_env_lib.h create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_topology.c create mode 100644 drivers/ddr/marvell/a38x/mv_ddr_topology.h create mode 100644 drivers/ddr/marvell/a38x/seq_exec.h delete mode 100644 drivers/ddr/marvell/a38x/silicon_if.h