aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-agl-bsp/conf/include/agl_dra7xx-evm.inc4
-rw-r--r--meta-agl-bsp/conf/include/agl_intel-corei7-64.inc5
-rw-r--r--meta-agl-bsp/conf/include/agl_porter-nogfx.inc9
-rw-r--r--meta-agl-bsp/conf/include/agl_porter.inc9
-rw-r--r--meta-agl-bsp/conf/include/agl_qemux86-64.inc7
-rw-r--r--meta-agl-bsp/conf/include/agl_raspberrypi2.inc18
-rw-r--r--meta-agl-bsp/conf/include/agl_raspberrypi3.inc18
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb32
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr3
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt7
-rw-r--r--meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt7
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch41
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch86
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch138
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb25
-rw-r--r--meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb13
-rw-r--r--templates/feature/agl-sota/50_bblayers.conf.inc8
-rw-r--r--templates/feature/agl-sota/50_local.conf.inc2
18 files changed, 370 insertions, 62 deletions
diff --git a/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc b/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc
index 86ed8d2d6..f3abe4cc5 100644
--- a/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc
+++ b/meta-agl-bsp/conf/include/agl_dra7xx-evm.inc
@@ -47,7 +47,3 @@ IMAGE_INSTALL_append = " \
${PACKAGES_MULTIMEDIA} \
cmem \
"
-
-IMAGE_CLASSES_append_sota = " image_types_uboot sdcard_image-dra7xx-evm-ota"
-IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'agl-ota', 'dra7xx-evm-sdimg-ota ', '', d)}"
-OSTREE_BOOTLOADER ?= "u-boot"
diff --git a/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc b/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc
index 1de73a208..b79b436ac 100644
--- a/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc
+++ b/meta-agl-bsp/conf/include/agl_intel-corei7-64.inc
@@ -24,7 +24,4 @@ IMAGE_INSTALL_append = " \
va-intel \
gstreamer-vaapi-1.0 "
-OSTREE_BOOTLOADER ?= "u-boot"
-PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot-ota"
-UBOOT_MACHINE_sota ?= "minnowmax_defconfig"
-
+require conf/include/local/sota_minnowboard.inc
diff --git a/meta-agl-bsp/conf/include/agl_porter-nogfx.inc b/meta-agl-bsp/conf/include/agl_porter-nogfx.inc
index 2a06bbec6..37ff7837d 100644
--- a/meta-agl-bsp/conf/include/agl_porter-nogfx.inc
+++ b/meta-agl-bsp/conf/include/agl_porter-nogfx.inc
@@ -19,11 +19,4 @@ UBOOT_MACHINE = "porter_vin_config"
PREFERRED_PROVIDER_virtual/libgles2 = "mesa"
PREFERRED_PROVIDER_virtual/egl = "mesa"
-# Commit united image to OSTree, not just uImage
-OSTREE_KERNEL = "uImage+dtb"
-
-EXTRA_IMAGEDEPENDS_append_sota = " porter-bootfiles"
-IMAGE_CLASSES_append_sota = " image_types_uboot "
-IMAGE_BOOT_FILES_sota = "porter-bootfiles/*"
-
-OSTREE_BOOTLOADER ?= "u-boot"
+require conf/include/local/sota_porter.inc
diff --git a/meta-agl-bsp/conf/include/agl_porter.inc b/meta-agl-bsp/conf/include/agl_porter.inc
index c562784aa..01ee3e414 100644
--- a/meta-agl-bsp/conf/include/agl_porter.inc
+++ b/meta-agl-bsp/conf/include/agl_porter.inc
@@ -179,11 +179,4 @@ DISTRO_FEATURES_append = " h264avcenc_lib"
# ARM AAC Encode Middleware for Linux
#DISTRO_FEATURES_append = " aacenc_mdw"
-# Commit united image to OSTree, not just uImage
-OSTREE_KERNEL = "uImage+dtb"
-
-EXTRA_IMAGEDEPENDS_append_sota = " porter-bootfiles"
-IMAGE_CLASSES_append_sota = " image_types_uboot "
-IMAGE_BOOT_FILES_sota = "porter-bootfiles/*"
-
-OSTREE_BOOTLOADER ?= "u-boot"
+require conf/include/local/sota_porter.inc
diff --git a/meta-agl-bsp/conf/include/agl_qemux86-64.inc b/meta-agl-bsp/conf/include/agl_qemux86-64.inc
index d48252e92..341e9ad74 100644
--- a/meta-agl-bsp/conf/include/agl_qemux86-64.inc
+++ b/meta-agl-bsp/conf/include/agl_qemux86-64.inc
@@ -18,9 +18,4 @@ APPEND += "console=ttyS0,115200n8"
# All boot message will be off
APPEND += "quiet"
-# U-Boot support for SOTA
-PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot-ota"
-UBOOT_MACHINE_sota = "qemu-x86_defconfig"
-OSTREE_BOOTLOADER ?= "u-boot"
-
-OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda"
+require conf/include/local/sota_qemux86-64.inc
diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi2.inc b/meta-agl-bsp/conf/include/agl_raspberrypi2.inc
index 7250f5c22..da4a02a5e 100644
--- a/meta-agl-bsp/conf/include/agl_raspberrypi2.inc
+++ b/meta-agl-bsp/conf/include/agl_raspberrypi2.inc
@@ -11,7 +11,6 @@ CORE_IMAGE_EXTRA_INSTALL += "wayland weston"
MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
KERNEL_DEVICETREE_append = " overlays/vc4-kms-v3d-overlay.dtb"
-KERNEL_IMAGETYPE_sota = "uImage"
PREFERRED_VERSION_linux-raspberrypi = "4.4.%"
PREFERRED_VERSION_mesa = "12.%"
@@ -23,20 +22,6 @@ PREFERRED_PROVIDER_jpeg = "jpeg"
MACHINE_FEATURES += "vc4graphics"
-### Image classes, fstypes and (S)OTA
-
-# normal image class is sdcard_image-rpi-gdp, for sota it is image_types_uboot & sdcard_image-rpi-ota
-IMAGE_CLASSES += "${@bb.utils.contains('DISTRO_FEATURES', 'agl-ota', 'image_types_uboot sdcard_image-rpi-ota', 'sdcard_image-rpi-gdp', d)}"
-
-# normal image is rpi-sdimg, for sota it is rpi-sdimg-ota
-#IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'agl-ota', 'rpi-sdimg-ota', 'rpi-sdimg', d)}"
-### both rpi-sdimg and rpi-sdimg-ota broken
-IMAGE_FSTYPES += "ext4.xz ext4.bmap tar.xz"
-
-KERNEL_IMAGETYPE_sota = "uImage"
-PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot"
-UBOOT_MACHINE_sota = "rpi_2_defconfig"
-
# For libomxil
#LICENSE_FLAGS_WHITELIST = "commercial"
@@ -44,4 +29,5 @@ IMAGE_INSTALL_append = " kernel-modules linux-firmware "
# Psplash causes crash on first boot on RPi
IMAGE_FEATURES_remove = "splash"
-OSTREE_BOOTLOADER ?= "u-boot"
+
+require conf/include/local/sota_raspberrypi.inc
diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi3.inc b/meta-agl-bsp/conf/include/agl_raspberrypi3.inc
index a3a84be5f..da4a02a5e 100644
--- a/meta-agl-bsp/conf/include/agl_raspberrypi3.inc
+++ b/meta-agl-bsp/conf/include/agl_raspberrypi3.inc
@@ -11,7 +11,6 @@ CORE_IMAGE_EXTRA_INSTALL += "wayland weston"
MULTI_PROVIDER_WHITELIST += "virtual/libgl virtual/egl virtual/libgles1 virtual/libgles2"
KERNEL_DEVICETREE_append = " overlays/vc4-kms-v3d-overlay.dtb"
-KERNEL_IMAGETYPE_sota = "uImage"
PREFERRED_VERSION_linux-raspberrypi = "4.4.%"
PREFERRED_VERSION_mesa = "12.%"
@@ -23,20 +22,6 @@ PREFERRED_PROVIDER_jpeg = "jpeg"
MACHINE_FEATURES += "vc4graphics"
-### Image classes, fstypes and (S)OTA
-
-# normal image class is sdcard_image-rpi-gdp, for sota it is image_types_uboot & sdcard_image-rpi-ota
-IMAGE_CLASSES += "${@bb.utils.contains('DISTRO_FEATURES', 'agl-ota', 'image_types_uboot sdcard_image-rpi-ota', 'sdcard_image-rpi-gdp', d)}"
-
-# normal image is rpi-sdimg, for sota it is rpi-sdimg-ota
-IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'agl-ota', 'rpi-sdimg-ota', 'rpi-sdimg', d)}"
-### both rpi-sdimg and rpi-sdimg-ota broken
-IMAGE_FSTYPES += "ext4.xz ext4.bmap tar.xz"
-
-KERNEL_IMAGETYPE_sota = "uImage"
-PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot"
-UBOOT_MACHINE_sota = "rpi_3_32b_defconfig"
-
# For libomxil
#LICENSE_FLAGS_WHITELIST = "commercial"
@@ -44,4 +29,5 @@ IMAGE_INSTALL_append = " kernel-modules linux-firmware "
# Psplash causes crash on first boot on RPi
IMAGE_FEATURES_remove = "splash"
-OSTREE_BOOTLOADER ?= "u-boot"
+
+require conf/include/local/sota_raspberrypi.inc
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb
new file mode 100644
index 000000000..ccaefc715
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb
@@ -0,0 +1,32 @@
+DESCRIPTION = "Boot script for launching OTA-enabled images on raspberrypi"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+DEPENDS = "u-boot-mkimage-native"
+
+COMPATIBLE_MACHINE = "raspberrypi"
+
+SRC_URI = "file://boot.scr \
+ file://uEnv.txt \
+ file://uEnv.cma.txt \
+ "
+
+S = "${WORKDIR}"
+
+inherit deploy
+
+do_deploy() {
+ install -d ${DEPLOYDIR}/bcm2835-bootfiles
+
+ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ostree boot script" -d ${S}/boot.scr ${DEPLOYDIR}/bcm2835-bootfiles/boot.scr
+ if [ "${ENABLE_CMA}" = "1" ]; then
+ install -m 0755 ${S}/uEnv.cma.txt ${DEPLOYDIR}/bcm2835-bootfiles/uEnv.txt
+ else
+ install -m 0755 ${S}/uEnv.txt ${DEPLOYDIR}/bcm2835-bootfiles/uEnv.txt
+ fi
+}
+
+addtask deploy before do_package after do_install
+do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr
new file mode 100644
index 000000000..dc13f85b2
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr
@@ -0,0 +1,3 @@
+fatload mmc 0:1 $loadaddr /uEnv.txt
+env import -t $loadaddr $filesize
+run bootcmd
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt
new file mode 100644
index 000000000..611119f09
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.cma.txt
@@ -0,0 +1,7 @@
+fdt_addr_r=0x0c800000
+bootcmd_dtb=fdt addr $fdt_addr_r; fdt get value bootargs_fdt /chosen bootargs
+bootcmd_otenv=ext2load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
+bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192 coherent_pool=6M smsc95xx.turbo_mode=N"
+bootcmd_load=ext2load mmc 0:2 $kernel_addr_r "/boot"$kernel_image; ext2load mmc 0:2 $ramdisk_addr_r "/boot"$ramdisk_image
+bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r
+bootcmd=run bootcmd_dtb; run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt
new file mode 100644
index 000000000..f6c05709b
--- /dev/null
+++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt
@@ -0,0 +1,7 @@
+fdt_addr_r=0x0c800000
+bootcmd_dtb=fdt addr $fdt_addr_r; fdt get value bootargs_fdt /chosen bootargs
+bootcmd_otenv=ext2load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
+bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192"
+bootcmd_load=ext2load mmc 0:2 $kernel_addr_r "/boot"$kernel_image; ext2load mmc 0:2 $ramdisk_addr_r "/boot"$ramdisk_image
+bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r
+bootcmd=run bootcmd_dtb; run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch
new file mode 100644
index 000000000..5172fdd3a
--- /dev/null
+++ b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch
@@ -0,0 +1,41 @@
+From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001
+From: Anton Gerasimov <anton@advancedtelematic.com>
+Date: Thu, 15 Sep 2016 17:52:41 +0200
+Subject: [PATCH 1/2] Set up environment for OSTree integration
+
+---
+ include/configs/qemu-x86.h | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h
+index 78c296f..79df455 100644
+--- a/include/configs/qemu-x86.h
++++ b/include/configs/qemu-x86.h
+@@ -74,4 +74,24 @@
+ #undef CONFIG_ENV_IS_IN_SPI_FLASH
+ #define CONFIG_ENV_IS_NOWHERE
+
++#undef CONFIG_BOOTARGS
++#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0"
++
++#undef CONFIG_BOOTDELAY
++#define CONFIG_BOOTDELAY 3
++
++#undef CONFIG_BOOTCOMMAND
++#define CONFIG_BOOTCOMMAND "run loadenv;" \
++ "setenv bootargs $bootargs\" console=ttyS0 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda ramdisk_size=16384 \";" \
++ "ext2load ide 0 $loadaddr \"/boot\"$kernel_image;" \
++ "ext2load ide 0 $ramdiskaddr \"/boot\"$ramdisk_image;" \
++ "zboot $loadaddr - $ramdiskaddr $filesize"
++
++#undef CONFIG_EXTRA_ENV_SETTINGS
++#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \
++ "ramdisk_image=/initrd\0" \
++ "ramdiskaddr=0x4000000\0" \
++ "bootdelay=3\0" \
++ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;"
++
+ #endif /* __CONFIG_H */
+--
+2.9.3
+
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch
new file mode 100644
index 000000000..df1f786c6
--- /dev/null
+++ b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0001-fixup-build-with-gcc6.patch
@@ -0,0 +1,86 @@
+From ba619c7ec7820e80d1b5b520440fdb81c31c0baf Mon Sep 17 00:00:00 2001
+From: Ronan Le Martret <ronan.lemartret@iot.bzh>
+Date: Fri, 14 Oct 2016 09:03:11 +0200
+Subject: [PATCH] fix gcc6 build
+
+Signed-off-by: ronan <ronan@linux-pgnz.suse>
+---
+ include/linux/compiler-gcc6.h | 66 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 66 insertions(+)
+ create mode 100644 include/linux/compiler-gcc6.h
+
+diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h
+new file mode 100644
+index 0000000..a3d00d8
+--- /dev/null
++++ b/include/linux/compiler-gcc6.h
+@@ -0,0 +1,66 @@
++#ifndef __LINUX_COMPILER_H
++#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
++#endif
++
++#define __used __attribute__((__used__))
++#define __must_check __attribute__((warn_unused_result))
++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
++
++/* Mark functions as cold. gcc will assume any path leading to a call
++ to them will be unlikely. This means a lot of manual unlikely()s
++ are unnecessary now for any paths leading to the usual suspects
++ like BUG(), printk(), panic() etc. [but let's keep them for now for
++ older compilers]
++
++ Early snapshots of gcc 4.3 don't support this and we can't detect this
++ in the preprocessor, but we can live with this because they're unreleased.
++ Maketime probing would be overkill here.
++
++ gcc also has a __attribute__((__hot__)) to move hot functions into
++ a special section, but I don't see any sense in this right now in
++ the kernel context */
++#define __cold __attribute__((__cold__))
++
++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
++
++#ifndef __CHECKER__
++# define __compiletime_warning(message) __attribute__((warning(message)))
++# define __compiletime_error(message) __attribute__((error(message)))
++#endif /* __CHECKER__ */
++
++/*
++ * Mark a position in code as unreachable. This can be used to
++ * suppress control flow warnings after asm blocks that transfer
++ * control elsewhere.
++ *
++ * Early snapshots of gcc 4.5 don't support this and we can't detect
++ * this in the preprocessor, but we can live with this because they're
++ * unreleased. Really, we need to have autoconf for the kernel.
++ */
++#define unreachable() __builtin_unreachable()
++
++/* Mark a function definition as prohibited from being cloned. */
++#define __noclone __attribute__((__noclone__))
++
++/*
++ * Tell the optimizer that something else uses this function or variable.
++ */
++#define __visible __attribute__((externally_visible))
++
++/*
++ * GCC 'asm goto' miscompiles certain code sequences:
++ *
++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
++ *
++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
++ * Fixed in GCC 4.8.2 and later versions.
++ *
++ * (asm goto is automatically volatile - the naming reflects this.)
++ */
++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
++
++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
++#define __HAVE_BUILTIN_BSWAP32__
++#define __HAVE_BUILTIN_BSWAP64__
++#define __HAVE_BUILTIN_BSWAP16__
++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
+--
+2.6.6
+
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
new file mode 100644
index 000000000..7540b7467
--- /dev/null
+++ b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
@@ -0,0 +1,138 @@
+From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001
+From: Anton Gerasimov <anton@advancedtelematic.com>
+Date: Thu, 15 Sep 2016 16:49:32 +0200
+Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on
+ multilib
+
+---
+ arch/x86/config.mk | 2 --
+ arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++---------
+ 2 files changed, 87 insertions(+), 19 deletions(-)
+
+diff --git a/arch/x86/config.mk b/arch/x86/config.mk
+index 999143e..139576e 100644
+--- a/arch/x86/config.mk
++++ b/arch/x86/config.mk
+@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
+ PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386
+
+ LDFLAGS_FINAL += --gc-sections -pie
+-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3
+-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3
+diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c
+index 497ad75..c321b11 100644
+--- a/arch/x86/lib/gcc.c
++++ b/arch/x86/lib/gcc.c
+@@ -19,22 +19,92 @@
+
+ #ifdef __GNUC__
+
+-/*
+- * GCC's libgcc handling is quite broken. While the libgcc functions
+- * are always regparm(0) the code that calls them uses whatever the
+- * compiler call specifies. Therefore we need a wrapper around those
+- * functions. See gcc bug PR41055 for more information.
+- */
+-#define WRAP_LIBGCC_CALL(type, name) \
+- type __normal_##name(type a, type b) __attribute__((regparm(0))); \
+- type __wrap_##name(type a, type b); \
+- type __attribute__((no_instrument_function)) \
+- __wrap_##name(type a, type b) \
+- { return __normal_##name(a, b); }
+-
+-WRAP_LIBGCC_CALL(long long, __divdi3)
+-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3)
+-WRAP_LIBGCC_CALL(long long, __moddi3)
+-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3)
++#include <stdint.h>
++#include <stddef.h>
++
++uint64_t __udivmoddi4 ( uint64_t num,
++ uint64_t den,
++ uint64_t *rem_p )
++{
++ uint64_t quot = 0, qbit = 1;
++
++ if ( den == 0 ) {
++ return 1/((unsigned)den); /* Intentional divide by zero, without
++ triggering a compiler warning which
++ would abort the build */
++ }
++
++ /* Left-justify denominator and count shift */
++ while ( (int64_t)den >= 0 ) {
++ den <<= 1;
++ qbit <<= 1;
++ }
++
++ while ( qbit ) {
++ if ( den <= num ) {
++ num -= den;
++ quot += qbit;
++ }
++ den >>= 1;
++ qbit >>= 1;
++ }
++
++ if ( rem_p )
++ *rem_p = num;
++
++ return quot;
++}
++uint64_t __udivdi3( uint64_t num, uint64_t den )
++{
++ return __udivmoddi4(num, den, NULL);
++}
++
++uint64_t __umoddi3 ( uint64_t num, uint64_t den )
++{
++ uint64_t v;
++
++ (void) __udivmoddi4(num, den, &v);
++ return v;
++}
++
++int64_t __divmoddi4 ( int64_t num,
++ int64_t den,
++ int64_t* rem_p )
++{
++ int minus = 0;
++ int64_t v;
++
++ if ( num < 0 ) {
++ num = -num;
++ minus = 1;
++ }
++ if ( den < 0 ) {
++ den = -den;
++ minus ^= 1;
++ }
++
++ v = __udivmoddi4(num, den, (uint64_t *)rem_p);
++ if ( minus ) {
++ v = -v;
++ if ( rem_p )
++ *rem_p = -(*rem_p);
++ }
++
++ return v;
++}
++
++
++int64_t __moddi3 (int64_t num, int64_t den)
++{
++ int64_t v;
++
++ (void) __divmoddi4(num, den, &v);
++ return v;
++}
++
++int64_t __divdi3(int64_t num, int64_t den)
++{
++ return __divmoddi4(num, den, NULL);
++}
+
+ #endif
+--
+2.9.3
+
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
new file mode 100644
index 000000000..dfa0631a0
--- /dev/null
+++ b/meta-agl-bsp/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
@@ -0,0 +1,25 @@
+include recipes-bsp/u-boot/u-boot.inc
+DEPENDS += "dtc-native"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"
+
+# This revision corresponds to the tag "v2015.07"
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204"
+
+SRC_URI += "file://0001-Set-up-environment-for-OSTree-integration.patch \
+ file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \
+ file://0001-fixup-build-with-gcc6.patch \
+ "
+
+PV = "v2015.07+git${SRCPV}"
+
+EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline "
+EXTRA_OEMAKE_append_qemux86 = " BUILD_ROM=y"
+EXTRA_OEMAKE_append_qemux86-64 = " BUILD_ROM=y"
+
+UBOOT_SUFFIX = "bin"
+UBOOT_SUFFIX_qemux86 = "rom"
+UBOOT_SUFFIX_qemux86-64 = "rom"
diff --git a/meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb b/meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb
new file mode 100644
index 000000000..2c7cc4bb9
--- /dev/null
+++ b/meta-agl-bsp/recipes-bsp/u-boot/u-boot_2016.11.bb
@@ -0,0 +1,13 @@
+require recipes-bsp/u-boot/u-boot.inc
+
+DEPENDS += "dtc-native"
+
+SRCREV = "5ea3e51fc481613a8dee8c02848d1b42c81ad892"
+
+PV = "v2016.11+git${SRCPV}"
+
+#This patch is not complacente with u-boot 2016.11
+#Version of u-boot from yocto 2.2 Morty is 2016.03 from:
+# meta/recipes-bsp/u-boot/u-boot_2016.03.bb
+SRC_URI_remove_raspberrypi3 = "file://0003-Include-lowlevel_init.o-for-rpi2.patch"
+SRC_URI_remove_raspberrypi2 = "file://0003-Include-lowlevel_init.o-for-rpi2.patch"
diff --git a/templates/feature/agl-sota/50_bblayers.conf.inc b/templates/feature/agl-sota/50_bblayers.conf.inc
new file mode 100644
index 000000000..bdcf07605
--- /dev/null
+++ b/templates/feature/agl-sota/50_bblayers.conf.inc
@@ -0,0 +1,8 @@
+BBLAYERS =+ " \
+ ${METADIR}/meta-updater \
+ ${METADIR}/meta-openembedded/meta-filesystems \
+ ${METADIR}/meta-openembedded/meta-python \
+ ${METADIR}/meta-openembedded/meta-ruby \
+ ${METADIR}/meta-rust \
+ "
+
diff --git a/templates/feature/agl-sota/50_local.conf.inc b/templates/feature/agl-sota/50_local.conf.inc
new file mode 100644
index 000000000..42ff6bc1c
--- /dev/null
+++ b/templates/feature/agl-sota/50_local.conf.inc
@@ -0,0 +1,2 @@
+#see meta-updater/conf/distro/sota.conf.inc
+require conf/distro/sota.conf.inc