aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2015-11-13 19:15:59 +1000
committerNathan Rossi <nathan@nathanrossi.com>2015-11-13 19:15:59 +1000
commitd35b4a3ecca8f9c9479cc75e0b7486940af57727 (patch)
treee19196d209dcb140b15ad49d8c556f839b0348ad
parent2b511e06a0b4e410760e36345187e2a5d3c9bc0b (diff)
downloadmeta-xilinx-d35b4a3ecca8f9c9479cc75e0b7486940af57727.zip
meta-xilinx-d35b4a3ecca8f9c9479cc75e0b7486940af57727.tar.gz
meta-xilinx-d35b4a3ecca8f9c9479cc75e0b7486940af57727.tar.bz2
u-boot-xlnx: Backport MicroBlaze patches to fix GCC 5.2 compatiblity
* Backport patches from upstream u-boot which fix compilation issues when using GCC 5.2 or other non gnu90 standards based compilers Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
-rw-r--r--recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc2
-rw-r--r--recipes-bsp/u-boot/u-boot-xlnx/0001-microblaze-Fix-style-issues-in-header-files.patch236
-rw-r--r--recipes-bsp/u-boot/u-boot-xlnx/0002-microblaze-Fix-C99-gnu99-compatiblity-for-inline-fun.patch239
3 files changed, 477 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc b/recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc
index 9206c2c..28c4faa 100644
--- a/recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc
+++ b/recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc
@@ -7,6 +7,8 @@ SRC_URI += " \
file://zynq-Add-Zynq-PicoZed-board-support.patch \
file://microblaze-Fix-EMAC-Lite-initialization.patch \
file://microblaze-generic_defconfig-Disable-configs.patch \
+ file://0001-microblaze-Fix-style-issues-in-header-files.patch \
+ file://0002-microblaze-Fix-C99-gnu99-compatiblity-for-inline-fun.patch \
"
LIC_FILES_CHKSUM = "file://README;beginline=1;endline=6;md5=157ab8408beab40cd8ce1dc69f702a6c"
diff --git a/recipes-bsp/u-boot/u-boot-xlnx/0001-microblaze-Fix-style-issues-in-header-files.patch b/recipes-bsp/u-boot/u-boot-xlnx/0001-microblaze-Fix-style-issues-in-header-files.patch
new file mode 100644
index 0000000..f81aee4
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-xlnx/0001-microblaze-Fix-style-issues-in-header-files.patch
@@ -0,0 +1,236 @@
+From 4a4d9396b889686914101607417bc094e43060e4 Mon Sep 17 00:00:00 2001
+From: Nathan Rossi <nathan@nathanrossi.com>
+Date: Fri, 6 Nov 2015 19:25:05 +1000
+Subject: [PATCH 1/2] microblaze: Fix style issues in header files
+
+Fix various style issues in MicroBlaze header files. Specifically fixing
+style voilations including '__inline__', 'foo * bar' and 'void foo ('.
+
+Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
+Cc: Michal Simek <monstr@monstr.eu>
+Cc: Tom Rini <trini@konsulko.com>
+Signed-off-by: Michal Simek <michal.simek@xilinx.com>
+Upstream-Status: Backport
+---
+ arch/microblaze/include/asm/bitops.h | 66 ++++++++++++++++++------------------
+ arch/microblaze/include/asm/system.h | 2 +-
+ 2 files changed, 34 insertions(+), 34 deletions(-)
+
+diff --git a/arch/microblaze/include/asm/bitops.h b/arch/microblaze/include/asm/bitops.h
+index d24f2cf..178c94f 100644
+--- a/arch/microblaze/include/asm/bitops.h
++++ b/arch/microblaze/include/asm/bitops.h
+@@ -21,31 +21,31 @@
+ * The __ functions are not atomic
+ */
+
+-extern void set_bit(int nr, volatile void * addr);
+-extern void __set_bit(int nr, volatile void * addr);
++extern void set_bit(int nr, volatile void *addr);
++extern void __set_bit(int nr, volatile void *addr);
+
+-extern void clear_bit(int nr, volatile void * addr);
++extern void clear_bit(int nr, volatile void *addr);
+ #define __clear_bit(nr, addr) clear_bit(nr, addr)
+ #define PLATFORM__CLEAR_BIT
+
+-extern void change_bit(int nr, volatile void * addr);
+-extern void __change_bit(int nr, volatile void * addr);
+-extern int test_and_set_bit(int nr, volatile void * addr);
+-extern int __test_and_set_bit(int nr, volatile void * addr);
+-extern int test_and_clear_bit(int nr, volatile void * addr);
+-extern int __test_and_clear_bit(int nr, volatile void * addr);
+-extern int test_and_change_bit(int nr, volatile void * addr);
+-extern int __test_and_change_bit(int nr, volatile void * addr);
+-extern int __constant_test_bit(int nr, const volatile void * addr);
+-extern int __test_bit(int nr, volatile void * addr);
+-extern int find_first_zero_bit(void * addr, unsigned size);
+-extern int find_next_zero_bit (void * addr, int size, int offset);
++extern void change_bit(int nr, volatile void *addr);
++extern void __change_bit(int nr, volatile void *addr);
++extern int test_and_set_bit(int nr, volatile void *addr);
++extern int __test_and_set_bit(int nr, volatile void *addr);
++extern int test_and_clear_bit(int nr, volatile void *addr);
++extern int __test_and_clear_bit(int nr, volatile void *addr);
++extern int test_and_change_bit(int nr, volatile void *addr);
++extern int __test_and_change_bit(int nr, volatile void *addr);
++extern int __constant_test_bit(int nr, const volatile void *addr);
++extern int __test_bit(int nr, volatile void *addr);
++extern int find_first_zero_bit(void *addr, unsigned size);
++extern int find_next_zero_bit(void *addr, int size, int offset);
+
+ /*
+ * ffz = Find First Zero in word. Undefined if no zero exists,
+ * so code should check against ~0UL first..
+ */
+-extern __inline__ unsigned long ffz(unsigned long word)
++extern inline unsigned long ffz(unsigned long word)
+ {
+ unsigned long result = 0;
+
+@@ -57,7 +57,7 @@ extern __inline__ unsigned long ffz(unsigned long word)
+ }
+
+
+-extern __inline__ void set_bit(int nr, volatile void * addr)
++extern inline void set_bit(int nr, volatile void *addr)
+ {
+ int * a = (int *) addr;
+ int mask;
+@@ -70,7 +70,7 @@ extern __inline__ void set_bit(int nr, volatile void * addr)
+ restore_flags(flags);
+ }
+
+-extern __inline__ void __set_bit(int nr, volatile void * addr)
++extern inline void __set_bit(int nr, volatile void *addr)
+ {
+ int * a = (int *) addr;
+ int mask;
+@@ -87,7 +87,7 @@ extern __inline__ void __set_bit(int nr, volatile void * addr)
+ #define smp_mb__before_clear_bit() barrier()
+ #define smp_mb__after_clear_bit() barrier()
+
+-extern __inline__ void clear_bit(int nr, volatile void * addr)
++extern inline void clear_bit(int nr, volatile void *addr)
+ {
+ int * a = (int *) addr;
+ int mask;
+@@ -100,7 +100,7 @@ extern __inline__ void clear_bit(int nr, volatile void * addr)
+ restore_flags(flags);
+ }
+
+-extern __inline__ void change_bit(int nr, volatile void * addr)
++extern inline void change_bit(int nr, volatile void *addr)
+ {
+ int mask;
+ unsigned long flags;
+@@ -113,7 +113,7 @@ extern __inline__ void change_bit(int nr, volatile void * addr)
+ restore_flags(flags);
+ }
+
+-extern __inline__ void __change_bit(int nr, volatile void * addr)
++extern inline void __change_bit(int nr, volatile void *addr)
+ {
+ int mask;
+ unsigned long *ADDR = (unsigned long *) addr;
+@@ -123,7 +123,7 @@ extern __inline__ void __change_bit(int nr, volatile void * addr)
+ *ADDR ^= mask;
+ }
+
+-extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
++extern inline int test_and_set_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -139,7 +139,7 @@ extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
+ return retval;
+ }
+
+-extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
++extern inline int __test_and_set_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -151,7 +151,7 @@ extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
+ return retval;
+ }
+
+-extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
++extern inline int test_and_clear_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -167,7 +167,7 @@ extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
+ return retval;
+ }
+
+-extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
++extern inline int __test_and_clear_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -179,7 +179,7 @@ extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
+ return retval;
+ }
+
+-extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
++extern inline int test_and_change_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -195,7 +195,7 @@ extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
+ return retval;
+ }
+
+-extern __inline__ int __test_and_change_bit(int nr, volatile void * addr)
++extern inline int __test_and_change_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -210,12 +210,12 @@ extern __inline__ int __test_and_change_bit(int nr, volatile void * addr)
+ /*
+ * This routine doesn't need to be atomic.
+ */
+-extern __inline__ int __constant_test_bit(int nr, const volatile void * addr)
++extern inline int __constant_test_bit(int nr, const volatile void *addr)
+ {
+ return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
+ }
+
+-extern __inline__ int __test_bit(int nr, volatile void * addr)
++extern inline int __test_bit(int nr, volatile void *addr)
+ {
+ int * a = (int *) addr;
+ int mask;
+@@ -233,7 +233,7 @@ extern __inline__ int __test_bit(int nr, volatile void * addr)
+ #define find_first_zero_bit(addr, size) \
+ find_next_zero_bit((addr), (size), 0)
+
+-extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
++extern inline int find_next_zero_bit(void *addr, int size, int offset)
+ {
+ unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
+ unsigned long result = offset & ~31UL;
+@@ -279,7 +279,7 @@ found_middle:
+ #define hweight8(x) generic_hweight8(x)
+
+
+-extern __inline__ int ext2_set_bit(int nr, volatile void * addr)
++extern inline int ext2_set_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ unsigned long flags;
+@@ -294,7 +294,7 @@ extern __inline__ int ext2_set_bit(int nr, volatile void * addr)
+ return retval;
+ }
+
+-extern __inline__ int ext2_clear_bit(int nr, volatile void * addr)
++extern inline int ext2_clear_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ unsigned long flags;
+@@ -309,7 +309,7 @@ extern __inline__ int ext2_clear_bit(int nr, volatile void * addr)
+ return retval;
+ }
+
+-extern __inline__ int ext2_test_bit(int nr, const volatile void * addr)
++extern inline int ext2_test_bit(int nr, const volatile void *addr)
+ {
+ int mask;
+ const volatile unsigned char *ADDR = (const unsigned char *) addr;
+diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
+index 0297a11..3090835 100644
+--- a/arch/microblaze/include/asm/system.h
++++ b/arch/microblaze/include/asm/system.h
+@@ -131,7 +131,7 @@ extern void *switch_thread (struct thread_struct *last,
+ ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr))))
+ #define tas(ptr) (xchg ((ptr), 1))
+
+-extern inline unsigned long __xchg (unsigned long with,
++extern inline unsigned long __xchg(unsigned long with,
+ __volatile__ void *ptr, int size)
+ {
+ unsigned long tmp, flags;
+--
+2.6.2
+
diff --git a/recipes-bsp/u-boot/u-boot-xlnx/0002-microblaze-Fix-C99-gnu99-compatiblity-for-inline-fun.patch b/recipes-bsp/u-boot/u-boot-xlnx/0002-microblaze-Fix-C99-gnu99-compatiblity-for-inline-fun.patch
new file mode 100644
index 0000000..d334867
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-xlnx/0002-microblaze-Fix-C99-gnu99-compatiblity-for-inline-fun.patch
@@ -0,0 +1,239 @@
+From ccd0c906131053b11790a6be076e2cf4f71fed10 Mon Sep 17 00:00:00 2001
+From: Nathan Rossi <nathan@nathanrossi.com>
+Date: Fri, 6 Nov 2015 19:25:06 +1000
+Subject: [PATCH 2/2] microblaze: Fix C99/gnu99 compatiblity for inline
+ functions
+
+'extern inline' is not portable across various C standards. To ensure
+compatiblity with various standards/compilers change the functions to
+static inline. This is a portable construct and serves as a comparable
+definition to 'extern inline' from the gnu90 standard.
+
+Additionally remove the function prototypes as they are not required due
+to the functions being declared static and functions are correctly
+ordered based on dependence.
+
+Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
+Cc: Michal Simek <monstr@monstr.eu>
+Cc: Tom Rini <trini@konsulko.com>
+Acked-by: Mans Rullgard <mans@mansr.com>
+Signed-off-by: Michal Simek <michal.simek@xilinx.com>
+Upstream-Status: Backport
+---
+ arch/microblaze/include/asm/bitops.h | 63 ++++++++++++------------------------
+ arch/microblaze/include/asm/system.h | 2 +-
+ 2 files changed, 22 insertions(+), 43 deletions(-)
+
+diff --git a/arch/microblaze/include/asm/bitops.h b/arch/microblaze/include/asm/bitops.h
+index 178c94f..2cab2ac 100644
+--- a/arch/microblaze/include/asm/bitops.h
++++ b/arch/microblaze/include/asm/bitops.h
+@@ -14,38 +14,14 @@
+
+ #ifdef __KERNEL__
+ /*
+- * Function prototypes to keep gcc -Wall happy
+- */
+-
+-/*
+ * The __ functions are not atomic
+ */
+
+-extern void set_bit(int nr, volatile void *addr);
+-extern void __set_bit(int nr, volatile void *addr);
+-
+-extern void clear_bit(int nr, volatile void *addr);
+-#define __clear_bit(nr, addr) clear_bit(nr, addr)
+-#define PLATFORM__CLEAR_BIT
+-
+-extern void change_bit(int nr, volatile void *addr);
+-extern void __change_bit(int nr, volatile void *addr);
+-extern int test_and_set_bit(int nr, volatile void *addr);
+-extern int __test_and_set_bit(int nr, volatile void *addr);
+-extern int test_and_clear_bit(int nr, volatile void *addr);
+-extern int __test_and_clear_bit(int nr, volatile void *addr);
+-extern int test_and_change_bit(int nr, volatile void *addr);
+-extern int __test_and_change_bit(int nr, volatile void *addr);
+-extern int __constant_test_bit(int nr, const volatile void *addr);
+-extern int __test_bit(int nr, volatile void *addr);
+-extern int find_first_zero_bit(void *addr, unsigned size);
+-extern int find_next_zero_bit(void *addr, int size, int offset);
+-
+ /*
+ * ffz = Find First Zero in word. Undefined if no zero exists,
+ * so code should check against ~0UL first..
+ */
+-extern inline unsigned long ffz(unsigned long word)
++static inline unsigned long ffz(unsigned long word)
+ {
+ unsigned long result = 0;
+
+@@ -57,7 +33,7 @@ extern inline unsigned long ffz(unsigned long word)
+ }
+
+
+-extern inline void set_bit(int nr, volatile void *addr)
++static inline void set_bit(int nr, volatile void *addr)
+ {
+ int * a = (int *) addr;
+ int mask;
+@@ -70,7 +46,7 @@ extern inline void set_bit(int nr, volatile void *addr)
+ restore_flags(flags);
+ }
+
+-extern inline void __set_bit(int nr, volatile void *addr)
++static inline void __set_bit(int nr, volatile void *addr)
+ {
+ int * a = (int *) addr;
+ int mask;
+@@ -87,7 +63,7 @@ extern inline void __set_bit(int nr, volatile void *addr)
+ #define smp_mb__before_clear_bit() barrier()
+ #define smp_mb__after_clear_bit() barrier()
+
+-extern inline void clear_bit(int nr, volatile void *addr)
++static inline void clear_bit(int nr, volatile void *addr)
+ {
+ int * a = (int *) addr;
+ int mask;
+@@ -100,7 +76,10 @@ extern inline void clear_bit(int nr, volatile void *addr)
+ restore_flags(flags);
+ }
+
+-extern inline void change_bit(int nr, volatile void *addr)
++#define __clear_bit(nr, addr) clear_bit(nr, addr)
++#define PLATFORM__CLEAR_BIT
++
++static inline void change_bit(int nr, volatile void *addr)
+ {
+ int mask;
+ unsigned long flags;
+@@ -113,7 +92,7 @@ extern inline void change_bit(int nr, volatile void *addr)
+ restore_flags(flags);
+ }
+
+-extern inline void __change_bit(int nr, volatile void *addr)
++static inline void __change_bit(int nr, volatile void *addr)
+ {
+ int mask;
+ unsigned long *ADDR = (unsigned long *) addr;
+@@ -123,7 +102,7 @@ extern inline void __change_bit(int nr, volatile void *addr)
+ *ADDR ^= mask;
+ }
+
+-extern inline int test_and_set_bit(int nr, volatile void *addr)
++static inline int test_and_set_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -139,7 +118,7 @@ extern inline int test_and_set_bit(int nr, volatile void *addr)
+ return retval;
+ }
+
+-extern inline int __test_and_set_bit(int nr, volatile void *addr)
++static inline int __test_and_set_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -151,7 +130,7 @@ extern inline int __test_and_set_bit(int nr, volatile void *addr)
+ return retval;
+ }
+
+-extern inline int test_and_clear_bit(int nr, volatile void *addr)
++static inline int test_and_clear_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -167,7 +146,7 @@ extern inline int test_and_clear_bit(int nr, volatile void *addr)
+ return retval;
+ }
+
+-extern inline int __test_and_clear_bit(int nr, volatile void *addr)
++static inline int __test_and_clear_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -179,7 +158,7 @@ extern inline int __test_and_clear_bit(int nr, volatile void *addr)
+ return retval;
+ }
+
+-extern inline int test_and_change_bit(int nr, volatile void *addr)
++static inline int test_and_change_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -195,7 +174,7 @@ extern inline int test_and_change_bit(int nr, volatile void *addr)
+ return retval;
+ }
+
+-extern inline int __test_and_change_bit(int nr, volatile void *addr)
++static inline int __test_and_change_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ volatile unsigned int *a = (volatile unsigned int *) addr;
+@@ -210,12 +189,12 @@ extern inline int __test_and_change_bit(int nr, volatile void *addr)
+ /*
+ * This routine doesn't need to be atomic.
+ */
+-extern inline int __constant_test_bit(int nr, const volatile void *addr)
++static inline int __constant_test_bit(int nr, const volatile void *addr)
+ {
+ return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
+ }
+
+-extern inline int __test_bit(int nr, volatile void *addr)
++static inline int __test_bit(int nr, volatile void *addr)
+ {
+ int * a = (int *) addr;
+ int mask;
+@@ -233,7 +212,7 @@ extern inline int __test_bit(int nr, volatile void *addr)
+ #define find_first_zero_bit(addr, size) \
+ find_next_zero_bit((addr), (size), 0)
+
+-extern inline int find_next_zero_bit(void *addr, int size, int offset)
++static inline int find_next_zero_bit(void *addr, int size, int offset)
+ {
+ unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
+ unsigned long result = offset & ~31UL;
+@@ -279,7 +258,7 @@ found_middle:
+ #define hweight8(x) generic_hweight8(x)
+
+
+-extern inline int ext2_set_bit(int nr, volatile void *addr)
++static inline int ext2_set_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ unsigned long flags;
+@@ -294,7 +273,7 @@ extern inline int ext2_set_bit(int nr, volatile void *addr)
+ return retval;
+ }
+
+-extern inline int ext2_clear_bit(int nr, volatile void *addr)
++static inline int ext2_clear_bit(int nr, volatile void *addr)
+ {
+ int mask, retval;
+ unsigned long flags;
+@@ -309,7 +288,7 @@ extern inline int ext2_clear_bit(int nr, volatile void *addr)
+ return retval;
+ }
+
+-extern inline int ext2_test_bit(int nr, const volatile void *addr)
++static inline int ext2_test_bit(int nr, const volatile void *addr)
+ {
+ int mask;
+ const volatile unsigned char *ADDR = (const unsigned char *) addr;
+diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
+index 3090835..3107748 100644
+--- a/arch/microblaze/include/asm/system.h
++++ b/arch/microblaze/include/asm/system.h
+@@ -131,7 +131,7 @@ extern void *switch_thread (struct thread_struct *last,
+ ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr))))
+ #define tas(ptr) (xchg ((ptr), 1))
+
+-extern inline unsigned long __xchg(unsigned long with,
++static inline unsigned long __xchg(unsigned long with,
+ __volatile__ void *ptr, int size)
+ {
+ unsigned long tmp, flags;
+--
+2.6.2
+