a few upstream fixes

This commit is contained in:
Peter Robinson 2018-02-16 12:30:49 +00:00
parent bcd4bd33cd
commit 38866e02ba
4 changed files with 189 additions and 1 deletions

View File

@ -0,0 +1,58 @@
From patchwork Thu Feb 15 18:05:59 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,v2] fdt: Fixup only valid memory banks
X-Patchwork-Submitter: Thierry Reding <thierry.reding@gmail.com>
X-Patchwork-Id: 874036
Message-Id: <20180215180559.27875-1-thierry.reding@gmail.com>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Tom Warren <twarren@nvidia.com>
Date: Thu, 15 Feb 2018 19:05:59 +0100
From: Thierry Reding <thierry.reding@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
From: Thierry Reding <treding@nvidia.com>
Memory banks with address 0 and size 0 are empty and should not be
passed to the OS via device tree.
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v2:
- check whether or not any banks need to be fixed up after filtering out
invalid ones (Stephen Warren)
- use braces around multiple-line body of for loop, even if not strictly
necessary (Stephen Warren)
---
common/fdt_support.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 17623a1728f6..da0c12e9c1bc 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -418,7 +418,7 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
{
int err, nodeoffset;
- int len;
+ int len, i;
u8 tmp[MEMORY_BANKS_MAX * 16]; /* Up to 64-bit address + 64-bit size */
if (banks > MEMORY_BANKS_MAX) {
@@ -447,6 +447,13 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
return err;
}
+ for (i = 0; i < banks; i++) {
+ if (start[i] == 0 && size[i] == 0)
+ break;
+ }
+
+ banks = i;
+
if (!banks)
return 0;

View File

@ -0,0 +1,72 @@
From patchwork Thu Feb 15 14:41:40 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,
v3] imx: spl: Partially revert "spl: eMMC/SD: Provide one __weak
spl_boot_mode() function"
X-Patchwork-Submitter: Fabio Estevam <fabio.estevam@nxp.com>
X-Patchwork-Id: 874073
Message-Id: <1518705700-9402-1-git-send-email-fabio.estevam@nxp.com>
To: <sbabic@denx.de>
Cc: trini@konsulko.com, u-boot@lists.denx.de, jsg@jsg.id.au,
Fabio Estevam <fabio.estevam@nxp.com>
Date: Thu, 15 Feb 2018 12:41:40 -0200
From: Fabio Estevam <fabio.estevam@nxp.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
function") breaks the boot on several i.MX6 boards,
such as cuboxi and wandboard:
U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33 +1300)
Trying to boot from MMC1
Failed to mount ext2 filesystem...
spl_load_image_ext: ext4fs mount err - 0
Partially revert it so that we can boot U-Boot again on these
i.MX6 platforms.
Reported-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Changes since v2:
- Do a partiall revert instead of full revert (Lukasz)
arch/arm/mach-imx/spl.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index a9079fc..b2521b2 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -132,6 +132,29 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
}
#endif
+#if defined(CONFIG_SPL_MMC_SUPPORT)
+/* called from spl_mmc to see type of boot mode for storage (RAW or FAT) */
+u32 spl_boot_mode(const u32 boot_device)
+{
+ switch (spl_boot_device()) {
+ /* for MMC return either RAW or FAT mode */
+ case BOOT_DEVICE_MMC1:
+ case BOOT_DEVICE_MMC2:
+#if defined(CONFIG_SPL_FAT_SUPPORT)
+ return MMCSD_MODE_FS;
+#elif defined(CONFIG_SUPPORT_EMMC_BOOT)
+ return MMCSD_MODE_EMMCBOOT;
+#else
+ return MMCSD_MODE_RAW;
+#endif
+ break;
+ default:
+ puts("spl: ERROR: unsupported device\n");
+ hang();
+ }
+}
+#endif
+
#if defined(CONFIG_SECURE_BOOT)
/*

View File

@ -0,0 +1,52 @@
From patchwork Fri Feb 9 15:24:38 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] mmc: Fix uninitialised priv member
X-Patchwork-Submitter: Alex Kiernan <alex.kiernan@gmail.com>
X-Patchwork-Id: 871459
X-Patchwork-Delegate: jh80.chung@samsung.com
Message-Id: <1518189878-14645-1-git-send-email-alex.kiernan@gmail.com>
To: u-boot@lists.denx.de
Date: Fri, 9 Feb 2018 15:24:38 +0000
From: Alex Kiernan <alex.kiernan@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
When using omap_hsmmc without the device model then the allocation
of mmc->priv ends up uninitialised.
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
---
I've a board (AM335xx based) which boots fine with 2018-01, with
2018-03-rc1 (actually 1811a92) it fails in the MLO:
U-Boot SPL 2018.03-rc1-00222-g128a503-dirty (Feb 09 2018 - 11:51:50 +0000)
Trying to boot from MMC2
omap_hsmmc_send_cmd : DMA timeout: No status update
mmc_init: -110, time 1026
spl: mmc init failed with error: -110
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
Bisecting it out, it's this commit:
f0d53e8 mmc: omap_hsmmc: Add support for DMA (ADMA2)
drivers/mmc/omap_hsmmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index b12d6d9..c6b3f25 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -918,7 +918,7 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
struct mmc_config *cfg;
uint host_caps_val;
- priv = malloc(sizeof(*priv));
+ priv = calloc(1, sizeof(*priv));
if (priv == NULL)
return -1;

View File

@ -2,7 +2,7 @@
Name: uboot-tools
Version: 2018.03
Release: 0.4%{?candidate:.%{candidate}}%{?dist}
Release: 0.5%{?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,6 +21,9 @@ Patch1: uefi-use-Fedora-specific-path-name.patch
Patch2: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
Patch3: usb-kbd-fixes.patch
Patch4: Add-fix-for-Pine64-gigabit-throughput-issues.patch
Patch5: imx-spl-Partially-revert-spl-eMMC-SD-Provide.patch
Patch6: fdt-Fixup-only-valid-memory-banks.patch
Patch7: mmc-Fix-uninitialised-priv-member.patch
# Board fixes and enablement
#Patch10: db-generic-fixes.patch
@ -288,6 +291,9 @@ cp -p board/warp7/README builds/docs/README.warp7
%endif
%changelog
* Fri Feb 15 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2018.03-0.5.rc2
- A few upstream fixes
* Thu Feb 14 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2018.03-0.4.rc2
- Fix for GBps network on some AllWinner devices