Browse code

u-boot-rpi3: new package

Use sources from OpenSuse.
This version of u-boot supports uEFI.
The great work was done to make it happen:
https://events.opensuse.org/conference/oSC16/program/proposal/946

Updated bootaa64.efi image, which supports both: VMs and RPI3.

makedefs.mk: fixed recursive variable assignment.

Change-Id: Ic5fcbd416c3ad6841262df3d8cc592ca1de1b133
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4542
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

Alexey Makhalov authored on 2017/12/21 06:46:39
Showing 7 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,41 @@
0
+From a7e044eece1d28a53f343503890e361322de96e3 Mon Sep 17 00:00:00 2001
1
+From: Alexander Graf <agraf@suse.de>
2
+Date: Wed, 13 Apr 2016 13:44:29 +0200
3
+Subject: [PATCH] XXX openSUSE XXX: Load dtb from partition 2
4
+
5
+Upstream U-Boot loads the device tree from the EFI partition. This is
6
+mostly because upstream we don't know which partition really holds the
7
+boot data.
8
+
9
+For openSUSE however we do know, so let's just patch the boot script to
10
+load device trees from partition 2.
11
+
12
+Signed-off-by: Alexander Graf <agraf@suse.de>
13
+---
14
+ include/config_distro_bootcmd.h | 6 +++---
15
+ 1 file changed, 3 insertions(+), 3 deletions(-)
16
+
17
+diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
18
+index e0d0034ed3..120e22e995 100644
19
+--- a/include/config_distro_bootcmd.h
20
+@@ -126,16 +126,16 @@
21
+ 		"fi\0"                                                    \
22
+ 	\
23
+ 	"load_efi_dtb="                                                   \
24
+-		"load ${devtype} ${devnum}:${distro_bootpart} "           \
25
++		"load ${devtype} ${devnum}:2 "           \
26
+ 			"${fdt_addr_r} ${prefix}${efi_fdtfile}\0"         \
27
+ 	\
28
+-	"efi_dtb_prefixes=/ /dtb/ /dtb/current/\0"                        \
29
++	"efi_dtb_prefixes=/ /dtb/ /dtb/current/ /boot/ /boot/dtb/ /boot/dtb/current/\0" \
30
+ 	"scan_dev_for_efi="                                               \
31
+ 		"setenv efi_fdtfile ${fdtfile}; "                         \
32
+ 		BOOTENV_EFI_SET_FDTFILE_FALLBACK                          \
33
+ 		"for prefix in ${efi_dtb_prefixes}; do "                  \
34
+ 			"if test -e ${devtype} "                          \
35
+-					"${devnum}:${distro_bootpart} "   \
36
++					"${devnum}:2 "   \
37
+ 					"${prefix}${efi_fdtfile}; then "  \
38
+ 				"run load_efi_dtb; "                      \
39
+ 			"fi;"                                             \
0 40
new file mode 100644
... ...
@@ -0,0 +1,23 @@
0
+From cb274c28c8e72fbf1e4c6cd41833442fd3f1a3db Mon Sep 17 00:00:00 2001
1
+From: Guillaume GARDET <guillaume.gardet@free.fr>
2
+Date: Thu, 16 Nov 2017 13:20:12 +0100
3
+Subject: [PATCH] Fix MMC1 (external SD slot) on Samsung Snow (Chromebook ARM)
4
+
5
+---
6
+ drivers/mmc/dw_mmc.c | 3 ++-
7
+ 1 file changed, 2 insertions(+), 1 deletion(-)
8
+
9
+diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
10
+index 23f642980b..a6a0934eef 100644
11
+--- a/drivers/mmc/dw_mmc.c
12
+@@ -508,7 +508,8 @@ void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host,
13
+ 		cfg->host_caps |= MMC_MODE_4BIT;
14
+ 		cfg->host_caps &= ~MMC_MODE_8BIT;
15
+ 	}
16
+-	cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
17
++	/* MMC_MODE_HS_52MHz is broken (at least) on Samsung Snow, so disbale it for now */
18
++	cfg->host_caps |= MMC_MODE_HS;
19
+ 
20
+ 	cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
21
+ }
0 22
new file mode 100644
... ...
@@ -0,0 +1,65 @@
0
+%global security_hardening none
1
+%global debug_package %{nil}
2
+Summary:        U-Boot EFI firmware for the rpi3
3
+Name:		u-boot-rpi3
4
+Version:	2017.11
5
+Release:	1%{?dist}
6
+License:	GPLv2
7
+Url:            http://www.denx.de/wiki/U-Boot
8
+Vendor:		VMware, Inc.
9
+Distribution:	Photon
10
+Source0:        ftp://ftp.denx.de/pub/u-boot/u-boot-%{version}.tar.bz2
11
+Patch0:		0001-XXX-openSUSE-XXX-Load-dtb-from-part.patch
12
+Patch1:		0004-Fix-MMC1-external-SD-slot-on-Samsun.patch
13
+BuildRequires:  bc
14
+BuildRequires:  openssl-devel
15
+BuildRequires:  python2-devel
16
+BuildRequires:  swig
17
+
18
+%define sha1 u-boot=6a3932b39a0f165aba210663ea2500bcfb9c8794
19
+%description
20
+Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for
21
+Embedded PowerPC, ARM, MIPS and x86 processors.
22
+
23
+%package doc
24
+Summary:        Documentation for the U-Boot Firmware
25
+Group:          Documentation/Other
26
+%description doc
27
+Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for
28
+Embedded PowerPC, ARM, MIPS and x86 processors.
29
+
30
+%prep
31
+%setup -q -n u-boot-%{version}
32
+%patch0 -p1
33
+%patch1 -p1
34
+
35
+%build
36
+make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" rpi_3_defconfig
37
+echo "CONFIG_OF_LIBFDT_OVERLAY=y" >> .config
38
+make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" USE_PRIVATE_LIBGG=yes
39
+
40
+%install
41
+install -D -m 0644 u-boot.bin %{buildroot}/boot/esp/u-boot.bin
42
+
43
+%files
44
+%defattr(-,root,root)
45
+/boot/esp/*
46
+%doc Licenses/gpl-2.0.txt README
47
+
48
+%files doc
49
+%defattr(-,root,root)
50
+# Generic documents
51
+%doc doc/README.JFFS2 doc/README.JFFS2_NAND doc/README.commands
52
+%doc doc/README.autoboot doc/README.commands doc/README.console doc/README.dns
53
+%doc doc/README.hwconfig doc/README.nand doc/README.NetConsole doc/README.serial_multi
54
+%doc doc/README.SNTP doc/README.standalone doc/README.update doc/README.usb
55
+%doc doc/README.video doc/README.VLAN doc/README.silent doc/README.POST
56
+# Copy some useful kermit scripts as well
57
+%doc tools/kermit/dot.kermrc tools/kermit/flash_param tools/kermit/send_cmd tools/kermit/send_image
58
+# Now any h/w dependent Documentation
59
+%doc doc/README.ARM-memory-map
60
+
61
+%changelog
62
+*   Fri Dec 15 2017 Alexey Makhalov <amakhalov@vmware.com> 2017.11-1
63
+-   Based on OpenSuse u-boot-rpi3-2017.11-266.2 from Thu Nov 16 2017
64
+    by guillaume@opensuse.org
0 65
Binary files a/installer/EFI_aarch64/BOOT/bootaa64.efi and b/installer/EFI_aarch64/BOOT/bootaa64.efi differ
... ...
@@ -61,6 +61,9 @@ cp EFI_$(uname -m)/BOOT/* ${BUILDROOT}/installer/EFI/BOOT/
61 61
 # grubx64.efi is generated on Photon OS by using grub2-efi >= 2.02-7:
62 62
 # # grub2-efi-mkimage -o grubx64.efi -p /boot/grub2 -O x86_64-efi  fat iso9660 part_gpt part_msdos  normal boot linux configfile loopback chain  efifwsetup efi_gop efi_uga  ls search search_label search_fs_uuid search_fs_file  gfxterm gfxterm_background gfxterm_menu test all_video loadenv  exfat ext2 udf halt gfxmenu png tga lsefi help linuxefi
63 63
 
64
+# grubaa64.efi is generated on Photon OS by using grub2-efi >= 2.02-7:
65
+#grub2-mkimage -o bootaa64.efi -p /boot/grub2 -O arm64-efi  fat iso9660 part_gpt part_msdos  normal boot linux configfile loopback chain efifwsetup efi_gop efinet ls search search_label search_fs_uuid search_fs_file  gfxterm gfxterm_background gfxterm_menu test all_video loadenv  exfat ext2 udf halt gfxmenu png tga lsefi help all_video
66
+
64 67
 # both bootx64.efi and grubx64.efi are signed with VMware key
65 68
 EFI_IMAGE=boot/grub2/efiboot.img
66 69
 EFI_FOLDER=`readlink -f ${STAGE_PATH}/efiboot`
... ...
@@ -43,7 +43,7 @@ PHOTON_SPECDEPS_DIR=$(SRCROOT)/support/package-builder
43 43
 PHOTON_SPECDEPS=$(PHOTON_SPECDEPS_DIR)/SpecDeps.py
44 44
 PHOTON_PACKAGE_BUILDER=$(PHOTON_PKG_BUILDER_DIR)/builder.py
45 45
 ifdef PHOTON_PULLSOURCES_CONFIG
46
-PHOTON_PULLSOURCES_CONFIG=$(abspath $(PHOTON_PULLSOURCES_CONFIG))
46
+PHOTON_PULLSOURCES_CONFIG:=$(abspath $(PHOTON_PULLSOURCES_CONFIG))
47 47
 else
48 48
 PHOTON_PULLSOURCES_CONFIG?=$(PHOTON_PKG_BUILDER_DIR)/bintray.conf
49 49
 endif
... ...
@@ -346,7 +346,9 @@ class constants(object):
346 346
 
347 347
     # list of spec files to skip for parsing for given arch
348 348
     skipSpecsForArch={
349
-        "x86_64":[],
349
+        "x86_64":[
350
+            "u-boot-rpi3.spec"
351
+            ],
350 352
         "aarch64":[
351 353
             # fakeroot-ng does not support aarch64
352 354
             "fakeroot-ng.spec",