summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-10-05 02:36:16 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-10-05 02:36:16 -0300
commit712d4814bd655fb3ed8b9af602158cc6923acae7 (patch)
treeb63eec3ed93130964a8f84558347bbe0fe95202b
parent765e537cf6fa34b3cd9e099623e2552e21501877 (diff)
downloadabslibre-712d4814bd655fb3ed8b9af602158cc6923acae7.tar.gz
abslibre-712d4814bd655fb3ed8b9af602158cc6923acae7.tar.bz2
abslibre-712d4814bd655fb3ed8b9af602158cc6923acae7.zip
uboot-cubox-i-linux-libre: add new package to [libre]
-rw-r--r--libre/uboot-cubox-i-linux-libre/PKGBUILD71
-rw-r--r--libre/uboot-cubox-i-linux-libre/arm_board_use_weak.patch81
-rw-r--r--libre/uboot-cubox-i-linux-libre/check_dtbs_subdir_fix.patch23
-rw-r--r--libre/uboot-cubox-i-linux-libre/cmd_test_implement_-e_for_file_existance.patch53
-rw-r--r--libre/uboot-cubox-i-linux-libre/common-main.c-make-show_boot_progress-__weak.patch31
-rw-r--r--libre/uboot-cubox-i-linux-libre/kernel-add-support-for-gcc-5.patch97
-rw-r--r--libre/uboot-cubox-i-linux-libre/leds_missing_include.patch61
-rw-r--r--libre/uboot-cubox-i-linux-libre/no-unalligned-access.patch22
-rw-r--r--libre/uboot-cubox-i-linux-libre/remove_unnecessary_inits.patch818
-rw-r--r--libre/uboot-cubox-i-linux-libre/u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch56
-rw-r--r--libre/uboot-cubox-i-linux-libre/uboot-cubox-i-linux-libre.install25
11 files changed, 1338 insertions, 0 deletions
diff --git a/libre/uboot-cubox-i-linux-libre/PKGBUILD b/libre/uboot-cubox-i-linux-libre/PKGBUILD
new file mode 100644
index 000000000..b37bcfcc7
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/PKGBUILD
@@ -0,0 +1,71 @@
+# U-Boot: UDOO
+# Maintainer: Dave Higham <pepedog@archlinuxarm.org>
+# Maintainer: André Silva <emulatorman@parabola.nu>
+
+buildarch=4
+
+_pkgname=linux-libre
+pkgname=("uboot-cubox-i-${_pkgname}")
+pkgver=2013.10
+pkgrel=4
+arch=('armv7h')
+url="http://git.denx.de/u-boot.git/"
+license=('GPL')
+makedepends=('bc')
+depends=('linux-libre')
+replaces=('uboot-cubox-i')
+option=('!strip')
+_commit=e509dd30e97bf2cbce21502e4462d9d7c1d85daa
+source=("uboot-${_commit}.tar.gz::https://github.com/SolidRun/u-boot-imx6/archive/${_commit}.tar.gz"
+ 'kernel-add-support-for-gcc-5.patch'
+ 'arm_board_use_weak.patch'
+ 'leds_missing_include.patch'
+ 'remove_unnecessary_inits.patch'
+ 'u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch'
+ 'no-unalligned-access.patch'
+ 'common-main.c-make-show_boot_progress-__weak.patch'
+ 'check_dtbs_subdir_fix.patch')
+md5sums=('3417d53a913949fd80c052fc8662c2a4'
+ '721a46867e189d8dedc6b6f86a536a34'
+ 'b8cd082b76224d157d55404d0bc87831'
+ 'cf823fe2da67b8db5b9de9352a815f91'
+ '6f3d537701904f0244e6d857e2545c5d'
+ '8ed91e4257bfb7e0971fa988342537a3'
+ '629d34349b5652e2d4274ad89e1c4481'
+ '8087672256020417438b12ec4946e1cf'
+ '5d5ea5bd73957bbf6ec18e1ae65a5e9c')
+prepare() {
+ cd u-boot-imx6-${_commit}
+
+ patch -Np1 -i ../kernel-add-support-for-gcc-5.patch
+ patch -Np1 -i ../arm_board_use_weak.patch
+ patch -Np1 -i ../leds_missing_include.patch
+ patch -Np1 -i ../remove_unnecessary_inits.patch
+ patch -Np1 -i ../u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch
+ patch -Np1 -i ../no-unalligned-access.patch
+ patch -Np1 -i ../common-main.c-make-show_boot_progress-__weak.patch
+ patch -Np1 -i ../check_dtbs_subdir_fix.patch
+}
+
+build() {
+ cd u-boot-imx6-${_commit}
+
+ unset CFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+
+ make distclean
+ make mx6_cubox-i_config
+ make
+}
+
+package() {
+ pkgdesc="U-Boot for all Cubox-i variants (built for the linux-libre kernel package)"
+ install=${pkgname}.install
+
+ cd u-boot-imx6-${_commit}
+
+ mkdir -p "${pkgdir}/boot/${pkgname}"
+ cp u-boot.img "${pkgdir}/boot/${pkgname}"
+ cp SPL "${pkgdir}/boot/${pkgname}"
+}
diff --git a/libre/uboot-cubox-i-linux-libre/arm_board_use_weak.patch b/libre/uboot-cubox-i-linux-libre/arm_board_use_weak.patch
new file mode 100644
index 000000000..58ab1d045
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/arm_board_use_weak.patch
@@ -0,0 +1,81 @@
+From 8590c800ee60e46f15d6085e3c1fed0d6881fc62 Mon Sep 17 00:00:00 2001
+From: Jeroen Hofstee <jeroen@myspectrum.nl>
+Date: Wed, 8 Oct 2014 22:57:21 +0200
+Subject: [PATCH] arm: board: use __weak
+
+Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
+Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
+---
+ arch/arm/lib/board.c | 40 ++++++++++++----------------------------
+ 1 file changed, 12 insertions(+), 28 deletions(-)
+
+diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
+index 76adaf3..98782ca 100644
+--- a/arch/arm/lib/board.c
++++ b/arch/arm/lib/board.c
+@@ -63,25 +63,15 @@ extern void dataflash_print_info(void);
+ ************************************************************************
+ * May be supplied by boards if desired
+ */
+-inline void __coloured_LED_init(void) {}
+-void coloured_LED_init(void)
+- __attribute__((weak, alias("__coloured_LED_init")));
+-inline void __red_led_on(void) {}
+-void red_led_on(void) __attribute__((weak, alias("__red_led_on")));
+-inline void __red_led_off(void) {}
+-void red_led_off(void) __attribute__((weak, alias("__red_led_off")));
+-inline void __green_led_on(void) {}
+-void green_led_on(void) __attribute__((weak, alias("__green_led_on")));
+-inline void __green_led_off(void) {}
+-void green_led_off(void) __attribute__((weak, alias("__green_led_off")));
+-inline void __yellow_led_on(void) {}
+-void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on")));
+-inline void __yellow_led_off(void) {}
+-void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off")));
+-inline void __blue_led_on(void) {}
+-void blue_led_on(void) __attribute__((weak, alias("__blue_led_on")));
+-inline void __blue_led_off(void) {}
+-void blue_led_off(void) __attribute__((weak, alias("__blue_led_off")));
++__weak void coloured_LED_init(void) {}
++__weak void red_led_on(void) {}
++__weak void red_led_off(void) {}
++__weak void green_led_on(void) {}
++__weak void green_led_off(void) {}
++__weak void yellow_led_on(void) {}
++__weak void yellow_led_off(void) {}
++__weak void blue_led_on(void) {}
++__weak void blue_led_off(void) {}
+
+ /*
+ ************************************************************************
+@@ -198,27 +188,21 @@ static int arm_pci_init(void)
+ */
+ typedef int (init_fnc_t) (void);
+
+-void __dram_init_banksize(void)
++__weak void dram_init_banksize(void)
+ {
+ gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+ gd->bd->bi_dram[0].size = gd->ram_size;
+ }
+-void dram_init_banksize(void)
+- __attribute__((weak, alias("__dram_init_banksize")));
+
+-int __arch_cpu_init(void)
++__weak int arch_cpu_init(void)
+ {
+ return 0;
+ }
+-int arch_cpu_init(void)
+- __attribute__((weak, alias("__arch_cpu_init")));
+
+-int __power_init_board(void)
++__weak int power_init_board(void)
+ {
+ return 0;
+ }
+-int power_init_board(void)
+- __attribute__((weak, alias("__power_init_board")));
+
+ /* Record the board_init_f() bootstage (after arch_cpu_init()) */
+ static int mark_bootstage(void)
diff --git a/libre/uboot-cubox-i-linux-libre/check_dtbs_subdir_fix.patch b/libre/uboot-cubox-i-linux-libre/check_dtbs_subdir_fix.patch
new file mode 100644
index 000000000..34d1ff46b
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/check_dtbs_subdir_fix.patch
@@ -0,0 +1,23 @@
+diff -ruN a/include/configs/mx6_cubox-i.h b/include/configs/mx6_cubox-i.h
+--- a/include/configs/mx6_cubox-i.h 2015-06-30 15:34:48.000000000 +0000
++++ b/include/configs/mx6_cubox-i.h 2015-08-28 05:48:43.225896471 +0000
+@@ -176,6 +176,7 @@
+ "bootfile=auto\0" \
+- "bootenv=uEnv.txt\0" \
++ "bootenv=uboot-cubox-i-linux-libre/uEnv.txt\0" \
+ "boot_prefixes=/ /boot/\0" \
++ "fdtfile_prefix=dtbs/linux-libre\0" \
+ "console=ttymxc0\0" \
+ "splashpos=m,m\0" \
+ "fdt_high=0xffffffff\0" \
+@@ -220,7 +221,9 @@
+ "fi;\0" \
+ "loadbootenv=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${file_prefix}${bootenv};\0" \
+ "loadfdt=if test ${boottype} = mmc; then " \
+- "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${file_prefix}${fdt_file}; " \
++ "if load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${file_prefix}${fdt_file}; then; else " \
++ "load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${file_prefix}${fdtfile_prefix}${fdt_file}; " \
++ "fi; " \
+ "else " \
+ "${get_cmd} ${fdt_addr} ${fdt_file}; " \
+ "fi;\0 " \
diff --git a/libre/uboot-cubox-i-linux-libre/cmd_test_implement_-e_for_file_existance.patch b/libre/uboot-cubox-i-linux-libre/cmd_test_implement_-e_for_file_existance.patch
new file mode 100644
index 000000000..02f2d9493
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/cmd_test_implement_-e_for_file_existance.patch
@@ -0,0 +1,53 @@
+This is much like a regular shell's -e operator, except that it takes
+multiple arguments to specify the device type and device/partition ID
+in addition to the usual filename:
+
+if test -e mmc 0:1 /boot/boot.scr; then echo yes; else echo no; fi
+
+Signed-off-by: Stephen Warren <swarren at nvidia.com>
+---
+v3: New patch.
+---
+ common/cmd_test.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/common/cmd_test.c b/common/cmd_test.c
+index 4c2f967c6dc0..c93fe7823100 100644
+--- a/common/cmd_test.c
++++ b/common/cmd_test.c
+@@ -16,6 +16,7 @@
+
+ #include <common.h>
+ #include <command.h>
++#include <fs.h>
+
+ #define OP_INVALID 0
+ #define OP_NOT 1
+@@ -33,6 +34,7 @@
+ #define OP_INT_LE 13
+ #define OP_INT_GT 14
+ #define OP_INT_GE 15
++#define OP_FILE_EXISTS 16
+
+ const struct {
+ int arg;
+@@ -55,6 +57,7 @@ const struct {
+ {0, "-a", OP_AND, 1},
+ {0, "-z", OP_STR_EMPTY, 2},
+ {0, "-n", OP_STR_NEMPTY, 2},
++ {0, "-e", OP_FILE_EXISTS, 4},
+ };
+
+ static int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+@@ -143,6 +146,9 @@ static int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+ expr = simple_strtol(ap[0], NULL, 10) >=
+ simple_strtol(ap[2], NULL, 10);
+ break;
++ case OP_FILE_EXISTS:
++ expr = file_exists(ap[1], ap[2], ap[3], FS_TYPE_ANY);
++ break;
+ }
+
+ switch (op) {
+--
+1.8.1.5
diff --git a/libre/uboot-cubox-i-linux-libre/common-main.c-make-show_boot_progress-__weak.patch b/libre/uboot-cubox-i-linux-libre/common-main.c-make-show_boot_progress-__weak.patch
new file mode 100644
index 000000000..41b9c5cb2
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/common-main.c-make-show_boot_progress-__weak.patch
@@ -0,0 +1,31 @@
+From 8158ac85f16963ff1d075255cd3f34b4f0614265 Mon Sep 17 00:00:00 2001
+From: Jeroen Hofstee <jeroen@myspectrum.nl>
+Date: Thu, 26 Jun 2014 20:18:31 +0200
+Subject: [PATCH 4/6] common: main.c: make show_boot_progress __weak
+
+This not only looks a bit better it also prevents a
+warning with W=1 (no previous prototype).
+
+Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
+Acked-by: Simon Glass <sjg@chromium.org>
+---
+ common/main.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/common/main.c b/common/main.c
+index 32618f1..2979fbe 100644
+--- a/common/main.c
++++ b/common/main.c
+@@ -17,8 +17,7 @@ DECLARE_GLOBAL_DATA_PTR;
+ /*
+ * Board-specific Platform code can reimplement show_boot_progress () if needed
+ */
+-void inline __show_boot_progress (int val) {}
+-void show_boot_progress (int val) __attribute__((weak, alias("__show_boot_progress")));
++__weak void show_boot_progress(int val) {}
+
+ static void modem_init(void)
+ {
+--
+2.4.4
+
diff --git a/libre/uboot-cubox-i-linux-libre/kernel-add-support-for-gcc-5.patch b/libre/uboot-cubox-i-linux-libre/kernel-add-support-for-gcc-5.patch
new file mode 100644
index 000000000..30718c561
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/kernel-add-support-for-gcc-5.patch
@@ -0,0 +1,97 @@
+From 5b07fc2c680ad4279a45d863108544020b4d74cd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sasha.levin@oracle.com>
+Date: Mon, 13 Oct 2014 15:51:05 -0700
+Subject: [PATCH 2/6] kernel: add support for gcc 5
+
+We're missing include/linux/compiler-gcc5.h which is required now
+because gcc branched off to v5 in trunk.
+
+Just copy the relevant bits out of include/linux/compiler-gcc4.h,
+no new code is added as of now.
+
+This fixes a build error when using gcc 5.
+
+Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+---
+ include/linux/compiler-gcc5.h | 66 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 66 insertions(+)
+ create mode 100644 include/linux/compiler-gcc5.h
+
+diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h
+new file mode 100644
+index 0000000..cdd1cc2
+--- /dev/null
++++ b/include/linux/compiler-gcc5.h
+@@ -0,0 +1,66 @@
++#ifndef __LINUX_COMPILER_H
++#error "Please don't include <linux/compiler-gcc5.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.4.4
+
diff --git a/libre/uboot-cubox-i-linux-libre/leds_missing_include.patch b/libre/uboot-cubox-i-linux-libre/leds_missing_include.patch
new file mode 100644
index 000000000..9828d1e89
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/leds_missing_include.patch
@@ -0,0 +1,61 @@
+From 52422e37bb199fa5c62881cdf26c687aa692d063 Mon Sep 17 00:00:00 2001
+From: Jeroen Hofstee <jeroen@myspectrum.nl>
+Date: Wed, 8 Oct 2014 22:57:53 +0200
+Subject: [PATCH] leds: missing include
+
+Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
+---
+ arch/arm/cpu/arm926ejs/at91/led.c | 1 +
+ arch/arm/lib/board.c | 1 +
+ board/atmel/at91rm9200ek/led.c | 1 +
+ board/atmel/at91sam9260ek/led.c | 1 +
+ 4 files changed, 4 insertions(+)
+
+diff --git a/arch/arm/cpu/arm926ejs/at91/led.c b/arch/arm/cpu/arm926ejs/at91/led.c
+index 46ed055..b8d5c78 100644
+--- a/arch/arm/cpu/arm926ejs/at91/led.c
++++ b/arch/arm/cpu/arm926ejs/at91/led.c
+@@ -9,6 +9,7 @@
+ #include <common.h>
+ #include <asm/gpio.h>
+ #include <asm/arch/gpio.h>
++#include <status_led.h>
+
+ #ifdef CONFIG_RED_LED
+ void red_led_on(void)
+diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
+index 98782ca..f606255 100644
+--- a/arch/arm/lib/board.c
++++ b/arch/arm/lib/board.c
+@@ -34,6 +34,7 @@
+ #include <nand.h>
+ #include <onenand_uboot.h>
+ #include <mmc.h>
++#include <status_led.h>
+ #include <libfdt.h>
+ #include <fdtdec.h>
+ #include <post.h>
+diff --git a/board/atmel/at91rm9200ek/led.c b/board/atmel/at91rm9200ek/led.c
+index 2298e36..6761b14 100644
+--- a/board/atmel/at91rm9200ek/led.c
++++ b/board/atmel/at91rm9200ek/led.c
+@@ -14,6 +14,7 @@
+ #include <asm/arch/hardware.h>
+ #include <asm/arch/at91_pmc.h>
+ #include <asm/arch/at91_pio.h>
++#include <status_led.h>
+
+ /* bit mask in PIO port B */
+ #define GREEN_LED (1<<0)
+diff --git a/board/atmel/at91sam9260ek/led.c b/board/atmel/at91sam9260ek/led.c
+index 56d811c..fbe15af 100644
+--- a/board/atmel/at91sam9260ek/led.c
++++ b/board/atmel/at91sam9260ek/led.c
+@@ -9,6 +9,7 @@
+ #include <common.h>
+ #include <asm/io.h>
+ #include <asm/arch/gpio.h>
++#include <status_led.h>
+
+ void coloured_LED_init(void)
+ {
diff --git a/libre/uboot-cubox-i-linux-libre/no-unalligned-access.patch b/libre/uboot-cubox-i-linux-libre/no-unalligned-access.patch
new file mode 100644
index 000000000..6582724e7
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/no-unalligned-access.patch
@@ -0,0 +1,22 @@
+diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
+index d01f3d9..c048531 100644
+--- a/arch/arm/cpu/armv7/config.mk
++++ b/arch/arm/cpu/armv7/config.mk
+@@ -10,9 +10,12 @@
+ PF_CPPFLAGS_ARMV7 := $(call cc-option, -march=armv7-a, -march=armv5)
+ PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV7)
+
+-# SEE README.arm-unaligned-accesses
++# On supported platforms we set the bit which causes us to trap on unaligned
++# memory access. This is the opposite of what the compiler expects to be
++# the default so we must pass in -mno-unaligned-access so that it is aware
++# of our decision.
+ PF_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,)
+-PLATFORM_NO_UNALIGNED := $(PF_NO_UNALIGNED)
++PLATFORM_CPPFLAGS += $(PF_NO_UNALIGNED)
+
+ ifneq ($(CONFIG_IMX_CONFIG),)
+ ifdef CONFIG_SPL
+--
+1.7.9.5
+
diff --git a/libre/uboot-cubox-i-linux-libre/remove_unnecessary_inits.patch b/libre/uboot-cubox-i-linux-libre/remove_unnecessary_inits.patch
new file mode 100644
index 000000000..8ab039177
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/remove_unnecessary_inits.patch
@@ -0,0 +1,818 @@
+From b60eff31f3bd71a6f14b6c6efc8ad5fb3705de6d Mon Sep 17 00:00:00 2001
+From: Albert ARIBAUD <albert.u.boot@aribaud.net>
+Date: Sat, 22 Feb 2014 17:53:43 +0100
+Subject: [PATCH] arm: remove unneeded symbol offsets and _TEXT_BASE
+
+Remove the last uses of symbol offsets in ARM U-Boot.
+Remove some needless uses of _TEXT_BASE.
+Remove all _TEXT_BASE definitions.
+
+Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
+---
+ README | 6 ------
+ arch/arm/cpu/arm1136/start.S | 27 ---------------------------
+ arch/arm/cpu/arm1176/start.S | 27 ---------------------------
+ arch/arm/cpu/arm720t/start.S | 26 --------------------------
+ arch/arm/cpu/arm920t/start.S | 26 --------------------------
+ arch/arm/cpu/arm926ejs/at91/lowlevel_init.S | 14 +-------------
+ arch/arm/cpu/arm926ejs/mxs/start.S | 27 ---------------------------
+ arch/arm/cpu/arm926ejs/start.S | 27 ---------------------------
+ arch/arm/cpu/arm946es/start.S | 26 --------------------------
+ arch/arm/cpu/arm_intcm/start.S | 26 --------------------------
+ arch/arm/cpu/armv7/omap3/lowlevel_init.S | 3 ---
+ arch/arm/cpu/armv7/start.S | 23 -----------------------
+ arch/arm/cpu/pxa/start.S | 27 ---------------------------
+ arch/arm/cpu/sa1100/start.S | 26 --------------------------
+ arch/arm/lib/board.c | 12 ++++++------
+ board/armltd/integrator/lowlevel_init.S | 2 +-
+ board/cm4008/flash.c | 2 +-
+ board/cm41xx/flash.c | 2 +-
+ board/mpl/vcma9/lowlevel_init.S | 5 +----
+ board/samsung/goni/lowlevel_init.S | 3 ---
+ board/samsung/smdk2410/lowlevel_init.S | 5 +----
+ board/samsung/smdkc100/lowlevel_init.S | 3 ---
+ board/ti/omap5912osk/lowlevel_init.S | 4 ----
+ common/board_f.c | 14 +++-----------
+ common/board_r.c | 4 ++--
+ include/asm-generic/sections.h | 26 +++++++-------------------
+ 26 files changed, 24 insertions(+), 369 deletions(-)
+
+diff --git a/README b/README
+index d4eb099..5b7dec9 100644
+--- a/README
++++ b/README
+@@ -3707,12 +3707,6 @@ Configuration Settings:
+ its config.mk file). If you find problems enabling this option on
+ your board please report the problem and send patches!
+
+-- CONFIG_SYS_SYM_OFFSETS
+- This is set by architectures that use offsets for link symbols
+- instead of absolute values. So bss_start is obtained using an
+- offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than
+- directly. You should not need to touch this setting.
+-
+ - CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC (OMAP only)
+ This is set by OMAP boards for the max time that reset should
+ be asserted. See doc/README.omap-reset-time for details on how
+diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
+index 00d1b30..3e2358e 100644
+--- a/arch/arm/cpu/arm1136/start.S
++++ b/arch/arm/cpu/arm1136/start.S
+@@ -70,32 +70,6 @@ _end_vect:
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+@@ -295,7 +269,6 @@ cpu_init_crit:
+ #ifdef CONFIG_SPL_BUILD
+ .align 5
+ do_hang:
+- ldr sp, _TEXT_BASE /* use 32 words about stack */
+ bl hang /* hang and never return */
+ #else /* !CONFIG_SPL_BUILD */
+ .align 5
+diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
+index ffd7dd0..ce62011 100644
+--- a/arch/arm/cpu/arm1176/start.S
++++ b/arch/arm/cpu/arm1176/start.S
+@@ -77,33 +77,6 @@ _end_vect:
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ /* IRQ stack memory (calculated at run-time) + 8 bytes */
+ .globl IRQ_STACK_START_IN
+ IRQ_STACK_START_IN:
+diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
+index f180eb8..1a34842 100644
+--- a/arch/arm/cpu/arm720t/start.S
++++ b/arch/arm/cpu/arm720t/start.S
+@@ -67,32 +67,6 @@ _pad: .word 0x12345678 /* now 16*4=64 */
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
+index a67b659..7bf094a 100644
+--- a/arch/arm/cpu/arm920t/start.S
++++ b/arch/arm/cpu/arm920t/start.S
+@@ -55,32 +55,6 @@ _fiq: .word fiq
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+diff --git a/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S b/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
+index e83968f..a9ec81a 100644
+--- a/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
++++ b/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
+@@ -26,27 +26,18 @@
+ #define CONFIG_SYS_MATRIX_EBICSA_VAL CONFIG_SYS_MATRIX_EBI0CSA_VAL
+ #endif
+
+-_TEXT_BASE:
+- .word CONFIG_SYS_TEXT_BASE
+-
+ .globl lowlevel_init
+ .type lowlevel_init,function
+ lowlevel_init:
+
+- mov r5, pc /* r5 = POS1 + 4 current */
+ POS1:
++ adr r5, POS1 /* r5 = POS1 run time */
+ ldr r0, =POS1 /* r0 = POS1 compile */
+- ldr r2, _TEXT_BASE
+- sub r0, r0, r2 /* r0 = POS1-_TEXT_BASE (POS1 relative) */
+ sub r5, r5, r0 /* r0 = CONFIG_SYS_TEXT_BASE-1 */
+- sub r5, r5, #4 /* r1 = text base - current */
+
+ /* memory control configuration 1 */
+ ldr r0, =SMRDATA
+ ldr r2, =SMRDATA1
+- ldr r1, _TEXT_BASE
+- sub r0, r0, r1
+- sub r2, r2, r1
+ add r0, r0, r5
+ add r2, r2, r5
+ 0:
+@@ -149,9 +140,6 @@ PLL_setup_end:
+
+ ldr r0, =SMRDATA1
+ ldr r2, =SMRDATA2
+- ldr r1, _TEXT_BASE
+- sub r0, r0, r1
+- sub r2, r2, r1
+ add r0, r0, r5
+ add r2, r2, r5
+ 2:
+diff --git a/arch/arm/cpu/arm926ejs/mxs/start.S b/arch/arm/cpu/arm926ejs/mxs/start.S
+index 5de2bad..34a0fcb 100644
+--- a/arch/arm/cpu/arm926ejs/mxs/start.S
++++ b/arch/arm/cpu/arm926ejs/mxs/start.S
+@@ -101,32 +101,6 @@ fiq:
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#ifdef CONFIG_SPL_TEXT_BASE
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+@@ -207,6 +181,5 @@ _reset:
+ bx lr
+
+ _hang:
+- ldr sp, _TEXT_BASE /* switch to abort stack */
+ 1:
+ bl 1b /* hang and never return */
+diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
+index 5360f55..0717327 100644
+--- a/arch/arm/cpu/arm926ejs/start.S
++++ b/arch/arm/cpu/arm926ejs/start.S
+@@ -102,32 +102,6 @@ _fiq:
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+@@ -330,7 +304,6 @@ flush_dcache:
+ #ifdef CONFIG_SPL_BUILD
+ .align 5
+ do_hang:
+- ldr sp, _TEXT_BASE /* switch to abort stack */
+ 1:
+ bl 1b /* hang and never return */
+ #else /* !CONFIG_SPL_BUILD */
+diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
+index e16b088..7d50145 100644
+--- a/arch/arm/cpu/arm946es/start.S
++++ b/arch/arm/cpu/arm946es/start.S
+@@ -71,32 +71,6 @@ _vectors_end:
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
+index 5783df1..7404ea7 100644
+--- a/arch/arm/cpu/arm_intcm/start.S
++++ b/arch/arm/cpu/arm_intcm/start.S
+@@ -67,32 +67,6 @@ _fiq:
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
+index 6f7261b..78577b1 100644
+--- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S
++++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
+@@ -17,9 +17,6 @@
+ #include <asm/arch/clocks_omap3.h>
+ #include <linux/linkage.h>
+
+-_TEXT_BASE:
+- .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
+-
+ #ifdef CONFIG_SPL_BUILD
+ ENTRY(save_boot_params)
+ ldr r4, =omap3_boot_device
+diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
+index 5aac773..ac1e55a 100644
+--- a/arch/arm/cpu/armv7/start.S
++++ b/arch/arm/cpu/armv7/start.S
+@@ -70,29 +70,6 @@ _end_vect:
+ *
+ *************************************************************************/
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
+index d8fb812..ae0d13c 100644
+--- a/arch/arm/cpu/pxa/start.S
++++ b/arch/arm/cpu/pxa/start.S
+@@ -84,32 +84,6 @@ _end_vect:
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+@@ -316,7 +290,6 @@ cpu_init_crit:
+ #ifdef CONFIG_SPL_BUILD
+ .align 5
+ do_hang:
+- ldr sp, _TEXT_BASE /* use 32 words about stack */
+ bl hang /* hang and never return */
+ #else /* !CONFIG_SPL_BUILD */
+ .align 5
+diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
+index 27bcda5..bf80937 100644
+--- a/arch/arm/cpu/sa1100/start.S
++++ b/arch/arm/cpu/sa1100/start.S
+@@ -56,32 +56,6 @@ _fiq: .word fiq
+ *************************************************************************
+ */
+
+-.globl _TEXT_BASE
+-_TEXT_BASE:
+-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
+- .word CONFIG_SPL_TEXT_BASE
+-#else
+- .word CONFIG_SYS_TEXT_BASE
+-#endif
+-
+-/*
+- * These are defined in the board-specific linker script.
+- * Subtracting _start from them lets the linker put their
+- * relative position in the executable instead of leaving
+- * them null.
+- */
+-.globl _bss_start_ofs
+-_bss_start_ofs:
+- .word __bss_start - _start
+-
+-.globl _bss_end_ofs
+-_bss_end_ofs:
+- .word __bss_end - _start
+-
+-.globl _end_ofs
+-_end_ofs:
+- .word _end - _start
+-
+ #ifdef CONFIG_USE_IRQ
+ /* IRQ stack memory (calculated at run-time) */
+ .globl IRQ_STACK_START
+diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
+index c320a35..1de5812 100644
+--- a/arch/arm/lib/board.c
++++ b/arch/arm/lib/board.c
+@@ -105,8 +105,8 @@ static int display_banner(void)
+ {
+ printf("\n\n%s\n\n", version_string);
+ debug("U-Boot code: %08lX -> %08lX BSS: -> %08lX\n",
+- _TEXT_BASE,
+- _bss_start_ofs + _TEXT_BASE, _bss_end_ofs + _TEXT_BASE);
++ (ulong)&_start,
++ (ulong)&__bss_start, (ulong)&__bss_end);
+ #ifdef CONFIG_MODEM_SUPPORT
+ debug("Modem Support enabled\n");
+ #endif
+@@ -277,13 +277,13 @@ void board_init_f(ulong bootflag)
+
+ memset((void *)gd, 0, sizeof(gd_t));
+
+- gd->mon_len = _bss_end_ofs;
++ gd->mon_len = (ulong)&__bss_end - (ulong)_start;
+ #ifdef CONFIG_OF_EMBED
+ /* Get a pointer to the FDT */
+ gd->fdt_blob = _binary_dt_dtb_start;
+ #elif defined CONFIG_OF_SEPARATE
+ /* FDT is at end of image */
+- gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
++ gd->fdt_blob = &_end;
+ #endif
+ /* Allow the early environment to override the fdt address */
+ gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
+@@ -451,7 +451,7 @@ void board_init_f(ulong bootflag)
+
+ gd->relocaddr = addr;
+ gd->start_addr_sp = addr_sp;
+- gd->reloc_off = addr - _TEXT_BASE;
++ gd->reloc_off = addr - (ulong)&_start;
+ debug("relocation Offset is: %08lx\n", gd->reloc_off);
+ if (new_fdt) {
+ memcpy(new_fdt, gd->fdt_blob, fdt_size);
+@@ -516,7 +516,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
+ gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
+ bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
+
+- monitor_flash_len = _end_ofs;
++ monitor_flash_len = (ulong)&__rel_dyn_end - (ulong)_start;
+
+ /* Enable caches */
+ enable_caches();
+diff --git a/board/armltd/integrator/lowlevel_init.S b/board/armltd/integrator/lowlevel_init.S
+index 389d5e9..0fb42ad 100644
+--- a/board/armltd/integrator/lowlevel_init.S
++++ b/board/armltd/integrator/lowlevel_init.S
+@@ -183,7 +183,7 @@ cm_remap:
+
+ /* Now 0x00000000 is writeable, replace the vectors */
+ ldr r0, =_start /* r0 <- start of vectors */
+- ldr r2, =_TEXT_BASE /* r2 <- past vectors */
++ add r2, r0, #64 /* r2 <- past vectors */
+ sub r1,r1,r1 /* destination 0x00000000 */
+
+ copy_vec:
+diff --git a/board/cm4008/flash.c b/board/cm4008/flash.c
+index 2511928..8315a57 100644
+--- a/board/cm4008/flash.c
++++ b/board/cm4008/flash.c
+@@ -57,7 +57,7 @@ unsigned long flash_init (void)
+ */
+ flash_protect (FLAG_PROTECT_SET,
+ CONFIG_SYS_FLASH_BASE,
+- CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
++ CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
+ &flash_info[0]);
+
+ return size;
+diff --git a/board/cm41xx/flash.c b/board/cm41xx/flash.c
+index 2511928..8315a57 100644
+--- a/board/cm41xx/flash.c
++++ b/board/cm41xx/flash.c
+@@ -57,7 +57,7 @@ unsigned long flash_init (void)
+ */
+ flash_protect (FLAG_PROTECT_SET,
+ CONFIG_SYS_FLASH_BASE,
+- CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
++ CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
+ &flash_info[0]);
+
+ return size;
+diff --git a/board/mpl/vcma9/lowlevel_init.S b/board/mpl/vcma9/lowlevel_init.S
+index b889cf9..cca9c0c 100644
+--- a/board/mpl/vcma9/lowlevel_init.S
++++ b/board/mpl/vcma9/lowlevel_init.S
+@@ -197,13 +197,10 @@
+ #define REFCNT_266 0
+ /**************************************/
+
+-_TEXT_BASE:
+- .word CONFIG_SYS_TEXT_BASE
+-
+ .globl lowlevel_init
+ lowlevel_init:
+ /* use r0 to relocate DATA read/write to flash rather than memory ! */
+- ldr r0, _TEXT_BASE
++ ldr r0, =CONFIG_SYS_TEXT_BASE
+ ldr r13, =BWSCON
+
+ /* enable minimal access to PLD */
+diff --git a/board/samsung/goni/lowlevel_init.S b/board/samsung/goni/lowlevel_init.S
+index 726211a..d52bc09 100644
+--- a/board/samsung/goni/lowlevel_init.S
++++ b/board/samsung/goni/lowlevel_init.S
+@@ -22,9 +22,6 @@
+ * r9 has Mobile DDR size, 1 means 1GiB, 2 means 2GiB and so on
+ */
+
+-_TEXT_BASE:
+- .word CONFIG_SYS_TEXT_BASE
+-
+ .globl lowlevel_init
+ lowlevel_init:
+ mov r11, lr
+diff --git a/board/samsung/smdk2410/lowlevel_init.S b/board/samsung/smdk2410/lowlevel_init.S
+index c7b78fd..5de04f1 100644
+--- a/board/samsung/smdk2410/lowlevel_init.S
++++ b/board/samsung/smdk2410/lowlevel_init.S
+@@ -110,16 +110,13 @@
+ #define REFCNT 1113 /* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */
+ /**************************************/
+
+-_TEXT_BASE:
+- .word CONFIG_SYS_TEXT_BASE
+-
+ .globl lowlevel_init
+ lowlevel_init:
+ /* memory control configuration */
+ /* make r0 relative the current location so that it */
+ /* reads SMRDATA out of FLASH rather than memory ! */
+ ldr r0, =SMRDATA
+- ldr r1, _TEXT_BASE
++ ldr r1, =CONFIG_SYS_TEXT_BASE
+ sub r0, r0, r1
+ ldr r1, =BWSCON /* Bus Width Status Controller */
+ add r2, r0, #13*4
+diff --git a/board/samsung/smdkc100/lowlevel_init.S b/board/samsung/smdkc100/lowlevel_init.S
+index 4df0974..65e6b7a 100644
+--- a/board/samsung/smdkc100/lowlevel_init.S
++++ b/board/samsung/smdkc100/lowlevel_init.S
+@@ -17,9 +17,6 @@
+ * r5 has zero always
+ */
+
+-_TEXT_BASE:
+- .word CONFIG_SYS_TEXT_BASE
+-
+ .globl lowlevel_init
+ lowlevel_init:
+ mov r9, lr
+diff --git a/board/ti/omap5912osk/lowlevel_init.S b/board/ti/omap5912osk/lowlevel_init.S
+index cad0a5a..e05a1c7 100644
+--- a/board/ti/omap5912osk/lowlevel_init.S
++++ b/board/ti/omap5912osk/lowlevel_init.S
+@@ -18,10 +18,6 @@
+ #include <./configs/omap1510.h>
+ #endif
+
+-
+-_TEXT_BASE:
+- .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */
+-
+ .globl lowlevel_init
+ lowlevel_init:
+
+diff --git a/common/board_f.c b/common/board_f.c
+index 02965b0..5b9ba07 100644
+--- a/common/board_f.c
++++ b/common/board_f.c
+@@ -149,13 +149,9 @@ static int display_text_info(void)
+ #ifndef CONFIG_SANDBOX
+ ulong bss_start, bss_end;
+
+-#ifdef CONFIG_SYS_SYM_OFFSETS
+- bss_start = _bss_start_ofs + _TEXT_BASE;
+- bss_end = _bss_end_ofs + _TEXT_BASE;
+-#else
+ bss_start = (ulong)&__bss_start;
+ bss_end = (ulong)&__bss_end;
+-#endif
++
+ debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n",
+ CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
+ #endif
+@@ -279,8 +275,8 @@ static int zero_global_data(void)
+
+ static int setup_mon_len(void)
+ {
+-#ifdef CONFIG_SYS_SYM_OFFSETS
+- gd->mon_len = _bss_end_ofs;
++#ifdef __ARM__
++ gd->mon_len = (ulong)&__bss_end - (ulong)_start;
+ #elif defined(CONFIG_SANDBOX)
+ gd->mon_len = (ulong)&_end - (ulong)_init;
+ #else
+@@ -363,11 +359,7 @@ static int setup_fdt(void)
+ gd->fdt_blob = __dtb_dt_begin;
+ #elif defined CONFIG_OF_SEPARATE
+ /* FDT is at end of image */
+-# ifdef CONFIG_SYS_SYM_OFFSETS
+- gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE);
+-# else
+ gd->fdt_blob = (ulong *)&_end;
+-# endif
+ #elif defined(CONFIG_OF_HOSTFILE)
+ if (read_fdt_from_file()) {
+ puts("Failed to read control FDT\n");
+diff --git a/common/board_r.c b/common/board_r.c
+index c2d0763..899f377 100644
+--- a/common/board_r.c
++++ b/common/board_r.c
+@@ -128,8 +128,8 @@ __weak int fixup_cpu(void)
+
+ static int initr_reloc_global_data(void)
+ {
+-#ifdef CONFIG_SYS_SYM_OFFSETS
+- monitor_flash_len = _end_ofs;
++#ifdef __ARM__
++ monitor_flash_len = _end - __image_copy_start;
+ #elif !defined(CONFIG_SANDBOX)
+ monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
+ #endif
+diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
+index 7e1eb4b..458952f 100644
+--- a/include/asm-generic/sections.h
++++ b/include/asm-generic/sections.h
+@@ -63,28 +63,16 @@ extern char __image_copy_end[];
+ extern void _start(void);
+
+ /*
+- * ARM needs to use offsets for symbols, since the values of some symbols
+- * are not resolved prior to relocation (and are just 0). Maybe this can be
+- * resolved, or maybe other architectures are similar, iwc this should be
+- * promoted to an architecture option.
++ * ARM defines its symbols as char[]. Other arches define them as ulongs.
+ */
+ #ifdef CONFIG_ARM
+-#define CONFIG_SYS_SYM_OFFSETS
+-#endif
+-
+-#ifdef CONFIG_SYS_SYM_OFFSETS
+-/* Start/end of the relocation entries, as an offset from _start */
+-extern ulong _rel_dyn_start_ofs;
+-extern ulong _rel_dyn_end_ofs;
+-
+-/* End of the region to be relocated, as an offset form _start */
+-extern ulong _image_copy_end_ofs;
+
+-extern ulong _bss_start_ofs; /* BSS start relative to _start */
+-extern ulong _bss_end_ofs; /* BSS end relative to _start */
+-extern ulong _end_ofs; /* end of image relative to _start */
+-
+-extern ulong _TEXT_BASE; /* code start */
++extern char __bss_start[];
++extern char __bss_end[];
++extern char __image_copy_start[];
++extern char __image_copy_end[];
++extern char __rel_dyn_start[];
++extern char __rel_dyn_end[];
+
+ #else /* don't use offsets: */
+
diff --git a/libre/uboot-cubox-i-linux-libre/u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch b/libre/uboot-cubox-i-linux-libre/u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch
new file mode 100644
index 000000000..4a5e0de4e
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch
@@ -0,0 +1,56 @@
+[RFC 08/10] inline: use the gcc inline version instead of the c99 one.
+
+Jeroen Hofstee jeroen at myspectrum.nl
+Sat May 31 22:32:22 CEST 2014
+Previous message: [U-Boot] [RFC 07/10] ARM: make gd a function a function for clang
+Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
+---
+This fixes errors like:
+
+make[1]: Entering directory `/home/jeroen/software/u-boot/arch/arm/cpu/armv7/omap-common'
+arm-linux-gnueabi-ld.bfd -r -o libomap-common.o reset.o timer.o utils.o
+timer.o: In function `get_tbclk':
+/home/jeroen/software/u-boot/include/asm/io.h:81: multiple definition of `__raw_writesb'
+reset.o:/home/jeroen/software/u-boot/include/asm/io.h:81: first defined here
+timer.o: In function `__udelay':
+/home/jeroen/software/u-boot/include/asm/io.h:88: multiple definition of `__raw_writesw'
+reset.o:/home/jeroen/software/u-boot/include/asm/io.h:88: first defined here
+timer.o: In function `get_ticks':
+/home/jeroen/software/u-boot/include/asm/io.h:95: multiple definition of `__raw_writesl'
+reset.o:/home/jeroen/software/u-boot/include/asm/io.h:95: first defined here
+timer.o: In function `__raw_readsb':
+/home/jeroen/software/u-boot/include/asm/io.h:102: multiple definition of `__raw_readsb'
+reset.o:/home/jeroen/software/u-boot/include/asm/io.h:102: first defined here
+timer.o: In function `__raw_readsw':
+/home/jeroen/software/u-boot/include/asm/io.h:109: multiple definition of `__raw_readsw'
+reset.o:/home/jeroen/software/u-boot/include/asm/io.h:109: first defined here
+timer.o: In function `__raw_readsl':
+/home/jeroen/software/u-boot/include/asm/io.h:116: multiple definition of `__raw_readsl'
+reset.o:/home/jeroen/software/u-boot/include/asm/io.h:116: first defined here
+make[1]: *** [libomap-common.o] Error 1
+make[1]: Leaving directory `/home/jeroen/software/u-boot/arch/arm/cpu/armv7/omap-common'
+make: *** [arch/arm/cpu/armv7/omap-common/libomap-common.o] Error 2
+---
+ include/linux/compiler-gcc.h | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
+index 9896e54..99c6dcc 100644
+--- a/include/linux/compiler-gcc.h
++++ b/include/linux/compiler-gcc.h
+@@ -44,9 +44,10 @@
+ */
+ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
+ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
+-# define inline inline __attribute__((always_inline))
+-# define __inline__ __inline__ __attribute__((always_inline))
+-# define __inline __inline __attribute__((always_inline))
++/* XXX: check __GNUC_STDC_INLINE__, fix line length */
++# define inline inline __attribute__((always_inline)) __attribute__((__gnu_inline__))
++# define __inline__ __inline__ __attribute__((always_inline)) __attribute__((__gnu_inline__))
++# define __inline __inline __attribute__((always_inline)) __attribute__((__gnu_inline__))
+ #endif
+
+ #define __deprecated __attribute__((deprecated))
+--
+1.8.3.2
diff --git a/libre/uboot-cubox-i-linux-libre/uboot-cubox-i-linux-libre.install b/libre/uboot-cubox-i-linux-libre/uboot-cubox-i-linux-libre.install
new file mode 100644
index 000000000..ff3b52d2a
--- /dev/null
+++ b/libre/uboot-cubox-i-linux-libre/uboot-cubox-i-linux-libre.install
@@ -0,0 +1,25 @@
+flash_uboot() {
+ echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0."
+ echo "Do you want to do this now? [y|N]"
+ read -r shouldwe
+ if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
+ dd if=/boot/uboot-cubox-i-linux-libre/SPL of=/dev/mmcblk0 bs=1K seek=1
+ dd if=/boot/uboot-cubox-i-linux-libre/u-boot.img of=/dev/mmcblk0 bs=1K seek=42
+ sync
+ else
+ echo "You can do this later by running:"
+ echo "# dd if=/boot/uboot-cubox-i-linux-libre/SPL of=/dev/mmcblk0 bs=1K seek=1"
+ echo "# dd dd if=/boot/uboot-cubox-i-linux-libre/u-boot.img of=/dev/mmcblk0 bs=1K seek=42"
+ fi
+}
+
+## arg 1: the new package version
+post_install() {
+ flash_uboot
+}
+
+## arg 1: the new package version
+## arg 2: the old package version
+post_upgrade() {
+ flash_uboot
+}