From patchwork Thu May 10 01:28:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 911233 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="SYIAZEcc"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40hFxP2QVtz9s1w for ; Thu, 10 May 2018 11:28:55 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 83DA3C21F98; Thu, 10 May 2018 01:28:50 +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_MSPIKE_H2, 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 E4AB2C21ED5; Thu, 10 May 2018 01:28:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 13C66C21E56; Thu, 10 May 2018 01:28:46 +0000 (UTC) Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by lists.denx.de (Postfix) with ESMTPS id 8E693C21ED5 for ; Thu, 10 May 2018 01:28:44 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id a22-v6so244553pfn.6 for ; Wed, 09 May 2018 18:28:44 -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=/q69IOGcPiyuxCkc6XSnjAUX8ydk+5I5seJFXQUd2Kg=; b=SYIAZEccVNzM8tjI0EdP/Wvl303kAPoLqaktgQ2tLS8rHOX65lOYb/DEsfEeR6LLd5 QzJKb5wANNfONYsPqh2Ps29AIActHAv+qcHqh0x2aG1GcFcVG/mKiLbvkBmoIPE5dNBP cOkPTHypWDA3aSYtjnNMgg6OmXcVjTpS+s7t5t3bjKkSLC2QFYXGKUDmmxhtEGRxajLH 6kPaFP0b+80sHrKl5lSo20Rsf13xeqIp+/QFfvwIGNhBs5MxZkO9f2dewos2ZePNPTf+ 5rKDYz/PywBgIbOD9OviMIhnED069brPHB1Cf6CWpdF/YqJXnQA4OlnvRabo0OAcZcYO i3Uw== 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=/q69IOGcPiyuxCkc6XSnjAUX8ydk+5I5seJFXQUd2Kg=; b=TVx62t5bxBjU3bk+tALg7YsVaeAEckvVhGD7QFDpRVwRVt8Q9wak2CVES0tMPl71nz RUIeUx0VPdcnm1kRV/c9cVkAosCFSRq9RiSx5/y8kqi0DHlIlMsXtTFrDmFQ8cNTHvS4 fMradJqXU/sjov2TD/2x3zWzkWarDkQdtWjWplsMeHEMQbwxUI/OXlgZBl9hKDNSGtv+ rSsOObFw5RXaU0tBSvrEowBf1hrqQl+Fd4r8YaBWBoEb0YuDDd+fZFZHWYRGXnzOba88 afpwyErYcfQhPU1TB2TCYWLY1n/6krwOtJ7rJ3Gx6v3T1gII1DRPRVWWpisZ6XWJHbGX oEvA== X-Gm-Message-State: ALQs6tBzVGFTsWnp1sO6wjbhL+jFcU83XEnE/2q1CCkdiTRJVmSGe7Oz NTC4Gb5xB+79HmWDC8Vxx0EJASF8 X-Google-Smtp-Source: AB8JxZrRMM54JByaR+QYjGISwLRJGR1BV2Bd4/c/newBkyqUzbfFDa2jVS9nx+MdOWmfu0tXBwPBHw== X-Received: by 10.167.130.140 with SMTP id s12mr29124934pfm.136.1525915722665; Wed, 09 May 2018 18:28:42 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc ([2001:df5:b000:22:3a2c:4aff:fe70:2b02]) by smtp.gmail.com with ESMTPSA id e87sm69712179pfl.65.2018.05.09.18.28.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 May 2018 18:28:41 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Thu, 10 May 2018 13:28:25 +1200 Message-Id: <20180510012831.21677-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.17.0 Cc: Tom Rini , Prafulla Wadaskar , Luka Perkov , "xypron.glpk@gmx.de" , Chris Packham , Tuan Pham , Victor Axelrod , Stefan Roese , Chris Packham Subject: [U-Boot] [PATCH v3 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. This version is rebased against master to mop up the SPDX changes. Changes in v3: - Update to current SPDX style 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 | 736 -------- drivers/ddr/marvell/a38x/ddr3_a38x.h | 92 - .../ddr/marvell/a38x/ddr3_a38x_mc_static.h | 225 --- drivers/ddr/marvell/a38x/ddr3_a38x_topology.h | 21 - drivers/ddr/marvell/a38x/ddr3_a38x_training.c | 39 - drivers/ddr/marvell/a38x/ddr3_debug.c | 742 +++++--- .../ddr/marvell/a38x/ddr3_hws_hw_training.c | 147 -- .../ddr/marvell/a38x/ddr3_hws_hw_training.h | 48 - .../marvell/a38x/ddr3_hws_hw_training_def.h | 463 ----- .../ddr/marvell/a38x/ddr3_hws_sil_training.h | 16 - 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 +- .../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 ++++-- .../a38x/ddr3_training_centralization.c | 108 +- drivers/ddr/marvell/a38x/ddr3_training_db.c | 267 ++- .../ddr/marvell/a38x/ddr3_training_hw_algo.c | 98 +- drivers/ddr/marvell/a38x/ddr3_training_ip.h | 19 +- .../ddr/marvell/a38x/ddr3_training_ip_bist.h | 6 +- .../ddr/marvell/a38x/ddr3_training_ip_db.h | 71 +- .../ddr/marvell/a38x/ddr3_training_ip_def.h | 34 +- .../marvell/a38x/ddr3_training_ip_engine.c | 1134 ++++++++----- .../marvell/a38x/ddr3_training_ip_engine.h | 9 +- .../ddr/marvell/a38x/ddr3_training_ip_flow.h | 305 +--- .../marvell/a38x/ddr3_training_ip_prv_if.h | 17 +- .../marvell/a38x/ddr3_training_ip_static.h | 30 - .../ddr/marvell/a38x/ddr3_training_leveling.c | 1347 ++++++++------- .../ddr/marvell/a38x/ddr3_training_leveling.h | 2 +- drivers/ddr/marvell/a38x/ddr3_training_pbs.c | 201 ++- .../ddr/marvell/a38x/ddr3_training_static.c | 538 ------ drivers/ddr/marvell/a38x/ddr_ml_wrapper.h | 148 ++ drivers/ddr/marvell/a38x/ddr_topology_def.h | 82 +- .../ddr/marvell/a38x/mv_ddr_build_message.c | 1 + drivers/ddr/marvell/a38x/mv_ddr_common.c | 47 + drivers/ddr/marvell/a38x/mv_ddr_common.h | 20 + drivers/ddr/marvell/a38x/mv_ddr_plat.c | 1450 ++++++++++++++++ drivers/ddr/marvell/a38x/mv_ddr_plat.h | 236 +++ drivers/ddr/marvell/a38x/mv_ddr_regs.h | 446 +++++ drivers/ddr/marvell/a38x/mv_ddr_spd.c | 377 +++++ drivers/ddr/marvell/a38x/mv_ddr_spd.h | 289 ++++ drivers/ddr/marvell/a38x/mv_ddr_sys_env_lib.c | 102 ++ drivers/ddr/marvell/a38x/mv_ddr_sys_env_lib.h | 117 ++ drivers/ddr/marvell/a38x/mv_ddr_topology.c | 197 +++ drivers/ddr/marvell/a38x/mv_ddr_topology.h | 129 ++ drivers/ddr/marvell/a38x/seq_exec.h | 64 + drivers/ddr/marvell/a38x/silicon_if.h | 16 - drivers/ddr/marvell/a38x/xor.c | 185 +- drivers/ddr/marvell/a38x/xor.h | 3 +- 60 files changed, 7984 insertions(+), 5955 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