2018.07 RC3

This commit is contained in:
Peter Robinson 2018-07-03 10:23:36 +01:00
parent 53da82c18c
commit 6048e76bc7
5 changed files with 292 additions and 116 deletions

View File

@ -1 +1 @@
SHA512 (u-boot-2018.07-rc2.tar.bz2) = 9a8842ad760841cf99f095e1883e11a9b28aacbf5429f9a4ca69e61bea9e17511dcd1f9e3d2b6c2429187bac0b26e6ee92917669c81eac2f2d894d069b5d8be4
SHA512 (u-boot-2018.07-rc3.tar.bz2) = 29ce3a0f61b624ff685571490cdaf45e58733cd7fbef05fc0aede8921655a1cb537345964204b74931b9ab230f5ffb5c86b670d932a852995f7e13571a14c862

View File

@ -0,0 +1,183 @@
From patchwork Wed Jun 27 00:42:52 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot, 1/2] arm: timer: factor out FSL arch timer erratum workaround
X-Patchwork-Submitter: Andre Przywara <andre.przywara@arm.com>
X-Patchwork-Id: 935206
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20180627004253.4094-2-andre.przywara@arm.com>
To: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
Jagan Teki <jagan@openedev.com>, Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Alex Graf <agraf@suse.de>, u-boot@lists.denx.de,
linux-sunxi@googlegroups.com, Guillaume Gardet <guillaume.gardet@free.fr>
Date: Wed, 27 Jun 2018 01:42:52 +0100
From: Andre Przywara <andre.przywara@arm.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
At the moment we have the workaround for the Freescale arch timer
erratum A-008585 merged into the generic timer_read_counter() routine.
Split those two up, so that we can add other errata workaround more
easily. Also add an explaining comment on the way.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/cpu/armv8/generic_timer.c | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c
index bf07a706a0..3d04fde650 100644
--- a/arch/arm/cpu/armv8/generic_timer.c
+++ b/arch/arm/cpu/armv8/generic_timer.c
@@ -20,27 +20,46 @@ unsigned long get_tbclk(void)
return cntfrq;
}
+#ifdef CONFIG_SYS_FSL_ERRATUM_A008585
/*
- * Generic timer implementation of timer_read_counter()
+ * FSL erratum A-008585 says that the ARM generic timer counter "has the
+ * potential to contain an erroneous value for a small number of core
+ * clock cycles every time the timer value changes".
+ * This sometimes leads to a consecutive counter read returning a lower
+ * value than the previous one, thus reporting the time to go backwards.
+ * The workaround is to read the counter twice and only return when the value
+ * was the same in both reads.
+ * Assumes that the CPU runs in much higher frequency than the timer.
*/
unsigned long timer_read_counter(void)
{
unsigned long cntpct;
-#ifdef CONFIG_SYS_FSL_ERRATUM_A008585
- /* This erratum number needs to be confirmed to match ARM document */
unsigned long temp;
-#endif
+
isb();
asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
-#ifdef CONFIG_SYS_FSL_ERRATUM_A008585
asm volatile("mrs %0, cntpct_el0" : "=r" (temp));
while (temp != cntpct) {
asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
asm volatile("mrs %0, cntpct_el0" : "=r" (temp));
}
-#endif
+
return cntpct;
}
+#else
+/*
+ * timer_read_counter() using the Arm Generic Timer (aka arch timer).
+ */
+unsigned long timer_read_counter(void)
+{
+ unsigned long cntpct;
+
+ isb();
+ asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
+
+ return cntpct;
+}
+#endif
uint64_t get_ticks(void)
{
From patchwork Wed Jun 27 00:42:53 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,
2/2] arm: timer: sunxi: add Allwinner timer erratum workaround
X-Patchwork-Submitter: Andre Przywara <andre.przywara@arm.com>
X-Patchwork-Id: 935207
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20180627004253.4094-3-andre.przywara@arm.com>
To: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
Jagan Teki <jagan@openedev.com>, Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Alex Graf <agraf@suse.de>, u-boot@lists.denx.de,
linux-sunxi@googlegroups.com, Guillaume Gardet <guillaume.gardet@free.fr>
Date: Wed, 27 Jun 2018 01:42:53 +0100
From: Andre Przywara <andre.przywara@arm.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
The Allwinner A64 SoCs suffers from an arch timer implementation erratum,
where sometimes the lower 11 bits of the counter value erroneously
become all 0's or all 1's [1]. This leads to sudden jumps, both forwards and
backwards, with the latter one often showing weird behaviour.
Port the workaround proposed for Linux to U-Boot and activate it for all
A64 boards.
This fixes crashes when accessing MMC devices (SD cards), caused by a
recent change to actually use the counter value for timeout checks.
Fixes: 5ff8e54888e4d26a352453564f7f599d29696dc9 ("sunxi: improve throughput
in the sunxi_mmc driver")
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-May/576886.html
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/cpu/armv8/generic_timer.c | 24 ++++++++++++++++++++++++
arch/arm/mach-sunxi/Kconfig | 4 ++++
2 files changed, 28 insertions(+)
diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c
index 3d04fde650..c1706dcec1 100644
--- a/arch/arm/cpu/armv8/generic_timer.c
+++ b/arch/arm/cpu/armv8/generic_timer.c
@@ -46,6 +46,30 @@ unsigned long timer_read_counter(void)
return cntpct;
}
+#elif CONFIG_SUNXI_A64_TIMER_ERRATUM
+/*
+ * This erratum sometimes flips the lower 11 bits of the counter value
+ * to all 0's or all 1's, leading to jumps forwards or backwards.
+ * Backwards jumps might be interpreted all roll-overs and be treated as
+ * huge jumps forward.
+ * The workaround is to check whether the lower 11 bits of the counter are
+ * all 0 or all 1, then discard this value and read again.
+ * This occasionally discards valid values, but will catch all erroneous
+ * reads and fixes the problem reliably. Also this mostly requires only a
+ * single read, so does not have any significant overhead.
+ * The algorithm was conceived by Samuel Holland.
+ */
+unsigned long timer_read_counter(void)
+{
+ unsigned long cntpct;
+
+ isb();
+ do {
+ asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
+ } while (((cntpct + 1) & GENMASK(10, 0)) <= 1);
+
+ return cntpct;
+}
#else
/*
* timer_read_counter() using the Arm Generic Timer (aka arch timer).
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index a3f7723028..3624a03947 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -84,6 +84,9 @@ config SUNXI_HIGH_SRAM
Chips using the latter setup are supposed to select this option to
adjust the addresses accordingly.
+config SUNXI_A64_TIMER_ERRATUM
+ bool
+
# Note only one of these may be selected at a time! But hidden choices are
# not supported by Kconfig
config SUNXI_GEN_SUN4I
@@ -270,6 +273,7 @@ config MACH_SUN50I
select SUNXI_DRAM_DW_32BIT
select FIT
select SPL_LOAD_FIT
+ select SUNXI_A64_TIMER_ERRATUM
config MACH_SUN50I_H5
bool "sun50i (Allwinner H5)"

View File

@ -1,106 +0,0 @@
From d25807c04228381ec55b7ee18480345516481e22 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Fri, 8 Jun 2018 04:24:16 +0100
Subject: [PATCH] sunxi: fix eMMC stability issues on A64
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
arch/arm/include/asm/arch-sunxi/mmc.h | 6 +++++-
arch/arm/mach-sunxi/Kconfig | 2 ++
drivers/mmc/Kconfig | 4 ++++
drivers/mmc/sunxi_mmc.c | 13 +++++++++++++
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/arch-sunxi/mmc.h b/arch/arm/include/asm/arch-sunxi/mmc.h
index 1574b8e8fed..d6664a01f21 100644
--- a/arch/arm/include/asm/arch-sunxi/mmc.h
+++ b/arch/arm/include/asm/arch-sunxi/mmc.h
@@ -46,7 +46,9 @@ struct sunxi_mmc {
u32 cbda; /* 0x94 */
u32 res2[26];
#ifdef CONFIG_SUNXI_GEN_SUN6I
- u32 res3[64];
+ u32 res3[17];
+ u32 samp_dl;
+ u32 res4[46];
#endif
u32 fifo; /* 0x100 / 0x200 FIFO access address */
};
@@ -130,5 +132,7 @@ struct sunxi_mmc {
#define SUNXI_MMC_COMMON_CLK_GATE (1 << 16)
#define SUNXI_MMC_COMMON_RESET (1 << 18)
+#define SUNXI_MMC_CAL_DL_SW_EN (0x1 << 7)
+
struct mmc *sunxi_mmc_init(int sdc_no);
#endif /* _SUNXI_MMC_H */
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index a3f77230286..6e3d7f6d0a2 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -213,6 +213,7 @@ config MACH_SUN8I_A83T
select PHY_SUN4I_USB
select SUNXI_GEN_SUN6I
select MMC_SUNXI_HAS_NEW_MODE
+ select MMC_SUNXI_HAS_NEW_MODE_SWITCH
select SUPPORT_SPL
config MACH_SUN8I_H3
@@ -265,6 +266,7 @@ config MACH_SUN50I
select SUNXI_DE2
select SUNXI_GEN_SUN6I
select SUNXI_HIGH_SRAM
+ select MMC_SUNXI_HAS_NEW_MODE
select SUPPORT_SPL
select SUNXI_DRAM_DW
select SUNXI_DRAM_DW_32BIT
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 693b3ceaf00..f8e435a2a25 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -536,6 +536,10 @@ config MMC_SUNXI_HAS_NEW_MODE
bool
depends on MMC_SUNXI
+config MMC_SUNXI_HAS_NEW_MODE_SWITCH
+ bool
+ depends on MMC_SUNXI
+
config GENERIC_ATMEL_MCI
bool "Atmel Multimedia Card Interface support"
depends on DM_MMC && BLK && ARCH_AT91
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index fe6d82c7b4e..624c9071548 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -166,7 +166,9 @@ static int mmc_set_mod_clk(struct sunxi_mmc_priv *priv, unsigned int hz)
if (new_mode) {
#ifdef CONFIG_MMC_SUNXI_HAS_NEW_MODE
+#ifdef CONFIG_MMC_SUNXI_HAS_NEW_MODE_SWITCH
val = CCM_MMC_CTRL_MODE_SEL_NEW;
+#endif
setbits_le32(&priv->reg->ntsr, SUNXI_MMC_NTSR_MODE_SEL_NEW);
#endif
} else {
@@ -223,6 +225,17 @@ static int mmc_config_clock(struct sunxi_mmc_priv *priv, struct mmc *mmc)
rval &= ~SUNXI_MMC_CLK_DIVIDER_MASK;
writel(rval, &priv->reg->clkcr);
+#ifdef CONFIG_MACH_SUN50I
+ /* A64 needs to run calibration on eMMC controller and we
+ * have to set delay of zero before starting calibration.
+ * Allwinner BSP driver sets a delay only in the case of
+ * using HS400 which is not supported by mainline U-Boot or
+ * Linux at the moment
+ */
+ if (priv->mmc_no == 2)
+ writel(SUNXI_MMC_CAL_DL_SW_EN, &priv->reg->samp_dl);
+#endif
+
/* Re-enable Clock */
rval |= SUNXI_MMC_CLK_ENABLE;
writel(rval, &priv->reg->clkcr);
--
2.17.1

View File

@ -1,8 +1,8 @@
%global candidate rc2
%global candidate rc3
Name: uboot-tools
Version: 2018.07
Release: 0.3%{?candidate:.%{candidate}}%{?dist}
Release: 0.4%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot
@ -20,15 +20,16 @@ Patch1: uefi-use-Fedora-specific-path-name.patch
# general fixes
Patch2: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
Patch3: usb-kbd-fixes.patch
Patch4: usb_kbd-with-DM-enabled.patch
# Board fixes and enablement
Patch10: sunxi-fix-eMMC-stability-issues-on-A64.patch
Patch11: mx6cuboxi-consolidate-board-detection-and-add-som-revision-checking.patch
Patch12: dragonboard-fixes.patch
Patch13: rockchip-make_fit_atf-fix-warning-unit_address_vs_reg.patch
Patch14: rockchip-make_fit_atf-use-elf-entry-point.patch
Patch15: tegra186-jetson-tx2-disable-onboard-emmc.patch
Patch16: tegra-nyan-big-Update-CONFIG_SYS_TEXT-to-the-default.patch
Patch11: sunxi-Fix-MMC-driver-crashes.patch
Patch12: mx6cuboxi-consolidate-board-detection-and-add-som-revision-checking.patch
Patch13: dragonboard-fixes.patch
Patch14: rockchip-make_fit_atf-fix-warning-unit_address_vs_reg.patch
Patch15: rockchip-make_fit_atf-use-elf-entry-point.patch
Patch16: tegra186-jetson-tx2-disable-onboard-emmc.patch
Patch17: tegra-nyan-big-Update-CONFIG_SYS_TEXT-to-the-default.patch
#Patch19: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
# Patch99: mvebu-enable-generic-distro-boot-config.patch
@ -293,6 +294,9 @@ cp -p board/warp7/README builds/docs/README.warp7
%endif
%changelog
* Tue Jul 3 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2018.07-0.4-rc3
- 2018.07 RC3
* Wed Jun 20 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2018.07-0.3-rc2
- 2018.07 RC2
- Enable Helios4

View File

@ -0,0 +1,95 @@
From patchwork Wed Jun 27 13:10:20 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,1/2] usb_kbd: Add support for watchdog
X-Patchwork-Submitter: Michal Simek <michal.simek@xilinx.com>
X-Patchwork-Id: 935475
X-Patchwork-Delegate: marek.vasut@gmail.com
Message-Id: <a516b2c1dc35c203a7a356d7a3d84fae53bdb91e.1530105018.git.michal.simek@xilinx.com>
To: u-boot@lists.denx.de,
hdegoede@redhat.com
Date: Wed, 27 Jun 2018 15:10:20 +0200
From: Michal Simek <michal.simek@xilinx.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
There is need to service watchdog in while loop or system will be
restarted when idlying.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
common/usb_kbd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 4c394d5613d1..20255dcf951f 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -16,6 +16,7 @@
#include <malloc.h>
#include <memalign.h>
#include <stdio_dev.h>
+#include <watchdog.h>
#include <asm/byteorder.h>
#include <usb.h>
@@ -398,8 +399,10 @@ static int usb_kbd_getc(struct stdio_dev *sdev)
usb_kbd_dev = (struct usb_device *)dev->priv;
data = usb_kbd_dev->privptr;
- while (data->usb_in_pointer == data->usb_out_pointer)
+ while (data->usb_in_pointer == data->usb_out_pointer) {
+ WATCHDOG_RESET();
usb_kbd_poll_for_event(usb_kbd_dev);
+ }
if (data->usb_out_pointer == USB_KBD_BUFFER_LEN - 1)
data->usb_out_pointer = 0;
From patchwork Wed Jun 27 13:10:21 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/2] usb_kdb: Get stdio_dev directly from sdev pointer
X-Patchwork-Submitter: Michal Simek <michal.simek@xilinx.com>
X-Patchwork-Id: 935476
X-Patchwork-Delegate: marek.vasut@gmail.com
Message-Id: <7aa2914cadf0f509fd67fb1b6ae0793408855a8e.1530105018.git.michal.simek@xilinx.com>
To: u-boot@lists.denx.de,
hdegoede@redhat.com
Date: Wed, 27 Jun 2018 15:10:21 +0200
From: Michal Simek <michal.simek@xilinx.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Driver supports only one instance of usb keyboard.
Remove the first dependency on generic usbkbd DEVNAME.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
common/usb_kbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 20255dcf951f..ce8cdc20fac5 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -372,7 +372,7 @@ static int usb_kbd_testc(struct stdio_dev *sdev)
return 0;
kbd_testc_tms = get_timer(0);
#endif
- dev = stdio_get_by_name(DEVNAME);
+ dev = stdio_get_by_name(sdev->name);
usb_kbd_dev = (struct usb_device *)dev->priv;
data = usb_kbd_dev->privptr;
@@ -395,7 +395,7 @@ static int usb_kbd_getc(struct stdio_dev *sdev)
struct usb_device *usb_kbd_dev;
struct usb_kbd_pdata *data;
- dev = stdio_get_by_name(DEVNAME);
+ dev = stdio_get_by_name(sdev->name);
usb_kbd_dev = (struct usb_device *)dev->priv;
data = usb_kbd_dev->privptr;