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 78E38C76196 for ; Mon, 3 Apr 2023 12:02:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F9D185E8E; Mon, 3 Apr 2023 14:02:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ziswiler.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id EE78885BB7; Mon, 3 Apr 2023 14:02:09 +0200 (CEST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7403485927 for ; Mon, 3 Apr 2023 14:02:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ziswiler.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=marcel@ziswiler.com Received: from toolbox.int.toradex.com ([194.191.254.210]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0M6BnI-1qbZYZ40KY-00y6dC; Mon, 03 Apr 2023 14:02:02 +0200 From: Marcel Ziswiler To: u-boot@lists.denx.de Cc: Emanuele Ghidoli , Marcel Ziswiler Subject: [PATCH v2 1/5] board: verdin-imx8mp: update ddrc config for different lpddr4 memories Date: Mon, 3 Apr 2023 14:01:53 +0200 Message-Id: <20230403120157.123621-2-marcel@ziswiler.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20230403120157.123621-1-marcel@ziswiler.com> References: <20230403120157.123621-1-marcel@ziswiler.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:6/zFWq+YQjjL6jJw0CSsnSEaMdJoTTY0Hbu5YRaypv5x6NKasQo sGKE0GllonEU6tTY1ybE48b3y9lca9a0uy+Ke14d9atIF9KPitWVr+rBifric2GyjUWsrcT 1XwLChlwUkHJAkVQ7Qk+pXJsf90LabwUNA1Qp/g1yKEBa1L2UwAmS9WKuHntbhZNH21QsNP +fYMyjPbPltrY7/dzq0YQ== UI-OutboundReport: notjunk:1;M01:P0:eBS0tZFUgAE=;bp+1wiDnrbO8uXXMoTl13+yjJzt /EZujpsjihJBtmVAtbgBRN3eI9EkF8lPnc8/w7K2bEx4x+/4o8/J/6cO++fnWrPdrlyhiHz/L 7Xf/dmC52fZAotfUGH0E2eTdIJgy53N6g2zjdG69tQW6wYJLvJ0mYaC29j7YXsZFD7z8sIslC AvIDCGaJFE0Y3uskeCXdqayeUwPHCFo4nV12COKuzYdnI6b908e5fF/6NfOktQap6+6eNcssL Mcz8FZ6J8eqklUEsUa75OguOshkEPHhsZP3TybEvZo6hXcEozMKDMJQrjoSxC63MINdbe6+qt 6/CIaoMC2X12DGDrs7QKpxVOEAYinTJicFY2UuNeeGkkewctu1dTirm2HdKsOI9/zzFuaVAdy CrD4Seurms3g/Qrpq9lj+2iVHckKcZGkVyj5Pyr5icRoLXjR7Dzc1zWBJNO530Lbzg2VIQGIN F2/orLtEuFyw/qkW8NIx+2DTLHj+qMEom524iHJpTcnTFACJOYNDd32VTGAuheokmNohGDMzb glsv7rCUDjg2gjobbP2sUTBiqYTdn3V6uzZR6aQ/5CBh2Sd/ol7svagp5yhuRAHoEhMh98Q7i T0ihc/OLOfkZRoZGw9Z0ufH4Uaz088iZMfehTytfbDBDTW7I71fqk7Oxe6f1E3nHtcmvB2G7W 8/cOBXDt7rSUxUUqtr1r4VZN6tWf0t5vYqOUZ0kg2g== 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 From: Emanuele Ghidoli Add support to Verdin IMX8MP V1.1B SKU which uses MT53E1G32D2FW-046 WT:B memory. Compared to the 8 GB memory (MT53E2G32D4NQ-046 WT:A) used on Verdin IMX8MP V1.0A it has 16 row addresses instead of 17. In fact, the new memory, is a 2 GB/rank memory. The 8 GB memory is a 4 GB/rank memory. Manually tweaking Host Interface addresses vs LPDDR4 signals mapping it is possible to have a single configuration working with both memories: - Old configuration: HIF bit 30 -> rank, HIF bit 29 -> Row 16 - New configuration: HIF bit 29 -> rank, HIF bit 30 -> Row 16 With this change the memory space from the host processor is contiguous for both the configurations and the correct memory size is computed using get_ram_size() at runtime. Support for single rank memories still works thanks to the fact dual ranks training fails (ddr_init->ddr_cfg_phy) toward single rank memories. Signed-off-by: Emanuele Ghidoli Signed-off-by: Marcel Ziswiler --- (no changes since v1) board/toradex/verdin-imx8mp/lpddr4_timing.c | 4 ++-- board/toradex/verdin-imx8mp/spl.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/board/toradex/verdin-imx8mp/lpddr4_timing.c b/board/toradex/verdin-imx8mp/lpddr4_timing.c index 3e00d9b51e1..314b74e7df2 100644 --- a/board/toradex/verdin-imx8mp/lpddr4_timing.c +++ b/board/toradex/verdin-imx8mp/lpddr4_timing.c @@ -55,13 +55,13 @@ struct dram_cfg_param ddr_ddrc_cfg[] = { { 0x3d4001c4, 0x1 }, { 0x3d4000f4, 0xc99 }, { 0x3d400108, 0x9121c1c }, - { 0x3d400200, 0x18 }, + { 0x3d400200, 0x17 }, { 0x3d40020c, 0x0 }, { 0x3d400210, 0x1f1f }, { 0x3d400204, 0x80808 }, { 0x3d400214, 0x7070707 }, { 0x3d400218, 0x7070707 }, - { 0x3d40021c, 0xf07 }, + { 0x3d40021c, 0xf08 }, { 0x3d400250, 0x1705 }, { 0x3d400254, 0x2c }, { 0x3d40025c, 0x4000030 }, diff --git a/board/toradex/verdin-imx8mp/spl.c b/board/toradex/verdin-imx8mp/spl.c index ea99e370850..7b383cc0d53 100644 --- a/board/toradex/verdin-imx8mp/spl.c +++ b/board/toradex/verdin-imx8mp/spl.c @@ -34,11 +34,10 @@ int spl_board_boot_device(enum boot_device boot_dev_spl) void spl_dram_init(void) { /* - * try configuring for quad die, dual rank aka 8 GB falling back to - * dual die, single rank aka 1 GB (untested), 2 GB or 4 GB if it fails + * Try configuring for dual rank memory falling back to single rank */ if (ddr_init(&dram_timing)) { - printf("Quad die, dual rank failed, attempting dual die, single rank configuration.\n"); + printf("Dual rank failed, attempting single rank configuration.\n"); ddr_init(&dram_timing2); } } -- 2.36.1