2021.07 RC2

This commit is contained in:
Peter Robinson 2021-05-10 22:20:20 +01:00
parent 6209cab21a
commit d6fc5ecb4b
8 changed files with 12 additions and 4850 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,152 +0,0 @@
From patchwork Sun Apr 25 23:08:03 2021
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Yuichiro Goto <goto@k-tech.co.jp>
X-Patchwork-Id: 1470141
Return-Path: <u-boot-bounces@lists.denx.de>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: 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=<UNKNOWN>)
Authentication-Results: ozlabs.org;
dkim=pass (2048-bit key;
unprotected) header.d=k-tech-co-jp.20150623.gappssmtp.com
header.i=@k-tech-co-jp.20150623.gappssmtp.com header.a=rsa-sha256
header.s=20150623 header.b=aG2evrkI;
dkim-atps=neutral
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 RSA-PSS (4096 bits))
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 4FT3cr5pLLz9sV5
for <incoming@patchwork.ozlabs.org>; Mon, 26 Apr 2021 09:09:16 +1000 (AEST)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id DAAE481FCD;
Mon, 26 Apr 2021 01:09:09 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=none (p=none dis=none) header.from=k-tech.co.jp
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=k-tech-co-jp.20150623.gappssmtp.com
header.i=@k-tech-co-jp.20150623.gappssmtp.com header.b="aG2evrkI";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 1971382057; Mon, 26 Apr 2021 01:09:06 +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,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2
Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com
[IPv6:2607:f8b0:4864:20::42a])
(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 E883680EC1
for <u-boot@lists.denx.de>; Mon, 26 Apr 2021 01:09:00 +0200 (CEST)
Authentication-Results: phobos.denx.de;
dmarc=none (p=none dis=none) header.from=k-tech.co.jp
Authentication-Results: phobos.denx.de;
spf=none smtp.mailfrom=goto@k-tech.co.jp
Received: by mail-pf1-x42a.google.com with SMTP id h11so6707950pfn.0
for <u-boot@lists.denx.de>; Sun, 25 Apr 2021 16:09:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=k-tech-co-jp.20150623.gappssmtp.com; s=20150623;
h=from:to:cc:subject:date:message-id;
bh=ToYmsqKBzr3zTVvJdRjIX1oCqkuII+g2LxuLKTcyCm4=;
b=aG2evrkIlEWR+2+O4uf7Z5Z5dADCoHUqUfa4wv2uGZq16LXSZXAfr96QVEaI+Ysrq9
S1Wd+94g29kp+qnFc4wLcMUomaZnm0eH+oliBgyqOH/LAB8n7c8avUhcTMJA60McRjeb
lMsHOX4LwDCbN9Nem+kDEPLIGsYIlg4bQczceWdlw5oHTMNRrj3uqSx1S52Y2xVo9Tl2
fGiB75T4OGHlO+4ZfXl6Ky1Q6j8eRAp0ysfO9ZY/SjDd8dFowmDn8nCU3Bmy4boJaiK9
uBxgI8S7h0uSltG+o8KcszPN/fpi2H8oBFuia8kJ1X/mrQ9AK4+n9jA4m5XlsXuyJYon
NSNA==
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=ToYmsqKBzr3zTVvJdRjIX1oCqkuII+g2LxuLKTcyCm4=;
b=idcco1cmfR9jg46QoNPi2i5Xp7KywMSugg82Gr+a6q2d+z8Y0bAWm69vVvCv27OuBe
EqSikfaPx616hVlE2JSRYhiQjTAkRivx+HbZTOo88Ud3nFuZSye7IzWVgTJQfYeMwk2t
ur3IC3wNHP8ZJZd7/ncR5bQtEH1dnQnntzZ/ObcQ2qYD7tE8i3XirP+t6bEXgfve6l3z
h8uhRhUdonx3My77SfoguPZ7agogNuJwKDxEOv2AiQC+sgi6hMSoCM5I/CTY5XBXWBcG
DsVq6CFis7XI0q4vT+fJnobTZcY+apdx6CQgbTHscvNNANNVQTcW4AmZtdMU00Py7rwl
+dlw==
X-Gm-Message-State: AOAM530gSI6IYWTUQZeEHkOvsFu+rBGyB3fBUHY4LPk43shM1KC4uXnK
KlhhaOqM5unov+ya4+knemWrDiRXPLvgHgVJ
X-Google-Smtp-Source:
ABdhPJz3Z6j4z6TV4bjvrr75pCyOMhSLC37qICUXTZOgOyojVAW7AH0TT24BTcUVdx8V5n2RwnQzBA==
X-Received: by 2002:a62:8c8c:0:b029:253:31e:55cb with SMTP id
m134-20020a628c8c0000b0290253031e55cbmr14541132pfd.27.1619392138942;
Sun, 25 Apr 2021 16:08:58 -0700 (PDT)
Received: from lubuntu1804.flets-east.jp (p1086-maru1shinjuku.tokyo.ocn.ne.jp.
[61.208.220.86])
by smtp.gmail.com with ESMTPSA id i63sm9669769pfg.112.2021.04.25.16.08.57
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 25 Apr 2021 16:08:58 -0700 (PDT)
From: Yuichiro Goto <goto@k-tech.co.jp>
To: u-boot@lists.denx.de
Cc: Yuichiro Goto <goto@k-tech.co.jp>, Peter Robinson <pbrobinson@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Subject: [PATCH v3] IOMUX: Fix buffer overflow in iomux_replace_device()
Date: Mon, 26 Apr 2021 08:08:03 +0900
Message-Id: <20210425230803.3055-1-goto@k-tech.co.jp>
X-Mailer: git-send-email 2.17.1
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de
X-Virus-Status: Clean
Use of strcat() against an uninitialized buffer would lead
to buffer overflow. This patch fixes it.
Fixes: 694cd5618c ("IOMUX: Introduce iomux_replace_device()")
Signed-off-by: Yuichiro Goto <goto@k-tech.co.jp>
Cc: Peter Robinson <pbrobinson@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
Changes for v3:
- Add a Fixes tag in commit message
- Refactor the patch per suggestion from Andy Shevchenko
Changes for v2:
- Add "IOMUX" in title
common/iomux.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/common/iomux.c b/common/iomux.c
index b9088aa3b5..c428f7110a 100644
--- a/common/iomux.c
+++ b/common/iomux.c
@@ -158,8 +158,12 @@ int iomux_replace_device(const int console, const char *old, const char *new)
return -ENOMEM;
}
- strcat(tmp, ",");
- strcat(tmp, name);
+ if (arg) {
+ strcat(tmp, ",");
+ strcat(tmp, name);
+ }
+ else
+ strcpy(tmp, name);
arg = tmp;
size = strlen(tmp) + 1;

View File

@ -4,6 +4,7 @@ MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Patchwork-Submitter: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
X-Patchwork-Id: 1471143
X-Patchwork-Delegate: xypron.glpk@gmx.de
Return-Path: <u-boot-bounces@lists.denx.de>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
@ -187,6 +188,8 @@ Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Stefan Sørensen <stefan.sorensen@spectralink.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Michal Simek <michal.simek@xilinx.com>
---
V2:

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
SHA512 (u-boot-2021.04.tar.bz2) = c24835a520bfd528032614576ca552e55e6de129372e72e22e80e0d45dc5c1c75aa4aad80e856d5bbd7146ec092cac52a6f352253cf3fdf9fe536f5e87782803
SHA512 (u-boot-2021.07-rc2.tar.bz2) = 3d753a7e85894fd0ecbe9ffcf6da6cc8f5e5d26cb1ec2505035c2183729d1b3ae5e4ece6ecdd93125f50627cd3e358cd911570c366e7e9dafac2c1369ca49697

View File

@ -1,337 +0,0 @@
From patchwork Thu Feb 25 16:13:24 2021
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Icenowy Zheng <icenowy@aosc.io>
X-Patchwork-Id: 1444507
X-Patchwork-Delegate: andre.przywara@arm.com
Return-Path: <u-boot-bounces@lists.denx.de>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: 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=<UNKNOWN>)
Authentication-Results: ozlabs.org;
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=mymailcheap.com header.i=@mymailcheap.com
header.a=rsa-sha256 header.s=default header.b=cioDKJo2;
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=aosc.io header.i=@aosc.io header.a=rsa-sha256
header.s=default header.b=HIUK4Nk2;
dkim-atps=neutral
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 RSA-PSS (4096 bits) server-digest
SHA256)
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 4DmdCS3h1Hz9rx6
for <incoming@patchwork.ozlabs.org>; Fri, 26 Feb 2021 03:14:28 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 110BD81B51;
Thu, 25 Feb 2021 17:14:23 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=none (p=none dis=none) header.from=aosc.io
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de
Authentication-Results: phobos.denx.de;
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=mymailcheap.com header.i=@mymailcheap.com
header.b="cioDKJo2";
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=aosc.io header.i=@aosc.io header.b="HIUK4Nk2";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id B889280598; Thu, 25 Feb 2021 17:14:13 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de
X-Spam-Level:
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham
autolearn_force=no version=3.4.2
Received: from relay4.mymailcheap.com (relay4.mymailcheap.com
[137.74.199.117])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id C7F5580598
for <u-boot@lists.denx.de>; Thu, 25 Feb 2021 17:14:09 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=none (p=none dis=none) header.from=aosc.io
Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=icenowy@aosc.io
Received: from filter1.mymailcheap.com (filter1.mymailcheap.com
[149.56.130.247])
by relay4.mymailcheap.com (Postfix) with ESMTPS id 6FC363F1CF;
Thu, 25 Feb 2021 17:14:09 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
by filter1.mymailcheap.com (Postfix) with ESMTP id A57402A383;
Thu, 25 Feb 2021 11:14:08 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mymailcheap.com;
s=default; t=1614269648;
bh=p5Qg+eI0X+uHI/vb/v+Q5hqIyhUcxanqxa0s3F6kzsk=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=cioDKJo2JP5QKxiGm4JTh3EgF9+TQ/ar45VDuTK90pKSZQrjTbxwSxU6+g/Qf11YS
Tl8xBob9LtGr3IqRPR6NvT1E5ZMyjJY5TA/5NTeRVDtgbfihgr9y79uX6wx8j0PwGI
HmhrdMUcAi1i6Nf8P8i7864A0P2g+73GGSbFTnxw=
Received: from filter1.mymailcheap.com ([127.0.0.1])
by localhost (filter1.mymailcheap.com [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id ZupYgX5wP4Vd; Thu, 25 Feb 2021 11:14:07 -0500 (EST)
Received: from mail20.mymailcheap.com (mail20.mymailcheap.com [51.83.111.147])
(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by filter1.mymailcheap.com (Postfix) with ESMTPS;
Thu, 25 Feb 2021 11:14:07 -0500 (EST)
Received: from [148.251.23.173] (ml.mymailcheap.com [148.251.23.173])
by mail20.mymailcheap.com (Postfix) with ESMTP id 623DD41AAC;
Thu, 25 Feb 2021 16:14:06 +0000 (UTC)
Authentication-Results: mail20.mymailcheap.com; dkim=pass (1024-bit key;
unprotected) header.d=aosc.io header.i=@aosc.io header.b="HIUK4Nk2";
dkim-atps=neutral
AI-Spam-Status: Not processed
Received: from ice-e5v2.lan (unknown [59.41.161.221])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
SHA256) (No client certificate requested)
by mail20.mymailcheap.com (Postfix) with ESMTPSA id 373A94085F;
Thu, 25 Feb 2021 16:13:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aosc.io; s=default;
t=1614269631; bh=p5Qg+eI0X+uHI/vb/v+Q5hqIyhUcxanqxa0s3F6kzsk=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=HIUK4Nk2y/BejXaMIQECyQ7r0JiiRWWbURK29vtVJOxbvSa5uDI5eMKRpJPD1FM0C
FcHWJD/H2cXjFNbCk9Ogmfwhcw2wgyXx0AranW4WXH8qg4g8uzYrAqN9nKGhbmDZ3n
ds22TcdBpaiuxNCOmVjRPJvWBZhWtTxLREQv27fw=
From: Icenowy Zheng <icenowy@aosc.io>
To: Jagan Teki <jagan@amarulasolutions.com>,
Andre Przywara <andre.przywara@arm.com>
Cc: u-boot@lists.denx.de, linux-sunxi@googlegroups.com,
Icenowy Zheng <icenowy@aosc.io>
Subject: [PATCH 1/2] sunxi: support asymmetric dual rank DRAM on A64/R40
Date: Fri, 26 Feb 2021 00:13:24 +0800
Message-Id: <20210225161325.94019-2-icenowy@aosc.io>
X-Mailer: git-send-email 2.30.0
In-Reply-To: <20210225161325.94019-1-icenowy@aosc.io>
References: <20210225161325.94019-1-icenowy@aosc.io>
MIME-Version: 1.0
X-Rspamd-Server: mail20.mymailcheap.com
X-Spamd-Result: default: False [4.90 / 20.00]; ARC_NA(0.00)[];
RCVD_VIA_SMTP_AUTH(0.00)[];
R_DKIM_ALLOW(0.00)[aosc.io:s=default];
RECEIVED_SPAMHAUS_PBL(0.00)[59.41.161.221:received];
FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[];
R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[aosc.io];
BROKEN_CONTENT_TYPE(1.50)[]; R_SPF_SOFTFAIL(0.00)[~all:c];
RCPT_COUNT_FIVE(0.00)[5]; ML_SERVERS(-3.10)[148.251.23.173];
DKIM_TRACE(0.00)[aosc.io:+]; MID_CONTAINS_FROM(1.00)[];
RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[];
MIME_TRACE(0.00)[0:+];
ASN(0.00)[asn:24940, ipnet:148.251.0.0/16, country:DE];
RCVD_COUNT_TWO(0.00)[2];
HFILTER_HELO_BAREIP(3.00)[148.251.23.173,1]
X-Rspamd-Queue-Id: 623DD41AAC
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de
X-Virus-Status: Clean
Previously we have known that R40 has a configuration register for its
rank 1, which allows different configuration than rank 0. Reverse
engineering of newest libdram of A64 from Allwinner shows that A64 has
this register too. It's bit 0 (which enables dual rank in rank 0
configuration register) means a dedicated rank size setup is used for
rank 1.
Now, Pine64 scheduled to use a 3GiB LPDDR3 DRAM chip (which has 2GiB
rank 0 and 1GiB rank 1) on PinePhone, that makes asymmetric dual rank
DRAM support necessary.
Add this support. The code could support both A64 and R40, but because
dual rank detection is broken on R40 now, we cannot really use it on R40
currently.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
.../include/asm/arch-sunxi/dram_sunxi_dw.h | 11 ++-
arch/arm/mach-sunxi/dram_sunxi_dw.c | 94 +++++++++++++++----
2 files changed, 82 insertions(+), 23 deletions(-)
diff --git a/arch/arm/include/asm/arch-sunxi/dram_sunxi_dw.h b/arch/arm/include/asm/arch-sunxi/dram_sunxi_dw.h
index a5a7ebde44..e843c14202 100644
--- a/arch/arm/include/asm/arch-sunxi/dram_sunxi_dw.h
+++ b/arch/arm/include/asm/arch-sunxi/dram_sunxi_dw.h
@@ -215,12 +215,17 @@ struct sunxi_mctl_ctl_reg {
#define NR_OF_BYTE_LANES (32 / BITS_PER_BYTE)
/* The eight data lines (DQn) plus DM, DQS and DQSN */
#define LINES_PER_BYTE_LANE (BITS_PER_BYTE + 3)
-struct dram_para {
+
+struct rank_para {
u16 page_size;
- u8 bus_full_width;
- u8 dual_rank;
u8 row_bits;
u8 bank_bits;
+};
+
+struct dram_para {
+ u8 dual_rank;
+ u8 bus_full_width;
+ struct rank_para ranks[2];
const u8 dx_read_delays[NR_OF_BYTE_LANES][LINES_PER_BYTE_LANE];
const u8 dx_write_delays[NR_OF_BYTE_LANES][LINES_PER_BYTE_LANE];
const u8 ac_delays[31];
diff --git a/arch/arm/mach-sunxi/dram_sunxi_dw.c b/arch/arm/mach-sunxi/dram_sunxi_dw.c
index d0600011ff..2b9d631d49 100644
--- a/arch/arm/mach-sunxi/dram_sunxi_dw.c
+++ b/arch/arm/mach-sunxi/dram_sunxi_dw.c
@@ -399,11 +399,19 @@ static void mctl_set_cr(uint16_t socid, struct dram_para *para)
#else
#error Unsupported DRAM type!
#endif
- (para->bank_bits == 3 ? MCTL_CR_EIGHT_BANKS : MCTL_CR_FOUR_BANKS) |
+ (para->ranks[0].bank_bits == 3 ? MCTL_CR_EIGHT_BANKS : MCTL_CR_FOUR_BANKS) |
MCTL_CR_BUS_FULL_WIDTH(para->bus_full_width) |
(para->dual_rank ? MCTL_CR_DUAL_RANK : MCTL_CR_SINGLE_RANK) |
- MCTL_CR_PAGE_SIZE(para->page_size) |
- MCTL_CR_ROW_BITS(para->row_bits), &mctl_com->cr);
+ MCTL_CR_PAGE_SIZE(para->ranks[0].page_size) |
+ MCTL_CR_ROW_BITS(para->ranks[0].row_bits), &mctl_com->cr);
+
+ if (para->dual_rank && (socid == SOCID_A64 || socid == SOCID_R40)) {
+ writel((para->ranks[1].bank_bits == 3 ? MCTL_CR_EIGHT_BANKS : MCTL_CR_FOUR_BANKS) |
+ MCTL_CR_BUS_FULL_WIDTH(para->bus_full_width) |
+ MCTL_CR_DUAL_RANK |
+ MCTL_CR_PAGE_SIZE(para->ranks[1].page_size) |
+ MCTL_CR_ROW_BITS(para->ranks[1].row_bits), &mctl_com->cr_r1);
+ }
if (socid == SOCID_R40) {
if (para->dual_rank)
@@ -646,35 +654,63 @@ static int mctl_channel_init(uint16_t socid, struct dram_para *para)
return 0;
}
-static void mctl_auto_detect_dram_size(uint16_t socid, struct dram_para *para)
+/*
+ * Test if memory at offset offset matches memory at a certain base
+ */
+static bool mctl_mem_matches_base(u32 offset, ulong base)
+{
+ /* Try to write different values to RAM at two addresses */
+ writel(0, base);
+ writel(0xaa55aa55, base + offset);
+ dsb();
+ /* Check if the same value is actually observed when reading back */
+ return readl(base) ==
+ readl(base + offset);
+}
+
+static void mctl_auto_detect_dram_size_rank(uint16_t socid, struct dram_para *para, ulong base, struct rank_para *rank)
{
/* detect row address bits */
- para->page_size = 512;
- para->row_bits = 16;
- para->bank_bits = 2;
+ rank->page_size = 512;
+ rank->row_bits = 16;
+ rank->bank_bits = 2;
mctl_set_cr(socid, para);
- for (para->row_bits = 11; para->row_bits < 16; para->row_bits++)
- if (mctl_mem_matches((1 << (para->row_bits + para->bank_bits)) * para->page_size))
+ for (rank->row_bits = 11; rank->row_bits < 16; rank->row_bits++)
+ if (mctl_mem_matches_base((1 << (rank->row_bits + rank->bank_bits)) * rank->page_size, base))
break;
/* detect bank address bits */
- para->bank_bits = 3;
+ rank->bank_bits = 3;
mctl_set_cr(socid, para);
- for (para->bank_bits = 2; para->bank_bits < 3; para->bank_bits++)
- if (mctl_mem_matches((1 << para->bank_bits) * para->page_size))
+ for (rank->bank_bits = 2; rank->bank_bits < 3; rank->bank_bits++)
+ if (mctl_mem_matches_base((1 << rank->bank_bits) * rank->page_size, base))
break;
/* detect page size */
- para->page_size = 8192;
+ rank->page_size = 8192;
mctl_set_cr(socid, para);
- for (para->page_size = 512; para->page_size < 8192; para->page_size *= 2)
- if (mctl_mem_matches(para->page_size))
+ for (rank->page_size = 512; rank->page_size < 8192; rank->page_size *= 2)
+ if (mctl_mem_matches_base(rank->page_size, base))
break;
}
+static unsigned long mctl_calc_rank_size(struct rank_para *rank)
+{
+ return (1UL << (rank->row_bits + rank->bank_bits)) * rank->page_size;
+}
+
+static void mctl_auto_detect_dram_size(uint16_t socid, struct dram_para *para)
+{
+ mctl_auto_detect_dram_size_rank(socid, para, (ulong)CONFIG_SYS_SDRAM_BASE, &para->ranks[0]);
+
+ if ((socid == SOCID_A64 || socid == SOCID_R40) && para->dual_rank) {
+ mctl_auto_detect_dram_size_rank(socid, para, (ulong)CONFIG_SYS_SDRAM_BASE + mctl_calc_rank_size(&para->ranks[0]), &para->ranks[1]);
+ }
+}
+
/*
* The actual values used here are taken from Allwinner provided boot0
* binaries, though they are probably board specific, so would likely benefit
@@ -769,12 +805,23 @@ unsigned long sunxi_dram_init(void)
struct sunxi_mctl_ctl_reg * const mctl_ctl =
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
+ unsigned long size;
+
struct dram_para para = {
.dual_rank = 1,
.bus_full_width = 1,
- .row_bits = 15,
- .bank_bits = 3,
- .page_size = 4096,
+ .ranks = {
+ {
+ .row_bits = 15,
+ .bank_bits = 3,
+ .page_size = 4096,
+ },
+ {
+ .row_bits = 15,
+ .bank_bits = 3,
+ .page_size = 4096,
+ }
+ },
#if defined(CONFIG_MACH_SUN8I_H3)
.dx_read_delays = SUN8I_H3_DX_READ_DELAYS,
@@ -846,6 +893,13 @@ unsigned long sunxi_dram_init(void)
mctl_auto_detect_dram_size(socid, &para);
mctl_set_cr(socid, &para);
- return (1UL << (para.row_bits + para.bank_bits)) * para.page_size *
- (para.dual_rank ? 2 : 1);
+ size = mctl_calc_rank_size(&para.ranks[0]);
+ if (socid == SOCID_A64 || socid == SOCID_R40) {
+ if (para.dual_rank)
+ size += mctl_calc_rank_size(&para.ranks[1]);
+ } else if (para.dual_rank) {
+ size *= 2;
+ }
+
+ return size;
}

View File

@ -1,8 +1,8 @@
#global candidate rc1
%global candidate rc2
Name: uboot-tools
Version: 2021.04
Release: 3%{?candidate:.%{candidate}}%{?dist}
Version: 2021.07
Release: 0.1%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot
@ -21,20 +21,14 @@ Patch2: efi_loader-loosen-buffer-parameter-check-in-efi_file_read_int.patch
# RPi - uses RPI firmware device tree for HAT support
Patch3: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
# Revert an upstream regression
Patch9: IOMUX-Fix-buffer-overflow-in-iomux_replace_device.patch
# Board fixes and enablement
# AllWinner improvements
Patch10: AllWinner-PineTab.patch
# TI fixes
Patch11: 0001-Fix-BeagleAI-detection.patch
# Rockchips improvements
Patch12: rk3399-Pinebook-pro-EDP-support.patch
Patch13: phy-rockchip-inno-usb2-fix-hang-when-multiple-controllers-exit.patch
Patch14: rockchip-fix-mmc-numbering.patch
# Fixes for Allwinner network issues
Patch15: 0001-arm-dts-allwinner-sync-from-linux-for-RGMII-RX-TX-de.patch
Patch16: sunxi-support-asymmetric-dual-rank-DRAM-on-A64.patch
Patch12: phy-rockchip-inno-usb2-fix-hang-when-multiple-controllers-exit.patch
Patch13: rockchip-fix-mmc-numbering.patch
BuildRequires: bc
BuildRequires: dtc
@ -261,6 +255,9 @@ cp -p board/warp7/README builds/docs/README.warp7
%endif
%changelog
* Mon May 10 2021 Peter Robinson <pbrobinson@fedoraproject.org> - 2021.07-0.1.rc2
- Update to 2021.07 RC2
* Wed Apr 28 2021 Peter Robinson <pbrobinson@fedoraproject.org> - 2021.04-3
- Upstream fix for console regression (rhbz 1946278)
- Fix for fallback.efi crash (rhbz 1733817)

View File

@ -1,115 +0,0 @@
From a49845f198af088c4e5e0019edbf519344d78c97 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Tue, 4 Dec 2018 15:29:14 +0000
Subject: [PATCH] usb kbd fixes
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
common/usb_kbd.c | 66 +++++++++++++++++++++++++++++++++++------------
include/console.h | 2 --
2 files changed, 50 insertions(+), 18 deletions(-)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 020f0d4117f..47674ce4458 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -518,25 +518,59 @@ static int probe_usb_keyboard(struct usb_device *dev)
return error;
stdinname = env_get("stdin");
-#if CONFIG_IS_ENABLED(CONSOLE_MUX)
- error = iomux_doenv(stdin, stdinname);
- if (error)
- return error;
-#else
- /* Check if this is the standard input device. */
- if (strcmp(stdinname, DEVNAME))
- return 1;
+ if (CONFIG_IS_ENABLED(CONSOLE_MUX)) {
+ char *devname = DEVNAME;
+ char *newstdin = NULL;
+ /*
+ * stdin might not be set yet.. either way, with console-
+ * mux the sensible thing to do is add ourselves to the
+ * list of stdio devices:
+ */
+ if (stdinname && !strstr(stdinname, DEVNAME)) {
+ newstdin = malloc(strlen(stdinname) +
+ strlen(","DEVNAME) + 1);
+ sprintf(newstdin, "%s,"DEVNAME, stdinname);
+ stdinname = newstdin;
+ } else if (!stdinname) {
+ stdinname = devname;
+ }
+ error = iomux_doenv(stdin, stdinname);
+ free(newstdin);
+ if (error)
+ goto unregister_stdio;
+ } else {
+ /* Check if this is the standard input device. */
+ if (strcmp(stdinname, DEVNAME)) {
+ error = -1;
+ goto unregister_stdio;
+ }
- /* Reassign the console */
- if (overwrite_console())
- return 1;
+ /* Reassign the console */
+ if (overwrite_console()) {
+ error = -1;
+ goto unregister_stdio;
+ }
- error = console_assign(stdin, DEVNAME);
- if (error)
- return error;
-#endif
+ error = console_assign(stdin, DEVNAME);
+ if (error)
+ goto unregister_stdio;
+ }
+
+ return 0;
+unregister_stdio:
+ /*
+ * If probe fails, the device will be removed.. leaving dangling
+ * pointers if the stdio device is not unregistered. If u-boot
+ * is built without stdio_deregister(), just pretend to succeed
+ * in order to avoid dangling pointers.
+ */
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
+ stdio_deregister(DEVNAME, 1);
+ return error;
+#else
return 0;
+#endif
}
#if !CONFIG_IS_ENABLED(DM_USB)
@@ -642,7 +676,7 @@ static int usb_kbd_remove(struct udevice *dev)
return 0;
err:
- printf("%s: warning, ret=%d", __func__, ret);
+ printf("%s: warning, ret=%d\n", __func__, ret);
return ret;
}
diff --git a/include/console.h b/include/console.h
index e935c601f12..6382ec8e0d6 100644
--- a/include/console.h
+++ b/include/console.h
@@ -56,8 +56,6 @@ int console_announce_r(void);
/*
* CONSOLE multiplexing.
*/
-#ifdef CONFIG_CONSOLE_MUX
#include <iomux.h>
-#endif
#endif
--
2.19.2