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 2B50EC00140 for ; Sun, 31 Jul 2022 10:52:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C8C32844AC; Sun, 31 Jul 2022 12:51:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=wirenboard.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=wirenboard.com header.i=@wirenboard.com header.b="bBp82lXz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B42CC81115; Sat, 30 Jul 2022 14:20:58 +0200 (CEST) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (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 5AF168044A for ; Sat, 30 Jul 2022 14:20:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=wirenboard.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=boger@wirenboard.com Received: by mail-ej1-x635.google.com with SMTP id rq15so6638578ejc.10 for ; Sat, 30 Jul 2022 05:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wirenboard.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=DpzgSNPdMkgVDwgFcpHMCU3aKuecse4UMlpK8+/nUaQ=; b=bBp82lXzL/Ls1M/yz4zYLZrrXx4VdwKALE0NnoB4Ck1XHq+PR8wlPc/+zrMPTRxy3C b+Tc+KUNK/sAUxh13BhpdT2Z+OVzDIVedLnQSlxcb55BX7ZTNNwWqwhqu3XvDjT95rP4 niD01/WKXyL9xLjLoJQ6A3gSeQV72xrrlWLojTGogRPkSrutVy7b/ksKikS1mPqC/Igk PPnJnG/1ObscLCkNSFJEo5Nx+U5xyR/wFYw7DPPZUKLOJb2u+EwAwDJywSiwQWfHwSay jzD+H95aEeOuU3oGX5oeal/CBcE1JWEQ7yKtQOudktgmqrYZ3dabTRCxxQNjsxxqzJKP h0rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=DpzgSNPdMkgVDwgFcpHMCU3aKuecse4UMlpK8+/nUaQ=; b=UhxLxi6wHAI8ErYKDu9VtCxPABkwUoSs4RLyt+2zqRxG5w1ohsNoV+JUD71GGG3S50 qqnBqHUr/fKkQbe75VuYmM2IS62+ijrmYsFVdkzhKh94yJbkFM11kYBuQ/gvXmQY5Gox FcDYcAZXnu0h54kqAbwhcH2Uy33+r2OMCqVWDni3JZYLrkiEo27BG03CjuFoYPnUhWO2 +QiZUFWjxLK8qEmNWuiW7A1QkKhHOFD1+XpTcNAQrjtD8g2xGDt7iljRbUjZBMhP3O74 2yQmUGttuI3PNfdEiCYd6TeHLC8De8qfK+8DskOzlPYoVBccp3tz5UxUjsq8sWWDqmo1 mJMw== X-Gm-Message-State: AJIora9O2p0ri1wGSf9sXeWUlrWG2AWvaf44G89qiMYffAktvphMdOyd 9zwY/ro6yfSEOw1hF8AMfB2Wzcq4binFV3/+qik= X-Google-Smtp-Source: AGRyM1v0XyiaD9ak1Yr1ZIoQUFsdj7Y0PtwtguUa3hTL8PGVf60WVUP6483ukfjR8WnZJd1TehRvkA== X-Received: by 2002:a17:907:7f1a:b0:72e:f9c9:dfe2 with SMTP id qf26-20020a1709077f1a00b0072ef9c9dfe2mr6080678ejc.84.1659183655610; Sat, 30 Jul 2022 05:20:55 -0700 (PDT) Received: from boger-laptop.lan ([78.109.64.100]) by smtp.gmail.com with ESMTPSA id j20-20020aa7c414000000b0043a85d7d15esm3859561edq.12.2022.07.30.05.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 05:20:54 -0700 (PDT) From: Evgeny Boger To: u-boot@lists.denx.de Cc: Evgeny Boger , Andre Przywara , Icenowy Zheng , Ivan Uvarov Subject: [PATCH 0/1] sunxi: support half DQ width memory on R40 Date: Sat, 30 Jul 2022 15:20:48 +0300 Message-Id: <20220730122049.3395254-1-boger@wirenboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sun, 31 Jul 2022 12:51:34 +0200 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.6 at phobos.denx.de X-Virus-Status: Clean On Allwinner boards memory configuration is detected by bootloader. However, R40 (A40i/T3) is somewhat unique because the detection by the DRAM controller via PIR_QSGATE is broken (either in U-Boot or in the controller). So the memory configuration must be detected by other means. Dual rank detection has been already implemented by Icenowy earlier. This patch extends the automation detection so it can detect half-width DQ configuration (i.e. single x16 DDR3 IC). Tested on Allwinner A40i-based Wiren Board 7 automation controller, for the following memory configurations: * 1x 16-bit 4Gbit DDR3, 512 MiB total RAM * 2x 16-bit 4Gbit DDR3, 1024 MiB total RAM * 2x 16-bit 8Gbit DDR3, 2048 MiB total RAM Unfortunately it has NOT been tested with dual-rank configuration yet, as I don't have any dual-rank boards at hand. I will really appreciate if someone could help me with that. Evgeny Boger (1): sunxi: support half DQ width memory on R40 .../include/asm/arch-sunxi/dram_sunxi_dw.h | 1 + arch/arm/mach-sunxi/dram_sunxi_dw.c | 115 ++++++++++++------ 2 files changed, 79 insertions(+), 37 deletions(-) -- 2.25.1