From patchwork Fri Aug 30 15:55:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 1979115 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=JoFVwkCA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WwN8l3XQzz1yfn for ; Sat, 31 Aug 2024 01:57:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D146E88C51; Fri, 30 Aug 2024 17:57:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="JoFVwkCA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9660188C72; Fri, 30 Aug 2024 17:57:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (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 69AFE88C45 for ; Fri, 30 Aug 2024 17:57:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7093efbade6so1334820a34.2 for ; Fri, 30 Aug 2024 08:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725033458; x=1725638258; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8PH9F1VBK3kWNUHiqkBLlRVWB0H6/h7ZsBfedPxrAx0=; b=JoFVwkCA0ZJTG6AWU7030XCr50fWehSanOGdW5NeTKYKkrp+VdJEZCEZKFSVXIobqI eS9TwiYJWYg0oSiRZdMnm6PqssHFhBwLmlIcwEwXG5VvgUDUjIQ7i4PwOq0ADsBLHtpo jjQs0jN9YtUDn/jZqtiX1JPtxUm/XSsplcdFD2+XEV6EueAyd4lwnxvfh5lY4SGGRU3X h6rhJb6hpK+XTkJGUgtymsmuMgDm7gG+cOpnXDj3Dhcey94Apv9XMkA6prXxQva5xd9E KjIFc/lVg3bcQF+CAfhTs7Kd1cSE6Y+p9RYRR4myoDvjMvx6a3hzrVc9wgmTcQxbuUVA 5Odw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725033458; x=1725638258; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8PH9F1VBK3kWNUHiqkBLlRVWB0H6/h7ZsBfedPxrAx0=; b=bIlJVJU7C1ufzOsQLfhBLNuLmyYwib+Z7JR9GvX4AuAOqWATGqxstLCGeaNs4oH0sa REjg0sOudRK+FP8dLBfl3g+MKAdA7GTsFNysgAAAX+4rcg5+BvrvGpgZ4YMhz/olYnmE 65dJE+dvC9RmO8pFECfl4xbZFPmVTbpXcl7xjOSxpXfz5mxEjTWBYlJVqUd71LjhV5dD +nLzlu2JsHnOB4wMWr3mWqPPReUpOM/52yKG/PmkcvmW5M6a1dc/xEhLw4OCobGGTW/+ Zf3TCoMtQ0B16Goktx0DbdKuV1skyReANDNVzGv0iK5YwhagUOwimSsY0HT5MHZVxO+M g8Tg== X-Gm-Message-State: AOJu0YyL2KXz+fkEds1x8/4EXzHJZO2MGOSS0ma49yxVeJwa8P+GKKXO qQ3InPAPbp4PqOSAhAmv8QSyNBQWDx4vOJqUIBo79ZM7j72aZbOf/VbyZA== X-Google-Smtp-Source: AGHT+IGQOd6xaZQNUqGgXFdh+QmOqYA5hbWkHjfu4QguedCJ0aaLN6r2YvXOPiDIhTy4ZtP27LGYjg== X-Received: by 2002:a05:6830:6d08:b0:70a:988a:b5fd with SMTP id 46e09a7af769-70f5c406907mr9162543a34.24.1725033458008; Fri, 30 Aug 2024 08:57:38 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70f671a8630sm490092a34.51.2024.08.30.08.57.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:57:37 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: sjg@chromium.org, jernej.skrabec@gmail.com, neil.armstrong@linaro.org, hdegoede@redhat.com, andre.przywara@arm.com, jagan@amarulasolutions.com, trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com, sumit.garg@linaro.org, Chris Morgan Subject: [PATCH V3 1/9] sunxi: H616: dram: LPDDR4: adjust settings Date: Fri, 30 Aug 2024 10:55:06 -0500 Message-Id: <20240830155514.481410-2-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com> References: <20240830155514.481410-1-macroalpha82@gmail.com> MIME-Version: 1.0 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: Jernej Skrabec Adjust H616 LPDDR4 DRAM settings to be in line with vendor driver. Signed-off-by: Jernej Skrabec Tested-by: Chris Morgan --- arch/arm/mach-sunxi/dram_sun50i_h616.c | 33 +++++++++++++------ .../dram_timings/h616_lpddr4_2133.c | 2 +- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c index 37c139e0ee..5be2887a06 100644 --- a/arch/arm/mach-sunxi/dram_sun50i_h616.c +++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c @@ -293,14 +293,22 @@ static void mctl_phy_configure_odt(const struct dram_para *para) dmb(); } -static bool mctl_phy_write_leveling(const struct dram_config *config) +static bool mctl_phy_write_leveling(const struct dram_para *para, + const struct dram_config *config) { bool result = true; u32 val; clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 8, 0xc0, 0x80); - writel(4, SUNXI_DRAM_PHY0_BASE + 0xc); - writel(0x40, SUNXI_DRAM_PHY0_BASE + 0x10); + + if (para->type == SUNXI_DRAM_TYPE_LPDDR4) { + /* MR2 value */ + writel(0x1b, SUNXI_DRAM_PHY0_BASE + 0xc); + writel(0, SUNXI_DRAM_PHY0_BASE + 0x10); + } else { + writel(4, SUNXI_DRAM_PHY0_BASE + 0xc); + writel(0x40, SUNXI_DRAM_PHY0_BASE + 0x10); + } setbits_le32(SUNXI_DRAM_PHY0_BASE + 8, 4); @@ -859,9 +867,9 @@ static void mctl_phy_ca_bit_delay_compensation(const struct dram_para *para, } break; case SUNXI_DRAM_TYPE_LPDDR4: - if (para->tpr2 & 1) { - writel(val, SUNXI_DRAM_PHY0_BASE + 0x788); - } else { + writel(val, SUNXI_DRAM_PHY0_BASE + 0x788); + if (config->ranks == 2) { + val = (para->tpr10 >> 11) & 0x1e; writel(val, SUNXI_DRAM_PHY0_BASE + 0x794); }; break; @@ -1080,19 +1088,27 @@ static bool mctl_phy_init(const struct dram_para *para, mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0); writel(0xb04, &mctl_ctl->mrctrl1); + udelay(10); writel(0x80000030, &mctl_ctl->mrctrl0); + udelay(10); mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0); writel(0xc72, &mctl_ctl->mrctrl1); + udelay(10); writel(0x80000030, &mctl_ctl->mrctrl0); + udelay(10); mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0); writel(0xe09, &mctl_ctl->mrctrl1); + udelay(10); writel(0x80000030, &mctl_ctl->mrctrl0); + udelay(10); mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0); writel(0x1624, &mctl_ctl->mrctrl1); + udelay(10); writel(0x80000030, &mctl_ctl->mrctrl0); + udelay(10); mctl_await_completion(&mctl_ctl->mrctrl0, BIT(31), 0); break; case SUNXI_DRAM_TYPE_DDR4: @@ -1108,7 +1124,7 @@ static bool mctl_phy_init(const struct dram_para *para, if (para->tpr10 & TPR10_WRITE_LEVELING) { for (i = 0; i < 5; i++) - if (mctl_phy_write_leveling(config)) + if (mctl_phy_write_leveling(para, config)) break; if (i == 5) { debug("write leveling failed!\n"); @@ -1234,9 +1250,6 @@ static bool mctl_ctrl_init(const struct dram_para *para, setbits_le32(&mctl_ctl->unk_0x3180, BIT(31) | BIT(30)); setbits_le32(&mctl_ctl->unk_0x4180, BIT(31) | BIT(30)); - if (para->type == SUNXI_DRAM_TYPE_LPDDR4) - setbits_le32(&mctl_ctl->dbictl, 0x1); - setbits_le32(&mctl_ctl->rfshctl3, BIT(0)); clrbits_le32(&mctl_ctl->dfimisc, BIT(0)); diff --git a/arch/arm/mach-sunxi/dram_timings/h616_lpddr4_2133.c b/arch/arm/mach-sunxi/dram_timings/h616_lpddr4_2133.c index e6446b9180..6f5c4acbd6 100644 --- a/arch/arm/mach-sunxi/dram_timings/h616_lpddr4_2133.c +++ b/arch/arm/mach-sunxi/dram_timings/h616_lpddr4_2133.c @@ -23,7 +23,7 @@ void mctl_set_timing_params(const struct dram_para *para) u8 trcd = max(ns_to_t(18), 2); u8 trc = ns_to_t(65); u8 txp = max(ns_to_t(8), 2); - u8 trtp = max(ns_to_t(8), 4); + u8 trtp = 4; u8 trp = ns_to_t(21); u8 tras = ns_to_t(42); u16 trefi = ns_to_t(3904) / 32; From patchwork Fri Aug 30 15:55:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 1979116 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Sxw8ieU9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WwN8t0GX7z1yfn for ; Sat, 31 Aug 2024 01:58:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 385E788C8C; Fri, 30 Aug 2024 17:57:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="Sxw8ieU9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5FBA88C75; Fri, 30 Aug 2024 17:57:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (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 3AFAD88C4D for ; Fri, 30 Aug 2024 17:57:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-70f5cd2fa39so1380317a34.0 for ; Fri, 30 Aug 2024 08:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725033459; x=1725638259; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wpkitDeuxRcNMfmg24HZXUmkTmVZb/2y6/y1WE/ozxo=; b=Sxw8ieU9yo02cSPlmyxZEMH3ytR+ow4Ww1WBAHwzZ9C5TvtzRYJ7A00QsthJ3TuG6V HEppCHtGf+iJDPCW1RMlHPEmqBhK0vP7LNWxu4rxYeJkyWaRK6bLNeu0gqfaHVvlVon1 JzCswjRThpfjLT+oKo6PF2peoMXHTjcS3rEtULRbP+jfnJUg3lFvgfcbXf4NKj+za6nA dfhjUPUgG4J0TjC8UL6HudMTzFHA5gpnJpx1AfDDiKIxYNcRMsoBE4tDdok1/12o85io UiczO7JyplsGVmRAG8arYV2SbV5xSnlji3AeKF3gTmj9ZSXljSkEDbNR/76byi805zlp PBNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725033459; x=1725638259; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wpkitDeuxRcNMfmg24HZXUmkTmVZb/2y6/y1WE/ozxo=; b=u7XI13pg+WEmqsSRshj1q9A6KwaIY/XVV0wlFt+YMLzzkuYMLIe6xmDKSue55FkFO+ tJNgIbsYPYT0WM4o74HUmYy4PnVW07p+o3AVAFPVjJIH4qes2W5Da2OpNxCiF0FqtXmr ltvvsjhqLDSRySNhgOz0OOof0j90NSK3EhyyxaED4kXnRVPYl7lQYKy9ixDHemmKgNmX UPKQcPyqkExX5cCaqGdwHx5Rnwfr3wZf9PZIUw3+EnW7bkyVK5D/YJLFqB/SXjd0wpQt N9uOc5AwuNg466t32IcJZoyROzPS50xlTH/HMHjCynP+WiPYP+th00hNziR7ezwOXl6k /HYA== X-Gm-Message-State: AOJu0Yy1K1j/Ka9lv/8HWldsmt+ECOXBx22cQmD5kVNLLn+scl+1K+bY yVQiqQ/L0JooEsDQbxaYni8+14wJTMkBv70FlalVpwFwKzDVqdm4a7EvNQ== X-Google-Smtp-Source: AGHT+IEHBsIbpUfwp9qe8QeeuVXh6pwXCA+cq0f9HjAFaUyOSw9k5b4cxmj24YmXwJVJgQ+oXQ33hQ== X-Received: by 2002:a05:6830:2c0c:b0:70f:674c:116c with SMTP id 46e09a7af769-70f674c17f3mr3510067a34.24.1725033458765; Fri, 30 Aug 2024 08:57:38 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70f671a8630sm490092a34.51.2024.08.30.08.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:57:38 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: sjg@chromium.org, jernej.skrabec@gmail.com, neil.armstrong@linaro.org, hdegoede@redhat.com, andre.przywara@arm.com, jagan@amarulasolutions.com, trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com, sumit.garg@linaro.org, Chris Morgan Subject: [PATCH V3 2/9] sunxi: H616: DRAM: Add alternative pin mapping Date: Fri, 30 Aug 2024 10:55:07 -0500 Message-Id: <20240830155514.481410-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com> References: <20240830155514.481410-1-macroalpha82@gmail.com> MIME-Version: 1.0 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: Chris Morgan It seems that different dies need different PHY pin mapping. Select alternatives at compile time. Signed-off-by: Jernej Skrabec [adapted to switch from runtime to compile time config] Signed-off-by: Chris Morgan --- arch/arm/mach-sunxi/Kconfig | 17 +++++++++++++++++ arch/arm/mach-sunxi/dram_sun50i_h616.c | 22 +++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 17666814c5..078f8c19fa 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -108,6 +108,23 @@ config DRAM_SUN50I_H616_TPR12 default 0x0 help TPR12 value from vendor DRAM settings. + +choice + prompt "H616 PHY pin mapping selection" + default DRAM_SUN50I_H616_PHY_ADDR_MAP_0 + +config DRAM_SUN50I_H616_PHY_ADDR_MAP_0 + bool "H313/H616/H618" + help + The pin mapping selection used by the H313, H616, H618, and + possibly other dies which use the H616 DRAM controller. + +config DRAM_SUN50I_H616_PHY_ADDR_MAP_1 + bool "H700" + help + The pin mapping selection used by the H700 and possibly other + dies which use the H616 DRAM controller. +endchoice endif config SUN6I_PRCM diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c index 5be2887a06..52f7799173 100644 --- a/arch/arm/mach-sunxi/dram_sun50i_h616.c +++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c @@ -225,6 +225,26 @@ static void mctl_set_addrmap(const struct dram_config *config) mctl_ctl->addrmap[8] = 0x3F3F; } +#ifdef CONFIG_DRAM_SUN50I_H616_PHY_ADDR_MAP_1 +static const u8 phy_init[] = { +#ifdef CONFIG_SUNXI_DRAM_H616_DDR3_1333 + 0x08, 0x02, 0x12, 0x05, 0x15, 0x17, 0x18, 0x0b, + 0x14, 0x07, 0x04, 0x13, 0x0c, 0x00, 0x16, 0x1a, + 0x0a, 0x11, 0x03, 0x10, 0x0e, 0x01, 0x0d, 0x19, + 0x06, 0x09, 0x0f +#elif defined(CONFIG_SUNXI_DRAM_H616_LPDDR3) + 0x18, 0x00, 0x04, 0x09, 0x06, 0x05, 0x02, 0x19, + 0x17, 0x03, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x07, + 0x08, 0x01, 0x1a +#elif defined(CONFIG_SUNXI_DRAM_H616_LPDDR4) + 0x03, 0x00, 0x17, 0x05, 0x02, 0x19, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x01, + 0x18, 0x04, 0x1a +#endif +}; +#else /* CONFIG_DRAM_SUN50I_H616_PHY_ADDR_MAP_0 */ static const u8 phy_init[] = { #ifdef CONFIG_SUNXI_DRAM_H616_DDR3_1333 0x07, 0x0b, 0x02, 0x16, 0x0d, 0x0e, 0x14, 0x19, @@ -243,7 +263,7 @@ static const u8 phy_init[] = { 0x18, 0x03, 0x1a #endif }; - +#endif /* CONFIG_DRAM_SUN50I_H616_PHY_ADDR_MAP_0 */ #define MASK_BYTE(reg, nr) (((reg) >> ((nr) * 8)) & 0x1f) static void mctl_phy_configure_odt(const struct dram_para *para) { From patchwork Fri Aug 30 15:55:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 1979117 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=D1PnbJ1q; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WwN9401czz1yfn for ; Sat, 31 Aug 2024 01:58:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9BD5688CDF; Fri, 30 Aug 2024 17:57:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="D1PnbJ1q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6E54288C51; Fri, 30 Aug 2024 17:57:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) (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 4662D887F3 for ; Fri, 30 Aug 2024 17:57:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-70941cb73e9so858875a34.2 for ; Fri, 30 Aug 2024 08:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725033460; x=1725638260; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JjGMN8JPijabux8Su8R9vbPFntOPbtfER54XsBLarT4=; b=D1PnbJ1qmrjM3D9mVtH8FgEDbcFskmTsYmezigJ8ON4AA01UfJKXGVwlH+gqXQkq/z 6KOFkKkxesxDdaUEap5rbOkmDKq4uwwhF4giQUhQ/0x+2BvpeN8H+VHdUYZ01h5n43b9 i7OkwV+4s+Joi6WMrbtSLCLxYOZnWUV7wfezC2NrkunIQ1JNy5eXZ92rc9moROgildr2 TkyIXT8qPmrHnWSya1Vuzs5d4hryiceRoTDcjPDUND9okpOWhCpywh5e61zT93HIAIlc mHxEiF2AlXwfZ2clw9ZGa2nAEhoDClGxjTFdv5FXlt6BgmOIAMBVdO9GA5kISiGsSRuz Jy8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725033460; x=1725638260; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JjGMN8JPijabux8Su8R9vbPFntOPbtfER54XsBLarT4=; b=P/zsILYi9Nwm762aXwOOxLwgHUd1XpIlNlrOTl5B9gm4z6LzZlTr6Ikr+ZNNFX6xjR p3daxe1VVn0rmytzuCZyIALMkc7SJgO4WZECB+n+ZAzOBodDU5sNQhT34beJbHQABQ4W V4OxD9XeNfALwj9uqc8Het80HbHWPvffV2a9yFp1xxDACnJeSJ4qv2MlOU2wCBggtQp3 bvMwdRU1A6atoNL5WLN6CLehfjFQ58PW8pWJChQ6/wSDTWy9GrWScX0xQS5zWCGzGcK6 fdC+T1UhBpA/jLnWEga8n7WjO9E7bKDWm/thwCaFm+i7rKDdEAEobkSp8TnYRtG7w8i2 Ew2w== X-Gm-Message-State: AOJu0Yy/Jrwu/egO/zAKroh3mXVHY5LkXegygTioCExFPS8XjlvxDHKQ StGDZlFdmHrhiMPLp+h5TfSdPto50g3FOK8iL8P+ZzcwYLgjco0dIZTL8g== X-Google-Smtp-Source: AGHT+IEG5V2t46EvTGeuRixmlfRgdYJi+bJrecDyAP9J+MC+fwm+xBdesN/KrgcOSmwDvwmZlIkf9A== X-Received: by 2002:a05:6830:700d:b0:709:3015:fd08 with SMTP id 46e09a7af769-70f5c40da27mr6757685a34.31.1725033459903; Fri, 30 Aug 2024 08:57:39 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70f671a8630sm490092a34.51.2024.08.30.08.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:57:39 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: sjg@chromium.org, jernej.skrabec@gmail.com, neil.armstrong@linaro.org, hdegoede@redhat.com, andre.przywara@arm.com, jagan@amarulasolutions.com, trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com, sumit.garg@linaro.org, Chris Morgan Subject: [PATCH V3 3/9] sunxi: H616: DRAM: Adjust configuration procedure Date: Fri, 30 Aug 2024 10:55:08 -0500 Message-Id: <20240830155514.481410-4-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com> References: <20240830155514.481410-1-macroalpha82@gmail.com> MIME-Version: 1.0 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: Jernej Skrabec When comparing configuration procedure to vendor driver, I noticed that one command was out of order and that some delays were missing. Fix that. Signed-off-by: Jernej Skrabec Tested-by: Chris Morgan --- arch/arm/mach-sunxi/dram_sun50i_h616.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c index 52f7799173..35405915e9 100644 --- a/arch/arm/mach-sunxi/dram_sun50i_h616.c +++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c @@ -1014,12 +1014,16 @@ static bool mctl_phy_init(const struct dram_para *para, clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 0x14c, 0xe0, 0x20); } + clrbits_le32(&mctl_com->unk_0x500, 0x200); + udelay(1); + clrbits_le32(SUNXI_DRAM_PHY0_BASE + 0x14c, 8); mctl_await_completion((u32 *)(SUNXI_DRAM_PHY0_BASE + 0x180), 4, 4); + udelay(1000); + writel(0x37, SUNXI_DRAM_PHY0_BASE + 0x58); - clrbits_le32(&mctl_com->unk_0x500, 0x200); writel(0, &mctl_ctl->swctl); setbits_le32(&mctl_ctl->dfimisc, 1); @@ -1038,6 +1042,8 @@ static bool mctl_phy_init(const struct dram_para *para, mctl_await_completion(&mctl_ctl->swstat, 1, 1); mctl_await_completion(&mctl_ctl->statr, 3, 1); + udelay(200); + writel(0, &mctl_ctl->swctl); clrbits_le32(&mctl_ctl->dfimisc, 1); @@ -1281,8 +1287,10 @@ static bool mctl_ctrl_init(const struct dram_para *para, setbits_le32(&mctl_ctl->clken, BIT(8)); clrsetbits_le32(&mctl_com->unk_0x500, BIT(24), 0x300); + udelay(1); /* this write seems to enable PHY MMIO region */ setbits_le32(&mctl_com->unk_0x500, BIT(24)); + udelay(1); if (!mctl_phy_init(para, config)) return false; From patchwork Fri Aug 30 15:55:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 1979118 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=MGuiEQ1t; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WwN9F3y8nz1yfn for ; Sat, 31 Aug 2024 01:58:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 097FA88C9A; Fri, 30 Aug 2024 17:57:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="MGuiEQ1t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 39D9488C90; Fri, 30 Aug 2024 17:57:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (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 1BA4088C47 for ; Fri, 30 Aug 2024 17:57:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-70f5a9bf18bso944849a34.2 for ; Fri, 30 Aug 2024 08:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725033461; x=1725638261; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ac3clolXtBWW4FL9/JYgaFFPoi0LZCznqT+B1+LGBPM=; b=MGuiEQ1tCHG+DLIUi4SpASLhdi5atKBRAU2ZVLLNnxz9HEXG0OqyOVpA2E4u0dfYdj 4gW/r03JTtSZ4xWcHWCA091qZPPaaHnUra1kZAp9zxhXu4WAf2XMlOTsiXCeprTrsn25 PFOFfYzBpSuPs8S1YtRsbPEl/f6CWD4ds+PQIq3C4ZAOjySJmiVfY7k9OzxiiYJGdY+o 2SLNlgWQ8PxcwuxZIGXMWQ3nwloYgcRMa1zNuuLTox4P5LsnJPKFwE4pCaOupYhWGheW ZWL1SqkyTWzNbx/hlhJ5Y/jsGGq830SXGtc+TBBhULfJYcow4C2sycFjnUYHEwoeCIvp 5New== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725033461; x=1725638261; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ac3clolXtBWW4FL9/JYgaFFPoi0LZCznqT+B1+LGBPM=; b=DlRi1Co6MM07tcb39qGVfXvj/lFXuqUuJf89iJ8KiXKdLuJwA27NO5YnWp0XVkV0fq qmjJS59s9xqyaVgjgXtEwUciqM+uEvTcRBfEW55ltMwHlXkZHOCcdwATMRC19J6RA9ci N9dRR1mwYmeiNq/ZIRD06iZTe3q5S80pzGR17qh3ZoQGQqa757qU50x6BJf/20hAp5Fi 2kHSF3FTwUbWaIXyWSczEemt2gOGZ4jGzkOXO54YhxZS4ZpE6LKfoCRIp5ILBKBUVLFK Na31eZO10YCcYW5UROiinHh23FhB0z91nRdXet5r232V/tE/pfYoTde/PnyiWnTMAfu0 Hx+A== X-Gm-Message-State: AOJu0YwQaYXRAStmMreOfi0FMiMVoIfHYB6I8w06LKYY/x4mOXCk7pEM 5LF5SFc7YtFRzHz7HzmW44iwiXqvrWGz8Hd1EuM28mpQ/45GSyBYVCp5+g== X-Google-Smtp-Source: AGHT+IFdlX5Qcl7/ogyJmRjJrwuQxkKjB0gqqtA7WCwqVZcj6JtEZ+kAxO73VSBj6yuQypy1wDP6lw== X-Received: by 2002:a05:6830:44a2:b0:709:3b06:d578 with SMTP id 46e09a7af769-70f7072ee46mr18066a34.26.1725033460616; Fri, 30 Aug 2024 08:57:40 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70f671a8630sm490092a34.51.2024.08.30.08.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:57:40 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: sjg@chromium.org, jernej.skrabec@gmail.com, neil.armstrong@linaro.org, hdegoede@redhat.com, andre.przywara@arm.com, jagan@amarulasolutions.com, trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com, sumit.garg@linaro.org, Chris Morgan Subject: [PATCH V3 4/9] sunxi: H616: DRAM: Adjust size scan procedure Date: Fri, 30 Aug 2024 10:55:09 -0500 Message-Id: <20240830155514.481410-5-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com> References: <20240830155514.481410-1-macroalpha82@gmail.com> MIME-Version: 1.0 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: Jernej Skrabec It's safer to start scanning for columns first and then rows. Columns reside on LSB address pins, which means that second configuration will already have all needed row pins active. This is also preparation for introducing DDR4 support, which need scan for banks and bank groups too. Signed-off-by: Jernej Skrabec Tested-by: Chris Morgan --- arch/arm/mach-sunxi/dram_sun50i_h616.c | 31 +++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c index 35405915e9..4782e6fe38 100644 --- a/arch/arm/mach-sunxi/dram_sun50i_h616.c +++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c @@ -1362,28 +1362,33 @@ static void mctl_auto_detect_rank_width(const struct dram_para *para, static void mctl_auto_detect_dram_size(const struct dram_para *para, struct dram_config *config) { - /* detect row address bits */ - config->cols = 8; - config->rows = 18; + unsigned int shift; + + /* max. config for columns, but not rows */ + config->cols = 11; + config->rows = 13; mctl_core_init(para, config); - for (config->rows = 13; config->rows < 18; config->rows++) { - /* 8 banks, 8 bit per byte and 16/32 bit width */ - if (mctl_mem_matches((1 << (config->rows + config->cols + - 4 + config->bus_full_width)))) + shift = config->bus_full_width + 1; + + /* detect column address bits */ + for (config->cols = 8; config->cols < 11; config->cols++) { + if (mctl_mem_matches(1ULL << (config->cols + shift))) break; } + debug("detected %u columns\n", config->cols); - /* detect column address bits */ - config->cols = 11; + /* reconfigure to make sure that all active rows are accessible */ + config->rows = 18; mctl_core_init(para, config); - for (config->cols = 8; config->cols < 11; config->cols++) { - /* 8 bits per byte and 16/32 bit width */ - if (mctl_mem_matches(1 << (config->cols + 1 + - config->bus_full_width))) + /* detect row address bits */ + shift = config->bus_full_width + 4 + config->cols; + for (config->rows = 13; config->rows < 18; config->rows++) { + if (mctl_mem_matches(1ULL << (config->rows + shift))) break; } + debug("detected %u rows\n", config->rows); } static unsigned long mctl_calc_size(const struct dram_config *config) From patchwork Fri Aug 30 15:55:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 1979119 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=PMmzs2uy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WwN9R28hSz1yfn for ; Sat, 31 Aug 2024 01:58:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7CEF388CF3; Fri, 30 Aug 2024 17:57:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="PMmzs2uy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 434E788C9C; Fri, 30 Aug 2024 17:57:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (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 1094888C4D for ; Fri, 30 Aug 2024 17:57:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-70f65cad4b8so624904a34.0 for ; Fri, 30 Aug 2024 08:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725033462; x=1725638262; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AssYWMbHFN8tdCn1r57ryZidzz1hchum9dNphDQAZ40=; b=PMmzs2uyy9hCNjiRK9HJ1RxY/rSIDS3dlxD7Gd65TrKnYAbIx7I7wFc0VWhUqa7CDt Rbbbpuhnf5eAej1jEOMBVr1utlM+LtX0BEee7x/7zzRFlOv4NkWxuDzslfoILNsqSuE7 cqms0BPx8KSQ/95qEqeGJfmUWiLntaCceuWzLJ2vzS46zsDkC8vrygjyn0xTkCPcTlf7 X1XHTolxlYqktzsjtByZa4A8EhbX7P8LBS8H6jZe7pQ8TkoUfnFgqKitXE3EX9lv2n22 NKRgU8U1+VP+5/jXodld4MrRhimBUgHiC33/8ndcmDMucLB2Ah3OblSw8+arBuavPILb 4VNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725033462; x=1725638262; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AssYWMbHFN8tdCn1r57ryZidzz1hchum9dNphDQAZ40=; b=X1pTifY5EZ/C3VSynINGdg82DqwHWqsevPGoYYoLN64eBfPw/CuGN6soeD0qpLi9aT hPq/IhxG66Y/8GOTtUxwYxTrxSHEIjqhSUdfTcVo/pXhfBbRtYSd9LqMxCv83WC/D7Nr h40rZk5EZxutl6LXYuTTD7OnRz0rjnbZ9Uk8Oj+tQ2re2reG8ha3hI8Hfj4cz8x0fw/d ZD3CFhiaR8vv6/FUvP3l4jA0XduV1itUGvyTSIZuMphG5sBsT9uHDo8DXLnLFudtkVY9 j4yjiksENYVQhkQzxUX0K4V/AY2GZoViga83iDBoIQ6Za+FfKOS1GxhDSWHoG2dcarPj LbmQ== X-Gm-Message-State: AOJu0YwDRh8fBGww3ZKp9UY+ZA3H/6cEtAb+6cK0N4GJRkRzr3pGowzv Ng3J5Yjwf7hGwofrTQqiKSI/tPJCMyKiGxhyWE2n5f6GBkP7utZ1go5kew== X-Google-Smtp-Source: AGHT+IHoKp+AAk5rjRIe35HAwAj0B13fy69idHtsqD0pHkzuqgX9El/+AHGMWn7I+L09TNDV0KvY4w== X-Received: by 2002:a05:6830:4990:b0:703:6cde:1cb9 with SMTP id 46e09a7af769-70f67f2d740mr1491462a34.13.1725033461661; Fri, 30 Aug 2024 08:57:41 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70f671a8630sm490092a34.51.2024.08.30.08.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:57:41 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: sjg@chromium.org, jernej.skrabec@gmail.com, neil.armstrong@linaro.org, hdegoede@redhat.com, andre.przywara@arm.com, jagan@amarulasolutions.com, trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com, sumit.garg@linaro.org, Chris Morgan Subject: [PATCH V3 5/9] sunxi: H616: dram: Update mbus priorities Date: Fri, 30 Aug 2024 10:55:10 -0500 Message-Id: <20240830155514.481410-6-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com> References: <20240830155514.481410-1-macroalpha82@gmail.com> MIME-Version: 1.0 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: Jernej Skrabec CSI1 channel (22) is missing and IOMMU (25) has priority flag set in vendor bootloader. Fix that. While at it, replace bandwidth flag with priority since original flag has always value "true". Signed-off-by: Jernej Skrabec Tested-by: Chris Morgan Reviewed-by: Andre Przywara --- arch/arm/mach-sunxi/dram_sun50i_h616.c | 41 +++++++++++++------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c index 4782e6fe38..863c4f1d7a 100644 --- a/arch/arm/mach-sunxi/dram_sun50i_h616.c +++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c @@ -55,8 +55,8 @@ static void mbus_configure_port(u8 port, writel_relaxed(cfg1, &mctl_com->master[port].cfg1); } -#define MBUS_CONF(port, bwlimit, qos, acs, bwl0, bwl1, bwl2) \ - mbus_configure_port(port, bwlimit, false, \ +#define MBUS_CONF(port, priority, qos, acs, bwl0, bwl1, bwl2) \ + mbus_configure_port(port, true, priority, \ MBUS_QOS_ ## qos, 0, acs, bwl0, bwl1, bwl2) static void mctl_set_master_priority(void) @@ -68,24 +68,25 @@ static void mctl_set_master_priority(void) writel(399, &mctl_com->tmr); writel(BIT(16), &mctl_com->bwcr); - MBUS_CONF( 0, true, HIGHEST, 0, 256, 128, 100); - MBUS_CONF( 1, true, HIGH, 0, 1536, 1400, 256); - MBUS_CONF( 2, true, HIGHEST, 0, 512, 256, 96); - MBUS_CONF( 3, true, HIGH, 0, 256, 100, 80); - MBUS_CONF( 4, true, HIGH, 2, 8192, 5500, 5000); - MBUS_CONF( 5, true, HIGH, 2, 100, 64, 32); - MBUS_CONF( 6, true, HIGH, 2, 100, 64, 32); - MBUS_CONF( 8, true, HIGH, 0, 256, 128, 64); - MBUS_CONF(11, true, HIGH, 0, 256, 128, 100); - MBUS_CONF(14, true, HIGH, 0, 1024, 256, 64); - MBUS_CONF(16, true, HIGHEST, 6, 8192, 2800, 2400); - MBUS_CONF(21, true, HIGHEST, 6, 2048, 768, 512); - MBUS_CONF(25, true, HIGHEST, 0, 100, 64, 32); - MBUS_CONF(26, true, HIGH, 2, 8192, 5500, 5000); - MBUS_CONF(37, true, HIGH, 0, 256, 128, 64); - MBUS_CONF(38, true, HIGH, 2, 100, 64, 32); - MBUS_CONF(39, true, HIGH, 2, 8192, 5500, 5000); - MBUS_CONF(40, true, HIGH, 2, 100, 64, 32); + MBUS_CONF(0, false, HIGHEST, 0, 256, 128, 100); + MBUS_CONF(1, false, HIGH, 0, 1536, 1400, 256); + MBUS_CONF(2, false, HIGHEST, 0, 512, 256, 96); + MBUS_CONF(3, false, HIGH, 0, 256, 100, 80); + MBUS_CONF(4, false, HIGH, 2, 8192, 5500, 5000); + MBUS_CONF(5, false, HIGH, 2, 100, 64, 32); + MBUS_CONF(6, false, HIGH, 2, 100, 64, 32); + MBUS_CONF(8, false, HIGH, 0, 256, 128, 64); + MBUS_CONF(11, false, HIGH, 0, 256, 128, 100); + MBUS_CONF(14, false, HIGH, 0, 1024, 256, 64); + MBUS_CONF(16, false, HIGHEST, 6, 8192, 2800, 2400); + MBUS_CONF(21, false, HIGHEST, 6, 2048, 768, 512); + MBUS_CONF(22, false, HIGH, 0, 256, 128, 100); + MBUS_CONF(25, true, HIGHEST, 0, 100, 64, 32); + MBUS_CONF(26, false, HIGH, 2, 8192, 5500, 5000); + MBUS_CONF(37, false, HIGH, 0, 256, 128, 64); + MBUS_CONF(38, false, HIGH, 2, 100, 64, 32); + MBUS_CONF(39, false, HIGH, 2, 8192, 5500, 5000); + MBUS_CONF(40, false, HIGH, 2, 100, 64, 32); dmb(); } From patchwork Fri Aug 30 15:55:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 1979120 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=UZx3FjbA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WwN9c2tgTz1yfn for ; Sat, 31 Aug 2024 01:58:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E85AC88CF7; Fri, 30 Aug 2024 17:57:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="UZx3FjbA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 585CE88CD5; Fri, 30 Aug 2024 17:57:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (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 EE2D788C75 for ; Fri, 30 Aug 2024 17:57:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-70943713472so944952a34.2 for ; Fri, 30 Aug 2024 08:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725033462; x=1725638262; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cvx+OSd/qEmaYvqkbQ2O8pkMqNCsgUCrsZyTpmqIRyY=; b=UZx3FjbA8cnqRRgQTWXsOd7UT+Ad0/QpX3QjeeQv+r7HowioLaWNaiGYVrjg40lvMc hPYp5ibr70PhyzoNzY9ABfZypwI0/qr0qIQ2Ttx2Ap0mrd8Dh2U0ydTePuB/H7+UTmOp xbBcSuVbkl/9kKPHtQ4HDa2Hf+HavpCDdP6Sa9UIkpQlMd7Uxyg8T/AzCLoyehhbGPSE d+YvuRMeYkhcck3knVZlXBDaYLfonw3WA/vFJCDINNebJ/kXUMs6EEM1M14XVy/IRX/s oO3rIE5nFiXtelGQPWg5DxuBo0gloxLQntz0jbj0zzD2ZhKQT1BGPdV/15suoJafqMoX KxVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725033462; x=1725638262; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cvx+OSd/qEmaYvqkbQ2O8pkMqNCsgUCrsZyTpmqIRyY=; b=lrCujwqyzfgSzSqeHV0nn3S4Ja67Fvc0Z3Kwsgl/i+uxzRHiCWjHxjBD0ikI8QEcCR 61TNx5KFl0g5JQTMJoyTRsOXXBy7lXC0dvxTkijwqbhjHwLqklH9TaYbeZLGJNm7Cdr7 HUs4/xFM31VG3BHSWyG8d3P4dMCDq1wAqOyVAvzrDZh6tvcDQiyplraQZF19zn9/ULHz HFNJViKjf1mucjFMXtJZOTz9lvncxgKuZ+x7/RxceQjkiK9i29iZ8P5tlEpb8LEbDeOF 16Cjs8SUAzgF6cnM4Gkb8qgChut68laDJUqQ1K9VzhmpJRUEMxVxLbWbzpnT8P+0V7j+ 38PA== X-Gm-Message-State: AOJu0YyiKj5WhG2VZqJhYY00gNJIjNdLTB+Syl9OlyHgKORFquHocoRn ypYu/KvnwhQfSXl4XI0aEo/jhnnAZLToDWmVzqZ+ehlJJEg4H9APvPhdSg== X-Google-Smtp-Source: AGHT+IGFi2nsiWmlzJ7LiExAj6Jml6zmvKy2lOqU1LCQXr/2IueQPGvnoREKuOEGSOCdOiHDgOxpzw== X-Received: by 2002:a05:6830:44ab:b0:70a:949c:144e with SMTP id 46e09a7af769-70f5c42cdeamr6434935a34.32.1725033462479; Fri, 30 Aug 2024 08:57:42 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70f671a8630sm490092a34.51.2024.08.30.08.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:57:42 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: sjg@chromium.org, jernej.skrabec@gmail.com, neil.armstrong@linaro.org, hdegoede@redhat.com, andre.przywara@arm.com, jagan@amarulasolutions.com, trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com, sumit.garg@linaro.org, Chris Morgan Subject: [PATCH V3 6/9] sunxi: Correct TPR6 parameter for H616 DRAM driver Date: Fri, 30 Aug 2024 10:55:11 -0500 Message-Id: <20240830155514.481410-7-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com> References: <20240830155514.481410-1-macroalpha82@gmail.com> MIME-Version: 1.0 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: Chris Morgan Correct the default TPR6 parameter based on suggestion from Mikhail Kalashnikov. [1] [1] https://lore.kernel.org/u-boot/4c003cab-c8b8-484d-924d-084e71fe666e@gmail.com/ Fixes: 4b02f0120a4b ("sunxi: H616: add LPDDR4 DRAM support") Suggested-by: Mikhail Kalashnikov Signed-off-by: Chris Morgan --- arch/arm/mach-sunxi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 078f8c19fa..5b3571025f 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -87,7 +87,7 @@ config DRAM_SUN50I_H616_TPR2 config DRAM_SUN50I_H616_TPR6 hex "H616 DRAM TPR6 parameter" - default 0x3300c080 + default 0x33c00080 help TPR6 value from vendor DRAM settings. From patchwork Fri Aug 30 15:55:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 1979121 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=GCEw1i6D; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WwN9p2bZKz1yfn for ; Sat, 31 Aug 2024 01:58:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5754C88C47; Fri, 30 Aug 2024 17:57:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="GCEw1i6D"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F0E4288CEA; Fri, 30 Aug 2024 17:57:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) (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 97B5188C90 for ; Fri, 30 Aug 2024 17:57:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-5d5e97b8a22so1111784eaf.2 for ; Fri, 30 Aug 2024 08:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725033463; x=1725638263; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NrgfAHom+R5ffS5XA8s7S+oDhg2omeL54jrvieS25sU=; b=GCEw1i6DDlWjisipvb3aEyILZf+FRqD2vuvZ0A/O4flPtpRP3F+g2PwJgcVH9wat1M Aj5XdC2mM/Nz0MtngcRwEy6u39TdwbZwcBe/El6fO3GIDtT2ezlLkeFAyeaGxGj6TeoI arWP2+40TINYK9IHvu7Cbs6kWKOSDs9IFw7TiCOzAl69h+KfXBi5CB7NCfTjGuskXLzF 3YaLZe/mfRgx2zqvyTANrS7rPg612Zxlaw7RFJuQsTFTij28VdxaOa/QMy4OZSkYzrJ8 decn45QqhchSTpaVVx7td9ZGMMdjNxT9ax7E4AODEzMDGYuFk0CN2j9SjhoMS41+LlXt dFXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725033463; x=1725638263; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NrgfAHom+R5ffS5XA8s7S+oDhg2omeL54jrvieS25sU=; b=pOh5x8lRPjIOnMgvvw7SvN+Lk/8GinkhlnvBiiNx2SVo5Nk2Pa0fqO2FJ+G1ix8WH8 I4lP1km7aOUC2S+fUlIQLr4RO3MI7/JH3dea9eiD61/977X42MVREXnamsVxr581HWof mGSB5dfKjtJyEWYsGCRpKem00oHBdbIEs/r4sJA3ra3mjzB37sRgzLy8jd0Ikdne+R++ lLXhHFEDl9TMeq5vLz261V6XjhvF5dKyO7n7Zt8K/EQ36fhr2RLJ/6uzORjWc2qCQu54 Gj54EIatIBJgr65vajtsby5QY+5mC5Cy/3TlgcrvgQFCfiUwymF22pGch7wfDDEKAHPX vASQ== X-Gm-Message-State: AOJu0YwrIZoa0djKW+buDa6JSYR/couyMuLV9z5fARX1p1nshQrkHxNP MsVIjl3mzO+EdN92eVxAneee3mHFR3RSzafoqwRURxXn7NY5Vp/eS4NlQQ== X-Google-Smtp-Source: AGHT+IHi5S1RuAU74YwXHmR3DVobnlIrej+boFSl/OpLYDG/OSpdaU7VTCuoN4dFtkesIqLW6lcYWA== X-Received: by 2002:a05:6870:2055:b0:267:df02:f7c0 with SMTP id 586e51a60fabf-277902c5471mr6322765fac.33.1725033463213; Fri, 30 Aug 2024 08:57:43 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70f671a8630sm490092a34.51.2024.08.30.08.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:57:42 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: sjg@chromium.org, jernej.skrabec@gmail.com, neil.armstrong@linaro.org, hdegoede@redhat.com, andre.przywara@arm.com, jagan@amarulasolutions.com, trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com, sumit.garg@linaro.org, Chris Morgan Subject: [PATCH V3 7/9] arm64: dts: allwinner: h616: Add r_i2c pinctrl nodes Date: Fri, 30 Aug 2024 10:55:12 -0500 Message-Id: <20240830155514.481410-8-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com> References: <20240830155514.481410-1-macroalpha82@gmail.com> MIME-Version: 1.0 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: Chris Morgan Add pinctrl nodes for the r_i2c node. Without the pinmux defined the r_i2c bus may fail to work, possibly if the bootloader uses rsb mode for the PMIC. Link: https://lore.kernel.org/linux-sunxi/172252952262.1669767.7675865282122079154.b4-ty@csie.org/ [ upstream commit: 7c9ea4ab76176f65f4f55aa144f9145a4bccaacb ] Signed-off-by: Chris Morgan --- arch/arm/dts/sun50i-h616.dtsi | 2 ++ dts/upstream/src/arm64/allwinner/sun50i-h616.dtsi | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi index 921d5f61d8..41f2c23e07 100644 --- a/arch/arm/dts/sun50i-h616.dtsi +++ b/arch/arm/dts/sun50i-h616.dtsi @@ -836,6 +836,8 @@ clocks = <&r_ccu CLK_R_APB2_I2C>; dmas = <&dma 48>, <&dma 48>; dma-names = "rx", "tx"; + pinctrl-names = "default"; + pinctrl-0 = <&r_i2c_pins>; resets = <&r_ccu RST_R_APB2_I2C>; status = "disabled"; #address-cells = <1>; diff --git a/dts/upstream/src/arm64/allwinner/sun50i-h616.dtsi b/dts/upstream/src/arm64/allwinner/sun50i-h616.dtsi index 921d5f61d8..41f2c23e07 100644 --- a/dts/upstream/src/arm64/allwinner/sun50i-h616.dtsi +++ b/dts/upstream/src/arm64/allwinner/sun50i-h616.dtsi @@ -836,6 +836,8 @@ clocks = <&r_ccu CLK_R_APB2_I2C>; dmas = <&dma 48>, <&dma 48>; dma-names = "rx", "tx"; + pinctrl-names = "default"; + pinctrl-0 = <&r_i2c_pins>; resets = <&r_ccu RST_R_APB2_I2C>; status = "disabled"; #address-cells = <1>; From patchwork Fri Aug 30 15:55:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 1979122 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=dCgaW393; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WwNB06PzYz1yfn for ; Sat, 31 Aug 2024 01:59:04 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AF1AA88C9C; Fri, 30 Aug 2024 17:57:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="dCgaW393"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C818088CF7; Fri, 30 Aug 2024 17:57:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (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 6B77B88C4D for ; Fri, 30 Aug 2024 17:57:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-70f6cb5518aso346659a34.1 for ; Fri, 30 Aug 2024 08:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725033464; x=1725638264; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m9pNeFmCdL12rOn66diT5pbvz0zTbF7OwHhL6mMDQC8=; b=dCgaW393yBlXz26ZtGoplDjSEtsNUwIKsPK6P6ALq95+vqGjsU5t8hkpstEKGLjACO s4Oi+dvj2kYM3KuoHQaUY3LPCCiVri+ZaXOIW3zsGNrLuI1hC7LrrvGEpCYayDAyAAsG Xj/dkBNPpdeI+1F9Y155t94//BhntFoHuxBHTSG5U5X+NMndkLNFrd1Va08YQ/QlPra/ HdRe/RG7nHdmoSiA7GMTvvIBY2RWkOXgeMFC9Cgb1sxQuqEA1wtv05UqM2v6t8KFPH1C RxO1XyKGI6cTRPcGPGHGPJI4wGQjlbryFY2CBBT0IjKxn9a9E79VkobS2iQEX70O7fk0 zJGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725033464; x=1725638264; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m9pNeFmCdL12rOn66diT5pbvz0zTbF7OwHhL6mMDQC8=; b=JWVKjYJNoSfTed28YmaY+dosjUyJnWTkjvNQJ3nh7yTHVtSMbXNuauITcWkcLLZQSo BYs7y08sfyGPmINvhKFacs4T+exBmqbFic2UoxxCINy3jd1HqfNQ8ZXkXoCkFEJad0LT iOzNzmWOJx032Silxew1o3iNvKsxcqyonU0H4/zlh6hz2L+fsTDOYhEKJnmXrkGTnb6p +ued8K0UEpgVa1mV5t/NP5uJC+ulIAzT08+ozkp4CERm3K8UNSAdXTlMh7nm/56WCwcL DUXRp7pNwb8k950ZjJ9w16W+kmU2R6hZMsiDwtg7BdtfXsIjLuUR7w/rlJ5wDxKUsIAs sHbg== X-Gm-Message-State: AOJu0Yz+GJDr2HkUwGn58uBOWGNv+dfXbd4Sm4OXM7uuvCevkfafAMru 86VTIVmERgxw0o3xVgrkrVOKYTksN8NO22eS+JhTZReai350GebN+WfAKw== X-Google-Smtp-Source: AGHT+IEQy20l9GSiVtUdNG0/vDPOm/WmLKzLq6SKpe8+EWNVSjp3VgC/btzwfI4RQI/eivjzghVwgA== X-Received: by 2002:a05:6830:916:b0:708:29dc:d2fc with SMTP id 46e09a7af769-70f5c3a9a52mr6552587a34.19.1725033464013; Fri, 30 Aug 2024 08:57:44 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70f671a8630sm490092a34.51.2024.08.30.08.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:57:43 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: sjg@chromium.org, jernej.skrabec@gmail.com, neil.armstrong@linaro.org, hdegoede@redhat.com, andre.przywara@arm.com, jagan@amarulasolutions.com, trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com, sumit.garg@linaro.org, Chris Morgan Subject: [PATCH V3 8/9] arm64: dts: allwinner: h616: Change RG35XX PMIC to r_i2c Date: Fri, 30 Aug 2024 10:55:13 -0500 Message-Id: <20240830155514.481410-9-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com> References: <20240830155514.481410-1-macroalpha82@gmail.com> MIME-Version: 1.0 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: Chris Morgan Change the Anbernic RG35XX series to use the r_i2c bus for the PMIC instead of the r_rsb bus. This is to keep the device tree consistent as there are at least 3 devices (the RG35XX-SP, RG28XX, and RG40XX-H) that have an external RTC on the r_i2c bus. Link: https://lore.kernel.org/linux-sunxi/172252952262.1669767.7675865282122079154.b4-ty@csie.org/ [ upstream commit: c712e5d0985628b1df13930489b49b740e610a2b ] Signed-off-by: Chris Morgan --- arch/arm/dts/sun50i-h700-anbernic-rg35xx-2024.dts | 6 +++--- .../arm64/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/dts/sun50i-h700-anbernic-rg35xx-2024.dts b/arch/arm/dts/sun50i-h700-anbernic-rg35xx-2024.dts index ee30584b6a..e2bbd22bd8 100644 --- a/arch/arm/dts/sun50i-h700-anbernic-rg35xx-2024.dts +++ b/arch/arm/dts/sun50i-h700-anbernic-rg35xx-2024.dts @@ -201,12 +201,12 @@ vcc-pi-supply = <®_cldo3>; }; -&r_rsb { +&r_i2c { status = "okay"; - axp717: pmic@3a3 { + axp717: pmic@34 { compatible = "x-powers,axp717"; - reg = <0x3a3>; + reg = <0x34>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&nmi_intc>; diff --git a/dts/upstream/src/arm64/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts b/dts/upstream/src/arm64/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts index ee30584b6a..e2bbd22bd8 100644 --- a/dts/upstream/src/arm64/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts +++ b/dts/upstream/src/arm64/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts @@ -201,12 +201,12 @@ vcc-pi-supply = <®_cldo3>; }; -&r_rsb { +&r_i2c { status = "okay"; - axp717: pmic@3a3 { + axp717: pmic@34 { compatible = "x-powers,axp717"; - reg = <0x3a3>; + reg = <0x34>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&nmi_intc>; From patchwork Fri Aug 30 15:55:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 1979123 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=TFCLG/u8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WwNBC1gBCz1yfn for ; Sat, 31 Aug 2024 01:59:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 197B988CCE; Fri, 30 Aug 2024 17:57:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="TFCLG/u8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B456E88C75; Fri, 30 Aug 2024 17:57:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) (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 1859388CD1 for ; Fri, 30 Aug 2024 17:57:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=macroalpha82@gmail.com Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-26fda13f898so1199089fac.1 for ; Fri, 30 Aug 2024 08:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725033465; x=1725638265; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T3FW+I+lePMlHT5ixc8Sbpd6OJIkdW5ZAfASeRacnPw=; b=TFCLG/u8O6WbhwcuMBf1UjuNgIFxJkrDhYsMKgFL2D4eWtFFK0IMbMljrGOEZQHWYN c4vQhGAP6nIQGky4WSwJeU5JuUXDSC8ZSzstFw1zgBkA5lEhHamxaHzl7ljSpIPaebVr 27lFyAzgOCxm1Aztc0i2y2hhlp9UsmYBVNqRBLgOMV20M02TaB6XQ+rZCjKv3az80jK0 W9fIktXIHnDJfWf72D2o/2EhM3CyL2FL/lFZCMHTV3sVolFhSEI9N1Ztu6HZeGT5Eidf copnaVBVASflb+mLfrAgJe4/Gsl3ExIo+bLFxYAQtiVqBV1tNcBhPycDtJugCGJaS6Lc tYRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725033465; x=1725638265; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T3FW+I+lePMlHT5ixc8Sbpd6OJIkdW5ZAfASeRacnPw=; b=C8g1dgb1HWEc5vdGA1voIw+6WnEIRpBmK56l+Rll4yMRmrS0SaSPZyoDmuh2yGaPwr 6AaKQ3eZi+pvZnY224wVYysbtNSyjIdO4/QpRoVTr4+fA5mqwxT4HFhSL+wfZsEetbnM 3kHVda3BaNo90KVISsFI98mv3i6g3Yqj3DPHmOzTe7AcIVySqB0nm/yK7ebVS2FxtHt1 Tf+YsKTPzncsakrctDkxi6zKh6OH9irwKzYwgSs9wpg9x6kHytG0kuyoYDXWN3Az3X5j 6566kWdZLUnt65cXOIS0Ra+TtGz2rR70wdLNU00w17W1iWG7M6MMGts9eqsEUj8cXNXF N1Aw== X-Gm-Message-State: AOJu0Yx5RsJjV5t7nNkTbDJTeQRKM9O9GtGuqdI8Q7HhfEjsvbSpGfNN yjBCOLbx+p8EhiQIJpviBbskmeevgK9KTKRnvm1XTvU3tNjPvhO3gi6vJw== X-Google-Smtp-Source: AGHT+IFAS3TphuUTkO57Y8Q9Qh5aVD0ymKbJbH03pUd+zrglZbMaT/dPs1OgHiurMjbYJ0HHZ9WrTg== X-Received: by 2002:a05:6870:6594:b0:261:9fc:16b9 with SMTP id 586e51a60fabf-277902b4b75mr8030788fac.33.1725033464704; Fri, 30 Aug 2024 08:57:44 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70f671a8630sm490092a34.51.2024.08.30.08.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:57:44 -0700 (PDT) From: Chris Morgan To: u-boot@lists.denx.de Cc: sjg@chromium.org, jernej.skrabec@gmail.com, neil.armstrong@linaro.org, hdegoede@redhat.com, andre.przywara@arm.com, jagan@amarulasolutions.com, trini@konsulko.com, ryan@testtoast.com, iuncuim@gmail.com, sumit.garg@linaro.org, Chris Morgan Subject: [PATCH V3 9/9] sunxi: Add support for Anbernic RG35XX-2024 Date: Fri, 30 Aug 2024 10:55:14 -0500 Message-Id: <20240830155514.481410-10-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240830155514.481410-1-macroalpha82@gmail.com> References: <20240830155514.481410-1-macroalpha82@gmail.com> MIME-Version: 1.0 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: Chris Morgan The Anbernic RG35XX series of devices are based around an Allwinner H700 SoC with 1GB of RAM, 2 SD cards, and multiple input buttons. This bootloader has been tested on the Anbernic RG35XX-2024 and RG35XX-H, but should be suitable for the entire lineup of H700 based devices. A future series of updates will add board selection logic to identify and load the correct device tree automatically. Signed-off-by: Chris Morgan --- board/sunxi/MAINTAINERS | 5 +++++ configs/anbernic_rg35xx_h700_defconfig | 28 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 configs/anbernic_rg35xx_h700_defconfig diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 4ad77c75f5..84799879e8 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -132,6 +132,11 @@ M: Paul Kocialkowski S: Maintained F: configs/Ampe_A76_defconfig +ANBERNIC RG35XX-2024 +M: Chris Morgan +S: Maintained +F: configs/anbernic_rg35xx_h700_defconfig + BANANAPI M1 PLUS M: Jagan Teki S: Maintained diff --git a/configs/anbernic_rg35xx_h700_defconfig b/configs/anbernic_rg35xx_h700_defconfig new file mode 100644 index 0000000000..57112f7d70 --- /dev/null +++ b/configs/anbernic_rg35xx_h700_defconfig @@ -0,0 +1,28 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_DEFAULT_DEVICE_TREE="sun50i-h700-anbernic-rg35xx-2024" +CONFIG_SPL=y +CONFIG_DRAM_SUN50I_H616_DX_ODT=0x08080808 +CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e +CONFIG_DRAM_SUN50I_H616_CA_DRI=0x0e0e +CONFIG_DRAM_SUN50I_H616_ODT_EN=0x7887bbbb +CONFIG_DRAM_SUN50I_H616_TPR2=0x1 +CONFIG_DRAM_SUN50I_H616_TPR6=0x40808080 +CONFIG_DRAM_SUN50I_H616_TPR10=0x402f6633 +CONFIG_DRAM_SUN50I_H616_TPR11=0x1b1f1e1c +CONFIG_DRAM_SUN50I_H616_TPR12=0x06060606 +CONFIG_DRAM_SUN50I_H616_PHY_ADDR_MAP_1=y +CONFIG_MACH_SUN50I_H616=y +CONFIG_SUNXI_DRAM_H616_LPDDR4=y +CONFIG_DRAM_CLK=672 +CONFIG_R_I2C_ENABLE=y +CONFIG_DEFAULT_FDT_FILE="sun50i-h700-anbernic-rg35xx-2024.dtb" +CONFIG_SPL_I2C=y +CONFIG_SPL_SYS_I2C_LEGACY=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_SYS_I2C_SLAVE=0x7f +CONFIG_SYS_I2C_SPEED=400000 +CONFIG_REGULATOR_AXP=y +CONFIG_AXP717_POWER=y +CONFIG_AXP_DCDC2_VOLT=940 +CONFIG_AXP_DCDC3_VOLT=1100