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 9B01AC433EF for ; Thu, 2 Dec 2021 16:14:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A1B883518; Thu, 2 Dec 2021 17:14:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=toradex.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=toradex.com header.i=@toradex.com header.b="bQQcDVYg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9838C83451; Thu, 2 Dec 2021 17:14:36 +0100 (CET) Received: from CHE01-GV0-obe.outbound.protection.outlook.com (mail-gv0che01on2070c.outbound.protection.outlook.com [IPv6:2a01:111:f403:4012::70c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7C20283451 for ; Thu, 2 Dec 2021 17:14:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=toradex.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=francesco.dolcini@toradex.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bHvp2Tr7fGAfjQ+Cl0itFhQ7qgEm4fwyQ9xq4w6ZPlH0UgONXP79cMdKZZtnvjHpfX0tx/dF2yCUJ8BW0Fk6N6jRAo4gH0nc6OwnGbkf/eai15cFmzc2K+yKbrxKw0yoM11TAeP3j4eS+a2zd7zIuke3b6ijLPzxjg7ZrdrMXQFStfhD8AVqaL9gxq1IhL9GwWcG0loYldGRfK+sNBa3XyxY7JJ99Ji+HAnrjad4kEerrYruYSpqc4bQnIcQwdskebRLki8WpF9KAHlroPBq7vfca9zF805WmDAaaM2R+L1Lx/OsEhU8Rxm+3HxiPTIp/5NWI3qCNS+NmGuE/Y6VZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yEn57DuUHfiO1/pX8G9zRCgmaN8zX2Ifawv32Bu4NWQ=; b=fBOEubLi8IPnGPCCNZyI2Xfxz6RM+0Goy4pDDPPO7VdnKt6roXnSz/fwFH6k6l1vxHtGOrDq8+4qh14aPCklNd+O7x5rYDDXsMdcdn7Mf7Zs4RsEb3pNNYG8TA+AzhMUfwssfnIsET5Ffoy/DSO+P44AVoT2XRmwWpNOAF0AWs8ZSkhhkLeRJmATj6EkXH3FgFmiMnVBEkTb1fiFKUQKw4OYEuY7UnYIRItImSOS5h8pwpDzVQsw2s6SxHp/k6wZlzbIiKGcagi66vd0r3llxmavInmP9kiRKDkjJGGm7HgrsqUMqTC2l0PxZIiijhvs4UjkNt4/BxYruxBpVxTVaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=toradex.com; dmarc=pass action=none header.from=toradex.com; dkim=pass header.d=toradex.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yEn57DuUHfiO1/pX8G9zRCgmaN8zX2Ifawv32Bu4NWQ=; b=bQQcDVYgsKuZj2NuFcwRmW7w+G9Q6CykSCG8J1H8kRRUiAWIeCGb369OVCqRcgXdWBrcjNI0oJskpEi1Z2jKQK8QN/QM1Njqt2Uj3wFDBUTW38nTbfkP7dEzfArgx9MpZdLDXTm9Jv9ymfD2IVZEihWOj9UBVpC52XGmh0nlwOg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=toradex.com; Received: from GV0P278MB0655.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:42::9) by GVAP278MB0470.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:37::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.15; Thu, 2 Dec 2021 16:14:30 +0000 Received: from GV0P278MB0655.CHEP278.PROD.OUTLOOK.COM ([fe80::a0c1:a828:f847:c1f2]) by GV0P278MB0655.CHEP278.PROD.OUTLOOK.COM ([fe80::a0c1:a828:f847:c1f2%9]) with mapi id 15.20.4755.016; Thu, 2 Dec 2021 16:14:29 +0000 Date: Thu, 2 Dec 2021 17:14:28 +0100 From: Francesco Dolcini To: Stefano Babic , Fabio Estevam , uboot-imx@nxp.com, u-boot@lists.denx.de, Tim Harvey Cc: Marcel Ziswiler Subject: Question/issues about i.MX6 DDR configuration Message-ID: <20211202161428.GA104937@francesco-nb.int.toradex.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-ClientProxiedBy: GV0P278CA0042.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:29::11) To GV0P278MB0655.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:42::9) MIME-Version: 1.0 Received: from francesco-nb.toradex.int (93.49.2.63) by GV0P278CA0042.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:29::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11 via Frontend Transport; Thu, 2 Dec 2021 16:14:28 +0000 Received: by francesco-nb.toradex.int (Postfix, from userid 1000) id 4F0EF10A3475; Thu, 2 Dec 2021 17:14:28 +0100 (CET) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d91eb00e-97ce-4ab8-6b33-08d9b5aed150 X-MS-TrafficTypeDiagnostic: GVAP278MB0470: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B70JlNxDxH+hHRMhA3T7cWMKUaMypm6FnvcOcErIS6DLzYQhxwAeF+z2DnNlBeLvOyH5gcw1kg6ysPmyr8RNpqGAYvxUzrinAjQo6N0P7aJhWi6YFSovQ7U8/WB/+iG2Vbj75FN2DCW5MM8zaNB8zgwmhvO+qYapEYp09nWcp4B/zlUALa22O6eXtZILptfMa0hAupb3nD9taIWLFZvdOIlLaDPJI9PUk2IjXl6pd+/cpMAbagPhNuMpcKh5k4c8U67OjWOi1r9Ycjzt9tzLwHS+K0jI6TTWlqZht3a10kQCI9WiwzaFNiwfqluH5PfY1F3WBiiR8n1M43RlxZ/lz3NuSotTc5xk9FBjmMmN8ugqXMQ7bnjJa5bagioV0/MvVKyfxCF7LWIfYhV/eQObEr2RvE05pPt5uRvTd74f4dfCcp4YjqNT0qJK3B/gHOuWL09mrv5uUtMBaWZmmxg34GQ36Har520ReTmJhqSpRtRpdagbSP849CAI9KbpulzjPlJZ6iT3jnAa0ml7j3nX6zb3A3EnV0amap1f7SqkfXchW+ip5i4EbqgcbEm3Re6DcpxwckQLCm2JKkh7QdABTRJ4AbCFgxZwMwf5K+d4UlatCgA/XGk0m9gAwOJ4mJeN/1zQJHgtipql3vDOj5sjo2jfvBTFJJn8ufmOF7r6js8DImgiJ4d31TinJ4UIi0pn/zyBOKyNMv3NMs37GrZYGD4RkPfITd/pZjp3SQK2AkDEC7Rv3kHOKotU7W6mIbg4+06PyZ8DH0KiJNZZn040QgA3OvLlSCJB1ZL5bj9Mr2c= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:GV0P278MB0655.CHEP278.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(39850400004)(396003)(346002)(136003)(376002)(366004)(508600001)(44832011)(33656002)(2906002)(186003)(83380400001)(1076003)(38100700002)(26005)(5660300002)(110136005)(42186006)(38350700002)(316002)(66946007)(8676002)(107886003)(8936002)(6266002)(52116002)(86362001)(66556008)(4326008)(966005)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QWFnEDoAOEZOq5AdTsd84SekZVHK2xpvhFR8eoAbwQZga30RfKt9Iw1ab8lN?= =?us-ascii?Q?iyl8dOeza1zbvKEcMwhQ8uLlf98L9p3SusvgHHdJ8/zWmMgrnR7bQhPWEPw3?= =?us-ascii?Q?9J9yVglhJ/SPN9FVDIjujPisUgH8t+0UOKAMXjspxFjiGjBXJ+TEHWjrSV6a?= =?us-ascii?Q?PHyaAU9rOe4VFf1CGkMgAu6eTq1uidtXw4n2j3Wg1M1Ag3INf21snwz4Q2Qx?= =?us-ascii?Q?P9OS9+GD532gMqGPsTrWSgwJlX+/DWbOMo6F21v2JEiDQ2LzTsi5zM5f66J4?= =?us-ascii?Q?ei7Wh0p8T5D8jielU5mvRBvSA8DQk/X9lXc5et7tg12YFkNir8G6X95LfLbx?= =?us-ascii?Q?s7DPj2bI/9Rryrb5YL/W64yDm2Cr0u7nab1gAAJPkLh5zMK962GDC8i67fUr?= =?us-ascii?Q?kIHTTiSGCKcfLXYyCtnZpWTwhH8ErO9ENOWYNHEj6cHc6g0UgfofZ4vqGKPi?= =?us-ascii?Q?CDWO8LeotecxwiQ4HAipgIeQpauT9GHnJRNf8dKpYzviTS/gNEVUf+llTEH+?= =?us-ascii?Q?/7CiVvO6hHT3snaBmVbbC6fbwcEN5L1Vyltb2RUPRlkq+OwRZHoMG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gk79RzO/dGsk0B3tG3FIRUHVqbZceF?= =?us-ascii?Q?LBTveQWukd7ogv7tvF97ePi5uebz0ga9qvc2khI9xvr/wwSxEPyifiZkc0to?= =?us-ascii?Q?ejJSyaYkEcrHxdskuN8BvbEgCQMG9kRyBilV9nVvkXt353exkqnr29LAxSKh?= =?us-ascii?Q?JDTJeZKYHXpwvgl1Gwbm3SJm3K3w0hugJ3+jAzHnFlgZdz6pTJBYSoBBUCwk?= =?us-ascii?Q?6zx6oA=3D=3D?= X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: d91eb00e-97ce-4ab8-6b33-08d9b5aed150 X-MS-Exchange-CrossTenant-AuthSource: GV0P278MB0655.CHEP278.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2021 16:14:29.1426 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UwRU5LGA8gGY63cHsZ+rdeoZP0QF0+pGYgK3ATRwNKu2IYFMkoybDzBlrugbVylwNnImWF8RAwcwYll0V3E5P6uFQqcTTA3gOgu8SwZzJ40= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVAP278MB0470 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean Hello Fabio, Tim and all, in the last few weeks I have been debugging some sporadic i.MX6 board boot failures (2020.07 U-Boot, if that matters) and we have some loose indication that they could be RAM related. The effect is that SPL is not able to load U-Boot from the eMMC to DDR and dqs|write_level calibration is failing. We do write the memory configuration in a pretty simple way, SPL is just iterating thought a list of register address/value, in a very similar way to what was done using the DCD table. Today most of the boards however use a more programmatic approach as introduced by Tim in 2014 [1]. Contrary to that, however, Fabio moved away from this new approach to just raw registers writing for the sabre board [2][3]. I'm a little bit puzzled at the moment, according to the iMX6 reference manual[4], 44.4.2 MMDC initialization, a specific sequence is required to be followed and this is implemented by the `mx6_dram_cfg()`[5] function, but according to what Fabio wrote the raw initialization of registers was just more reliable for mx6sabresd. Fabio, what was the reason? I would expect that using `mx6_dram_cfg()` is the correct approach and I would expect issue if doing in a different way from what is described in the reference manual. Regarding that I found also this note in the manual interesting: "A Precharge All command must be issued prior to the MRW command to ensure robust DDR initialization. This command is required to be issued to both chip selects if two chip selects are utilized in the system." In my tests adding 1ms delay after each MMDC register write seems to have a positive effect and this is going into the direction that using `mx6_dram_cfg()` is the way to go. Any suggestion? Do I miss something? Francesco [1] https://lore.kernel.org/all/1401750807-5975-7-git-send-email-tharvey@gateworks.com/ [2] https://lore.kernel.org/all/1474892066-32005-1-git-send-email-festevam@gmail.com/ [3] https://source.denx.de/u-boot/u-boot/-/commit/3b30eece271cfc4096c2d20048c89e8bed0bbbfd [4] https://www.nxp.com/webapp/Download?colCode=IMX6DQRM [5] https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/mach-imx/mx6/ddr.c#L1672