Hello community,

here is the log from the commit of package u-boot for openSUSE:Factory checked 
in at 2016-03-07 13:27:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/u-boot (Old)
 and      /work/SRC/openSUSE:Factory/.u-boot.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "u-boot"

Changes:
--------
--- /work/SRC/openSUSE:Factory/u-boot/u-boot-a10-olinuxino-lime.changes 
2016-02-26 22:18:47.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.u-boot.new/u-boot-a10-olinuxino-lime.changes    
2016-03-07 13:29:04.000000000 +0100
@@ -1,0 +2,53 @@
+Thu Mar  3 15:02:37 UTC 2016 - ag...@suse.com
+
+- EFI: Map fdt as reserved
+  * efi-map-fdt-as-reserved.patch
+
+-------------------------------------------------------------------
+Thu Mar  3 12:52:17 UTC 2016 - ag...@suse.com
+
+- Fix OMAP3 boards to load u-boot from raw sector offset
+  * omap3-Use-raw-SPL-by-default-for-mmc1.patch
+
+-------------------------------------------------------------------
+Wed Mar  2 23:46:44 UTC 2016 - ag...@suse.com
+
+- Allow grub2 to find its config
+  * efi_loader-Pass-proper-device-path-in-on-boot.patch
+- Fix Raspberry Pi 1 build
+  * efi_loader-Provide-icache-flush-stub.patch
+
+-------------------------------------------------------------------
+Wed Mar  2 10:03:56 UTC 2016 - guilla...@opensuse.org
+
+- Update to 2016.03-rc3
+- Remove upstreamed patches:
+  * 0001-spl-if-MMCSD_MODE_RAW-fails-try-MMCSD_MODE_FS-if-ava.patch
+
+-------------------------------------------------------------------
+Tue Mar  1 23:06:57 UTC 2016 - ag...@suse.com
+
+- Move omap3 to distro bootcmd (to enable efi boot on beagle-xm)
+  * omap3-Move-to-distro-bootcmd.patch
+- Add EFI patch to support FDT fixups (patches in RAM size)
+  * efi_loader-Call-fdt-preparation-functions.patch
+
+-------------------------------------------------------------------
+Mon Feb 29 23:28:15 UTC 2016 - ag...@suse.com
+
+- Patch the default u-boot env to search for dtb in /boot at part 2
+  * efi-default-env.patch
+
+-------------------------------------------------------------------
+Sun Feb 28 11:02:04 UTC 2016 - ag...@suse.com
+
+- Use $fdtfile rather than $fdt_name everywhere:
+  * efi2.patch
+
+-------------------------------------------------------------------
+Sat Feb 27 13:20:29 UTC 2016 - ag...@suse.com
+
+- Add EFI support about to move upstream:
+  * efi.patch
+
+-------------------------------------------------------------------
u-boot-a13-olinuxino.changes: same change
u-boot-a13-olinuxinom.changes: same change
u-boot-a20-olinuxino-lime.changes: same change
u-boot-a20-olinuxino-lime2.changes: same change
u-boot-a20-olinuxinomicro.changes: same change
u-boot-am335xboneblack.changes: same change
u-boot-am335xevm.changes: same change
u-boot-am57xxevm.changes: same change
u-boot-am57xxevmnodt.changes: same change
u-boot-arndale.changes: same change
u-boot-bananapi.changes: same change
u-boot-colibrit20.changes: same change
u-boot-cubieboard.changes: same change
u-boot-cubieboard2.changes: same change
u-boot-cubietruck.changes: same change
u-boot-firefly-rk3288.changes: same change
u-boot-highbank.changes: same change
u-boot-hyundaia7hd.changes: same change
u-boot-jetson-tk1.changes: same change
u-boot-melea1000.changes: same change
u-boot-merriia80optimus.changes: same change
u-boot-mx53loco.changes: same change
u-boot-mx6cuboxi.changes: same change
u-boot-mx6qsabrelite.changes: same change
u-boot-odroid-xu3.changes: same change
u-boot-odroid.changes: same change
u-boot-omap3beagle.changes: same change
u-boot-omap4panda.changes: same change
u-boot-orangepipc.changes: same change
u-boot-p2371-2180.changes: same change
u-boot-paz00.changes: same change
u-boot-pcm051rev3.changes: same change
u-boot-qemu-ppce500.changes: same change
u-boot-rpi.changes: same change
u-boot-rpi2.changes: same change
u-boot-snow.changes: same change
u-boot-spring.changes: same change
u-boot-udoo.changes: same change
u-boot.changes: same change

Old:
----
  0001-spl-if-MMCSD_MODE_RAW-fails-try-MMCSD_MODE_FS-if-ava.patch
  u-boot-2016.03-rc2.tar.bz2

New:
----
  efi-default-env.patch
  efi-map-fdt-as-reserved.patch
  efi.patch
  efi2.patch
  efi_loader-Call-fdt-preparation-functions.patch
  efi_loader-Pass-proper-device-path-in-on-boot.patch
  efi_loader-Provide-icache-flush-stub.patch
  omap3-Move-to-distro-bootcmd.patch
  omap3-Use-raw-SPL-by-default-for-mmc1.patch
  u-boot-2016.03-rc3.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ u-boot-a10-olinuxino-lime.spec ++++++
--- /var/tmp/diff_new_pack.VAloME/_old  2016-03-07 13:29:13.000000000 +0100
+++ /var/tmp/diff_new_pack.VAloME/_new  2016-03-07 13:29:13.000000000 +0100
@@ -26,10 +26,10 @@
 %define udoo_spl 0
 
 # archive_version differs from version for RC version only
-%define archive_version 2016.03-rc2
+%define archive_version 2016.03-rc3
 
 Name:           u-boot-a10-olinuxino-lime
-Version:        2016.03~rc2
+Version:        2016.03~rc3
 Release:        0
 Summary:        The u-boot firmware for the a10-olinuxino-lime arm platform
 License:        GPL-2.0
@@ -40,8 +40,23 @@
 Source300:      u-boot-rpmlintrc
 # Fix exynos KVM support
 Patch1:         u-boot-exynos.patch
-# PATCH-FIX-UPSTREAM fix boot on partition when RAW mode is also available
-Patch2:         0001-spl-if-MMCSD_MODE_RAW-fails-try-MMCSD_MODE_FS-if-ava.patch
+# Add EFI support. Will be upstream in the next version of u-boot.
+Patch3:         efi.patch
+Patch4:         efi2.patch
+# Set default environment slightly different for EFI, so it finds our dtbs
+Patch5:         efi-default-env.patch
+# Move omap3 to distro boot method
+Patch6:         omap3-Move-to-distro-bootcmd.patch
+# efi: Run memory node fixups in device tree
+Patch7:         efi_loader-Call-fdt-preparation-functions.patch
+# Allow grub2 to find its config file
+Patch8:         efi_loader-Pass-proper-device-path-in-on-boot.patch
+# Fix Raspberry Pi 1 build
+Patch9:         efi_loader-Provide-icache-flush-stub.patch
+# Make SPL work with raw sector offsets on beagle-xm
+Patch10:        omap3-Use-raw-SPL-by-default-for-mmc1.patch
+# Ensure we mark the device tree as reserved
+Patch11:        efi-map-fdt-as-reserved.patch
 # Marvell boards support is non-free licensed, and we don't need it 
(bnc#773824)
 Patch99:        drop-marvell.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -80,7 +95,15 @@
 %prep
 %setup -q -n u-boot-%{archive_version}
 %patch1 -p1
-%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
 # is non-free licensed, and we don't need it (bnc#773824)
 rm -rf board/Marvell
 %patch99 -p1

u-boot-a13-olinuxino.spec: same change
u-boot-a13-olinuxinom.spec: same change
u-boot-a20-olinuxino-lime.spec: same change
u-boot-a20-olinuxino-lime2.spec: same change
u-boot-a20-olinuxinomicro.spec: same change
u-boot-am335xboneblack.spec: same change
u-boot-am335xevm.spec: same change
u-boot-am57xxevm.spec: same change
u-boot-am57xxevmnodt.spec: same change
u-boot-arndale.spec: same change
u-boot-bananapi.spec: same change
u-boot-colibrit20.spec: same change
u-boot-cubieboard.spec: same change
u-boot-cubieboard2.spec: same change
u-boot-cubietruck.spec: same change
u-boot-firefly-rk3288.spec: same change
u-boot-highbank.spec: same change
u-boot-hyundaia7hd.spec: same change
u-boot-jetson-tk1.spec: same change
u-boot-melea1000.spec: same change
u-boot-merriia80optimus.spec: same change
u-boot-mx53loco.spec: same change
u-boot-mx6cuboxi.spec: same change
u-boot-mx6qsabrelite.spec: same change
u-boot-odroid-xu3.spec: same change
u-boot-odroid.spec: same change
u-boot-omap3beagle.spec: same change
u-boot-omap4panda.spec: same change
u-boot-orangepipc.spec: same change
u-boot-p2371-2180.spec: same change
u-boot-paz00.spec: same change
u-boot-pcm051rev3.spec: same change
u-boot-qemu-ppce500.spec: same change
u-boot-rpi.spec: same change
u-boot-rpi2.spec: same change
u-boot-snow.spec: same change
u-boot-spring.spec: same change
++++++ u-boot-udoo.spec ++++++
--- /var/tmp/diff_new_pack.VAloME/_old  2016-03-07 13:29:14.000000000 +0100
+++ /var/tmp/diff_new_pack.VAloME/_new  2016-03-07 13:29:14.000000000 +0100
@@ -26,10 +26,10 @@
 %define udoo_spl 1
 
 # archive_version differs from version for RC version only
-%define archive_version 2016.03-rc2
+%define archive_version 2016.03-rc3
 
 Name:           u-boot-udoo
-Version:        2016.03~rc2
+Version:        2016.03~rc3
 Release:        0
 Summary:        The u-boot firmware for the udoo arm platform
 License:        GPL-2.0
@@ -40,8 +40,23 @@
 Source300:      u-boot-rpmlintrc
 # Fix exynos KVM support
 Patch1:         u-boot-exynos.patch
-# PATCH-FIX-UPSTREAM fix boot on partition when RAW mode is also available
-Patch2:         0001-spl-if-MMCSD_MODE_RAW-fails-try-MMCSD_MODE_FS-if-ava.patch
+# Add EFI support. Will be upstream in the next version of u-boot.
+Patch3:         efi.patch
+Patch4:         efi2.patch
+# Set default environment slightly different for EFI, so it finds our dtbs
+Patch5:         efi-default-env.patch
+# Move omap3 to distro boot method
+Patch6:         omap3-Move-to-distro-bootcmd.patch
+# efi: Run memory node fixups in device tree
+Patch7:         efi_loader-Call-fdt-preparation-functions.patch
+# Allow grub2 to find its config file
+Patch8:         efi_loader-Pass-proper-device-path-in-on-boot.patch
+# Fix Raspberry Pi 1 build
+Patch9:         efi_loader-Provide-icache-flush-stub.patch
+# Make SPL work with raw sector offsets on beagle-xm
+Patch10:        omap3-Use-raw-SPL-by-default-for-mmc1.patch
+# Ensure we mark the device tree as reserved
+Patch11:        efi-map-fdt-as-reserved.patch
 # Marvell boards support is non-free licensed, and we don't need it 
(bnc#773824)
 Patch99:        drop-marvell.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -80,7 +95,15 @@
 %prep
 %setup -q -n u-boot-%{archive_version}
 %patch1 -p1
-%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
 # is non-free licensed, and we don't need it (bnc#773824)
 rm -rf board/Marvell
 %patch99 -p1

++++++ u-boot.spec ++++++
--- /var/tmp/diff_new_pack.VAloME/_old  2016-03-07 13:29:14.000000000 +0100
+++ /var/tmp/diff_new_pack.VAloME/_new  2016-03-07 13:29:14.000000000 +0100
@@ -19,10 +19,10 @@
 
 
 # 'archive_version' differs from 'version' for RC version only
-%define archive_version 2016.03-rc2
+%define archive_version 2016.03-rc3
 
 Name:           u-boot
-Version:        2016.03~rc2
+Version:        2016.03~rc3
 Release:        0
 Summary:        Tools for the u-boot Firmware
 License:        GPL-2.0


++++++ efi-default-env.patch ++++++
Index: u-boot-2016.03-rc2/include/config_distro_bootcmd.h
===================================================================
--- u-boot-2016.03-rc2.orig/include/config_distro_bootcmd.h
+++ u-boot-2016.03-rc2/include/config_distro_bootcmd.h
@@ -106,15 +106,15 @@
                "bootefi ${kernel_addr_r}\0"                              \
        \
        "load_efi_dtb="                                                   \
-               "load ${devtype} ${devnum}:${distro_bootpart} "           \
+               "load ${devtype} ${devnum}:2 "                            \
                        "${fdt_addr_r} ${prefix}${fdtfile}; "             \
                "fdt addr ${fdt_addr_r}\0"                                \
        \
-       "efi_dtb_prefixes=/ /dtb/ /dtb/current/\0"                        \
+       "efi_dtb_prefixes=/ /dtb/ /dtb/current/ /boot/ /boot/dtb/ 
/boot/dtb/current/\0" \
        "scan_dev_for_efi="                                               \
                "for prefix in ${efi_dtb_prefixes}; do "                  \
                        "if test -e ${devtype} "                          \
-                                       "${devnum}:${distro_bootpart} "   \
+                                       "${devnum}:2 "                    \
                                        "${prefix}${fdtfile}; then "      \
                                "run load_efi_dtb; "                      \
                        "fi;"                                             \
++++++ efi-map-fdt-as-reserved.patch ++++++
>From 058aba8cbd2194c0dfe6b232170f43f8e410f119 Mon Sep 17 00:00:00 2001
From: Alexander Graf <ag...@suse.de>
Date: Thu, 3 Mar 2016 15:02:27 +0100
Subject: [PATCH] bootefi: Mark fdt memory as in-use

Signed-off-by: Alexander Graf <ag...@suse.de>

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 6119854..8ba2c53 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -10,6 +10,7 @@
 #include <command.h>
 #include <efi_loader.h>
 #include <errno.h>
+#include <libfdt.h>
 #include <libfdt_env.h>
 
 /*
@@ -91,6 +92,7 @@ static unsigned long do_bootefi_exec(void *efi)
 {
        ulong (*entry)(void *image_handle, struct efi_system_table *st);
        bootm_headers_t img = { 0 };
+       ulong fdt_pages, fdt_size, fdt_start, fdt_end;
 
        /*
         * gd lives in a fixed register which may get clobbered while we execute
@@ -111,6 +113,15 @@ static unsigned long do_bootefi_exec(void *efi)
                systab.tables[0].guid = EFI_FDT_GUID;
                systab.tables[0].table = working_fdt;
                systab.nr_tables = 1;
+
+               /* And reserve the space in the memory map */
+               fdt_start = ((ulong)working_fdt) & ~EFI_PAGE_MASK;
+               fdt_end = ((ulong)working_fdt) + fdt_totalsize(working_fdt);
+               fdt_size = (fdt_end - fdt_start) + EFI_PAGE_MASK;
+               fdt_pages = (fdt_size >> EFI_PAGE_SHIFT) + 2;
+               efi_add_memory_map(fdt_start, fdt_pages,
+                                  EFI_BOOT_SERVICES_DATA, true);
+
        } else {
                printf("WARNING: No device tree loaded, expect boot to fail\n");
                systab.nr_tables = 0;
++++++ efi.patch ++++++
++++ 5575 lines (skipped)

++++++ efi2.patch ++++++
commit f01eab5acb39a4adf7577a83ef81cf4a0736633a
Author: Alexander Graf <ag...@suse.de>
Date:   Sun Feb 28 11:58:15 2016 +0100

    arm64: Replace fdt_name env variables with fdtfile
    
    The commonly defined environment variable to determine the device tree
    file name is called fdtfile rather than fdt_name. Replace all occurences
    of fdt_name with fdtfile.
    
    Signed-off-by: Alexander Graf <ag...@suse.de>

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index c19f1b0..e7d7002 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -107,7 +107,7 @@
        \
        "load_efi_dtb="                                                   \
                "load ${devtype} ${devnum}:${distro_bootpart} "           \
-                       "${fdt_addr_r} ${prefix}${fdt_name}; "           \
+                       "${fdt_addr_r} ${prefix}${fdtfile}; "             \
                "fdt addr ${fdt_addr_r}\0"                                \
        \
        "efi_dtb_prefixes=/ /dtb/ /dtb/current/\0"                        \
@@ -115,7 +115,7 @@
                "for prefix in ${efi_dtb_prefixes}; do "                  \
                        "if test -e ${devtype} "                          \
                                        "${devnum}:${distro_bootpart} "   \
-                                       "${prefix}${fdt_name}; then "     \
+                                       "${prefix}${fdtfile}; then "      \
                                "run load_efi_dtb; "                      \
                        "fi;"                                             \
                "done;"                                                   \
diff --git a/include/configs/hikey.h b/include/configs/hikey.h
index 2d9ace9..f3ae0dd 100644
--- a/include/configs/hikey.h
+++ b/include/configs/hikey.h
@@ -121,7 +121,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS      \
                                "kernel_name=Image\0"   \
                                "kernel_addr_r=0x00080000\0" \
-                               "fdt_name=hi6220-hikey.dtb\0" \
+                               "fdtfile=hi6220-hikey.dtb\0" \
                                "fdt_addr_r=0x02000000\0" \
                                "fdt_high=0xffffffffffffffff\0" \
                                "initrd_high=0xffffffffffffffff\0" \
diff --git a/include/configs/vexpress_aemv8a.h 
b/include/configs/vexpress_aemv8a.h
index 2949170..3e588c0 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -191,7 +191,7 @@
                                "kernel_addr=0x80080000\0" \
                                "initrd_name=ramdisk.img\0"     \
                                "initrd_addr=0x84000000\0"      \
-                               "fdt_name=board.dtb\0" \
+                               "fdtfile=board.dtb\0" \
                                "fdt_alt_name=juno\0" \
                                "fdt_addr=0x83000000\0" \
                                "fdt_high=0xffffffffffffffff\0" \
@@ -213,10 +213,10 @@
                                "${kernel_name}; "\
                                "  afs load ${kernel_alt_name} ${kernel_addr};"\
                                "fi ; "\
-                               "afs load  ${fdt_name} ${fdt_addr} ; " \
+                               "afs load  ${fdtfile} ${fdt_addr} ; " \
                                "if test $? -eq 1; then "\
                                "  echo Loading ${fdt_alt_name} instead of "\
-                               "${fdt_name}; "\
+                               "${fdtfile}; "\
                                "  afs load ${fdt_alt_name} ${fdt_addr}; "\
                                "fi ; "\
                                "fdt addr ${fdt_addr}; fdt resize; " \
@@ -235,7 +235,7 @@
                                "kernel_addr=0x80080000\0"      \
                                "initrd_name=ramdisk.img\0"     \
                                "initrd_addr=0x88000000\0"      \
-                               "fdt_name=devtree.dtb\0"        \
+                               "fdtfile=devtree.dtb\0"         \
                                "fdt_addr=0x83000000\0"         \
                                "fdt_high=0xffffffffffffffff\0" \
                                "initrd_high=0xffffffffffffffff\0"
@@ -245,7 +245,7 @@
                                "loglevel=9"
 
 #define CONFIG_BOOTCOMMAND     "smhload ${kernel_name} ${kernel_addr}; " \
-                               "smhload ${fdt_name} ${fdt_addr}; " \
+                               "smhload ${fdtfile} ${fdt_addr}; " \
                                "smhload ${initrd_name} ${initrd_addr} "\
                                "initrd_end; " \
                                "fdt addr ${fdt_addr}; fdt resize; " \
++++++ efi_loader-Call-fdt-preparation-functions.patch ++++++
>From 289d5c6d680d1c7a9e7c0ca4e3152dbfca67004c Mon Sep 17 00:00:00 2001
From: Alexander Graf <ag...@suse.de>
Date: Wed, 2 Mar 2016 00:35:06 +0100
Subject: [PATCH 1/1] efi_loader: Call fdt preparation functions

We have a nice framework around image fils to prepare a device tree
for OS execution. That one patches in missing device tree nodes and
fixes up the memory range bits.

We need to call that one from the EFI boot path too to get all those
nice fixups. This patch adds the call.

Signed-off-by: Alexander Graf <ag...@suse.de>
---
 cmd/bootefi.c      | 8 ++++++++
 common/image-fdt.c | 8 +++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index e3e51d4..45d193a 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -90,6 +90,7 @@ static struct efi_object bootefi_device_obj = {
 static unsigned long do_bootefi_exec(void *efi)
 {
        ulong (*entry)(void *image_handle, struct efi_system_table *st);
+       bootm_headers_t img = { 0 };
 
        /*
         * gd lives in a fixed register which may get clobbered while we execute
@@ -100,6 +101,13 @@ static unsigned long do_bootefi_exec(void *efi)
        /* Update system table to point to our currently loaded FDT */
 
        if (working_fdt) {
+               /* Prepare fdt for payload */
+               if (image_setup_libfdt(&img, working_fdt, 0, NULL)) {
+                       printf("ERROR: Failed to process device tree\n");
+                       return -EINVAL;
+               }
+
+               /* Link to it in the efi tables */
                systab.tables[0].guid = EFI_FDT_GUID;
                systab.tables[0].table = working_fdt;
                systab.nr_tables = 1;
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 79fa655..5a1b432 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -502,8 +502,9 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
        fdt_fixup_ethernet(blob);
 
        /* Delete the old LMB reservation */
-       lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,
-                (phys_size_t)fdt_totalsize(blob));
+       if (lmb)
+               lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,
+                        (phys_size_t)fdt_totalsize(blob));
 
        ret = fdt_shrink_to_minimum(blob);
        if (ret < 0)
@@ -515,7 +516,8 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
                fdt_set_totalsize(blob, of_size);
        }
        /* Create a new LMB reservation */
-       lmb_reserve(lmb, (ulong)blob, of_size);
+       if (lmb)
+               lmb_reserve(lmb, (ulong)blob, of_size);
 
        fdt_initrd(blob, *initrd_start, *initrd_end);
        if (!ft_verify_fdt(blob))
-- 
2.7.1

++++++ efi_loader-Pass-proper-device-path-in-on-boot.patch ++++++
>From dafccc9baef4cb395d0dbd91ddf683e622212f47 Mon Sep 17 00:00:00 2001
From: Alexander Graf <ag...@suse.de>
Date: Wed, 2 Mar 2016 23:54:23 +0100
Subject: [PATCH] efi_loader: Pass proper device path in on boot

EFI payloads can query for the device they were booted from. Because
we have a disconnect between loading binaries and running binaries,
we passed in a dummy device path so far.

Unfortunately that breaks grub2's logic to find its configuration
file from the same device it was booted from.

This patch adds logic to have the "load" command call into our efi
code to set the device path to the one we last loaded a binary from.

With this grub2 properly detects where we got booted from and can
find its configuration file, even when searching by-partition.

Signed-off-by: Alexander Graf <ag...@suse.de>
---
 cmd/bootefi.c             | 34 +++++++++++++++++++++++++---------
 cmd/fs.c                  |  2 ++
 include/efi_loader.h      | 10 ++++++++++
 lib/efi_loader/efi_disk.c |  6 ------
 4 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 45d193a..6119854 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -20,16 +20,16 @@
  * In addition to the originating device we also declare the file path
  * of "bootefi" based loads to be /bootefi.
  */
-static struct efi_device_path_file_path bootefi_dummy_path[] = {
+static struct efi_device_path_file_path bootefi_image_path[] = {
        {
                .dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE,
                .dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH,
-               .dp.length = sizeof(bootefi_dummy_path[0]),
+               .dp.length = sizeof(bootefi_image_path[0]),
                .str = { 'b','o','o','t','e','f','i' },
        }, {
                .dp.type = DEVICE_PATH_TYPE_END,
                .dp.sub_type = DEVICE_PATH_SUB_TYPE_END,
-               .dp.length = sizeof(bootefi_dummy_path[0]),
+               .dp.length = sizeof(bootefi_image_path[0]),
        }
 };
 
@@ -37,14 +37,14 @@ static efi_status_t bootefi_open_dp(void *handle, 
efi_guid_t *protocol,
                        void **protocol_interface, void *agent_handle,
                        void *controller_handle, uint32_t attributes)
 {
-       *protocol_interface = bootefi_dummy_path;
+       *protocol_interface = bootefi_image_path;
        return EFI_SUCCESS;
 }
 
 /* The EFI loaded_image interface for the image executed via "bootefi" */
 static struct efi_loaded_image loaded_image_info = {
-       .device_handle = bootefi_dummy_path,
-       .file_path = bootefi_dummy_path,
+       .device_handle = bootefi_image_path,
+       .file_path = bootefi_image_path,
 };
 
 /* The EFI object struct for the image executed via "bootefi" */
@@ -62,7 +62,7 @@ static struct efi_object loaded_image_info_obj = {
                {
                        /*
                         * When asking for the device path interface, return
-                        * bootefi_dummy_path
+                        * bootefi_image_path
                         */
                        .guid = &efi_guid_device_path,
                        .open = &bootefi_open_dp,
@@ -72,11 +72,11 @@ static struct efi_object loaded_image_info_obj = {
 
 /* The EFI object struct for the device the "bootefi" image was loaded from */
 static struct efi_object bootefi_device_obj = {
-       .handle = bootefi_dummy_path,
+       .handle = bootefi_image_path,
        .protocols = {
                {
                        /* When asking for the device path interface, return
-                        * bootefi_dummy_path */
+                        * bootefi_image_path */
                        .guid = &efi_guid_device_path,
                        .open = &bootefi_open_dp,
                }
@@ -173,3 +173,19 @@ U_BOOT_CMD(
        "Boots an EFI payload from memory\n",
        bootefi_help_text
 );
+
+void efi_set_bootdev(const char *dev, const char *devnr)
+{
+       char devname[16] = { 0 }; /* dp->str is u16[16] long */
+       char *colon;
+
+       /* Assemble the condensed device name we use in efi_disk.c */
+       snprintf(devname, sizeof(devname), "%s%s", dev, devnr);
+       colon = strchr(devname, ':');
+       if (colon)
+               *colon = '\0';
+
+       /* Patch the bootefi_image_path to the target device */
+       memset(bootefi_image_path[0].str, 0, sizeof(bootefi_image_path[0].str));
+       ascii2unicode(bootefi_image_path[0].str, devname);
+}
diff --git a/cmd/fs.c b/cmd/fs.c
index 8f8f1b2..be8f289 100644
--- a/cmd/fs.c
+++ b/cmd/fs.c
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <command.h>
 #include <fs.h>
+#include <efi_loader.h>
 
 static int do_size_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[])
 {
@@ -26,6 +27,7 @@ U_BOOT_CMD(
 static int do_load_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
                                char * const argv[])
 {
+       efi_set_bootdev(argv[1], (argc > 2) ? argv[2] : "");
        return do_load(cmdtp, flag, argc, argv, FS_TYPE_ANY);
 }
 
diff --git a/include/efi_loader.h b/include/efi_loader.h
index e344566..385239b 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -108,6 +108,8 @@ void efi_restore_gd(void);
 efi_status_t efi_exit_func(efi_status_t ret);
 /* Call this to relocate the runtime section to an address space */
 void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map);
+/* Call this to set the current device name */
+void efi_set_bootdev(const char *dev, const char *devnr);
 
 /* Generic EFI memory allocator, call this to get memory */
 void *efi_alloc(uint64_t len, int memory_type);
@@ -128,6 +130,13 @@ uint64_t efi_add_memory_map(uint64_t start, uint64_t 
pages, int memory_type,
 /* Called by board init to initialize the EFI memory map */
 int efi_memory_init(void);
 
+/* Convert strings from normal C strings to uEFI strings */
+static inline void ascii2unicode(u16 *unicode, char *ascii)
+{
+       while (*ascii)
+               *(unicode++) = *(ascii++);
+}
+
 /*
  * Use these to indicate that your code / data should go into the EFI runtime
  * section and thus still be available when the OS is running
@@ -143,5 +152,6 @@ int efi_memory_init(void);
 
 /* No loader configured, stub out EFI_ENTRY */
 static inline void efi_restore_gd(void) { }
+static inline void efi_set_bootdev(const char *dev, const char *devnr) { }
 
 #endif
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index f93fcb2..9bdfad3 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -29,12 +29,6 @@ struct efi_disk_obj {
        struct efi_device_path_file_path *dp;
 };
 
-static void ascii2unicode(u16 *unicode, char *ascii)
-{
-       while (*ascii)
-               *(unicode++) = *(ascii++);
-}
-
 static efi_status_t efi_disk_open_block(void *handle, efi_guid_t *protocol,
                        void **protocol_interface, void *agent_handle,
                        void *controller_handle, uint32_t attributes)
-- 
2.7.1

++++++ efi_loader-Provide-icache-flush-stub.patch ++++++
>From ef75ea486f383e87bef40446d1c993704c688187 Mon Sep 17 00:00:00 2001
From: Alexander Graf <ag...@suse.de>
Date: Thu, 3 Mar 2016 00:55:22 +0100
Subject: [PATCH] efi_loader: Provide icache flush stub

If the platform doesn't implement a function to invalidate all icache,
let's just cross our fingers that things happen to work out and roll on.

Signed-off-by: Alexander Graf <ag...@suse.de>
---
 lib/efi_loader/efi_image_loader.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/efi_loader/efi_image_loader.c 
b/lib/efi_loader/efi_image_loader.c
index 4479726..d558f5a 100644
--- a/lib/efi_loader/efi_image_loader.c
+++ b/lib/efi_loader/efi_image_loader.c
@@ -73,6 +73,11 @@ static void efi_loader_relocate(const IMAGE_BASE_RELOCATION 
*rel,
        }
 }
 
+void __weak invalidate_icache_all(void)
+{
+       /* If the system doesn't support icache_all flush, cross our fingers */
+}
+
 /*
  * This function loads all sections from a PE binary into a newly reserved
  * piece of memory. On successful load it then returns the entry point for
-- 
2.7.1

++++++ omap3-Move-to-distro-bootcmd.patch ++++++
>From 49a231145790724f4d7d386c414ab66980e4c459 Mon Sep 17 00:00:00 2001
From: Alexander Graf <ag...@suse.de>
Date: Tue, 1 Mar 2016 10:05:10 +0100
Subject: [PATCH] omap3: Move to distro bootcmd

Signed-off-by: Alexander Graf <ag...@suse.de>

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 65f08a1..63623a0 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -126,9 +126,12 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "loadaddr=0x80200000\0" \
+       "kernel_addr_r=0x80200000\0" \
        "rdaddr=0x81000000\0" \
+       "initrd_addr_r=0x81000000\0" \
        "fdt_high=0xffffffff\0" \
-       "fdtaddr=0x80f80000\0" \
+       "fdtaddr=0x90f80000\0" \
+       "fdt_addr_r=0x90f80000\0" \
        "usbtty=cdc_acm\0" \
        "bootfile=uImage\0" \
        "ramdisk=ramdisk.gz\0" \
@@ -223,39 +226,17 @@
        "userbutton=if gpio input 173; then run userbutton_xm; " \
                "else run userbutton_nonxm; fi;\0" \
        "userbutton_xm=gpio input 4;\0" \
-       "userbutton_nonxm=gpio input 7;\0"
-/* "run userbutton" will return 1 (false) if pressed and 0 (true) if not */
+       "userbutton_nonxm=gpio input 7;\0" \
+       BOOTENV
+
+#define BOOT_TARGET_DEVICES(func) \
+        func(MMC, mmc, 0)
+
 #define CONFIG_BOOTCOMMAND \
        "run findfdt; " \
-       "mmc dev ${mmcdev}; if mmc rescan; then " \
-               "if run userbutton; then " \
-                       "setenv bootenv uEnv.txt;" \
-               "else " \
-                       "setenv bootenv user.txt;" \
-               "fi;" \
-               "echo SD/MMC found on device ${mmcdev};" \
-               "if run loadbootenv; then " \
-                       "echo Loaded environment from ${bootenv};" \
-                       "run importbootenv;" \
-               "fi;" \
-               "if test -n $uenvcmd; then " \
-                       "echo Running uenvcmd ...;" \
-                       "run uenvcmd;" \
-               "fi;" \
-               "if run loadbootscript; then " \
-                       "run bootscript; " \
-               "else " \
-                       "if run loadimage; then " \
-                               "run mmcboot;" \
-                       "fi;" \
-               "fi; " \
-       "fi;" \
-       "run nandboot;" \
-       "setenv bootfile zImage;" \
-       "if run loadimage; then " \
-               "run loadfdt;" \
-               "run mmcbootz; " \
-       "fi; " \
+       "run distro_bootcmd"
+
+#include <config_distro_bootcmd.h>
 
 /*
  * OMAP3 has 12 GP timers, they can be driven by the system clock
++++++ omap3-Use-raw-SPL-by-default-for-mmc1.patch ++++++
>From 098b825ca50657cdf737aee4cf1da9eaae05d42c Mon Sep 17 00:00:00 2001
From: Alexander Graf <ag...@suse.de>
Date: Tue, 1 Mar 2016 09:52:28 +0100
Subject: [PATCH] omap3: Use raw SPL by default for mmc1

Now that we fall back to the FS code path when we don't find u-boot
at the raw sector offset, there is no good reason to not default to
raw boot.

With this patch, I can successfully boot u-boot from a raw sector
offset on beagle-xm.

Signed-off-by: Alexander Graf <ag...@suse.de>
---

I think this patch is safe and important enough to count as a bug fix for
2016.03.

 arch/arm/cpu/armv7/omap-common/boot-common.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c 
b/arch/arm/cpu/armv7/omap-common/boot-common.c
index 0456263..ed9ba7b 100644
--- a/arch/arm/cpu/armv7/omap-common/boot-common.c
+++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
@@ -111,8 +111,6 @@ void save_omap_boot_params(void)
            (boot_device <= MMC_BOOT_DEVICES_END)) {
                switch (boot_device) {
                case BOOT_DEVICE_MMC1:
-                       boot_mode = MMCSD_MODE_FS;
-                       break;
                case BOOT_DEVICE_MMC2:
                        boot_mode = MMCSD_MODE_RAW;
                        break;
-- 
1.8.5.6

++++++ u-boot-2016.03-rc2.tar.bz2 -> u-boot-2016.03-rc3.tar.bz2 ++++++
/work/SRC/openSUSE:Factory/u-boot/u-boot-2016.03-rc2.tar.bz2 
/work/SRC/openSUSE:Factory/.u-boot.new/u-boot-2016.03-rc3.tar.bz2 differ: char 
11, line 1

++++++ u-boot.spec.in ++++++
--- /var/tmp/diff_new_pack.VAloME/_old  2016-03-07 13:29:14.000000000 +0100
+++ /var/tmp/diff_new_pack.VAloME/_new  2016-03-07 13:29:14.000000000 +0100
@@ -26,10 +26,10 @@
 %define udoo_spl UDOO_SPL
 
 # archive_version differs from version for RC version only
-%define archive_version 2016.03-rc2
+%define archive_version 2016.03-rc3
 
 Name:           u-boot-BOARDNAME
-Version:        2016.03~rc2
+Version:        2016.03~rc3
 Release:        0
 Summary:        The u-boot firmware for the BOARDNAME arm platform
 License:        GPL-2.0
@@ -40,8 +40,23 @@
 Source300:      u-boot-rpmlintrc
 # Fix exynos KVM support
 Patch1:         u-boot-exynos.patch
-# PATCH-FIX-UPSTREAM fix boot on partition when RAW mode is also available
-Patch2:         0001-spl-if-MMCSD_MODE_RAW-fails-try-MMCSD_MODE_FS-if-ava.patch
+# Add EFI support. Will be upstream in the next version of u-boot.
+Patch3:         efi.patch
+Patch4:         efi2.patch
+# Set default environment slightly different for EFI, so it finds our dtbs
+Patch5:         efi-default-env.patch
+# Move omap3 to distro boot method
+Patch6:                omap3-Move-to-distro-bootcmd.patch
+# efi: Run memory node fixups in device tree
+Patch7:         efi_loader-Call-fdt-preparation-functions.patch
+# Allow grub2 to find its config file
+Patch8:         efi_loader-Pass-proper-device-path-in-on-boot.patch
+# Fix Raspberry Pi 1 build
+Patch9:         efi_loader-Provide-icache-flush-stub.patch
+# Make SPL work with raw sector offsets on beagle-xm
+Patch10:        omap3-Use-raw-SPL-by-default-for-mmc1.patch
+# Ensure we mark the device tree as reserved
+Patch11:        efi-map-fdt-as-reserved.patch
 # Marvell boards support is non-free licensed, and we don't need it 
(bnc#773824)
 Patch99:        drop-marvell.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -80,7 +95,15 @@
 %prep
 %setup -q -n u-boot-%{archive_version}
 %patch1 -p1
-%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
 # is non-free licensed, and we don't need it (bnc#773824)
 rm -rf board/Marvell
 %patch99 -p1


Reply via email to