[meta-freescale] [meta-fsl-arm-extra][PATCH 2/4] u-boot-variscite: Add u-boot recipe for variscite

Fabio Berton fabio.berton at ossystems.com.br
Tue Apr 12 12:34:37 PDT 2016


Signed-off-by: Fabio Berton <fabio.berton at ossystems.com.br>
---
 ...x-compiler-gcc5.h-to-fix-builds-with-gcc5.patch | 94 ++++++++++++++++++++++
 .../0002-ARM-asm-io.h-use-static-inline.patch      | 74 +++++++++++++++++
 .../0003-gcc5-no-unalligned-access.patch           | 19 +++++
 ...2-gcc5-use_gcc_inline_version_instead_c99.patch | 57 +++++++++++++
 recipes-bsp/u-boot/u-boot-variscite_2013.10.bb     | 28 +++++++
 5 files changed, 272 insertions(+)
 create mode 100644 recipes-bsp/u-boot/u-boot-variscite-2013.10/0001-Add-linux-compiler-gcc5.h-to-fix-builds-with-gcc5.patch
 create mode 100644 recipes-bsp/u-boot/u-boot-variscite-2013.10/0002-ARM-asm-io.h-use-static-inline.patch
 create mode 100644 recipes-bsp/u-boot/u-boot-variscite-2013.10/0003-gcc5-no-unalligned-access.patch
 create mode 100644 recipes-bsp/u-boot/u-boot-variscite-2013.10/u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch
 create mode 100644 recipes-bsp/u-boot/u-boot-variscite_2013.10.bb

diff --git a/recipes-bsp/u-boot/u-boot-variscite-2013.10/0001-Add-linux-compiler-gcc5.h-to-fix-builds-with-gcc5.patch b/recipes-bsp/u-boot/u-boot-variscite-2013.10/0001-Add-linux-compiler-gcc5.h-to-fix-builds-with-gcc5.patch
new file mode 100644
index 0000000..c5fc731
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-variscite-2013.10/0001-Add-linux-compiler-gcc5.h-to-fix-builds-with-gcc5.patch
@@ -0,0 +1,94 @@
+From 9012ad08ed7615cf0afaf8fab631239c0f148889 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede at redhat.com>
+Date: Sat, 7 Feb 2015 22:52:40 +0100
+Subject: [PATCH 1/2] Add linux/compiler-gcc5.h to fix builds with gcc5
+Organization: O.S. Systems Software LTDA.
+
+Add linux/compiler-gcc5/h from the kernel sources at:
+
+commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b
+Author: Steven Noonan <steven at uplinklabs.net>
+Date:   Sat Oct 25 15:09:42 2014 -0700
+
+    compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+---
+ include/linux/compiler-gcc5.h | 65 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 65 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..c8c5659
+--- /dev/null
++++ b/include/linux/compiler-gcc5.h
+@@ -0,0 +1,65 @@
++#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.
++ *
++ * (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.7.0
+
diff --git a/recipes-bsp/u-boot/u-boot-variscite-2013.10/0002-ARM-asm-io.h-use-static-inline.patch b/recipes-bsp/u-boot/u-boot-variscite-2013.10/0002-ARM-asm-io.h-use-static-inline.patch
new file mode 100644
index 0000000..2a0c199
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-variscite-2013.10/0002-ARM-asm-io.h-use-static-inline.patch
@@ -0,0 +1,74 @@
+From 0104a0612ede002a03b1d6349a38ec575e76d186 Mon Sep 17 00:00:00 2001
+From: Jeroen Hofstee <jeroen at myspectrum.nl>
+Date: Sun, 22 Jun 2014 23:10:39 +0200
+Subject: [PATCH 2/2] ARM:asm:io.h use static inline
+Organization: O.S. Systems Software LTDA.
+
+When compiling u-boot with W=1 the extern inline void for
+read* is likely causing the most noise. gcc / clang will
+warn there is never a actual declaration for these functions.
+Instead of declaring these extern make them static inline so
+it is actually declared.
+
+cc: Albert ARIBAUD <albert.u.boot at aribaud.net>
+Signed-off-by: Jeroen Hofstee <jeroen at myspectrum.nl>
+---
+ arch/arm/include/asm/io.h | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
+index 1fbc531..5f5f8d0 100644
+--- a/arch/arm/include/asm/io.h
++++ b/arch/arm/include/asm/io.h
+@@ -75,42 +75,42 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
+ #define __arch_putw(v,a)		(*(volatile unsigned short *)(a) = (v))
+ #define __arch_putl(v,a)		(*(volatile unsigned int *)(a) = (v))
+ 
+-extern inline void __raw_writesb(unsigned int addr, const void *data, int bytelen)
++static inline void __raw_writesb(unsigned int addr, const void *data, int bytelen)
+ {
+ 	uint8_t *buf = (uint8_t *)data;
+ 	while(bytelen--)
+ 		__arch_putb(*buf++, addr);
+ }
+ 
+-extern inline void __raw_writesw(unsigned int addr, const void *data, int wordlen)
++static inline void __raw_writesw(unsigned int addr, const void *data, int wordlen)
+ {
+ 	uint16_t *buf = (uint16_t *)data;
+ 	while(wordlen--)
+ 		__arch_putw(*buf++, addr);
+ }
+ 
+-extern inline void __raw_writesl(unsigned int addr, const void *data, int longlen)
++static inline void __raw_writesl(unsigned int addr, const void *data, int longlen)
+ {
+ 	uint32_t *buf = (uint32_t *)data;
+ 	while(longlen--)
+ 		__arch_putl(*buf++, addr);
+ }
+ 
+-extern inline void __raw_readsb(unsigned int addr, void *data, int bytelen)
++static inline void __raw_readsb(unsigned int addr, void *data, int bytelen)
+ {
+ 	uint8_t *buf = (uint8_t *)data;
+ 	while(bytelen--)
+ 		*buf++ = __arch_getb(addr);
+ }
+ 
+-extern inline void __raw_readsw(unsigned int addr, void *data, int wordlen)
++static inline void __raw_readsw(unsigned int addr, void *data, int wordlen)
+ {
+ 	uint16_t *buf = (uint16_t *)data;
+ 	while(wordlen--)
+ 		*buf++ = __arch_getw(addr);
+ }
+ 
+-extern inline void __raw_readsl(unsigned int addr, void *data, int longlen)
++static inline void __raw_readsl(unsigned int addr, void *data, int longlen)
+ {
+ 	uint32_t *buf = (uint32_t *)data;
+ 	while(longlen--)
+-- 
+2.7.0
+
diff --git a/recipes-bsp/u-boot/u-boot-variscite-2013.10/0003-gcc5-no-unalligned-access.patch b/recipes-bsp/u-boot/u-boot-variscite-2013.10/0003-gcc5-no-unalligned-access.patch
new file mode 100644
index 0000000..dfec5a8
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-variscite-2013.10/0003-gcc5-no-unalligned-access.patch
@@ -0,0 +1,19 @@
+from https://raw.githubusercontent.com/schnitzeltony/meta-gumstix-community/master/recipes-bsp/u-boot/u-boot-overo/0013-arm-Switch-to-mno-unaligned-access-when-supported-by.patch
+
+--- a/arch/arm/cpu/armv7/config.mk  2015-11-22 20:44:42.744557427 +0100
++++ b/arch/arm/cpu/armv7/config.mk  2015-11-22 20:45:26.381024395 +0100
+@@ -18,9 +18,12 @@ PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV7
+ PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
+ PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT)
+ 
+-# 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
diff --git a/recipes-bsp/u-boot/u-boot-variscite-2013.10/u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch b/recipes-bsp/u-boot/u-boot-variscite-2013.10/u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch
new file mode 100644
index 0000000..d8dd6d2
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-variscite-2013.10/u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch
@@ -0,0 +1,57 @@
+[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/recipes-bsp/u-boot/u-boot-variscite_2013.10.bb b/recipes-bsp/u-boot/u-boot-variscite_2013.10.bb
new file mode 100644
index 0000000..1c07058
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-variscite_2013.10.bb
@@ -0,0 +1,28 @@
+require recipes-bsp/u-boot/u-boot.inc
+
+DESCRIPTION = "bootloader for imx platforms"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=025bf9f768cbcb1a165dbe1a110babfb"
+COMPATIBLE_MACHINE = "(mxs|mx6)"
+
+PROVIDES += "u-boot"
+
+UBOOT_MAKE_TARGET = "all"
+UBOOT_SUFFIX = "img"
+
+SPL_BINARY = "SPL"
+
+SRCREV = "a2bb081c08f8e18cee3ffbf577adb9bdb7d5a6f9"
+SRCBRANCH = "imx_v2013.10_var4"
+
+SRC_URI = "\
+    git://github.com/varigit/uboot-imx.git;protocol=git;branch=${SRCBRANCH} \
+    file://u-boot-002-gcc5-use_gcc_inline_version_instead_c99.patch \
+    file://0001-Add-linux-compiler-gcc5.h-to-fix-builds-with-gcc5.patch \
+    file://0002-ARM-asm-io.h-use-static-inline.patch \
+    file://0003-gcc5-no-unalligned-access.patch \
+"
+
+S = "${WORKDIR}/git"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
-- 
2.1.4



More information about the meta-freescale mailing list