public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Angelo Dureghello <angelo@sysam.it>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] m68k: add malloc memory for early malloc
Date: Sat, 19 Dec 2015 14:43:48 +0100	[thread overview]
Message-ID: <1450532629-10505-1-git-send-email-angelo@sysam.it> (raw)

To use serial uclass and DM, CONFIG_SYS_MALLOC_F must be used.
So CONFIG_SYS_GENERIC_GLOBAL_DATA has been undefined and
call to board_init_f_mem() is added for all cpu's.

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
---

 arch/m68k/cpu/mcf5227x/start.S   | 8 ++++++++
 arch/m68k/cpu/mcf523x/start.S    | 8 ++++++++
 arch/m68k/cpu/mcf52x2/start.S    | 8 ++++++++
 arch/m68k/cpu/mcf530x/cpu_init.c | 2 +-
 arch/m68k/cpu/mcf530x/start.S    | 8 ++++++++
 arch/m68k/cpu/mcf532x/start.S    | 8 ++++++++
 arch/m68k/cpu/mcf5445x/start.S   | 8 ++++++++
 arch/m68k/cpu/mcf547x_8x/start.S | 8 ++++++++
 arch/m68k/include/asm/config.h   | 2 --
 9 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S
index 23024f9..bcb5611 100644
--- a/arch/m68k/cpu/mcf5227x/start.S
+++ b/arch/m68k/cpu/mcf5227x/start.S
@@ -379,6 +379,14 @@ _start:
 
 	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
+	/* Allocate and zero GD, update SP */
+	move.l	%sp,-(%sp)
+	bsr	board_init_f_mem
+
+	/* Update stack- and frame-pointers */
+	move.l	%d0, %sp
+	move.l	%sp, %fp
+
 	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
 	bsr board_init_f		/* run low-level board init code (from flash) */
 
diff --git a/arch/m68k/cpu/mcf523x/start.S b/arch/m68k/cpu/mcf523x/start.S
index 8a23e72..14b3025 100644
--- a/arch/m68k/cpu/mcf523x/start.S
+++ b/arch/m68k/cpu/mcf523x/start.S
@@ -141,6 +141,14 @@ _start:
 
 	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
+	/* Allocate and zero GD, update SP */
+	move.l	%sp,-(%sp)
+	bsr	board_init_f_mem
+
+	/* Update stack- and frame-pointers */
+	move.l	%d0, %sp
+	move.l	%sp, %fp
+
 	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
 	bsr board_init_f		/* run low-level board init code (from flash) */
 
diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S
index 8a59496..abb9291 100644
--- a/arch/m68k/cpu/mcf52x2/start.S
+++ b/arch/m68k/cpu/mcf52x2/start.S
@@ -198,6 +198,14 @@ _after_flashbar_copy:
 
 	move.l #__got_start, %a5		/* put relocation table address to a5 */
 
+	/* Allocate and zero GD, update SP */
+	move.l	%sp,-(%sp)
+	bsr	board_init_f_mem
+
+	/* Update stack- and frame-pointers */
+	move.l	%d0, %sp
+	move.l	%sp, %fp
+
 	bsr cpu_init_f				/* run low-level CPU init code (from flash) */
 	bsr board_init_f			/* run low-level board init code (from flash) */
 
diff --git a/arch/m68k/cpu/mcf530x/cpu_init.c b/arch/m68k/cpu/mcf530x/cpu_init.c
index 80dc239..b09eed8 100644
--- a/arch/m68k/cpu/mcf530x/cpu_init.c
+++ b/arch/m68k/cpu/mcf530x/cpu_init.c
@@ -142,7 +142,7 @@ int cpu_init_r(void)
 	return 0;
 }
 
-void uart_port_conf(void)
+void uart_port_conf(int port)
 {
 }
 
diff --git a/arch/m68k/cpu/mcf530x/start.S b/arch/m68k/cpu/mcf530x/start.S
index 097958a..d9034e1 100644
--- a/arch/m68k/cpu/mcf530x/start.S
+++ b/arch/m68k/cpu/mcf530x/start.S
@@ -137,6 +137,14 @@ _start:
 	/* put relocation table address to a5 */
 	move.l #__got_start, %a5
 
+	/* Allocate and zero GD, update SP */
+	move.l	%sp,-(%sp)
+	bsr	board_init_f_mem
+
+	/* Update stack- and frame-pointers */
+	move.l	%d0, %sp
+	move.l	%sp, %fp
+
 	/* run low-level CPU init code (from flash) */
 	bsr cpu_init_f
 
diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S
index 3b9ede0..98a5401 100644
--- a/arch/m68k/cpu/mcf532x/start.S
+++ b/arch/m68k/cpu/mcf532x/start.S
@@ -155,6 +155,14 @@ _start:
 
 	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
+	/* Allocate and zero GD, update SP */
+	move.l	%sp,-(%sp)
+	bsr	board_init_f_mem
+
+	/* Update stack- and frame-pointers */
+	move.l	%d0, %sp
+	move.l	%sp, %fp
+
 	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
 	bsr board_init_f		/* run low-level board init code (from flash) */
 
diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index 979eb5a..340ab84 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -664,6 +664,14 @@ _start:
 
 	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
+	/* Allocate and zero GD, update SP */
+	move.l	%sp,-(%sp)
+	bsr	board_init_f_mem
+
+	/* Update stack- and frame-pointers */
+	move.l	%d0, %sp
+	move.l	%sp, %fp
+
 	bsr cpu_init_f			/* run low-level CPU init code (from flash) */
 	bsr board_init_f		/* run low-level board init code (from flash) */
 
diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S
index 75de22d..0468d1a 100644
--- a/arch/m68k/cpu/mcf547x_8x/start.S
+++ b/arch/m68k/cpu/mcf547x_8x/start.S
@@ -148,6 +148,14 @@ _start:
 
 	move.l #__got_start, %a5	/* put relocation table address to a5 */
 
+	/* Allocate and zero GD, update SP */
+	move.l	%sp,-(%sp)
+	bsr	board_init_f_mem
+
+	/* Update stack- and frame-pointers */
+	move.l	%d0, %sp
+	move.l	%sp, %fp
+
 	jbsr cpu_init_f			/* run low-level CPU init code (from flash) */
 	jbsr board_init_f		/* run low-level board init code (from flash) */
 
diff --git a/arch/m68k/include/asm/config.h b/arch/m68k/include/asm/config.h
index e1458ac..9c4d3fb 100644
--- a/arch/m68k/include/asm/config.h
+++ b/arch/m68k/include/asm/config.h
@@ -7,8 +7,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
-#define CONFIG_SYS_GENERIC_GLOBAL_DATA
-
 #define CONFIG_NEEDS_MANUAL_RELOC
 
 #define CONFIG_LMB
-- 
2.5.3

             reply	other threads:[~2015-12-19 13:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19 13:43 Angelo Dureghello [this message]
2015-12-19 13:43 ` [U-Boot] [PATCH 2/2] m68k: add DM model serial driver Angelo Dureghello
2015-12-19 20:29   ` Simon Glass
2015-12-19 22:32     ` Angelo Dureghello
2015-12-19 23:07       ` Simon Glass
2015-12-19 20:29 ` [U-Boot] [PATCH 1/2] m68k: add malloc memory for early malloc Simon Glass

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=1450532629-10505-1-git-send-email-angelo@sysam.it \
    --to=angelo@sysam.it \
    --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