Merge pull request #1593 from vpeter4/u-boot-8

imx6/u-boot: update to ad02f49 [backport of #1592]
This commit is contained in:
Christian Hewitt 2017-05-05 10:15:02 +04:00 committed by GitHub
commit dd4431b2a0
5 changed files with 1 additions and 289 deletions

View File

@ -19,7 +19,7 @@
PKG_NAME="u-boot" PKG_NAME="u-boot"
PKG_DEPENDS_TARGET="toolchain" PKG_DEPENDS_TARGET="toolchain"
if [ "$UBOOT_VERSION" = "imx6-cuboxi" ]; then if [ "$UBOOT_VERSION" = "imx6-cuboxi" ]; then
PKG_COMMIT="c8d1200" PKG_COMMIT="ad02f49"
PKG_VERSION="imx6-$PKG_COMMIT" PKG_VERSION="imx6-$PKG_COMMIT"
PKG_SITE="http://solid-run.com/wiki/doku.php?id=products:imx6:software:development:u-boot" PKG_SITE="http://solid-run.com/wiki/doku.php?id=products:imx6:software:development:u-boot"
PKG_URL="https://github.com/SolidRun/u-boot-imx6/archive/$PKG_COMMIT.tar.gz" PKG_URL="https://github.com/SolidRun/u-boot-imx6/archive/$PKG_COMMIT.tar.gz"

View File

@ -1,120 +0,0 @@
--- a/board/solidrun/mx6_cubox-i/mx6_cubox-i.c 2016-12-22 18:58:59.769716356 +0100
+++ b/board/solidrun/mx6_cubox-i/mx6_cubox-i.c 2016-12-22 18:59:11.293716827 +0100
@@ -79,9 +79,85 @@
int hb_cuboxi_ = 0; /* 2 is HummingBoard2, 1 is HummingBoard, 0 is CuBox-i */
int ver_15_ = 0; /* 0 is original som, 1 is the rev 1.5 */
+/*
+ * Check memory range for valid RAM. A simple memory test determines
+ * the actually available RAM size between addresses `base' and
+ * `base + maxsize'.
+ * This algorithm uses value MEM_STRIDE (like 128MByte) steps instead of the one bit right shift
+ * algorithm originally used in get_ram_size() since a 4GByte memory setup in
+ * a 32bit architecture forbids addressing all the memory, so right shift
+ * algorithm that assumes total memory size is exponents of 2 would fail.
+ */
+#define MEM_STRIDE 0x04000000
+static u32 get_ram_size_stride_test(u32 *base, u32 maxsize)
+{
+ volatile u32 *addr;
+ u32 save[64];
+ u32 cnt;
+ long size;
+ u32 size_tmp;
+ int i = 0;
+ cnt = maxsize;
+ /* First save the data */
+ for (cnt = 0; cnt < maxsize; cnt += MEM_STRIDE) {
+ addr = (volatile u32 *)((u32)base + cnt); /* pointer arith! */
+ sync ();
+ save[i] = *addr;
+ i++;
+ sync ();
+ }
+ /* First write a signature */
+ * (volatile u32 *) base = 0x12345678;
+ for (size_tmp = MEM_STRIDE; size_tmp < (u32)maxsize; size_tmp += MEM_STRIDE) {
+ long tmp;
+ * (volatile u32 *)((u32)base + (u32)size_tmp) = (u32)size_tmp;
+ sync ();
+ tmp = * (volatile u32 *)((u32)base + (u32)size);
+ if (tmp == size_tmp) { /* Looks we reached overlapping address */
+ break;
+ }
+ }
+ /* Resotre the data */
+ for (cnt = (maxsize - MEM_STRIDE); i > 0; cnt -= MEM_STRIDE) {
+ i--;
+ addr = (volatile u32 *)((u32)base + cnt); /* pointer arith! */
+ sync ();
+ * addr = save[i];
+ sync ();
+ }
+ maxsize = size_tmp;
+
+ return (maxsize);
+}
+
int dram_init(void)
{
- gd->ram_size = imx_ddr_size();
+ uint cpurev, imxtype;
+ u32 sdram_size;
+
+ cpurev = get_cpu_rev();
+ imxtype = (cpurev & 0xFF000) >> 12;
+
+ switch (imxtype){
+ case MXC_CPU_MX6SOLO:
+ sdram_size = 0x20000000;
+ break;
+ case MXC_CPU_MX6Q:
+ {
+ /* Read first the snoop control unit config register */
+ u32 scu_config = *(u32 *)(SCU_BASE_ADDR + 0x4);
+ if ((scu_config & 0x3) == 0x3) /* Quad core */
+ sdram_size = 0xf0000000;
+ else /* Dual core */
+ sdram_size = 0x40000000;
+ break;
+ }
+ case MXC_CPU_MX6DL:
+ default:
+ sdram_size = 0x40000000;
+ break;
+ }
+ gd->ram_size = get_ram_size_stride_test((void *)PHYS_SDRAM, sdram_size);
return 0;
}
--- a/board/solidrun/mx6_cubox-i/mx6_cubox-i.c 2015-07-12 20:18:36.781791390 +0200
+++ b/board/solidrun/mx6_cubox-i/mx6_cubox-i.c 2015-07-12 20:18:36.817791389 +0200
@@ -94,10 +94,9 @@
volatile u32 *addr;
u32 save[64];
u32 cnt;
- long size;
u32 size_tmp;
int i = 0;
- cnt = maxsize;
+
/* First save the data */
for (cnt = 0; cnt < maxsize; cnt += MEM_STRIDE) {
addr = (volatile u32 *)((u32)base + cnt); /* pointer arith! */
@@ -112,12 +111,12 @@
long tmp;
* (volatile u32 *)((u32)base + (u32)size_tmp) = (u32)size_tmp;
sync ();
- tmp = * (volatile u32 *)((u32)base + (u32)size);
+ tmp = * (volatile u32 *) base;
if (tmp == size_tmp) { /* Looks we reached overlapping address */
break;
}
}
- /* Resotre the data */
+ /* Restore the data */
for (cnt = (maxsize - MEM_STRIDE); i > 0; cnt -= MEM_STRIDE) {
i--;
addr = (volatile u32 *)((u32)base + cnt); /* pointer arith! */

View File

@ -1,93 +0,0 @@
From 478b02f1a7043b673565075ea5016376f3293b23 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 7 Feb 2015 22:52:40 +0100
Subject: [PATCH] Add linux/compiler-gcc5.h to fix builds with gcc5
Add linux/compiler-gcc5/h from the kernel sources at:
commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b
Author: Steven Noonan <steven@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@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 */
--
1.7.10.4

View File

@ -1,56 +0,0 @@
[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

View File

@ -1,19 +0,0 @@
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