public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 0/8] arm: Tidy up early init
@ 2015-10-19 12:49 Simon Glass
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 1/8] Move board_init_f_mem() into a common location Simon Glass
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Simon Glass @ 2015-10-19 12:49 UTC (permalink / raw)
  To: u-boot

This series collects the previous RFT patches I sent out.

https://patchwork.ozlabs.org/patch/508167/
https://patchwork.ozlabs.org/patch/508168/

It turns out that I originally sent a version of these in April:

https://patchwork.ozlabs.org/patch/461687/
https://patchwork.ozlabs.org/patch/461690/

so this series mirrors that one and includes the Zynq patches from that
series.

I have tested this on a few ARM platforms: Zynq Zybo, Beaglebone Black,
pcduino3 (sunxi), Jetson-TK1 (tegra).

Changes in v4:
- Remove the 'end' variable in board_init_f_mem()
- Update commit message to address Albert's comments
- Fully revert the commit (some changes were lost in v3)

Changes in v3:
- Rebase to master
- Rebase to master

Changes in v2:
- Put this into common/init/ and just Makefiles accordingly
- Add comments as to why this is needed, deal with arch-specific memset()

Simon Glass (8):
  Move board_init_f_mem() into a common location
  board_init_f_mem(): Don't require memset()
  board_init_f_mem(): Don't create an unused early malloc() area
  arm: Switch aarch64 to using generic global_data setup
  arm: Switch 32-bit ARM to using generic global_data setup
  microblaze: Add a TODO to call board_init_f_mem()
  zynq: Move SPL console init out of board_init_f()
  Revert "ARM: zynq: disable CONFIG_SYS_MALLOC_F to fix MMC boot"

 arch/arm/lib/crt0.S                | 28 +++---------------
 arch/arm/lib/crt0_64.S             | 15 ++--------
 arch/arm/mach-zynq/spl.c           |  2 +-
 arch/microblaze/cpu/start.S        |  2 ++
 common/Makefile                    |  1 +
 common/board_f.c                   | 29 ------------------
 common/init/Makefile               |  7 +++++
 common/init/board_init.c           | 60 ++++++++++++++++++++++++++++++++++++++
 configs/zynq_microzed_defconfig    |  1 -
 configs/zynq_zc702_defconfig       |  1 -
 configs/zynq_zc706_defconfig       |  1 -
 configs/zynq_zc70x_defconfig       |  1 -
 configs/zynq_zc770_xm010_defconfig |  1 -
 configs/zynq_zc770_xm011_defconfig |  1 -
 configs/zynq_zc770_xm012_defconfig |  1 -
 configs/zynq_zc770_xm013_defconfig |  1 -
 configs/zynq_zed_defconfig         |  1 -
 configs/zynq_zybo_defconfig        |  1 -
 scripts/Makefile.spl               |  1 +
 19 files changed, 79 insertions(+), 76 deletions(-)
 create mode 100644 common/init/Makefile
 create mode 100644 common/init/board_init.c

-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v4 1/8] Move board_init_f_mem() into a common location
  2015-10-19 12:49 [U-Boot] [PATCH v4 0/8] arm: Tidy up early init Simon Glass
@ 2015-10-19 12:49 ` Simon Glass
  2015-10-22  5:53   ` Albert ARIBAUD
  2015-10-24 21:15   ` [U-Boot] [U-Boot, v4, " Tom Rini
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 2/8] board_init_f_mem(): Don't require memset() Simon Glass
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 18+ messages in thread
From: Simon Glass @ 2015-10-19 12:49 UTC (permalink / raw)
  To: u-boot

This function will be used by both SPL and U-Boot proper. So move it into
a common place. Also change the #ifdef so that the early malloc() area is
not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case
it would never actually be used, and just chews up stack space.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Put this into common/init/ and just Makefiles accordingly

 common/Makefile          |  1 +
 common/board_f.c         | 29 -----------------------------
 common/init/Makefile     |  7 +++++++
 common/init/board_init.c | 41 +++++++++++++++++++++++++++++++++++++++++
 scripts/Makefile.spl     |  1 +
 5 files changed, 50 insertions(+), 29 deletions(-)
 create mode 100644 common/init/Makefile
 create mode 100644 common/init/board_init.c

diff --git a/common/Makefile b/common/Makefile
index 491c565..e2f9401 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -7,6 +7,7 @@
 
 # core
 ifndef CONFIG_SPL_BUILD
+obj-y += init/
 obj-y += main.o
 obj-y += exports.o
 obj-y += hash.o
diff --git a/common/board_f.c b/common/board_f.c
index 613332e..62570ab 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -1030,32 +1030,3 @@ void board_init_f_r(void)
 	hang();
 }
 #endif /* CONFIG_X86 */
-
-/* Unfortunately x86 can't compile this code as gd cannot be assigned */
-#ifndef CONFIG_X86
-__weak void arch_setup_gd(struct global_data *gd_ptr)
-{
-	gd = gd_ptr;
-}
-#endif /* !CONFIG_X86 */
-
-ulong board_init_f_mem(ulong top)
-{
-	struct global_data *gd_ptr;
-
-	/* Leave space for the stack we are running with now */
-	top -= 0x40;
-
-	top -= sizeof(struct global_data);
-	top = ALIGN(top, 16);
-	gd_ptr = (struct global_data *)top;
-	memset(gd_ptr, '\0', sizeof(*gd));
-	arch_setup_gd(gd_ptr);
-
-#ifdef CONFIG_SYS_MALLOC_F_LEN
-	top -= CONFIG_SYS_MALLOC_F_LEN;
-	gd->malloc_base = top;
-#endif
-
-	return top;
-}
diff --git a/common/init/Makefile b/common/init/Makefile
new file mode 100644
index 0000000..4902635
--- /dev/null
+++ b/common/init/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2015 Google, Inc
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+obj-y += board_init.o
diff --git a/common/init/board_init.c b/common/init/board_init.c
new file mode 100644
index 0000000..e7ebca7
--- /dev/null
+++ b/common/init/board_init.c
@@ -0,0 +1,41 @@
+/*
+ * Code shared between SPL and U-Boot proper
+ *
+ * Copyright (c) 2015 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Unfortunately x86 can't compile this code as gd cannot be assigned */
+#ifndef CONFIG_X86
+__weak void arch_setup_gd(struct global_data *gd_ptr)
+{
+	gd = gd_ptr;
+}
+#endif /* !CONFIG_X86 */
+
+ulong board_init_f_mem(ulong top)
+{
+	struct global_data *gd_ptr;
+
+	/* Leave space for the stack we are running with now */
+	top -= 0x40;
+
+	top -= sizeof(struct global_data);
+	top = ALIGN(top, 16);
+	gd_ptr = (struct global_data *)top;
+	memset(gd_ptr, '\0', sizeof(*gd));
+	arch_setup_gd(gd_ptr);
+
+#if defined(CONFIG_SYS_MALLOC_F)
+	top -= CONFIG_SYS_MALLOC_F_LEN;
+	gd->malloc_base = top;
+#endif
+
+	return top;
+}
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 58442f1..2df93c8 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -52,6 +52,7 @@ libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
 
 libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/
+libs-y += common/init/
 libs-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/
 libs-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/
 libs-y += drivers/
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v4 2/8] board_init_f_mem(): Don't require memset()
  2015-10-19 12:49 [U-Boot] [PATCH v4 0/8] arm: Tidy up early init Simon Glass
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 1/8] Move board_init_f_mem() into a common location Simon Glass
@ 2015-10-19 12:49 ` Simon Glass
  2015-10-24 21:15   ` [U-Boot] [U-Boot, v4, " Tom Rini
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 3/8] board_init_f_mem(): Don't create an unused early malloc() area Simon Glass
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Simon Glass @ 2015-10-19 12:49 UTC (permalink / raw)
  To: u-boot

Unfortunately memset() is not always available, so provide a substitute when
needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v4:
- Remove the 'end' variable in board_init_f_mem()

Changes in v3: None
Changes in v2:
- Add comments as to why this is needed, deal with arch-specific memset()

 common/init/board_init.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/common/init/board_init.c b/common/init/board_init.c
index e7ebca7..1c6126d 100644
--- a/common/init/board_init.c
+++ b/common/init/board_init.c
@@ -11,6 +11,16 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * It isn't trivial to figure out whether memcpy() exists. The arch-specific
+ * memcpy() is not normally available in SPL due to code size.
+ */
+#if !defined(CONFIG_SPL_BUILD) || \
+		(defined(CONFIG_SPL_LIBGENERIC_SUPPORT) && \
+		!defined(CONFIG_USE_ARCH_MEMSET))
+#define _USE_MEMCPY
+#endif
+
 /* Unfortunately x86 can't compile this code as gd cannot be assigned */
 #ifndef CONFIG_X86
 __weak void arch_setup_gd(struct global_data *gd_ptr)
@@ -22,6 +32,9 @@ __weak void arch_setup_gd(struct global_data *gd_ptr)
 ulong board_init_f_mem(ulong top)
 {
 	struct global_data *gd_ptr;
+#ifndef _USE_MEMCPY
+	int *ptr;
+#endif
 
 	/* Leave space for the stack we are running with now */
 	top -= 0x40;
@@ -29,7 +42,12 @@ ulong board_init_f_mem(ulong top)
 	top -= sizeof(struct global_data);
 	top = ALIGN(top, 16);
 	gd_ptr = (struct global_data *)top;
+#ifdef _USE_MEMCPY
 	memset(gd_ptr, '\0', sizeof(*gd));
+#else
+	for (ptr = (int *)gd_ptr; ptr < (int *)(gd_ptr + 1); )
+		*ptr++ = 0;
+#endif
 	arch_setup_gd(gd_ptr);
 
 #if defined(CONFIG_SYS_MALLOC_F)
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v4 3/8] board_init_f_mem(): Don't create an unused early malloc() area
  2015-10-19 12:49 [U-Boot] [PATCH v4 0/8] arm: Tidy up early init Simon Glass
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 1/8] Move board_init_f_mem() into a common location Simon Glass
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 2/8] board_init_f_mem(): Don't require memset() Simon Glass
@ 2015-10-19 12:49 ` Simon Glass
  2015-10-24 21:15   ` [U-Boot] [U-Boot, v4, " Tom Rini
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 4/8] arm: Switch aarch64 to using generic global_data setup Simon Glass
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Simon Glass @ 2015-10-19 12:49 UTC (permalink / raw)
  To: u-boot

Change the #ifdef so that the early malloc() area is not set up in SPL if
CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually
be used, and just chews up stack space.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/init/board_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/init/board_init.c b/common/init/board_init.c
index 1c6126d..e74b63b 100644
--- a/common/init/board_init.c
+++ b/common/init/board_init.c
@@ -50,7 +50,8 @@ ulong board_init_f_mem(ulong top)
 #endif
 	arch_setup_gd(gd_ptr);
 
-#if defined(CONFIG_SYS_MALLOC_F)
+#if defined(CONFIG_SYS_MALLOC_F) && \
+	(!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYS_SPL_MALLOC_START))
 	top -= CONFIG_SYS_MALLOC_F_LEN;
 	gd->malloc_base = top;
 #endif
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v4 4/8] arm: Switch aarch64 to using generic global_data setup
  2015-10-19 12:49 [U-Boot] [PATCH v4 0/8] arm: Tidy up early init Simon Glass
                   ` (2 preceding siblings ...)
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 3/8] board_init_f_mem(): Don't create an unused early malloc() area Simon Glass
@ 2015-10-19 12:49 ` Simon Glass
  2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 5/8] arm: Switch 32-bit ARM " Simon Glass
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Simon Glass @ 2015-10-19 12:49 UTC (permalink / raw)
  To: u-boot

There is quite a bit of assembler code that can be removed if we use the
generic global_data setup. Less arch-specific code makes it easier to add
new features and maintain the start-up code.

Drop the unneeded code and adjust the hooks in board_f.c to cope.

Tested on LS2085ARDB and LS2085AQDS (armv8 SoC).
Tested-by: York Sun <yorksun@freescale.com>

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/lib/crt0_64.S | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S
index 8b34e04..cef1c71 100644
--- a/arch/arm/lib/crt0_64.S
+++ b/arch/arm/lib/crt0_64.S
@@ -74,19 +74,10 @@ ENTRY(_main)
 #else
 	ldr	x0, =(CONFIG_SYS_INIT_SP_ADDR)
 #endif
-	sub	x18, x0, #GD_SIZE	/* allocate one GD above SP */
-	bic	x18, x18, #0x7		/* 8-byte alignment for GD */
-zero_gd:
-	sub	x0, x0, #0x8
-	str	xzr, [x0]
-	cmp	x0, x18
-	b.gt	zero_gd
-#if defined(CONFIG_SYS_MALLOC_F_LEN)
-	ldr	x0, =CONFIG_SYS_MALLOC_F_LEN
-	sub	x0, x18, x0
-	str	x0, [x18, #GD_MALLOC_BASE]
-#endif
 	bic	sp, x0, #0xf	/* 16-byte alignment for ABI compliance */
+	bl	board_init_f_mem
+	mov	sp, x0
+
 	mov	x0, #0
 	bl	board_init_f
 
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v4 5/8] arm: Switch 32-bit ARM to using generic global_data setup
  2015-10-19 12:49 [U-Boot] [PATCH v4 0/8] arm: Tidy up early init Simon Glass
                   ` (3 preceding siblings ...)
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 4/8] arm: Switch aarch64 to using generic global_data setup Simon Glass
@ 2015-10-19 12:50 ` Simon Glass
  2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 6/8] microblaze: Add a TODO to call board_init_f_mem() Simon Glass
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Simon Glass @ 2015-10-19 12:50 UTC (permalink / raw)
  To: u-boot

There is quite a bit of assembler code that can be removed if we use the
generic global_data setup. Less arch-specific code makes it easier to add
new features and maintain the start-up code.

Drop the unneeded code and adjust the hooks in board_f.c to cope.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/lib/crt0.S | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)

diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 4c3a94a..80548eb 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -82,31 +82,11 @@ ENTRY(_main)
 #else
 	bic	sp, sp, #7	/* 8-byte alignment for ABI compliance */
 #endif
-	mov	r2, sp
-	sub	sp, sp, #GD_SIZE	/* allocate one GD above SP */
-#if defined(CONFIG_CPU_V7M)	/* v7M forbids using SP as BIC destination */
-	mov	r3, sp
-	bic	r3, r3, #7
-	mov	sp, r3
-#else
-	bic	sp, sp, #7	/* 8-byte alignment for ABI compliance */
-#endif
-	mov	r9, sp		/* GD is above SP */
-	mov	r1, sp
+	mov	r0, sp
+	bl	board_init_f_mem
+	mov	sp, r0
+
 	mov	r0, #0
-clr_gd:
-	cmp	r1, r2			/* while not at end of GD */
-#if defined(CONFIG_CPU_V7M)
-	itt	lo
-#endif
-	strlo	r0, [r1]		/* clear 32-bit GD word */
-	addlo	r1, r1, #4		/* move to next */
-	blo	clr_gd
-#if defined(CONFIG_SYS_MALLOC_F_LEN)
-	sub	sp, sp, #CONFIG_SYS_MALLOC_F_LEN
-	str	sp, [r9, #GD_MALLOC_BASE]
-#endif
-	/* mov r0, #0 not needed due to above code */
 	bl	board_init_f
 
 #if ! defined(CONFIG_SPL_BUILD)
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v4 6/8] microblaze: Add a TODO to call board_init_f_mem()
  2015-10-19 12:49 [U-Boot] [PATCH v4 0/8] arm: Tidy up early init Simon Glass
                   ` (4 preceding siblings ...)
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 5/8] arm: Switch 32-bit ARM " Simon Glass
@ 2015-10-19 12:50 ` Simon Glass
  2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 7/8] zynq: Move SPL console init out of board_init_f() Simon Glass
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 8/8] Revert "ARM: zynq: disable CONFIG_SYS_MALLOC_F to fix MMC boot" Simon Glass
  7 siblings, 1 reply; 18+ messages in thread
From: Simon Glass @ 2015-10-19 12:50 UTC (permalink / raw)
  To: u-boot

This C function should be used to do the early memory layout and init. This
is beyond my powers, so just add a TODO for the maintainer.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/microblaze/cpu/start.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S
index 953d3a1..14f46a8 100644
--- a/arch/microblaze/cpu/start.S
+++ b/arch/microblaze/cpu/start.S
@@ -25,6 +25,7 @@ _start:
 
 	addi	r8, r0, __end
 	mts	rslr, r8
+	/* TODO: Redo this code to call board_init_f_mem() */
 #if defined(CONFIG_SPL_BUILD)
 	addi	r1, r0, CONFIG_SPL_STACK_ADDR
 	mts	rshr, r1
@@ -141,6 +142,7 @@ _start:
 	ori	r12, r12, 0x1a0
 	mts	rmsr, r12
 
+	/* TODO: Redo this code to call board_init_f_mem() */
 clear_bss:
 	/* clear BSS segments */
 	addi	r5, r0, __bss_start
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v4 7/8] zynq: Move SPL console init out of board_init_f()
  2015-10-19 12:49 [U-Boot] [PATCH v4 0/8] arm: Tidy up early init Simon Glass
                   ` (5 preceding siblings ...)
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 6/8] microblaze: Add a TODO to call board_init_f_mem() Simon Glass
@ 2015-10-19 12:50 ` Simon Glass
  2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 8/8] Revert "ARM: zynq: disable CONFIG_SYS_MALLOC_F to fix MMC boot" Simon Glass
  7 siblings, 1 reply; 18+ messages in thread
From: Simon Glass @ 2015-10-19 12:50 UTC (permalink / raw)
  To: u-boot

We should not init the console this early since it precludes using driver
model for the UART, since it is not set up at the start of board_init_f().
See the README for more information. The debug UART does not have this
restriction. If we want to do early init with the console on it can be done
in spl_board_init().

Move the preloader_console_init() call from board_init_f() to board_init_r().

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v4:
- Update commit message to address Albert's comments

Changes in v3:
- Rebase to master

Changes in v2: None

 arch/arm/mach-zynq/spl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-zynq/spl.c b/arch/arm/mach-zynq/spl.c
index e7df6d3..7bdac3b 100644
--- a/arch/arm/mach-zynq/spl.c
+++ b/arch/arm/mach-zynq/spl.c
@@ -20,7 +20,6 @@ void board_init_f(ulong dummy)
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
-	preloader_console_init();
 	arch_cpu_init();
 	board_init_r(NULL, 0);
 }
@@ -28,6 +27,7 @@ void board_init_f(ulong dummy)
 #ifdef CONFIG_SPL_BOARD_INIT
 void spl_board_init(void)
 {
+	preloader_console_init();
 	board_init();
 }
 #endif
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v4 8/8] Revert "ARM: zynq: disable CONFIG_SYS_MALLOC_F to fix MMC boot"
  2015-10-19 12:49 [U-Boot] [PATCH v4 0/8] arm: Tidy up early init Simon Glass
                   ` (6 preceding siblings ...)
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 7/8] zynq: Move SPL console init out of board_init_f() Simon Glass
@ 2015-10-19 12:50 ` Simon Glass
  2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini
  7 siblings, 1 reply; 18+ messages in thread
From: Simon Glass @ 2015-10-19 12:50 UTC (permalink / raw)
  To: u-boot

This reverts commit 321f86e18d6aae9f7b7ba3ef1eb0cec769481874.

The original bug has been fixed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-on: Zedboard and ZC706 board
Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-on: zc702
Tested-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v4:
- Fully revert the commit (some changes were lost in v3)

Changes in v3:
- Rebase to master

Changes in v2: None

 configs/zynq_microzed_defconfig    | 1 -
 configs/zynq_zc702_defconfig       | 1 -
 configs/zynq_zc706_defconfig       | 1 -
 configs/zynq_zc70x_defconfig       | 1 -
 configs/zynq_zc770_xm010_defconfig | 1 -
 configs/zynq_zc770_xm011_defconfig | 1 -
 configs/zynq_zc770_xm012_defconfig | 1 -
 configs/zynq_zc770_xm013_defconfig | 1 -
 configs/zynq_zed_defconfig         | 1 -
 configs/zynq_zybo_defconfig        | 1 -
 10 files changed, 10 deletions(-)

diff --git a/configs/zynq_microzed_defconfig b/configs/zynq_microzed_defconfig
index a6757ac..e9c3209 100644
--- a/configs/zynq_microzed_defconfig
+++ b/configs/zynq_microzed_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_TARGET_ZYNQ_MICROZED=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-microzed"
 CONFIG_SPL=y
diff --git a/configs/zynq_zc702_defconfig b/configs/zynq_zc702_defconfig
index 8a388f3..0abb7a8 100644
--- a/configs/zynq_zc702_defconfig
+++ b/configs/zynq_zc702_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc702"
 CONFIG_SPL=y
 CONFIG_FIT=y
diff --git a/configs/zynq_zc706_defconfig b/configs/zynq_zc706_defconfig
index f1009ee..d67f507 100644
--- a/configs/zynq_zc706_defconfig
+++ b/configs/zynq_zc706_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_TARGET_ZYNQ_ZC706=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc706"
 CONFIG_SPL=y
diff --git a/configs/zynq_zc70x_defconfig b/configs/zynq_zc70x_defconfig
index 6465040..37c249f 100644
--- a/configs/zynq_zc70x_defconfig
+++ b/configs/zynq_zc70x_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_TARGET_ZYNQ_ZC70X=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc702"
 CONFIG_SPL=y
diff --git a/configs/zynq_zc770_xm010_defconfig b/configs/zynq_zc770_xm010_defconfig
index cafbb09..0e826bb 100644
--- a/configs/zynq_zc770_xm010_defconfig
+++ b/configs/zynq_zc770_xm010_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_TARGET_ZYNQ_ZC770=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm010"
 CONFIG_SPL=y
diff --git a/configs/zynq_zc770_xm011_defconfig b/configs/zynq_zc770_xm011_defconfig
index e6e1c30..46d043b 100644
--- a/configs/zynq_zc770_xm011_defconfig
+++ b/configs/zynq_zc770_xm011_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_TARGET_ZYNQ_ZC770=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm011"
 CONFIG_SPL=y
diff --git a/configs/zynq_zc770_xm012_defconfig b/configs/zynq_zc770_xm012_defconfig
index 9a44009..34d479f 100644
--- a/configs/zynq_zc770_xm012_defconfig
+++ b/configs/zynq_zc770_xm012_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_TARGET_ZYNQ_ZC770=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm012"
 CONFIG_SPL=y
diff --git a/configs/zynq_zc770_xm013_defconfig b/configs/zynq_zc770_xm013_defconfig
index 95e32a5..c59599f 100644
--- a/configs/zynq_zc770_xm013_defconfig
+++ b/configs/zynq_zc770_xm013_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_TARGET_ZYNQ_ZC770=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zc770-xm013"
 CONFIG_SPL=y
diff --git a/configs/zynq_zed_defconfig b/configs/zynq_zed_defconfig
index 43520d0..886b4a5 100644
--- a/configs/zynq_zed_defconfig
+++ b/configs/zynq_zed_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_TARGET_ZYNQ_ZED=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zed"
 CONFIG_SPL=y
diff --git a/configs/zynq_zybo_defconfig b/configs/zynq_zybo_defconfig
index 46379e5..77b9409 100644
--- a/configs/zynq_zybo_defconfig
+++ b/configs/zynq_zybo_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQ=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_TARGET_ZYNQ_ZYBO=y
 CONFIG_DEFAULT_DEVICE_TREE="zynq-zybo"
 CONFIG_SPL=y
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [U-Boot] [PATCH v4 1/8] Move board_init_f_mem() into a common location
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 1/8] Move board_init_f_mem() into a common location Simon Glass
@ 2015-10-22  5:53   ` Albert ARIBAUD
  2015-10-24 21:15   ` [U-Boot] [U-Boot, v4, " Tom Rini
  1 sibling, 0 replies; 18+ messages in thread
From: Albert ARIBAUD @ 2015-10-22  5:53 UTC (permalink / raw)
  To: u-boot

Hello Simon,

On Mon, 19 Oct 2015 06:49:56 -0600, Simon Glass <sjg@chromium.org>
wrote:
> This function will be used by both SPL and U-Boot proper. So move it into
> a common place. Also change the #ifdef so that the early malloc() area is
> not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case
> it would never actually be used, and just chews up stack space.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

> diff --git a/common/Makefile b/common/Makefile
> index 491c565..e2f9401 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -7,6 +7,7 @@
>  
>  # core
>  ifndef CONFIG_SPL_BUILD
> +obj-y += init/

I'm certainly missing something, even if only a comment in the file
or note in the commit: why is this under ifndef CONFIG_SPL_BUILD (and
thus won't build with SPL) when the file init/board_init.c is supposed
to be "Code shared between SPL and U-Boot proper"?

Amicalement,
-- 
Albert.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [U-Boot, v4, 1/8] Move board_init_f_mem() into a common location
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 1/8] Move board_init_f_mem() into a common location Simon Glass
  2015-10-22  5:53   ` Albert ARIBAUD
@ 2015-10-24 21:15   ` Tom Rini
  1 sibling, 0 replies; 18+ messages in thread
From: Tom Rini @ 2015-10-24 21:15 UTC (permalink / raw)
  To: u-boot

On Mon, Oct 19, 2015 at 06:49:56AM -0600, Simon Glass wrote:

> This function will be used by both SPL and U-Boot proper. So move it into
> a common place. Also change the #ifdef so that the early malloc() area is
> not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case
> it would never actually be used, and just chews up stack space.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151024/35342aaa/attachment.sig>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [U-Boot, v4, 2/8] board_init_f_mem(): Don't require memset()
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 2/8] board_init_f_mem(): Don't require memset() Simon Glass
@ 2015-10-24 21:15   ` Tom Rini
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rini @ 2015-10-24 21:15 UTC (permalink / raw)
  To: u-boot

On Mon, Oct 19, 2015 at 06:49:57AM -0600, Simon Glass wrote:

> Unfortunately memset() is not always available, so provide a substitute when
> needed.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151024/781e00b0/attachment.sig>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [U-Boot, v4, 3/8] board_init_f_mem(): Don't create an unused early malloc() area
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 3/8] board_init_f_mem(): Don't create an unused early malloc() area Simon Glass
@ 2015-10-24 21:15   ` Tom Rini
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rini @ 2015-10-24 21:15 UTC (permalink / raw)
  To: u-boot

On Mon, Oct 19, 2015 at 06:49:58AM -0600, Simon Glass wrote:

> Change the #ifdef so that the early malloc() area is not set up in SPL if
> CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually
> be used, and just chews up stack space.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151024/ca82bf9a/attachment.sig>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [U-Boot, v4, 4/8] arm: Switch aarch64 to using generic global_data setup
  2015-10-19 12:49 ` [U-Boot] [PATCH v4 4/8] arm: Switch aarch64 to using generic global_data setup Simon Glass
@ 2015-10-24 21:16   ` Tom Rini
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rini @ 2015-10-24 21:16 UTC (permalink / raw)
  To: u-boot

On Mon, Oct 19, 2015 at 06:49:59AM -0600, Simon Glass wrote:

> There is quite a bit of assembler code that can be removed if we use the
> generic global_data setup. Less arch-specific code makes it easier to add
> new features and maintain the start-up code.
> 
> Drop the unneeded code and adjust the hooks in board_f.c to cope.
> 
> Tested on LS2085ARDB and LS2085AQDS (armv8 SoC).
> Tested-by: York Sun <yorksun@freescale.com>
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151024/c4e75b3a/attachment.sig>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [U-Boot, v4, 5/8] arm: Switch 32-bit ARM to using generic global_data setup
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 5/8] arm: Switch 32-bit ARM " Simon Glass
@ 2015-10-24 21:16   ` Tom Rini
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rini @ 2015-10-24 21:16 UTC (permalink / raw)
  To: u-boot

On Mon, Oct 19, 2015 at 06:50:00AM -0600, Simon Glass wrote:

> There is quite a bit of assembler code that can be removed if we use the
> generic global_data setup. Less arch-specific code makes it easier to add
> new features and maintain the start-up code.
> 
> Drop the unneeded code and adjust the hooks in board_f.c to cope.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151024/28a3fbd4/attachment.sig>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [U-Boot, v4, 6/8] microblaze: Add a TODO to call board_init_f_mem()
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 6/8] microblaze: Add a TODO to call board_init_f_mem() Simon Glass
@ 2015-10-24 21:16   ` Tom Rini
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rini @ 2015-10-24 21:16 UTC (permalink / raw)
  To: u-boot

On Mon, Oct 19, 2015 at 06:50:01AM -0600, Simon Glass wrote:

> This C function should be used to do the early memory layout and init. This
> is beyond my powers, so just add a TODO for the maintainer.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Acked-by: Michal Simek <michal.simek@xilinx.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151024/5c2404b8/attachment.sig>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [U-Boot, v4, 7/8] zynq: Move SPL console init out of board_init_f()
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 7/8] zynq: Move SPL console init out of board_init_f() Simon Glass
@ 2015-10-24 21:16   ` Tom Rini
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rini @ 2015-10-24 21:16 UTC (permalink / raw)
  To: u-boot

On Mon, Oct 19, 2015 at 06:50:02AM -0600, Simon Glass wrote:

> We should not init the console this early since it precludes using driver
> model for the UART, since it is not set up at the start of board_init_f().
> See the README for more information. The debug UART does not have this
> restriction. If we want to do early init with the console on it can be done
> in spl_board_init().
> 
> Move the preloader_console_init() call from board_init_f() to board_init_r().
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Tested-by: Michal Simek <michal.simek@xilinx.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151024/462898e8/attachment.sig>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [U-Boot] [U-Boot, v4, 8/8] Revert "ARM: zynq: disable CONFIG_SYS_MALLOC_F to fix MMC boot"
  2015-10-19 12:50 ` [U-Boot] [PATCH v4 8/8] Revert "ARM: zynq: disable CONFIG_SYS_MALLOC_F to fix MMC boot" Simon Glass
@ 2015-10-24 21:16   ` Tom Rini
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Rini @ 2015-10-24 21:16 UTC (permalink / raw)
  To: u-boot

On Mon, Oct 19, 2015 at 06:50:03AM -0600, Simon Glass wrote:

> This reverts commit 321f86e18d6aae9f7b7ba3ef1eb0cec769481874.
> 
> The original bug has been fixed.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Tested-on: Zedboard and ZC706 board
> Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Tested-on: zc702
> Tested-by: Michal Simek <michal.simek@xilinx.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151024/0a3c3a7b/attachment.sig>

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-10-24 21:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-19 12:49 [U-Boot] [PATCH v4 0/8] arm: Tidy up early init Simon Glass
2015-10-19 12:49 ` [U-Boot] [PATCH v4 1/8] Move board_init_f_mem() into a common location Simon Glass
2015-10-22  5:53   ` Albert ARIBAUD
2015-10-24 21:15   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-19 12:49 ` [U-Boot] [PATCH v4 2/8] board_init_f_mem(): Don't require memset() Simon Glass
2015-10-24 21:15   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-19 12:49 ` [U-Boot] [PATCH v4 3/8] board_init_f_mem(): Don't create an unused early malloc() area Simon Glass
2015-10-24 21:15   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-19 12:49 ` [U-Boot] [PATCH v4 4/8] arm: Switch aarch64 to using generic global_data setup Simon Glass
2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-19 12:50 ` [U-Boot] [PATCH v4 5/8] arm: Switch 32-bit ARM " Simon Glass
2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-19 12:50 ` [U-Boot] [PATCH v4 6/8] microblaze: Add a TODO to call board_init_f_mem() Simon Glass
2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-19 12:50 ` [U-Boot] [PATCH v4 7/8] zynq: Move SPL console init out of board_init_f() Simon Glass
2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-19 12:50 ` [U-Boot] [PATCH v4 8/8] Revert "ARM: zynq: disable CONFIG_SYS_MALLOC_F to fix MMC boot" Simon Glass
2015-10-24 21:16   ` [U-Boot] [U-Boot, v4, " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox