public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] armv8: Implement CONFIG_SYS_MALLOC_F_LEN support
Date: Fri, 20 Mar 2015 12:47:49 +0100	[thread overview]
Message-ID: <1426852073-10299-2-git-send-email-thierry.reding@gmail.com> (raw)
In-Reply-To: <1426852073-10299-1-git-send-email-thierry.reding@gmail.com>

From: Thierry Reding <treding@nvidia.com>

Implement early malloc() support in a similar way as on 32-bit ARM. This
is required for 64-bit Tegra SoCs that initialize from the device tree
just like the earlier 32-bit SoCs.

Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 arch/arm/include/asm/config.h |  4 ----
 arch/arm/lib/crt0_64.S        | 16 ++++++++++++++--
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/config.h b/arch/arm/include/asm/config.h
index be80434dee4d..7a34a0186cb1 100644
--- a/arch/arm/include/asm/config.h
+++ b/arch/arm/include/asm/config.h
@@ -7,10 +7,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
-#ifdef __aarch64__
-#define CONFIG_SYS_GENERIC_GLOBAL_DATA
-#endif
-
 #define CONFIG_LMB
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S
index 77563967e517..010efdbf8f3f 100644
--- a/arch/arm/lib/crt0_64.S
+++ b/arch/arm/lib/crt0_64.S
@@ -62,9 +62,21 @@ ENTRY(_main)
  * Set up initial C runtime environment and call board_init_f(0).
  */
 	ldr	x0, =(CONFIG_SYS_INIT_SP_ADDR)
+	mov	x1, x0
 	sub	x0, x0, #GD_SIZE	/* allocate one GD above SP */
-	bic	sp, x0, #0xf	/* 16-byte alignment for ABI compliance */
-	mov	x18, sp			/* GD is above SP */
+	bic	x0, x0, #0xf		/* 16-byte alignment for ABI compliance */
+	mov	x18, x0			/* GD is above SP */
+	mov	sp, x0
+clr_gd:
+	str	xzr, [x0], #8
+	cmp	x0, x1
+	b.lo	clr_gd
+#if defined(CONFIG_SYS_MALLOC_F_LEN)
+	ldr	x0, =CONFIG_SYS_MALLOC_F_LEN
+	sub	x0, sp, x0
+	str	x0, [x18, #GD_MALLOC_BASE]
+#endif
+3:
 	mov	x0, #0
 	bl	board_init_f
 
-- 
2.3.2

  reply	other threads:[~2015-03-20 11:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 11:47 [U-Boot] [PATCH 1/6] armv8/cache: Fix page table creation Thierry Reding
2015-03-20 11:47 ` Thierry Reding [this message]
2015-03-24 14:47   ` [U-Boot] [PATCH 2/6] armv8: Implement CONFIG_SYS_MALLOC_F_LEN support FengHua
2015-03-20 11:47 ` [U-Boot] [PATCH 3/6] armv8/mmu: Clean up TCR programming Thierry Reding
2015-03-20 18:13   ` Marc Zyngier
2015-07-02 21:06     ` Albert ARIBAUD
2015-07-03  7:28       ` Marc Zyngier
2015-03-24 14:55   ` FengHua
2015-03-20 11:47 ` [U-Boot] [PATCH 4/6] armv8/mmu: Set bits marked RES1 in TCR Thierry Reding
2015-03-20 18:16   ` Marc Zyngier
2015-03-24 15:10   ` FengHua
2015-03-20 11:47 ` [U-Boot] [PATCH 5/6] armv8/gic: Fix GIC v2 initialization Thierry Reding
2015-03-20 18:03   ` Marc Zyngier
2015-03-20 11:47 ` [U-Boot] [PATCH 6/6] armv8: Allow SoCs to override the generic timer Thierry Reding
2015-03-20 18:18   ` Marc Zyngier
2015-03-24 14:59   ` FengHua
2015-03-20 18:06 ` [U-Boot] [PATCH 1/6] armv8/cache: Fix page table creation Marc Zyngier
2015-03-24 14:52 ` FengHua
2015-04-16 11:24 ` Albert ARIBAUD
2015-06-03 15:09   ` Albert ARIBAUD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426852073-10299-2-git-send-email-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox