From patchwork Sun Apr 24 22:20:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 614243 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3qtP1f4ymwz9t47 for ; Mon, 25 Apr 2016 08:20:21 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7BCA4A75CA; Mon, 25 Apr 2016 00:20:16 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AhPn1RUxALVE; Mon, 25 Apr 2016 00:20:16 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F405CA7521; Mon, 25 Apr 2016 00:20:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6DA2AA7521 for ; Mon, 25 Apr 2016 00:20:12 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G3rv7EutI9nZ for ; Mon, 25 Apr 2016 00:20:12 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from sysam.it (sysam.it [5.39.81.93]) by theia.denx.de (Postfix) with ESMTPS id 219F2A74F1 for ; Mon, 25 Apr 2016 00:20:07 +0200 (CEST) Received: (qmail 16250 invoked from network); 24 Apr 2016 22:20:48 -0000 Received: from host97-236-dynamic.244-95-r.retail.telecomitalia.it (HELO localhost.localdomain) (angelo@sysam.it@95.244.236.97) by sysam.it with ESMTPA; 24 Apr 2016 22:20:47 -0000 From: Angelo Dureghello To: u-boot@lists.denx.de Date: Mon, 25 Apr 2016 00:20:04 +0200 Message-Id: <1461536404-14669-1-git-send-email-angelo@sysam.it> X-Mailer: git-send-email 2.7.0.rc3 Cc: Angelo Dureghello , abrodkin@synopsys.com, alison.wang@freescale.com Subject: [U-Boot] [PATCH v3 1/2] m68k: add malloc memory for early malloc X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- Changes for v2: - none Changes for v3: - fix start.S using new board_init_f_alloc_reserve --- arch/m68k/cpu/mcf5227x/start.S | 16 ++++++++++++++++ arch/m68k/cpu/mcf523x/start.S | 16 ++++++++++++++++ arch/m68k/cpu/mcf52x2/start.S | 16 ++++++++++++++++ arch/m68k/cpu/mcf530x/cpu_init.c | 2 +- arch/m68k/cpu/mcf530x/start.S | 16 ++++++++++++++++ arch/m68k/cpu/mcf532x/start.S | 16 ++++++++++++++++ arch/m68k/cpu/mcf5445x/start.S | 16 ++++++++++++++++ arch/m68k/cpu/mcf547x_8x/start.S | 16 ++++++++++++++++ 8 files changed, 113 insertions(+), 1 deletion(-) diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S index 23024f9..ea36020 100644 --- a/arch/m68k/cpu/mcf5227x/start.S +++ b/arch/m68k/cpu/mcf5227x/start.S @@ -379,6 +379,22 @@ _start: move.l #__got_start, %a5 /* put relocation table address to a5 */ +#if defined(CONFIG_SYS_MALLOC_F) + move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE), %sp + + /* allocate reserved area from current top of stack */ + move.l %sp, -(%sp) + bsr board_init_f_alloc_reserve + + /* update stack and frame-pointers */ + move.l %d0, %sp + move.l %sp, %fp + + /* initialize reserved area */ + move.l %d0, -(%sp) + bsr board_init_f_init_reserve +#endif + 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 1702f98..db1cb11 100644 --- a/arch/m68k/cpu/mcf523x/start.S +++ b/arch/m68k/cpu/mcf523x/start.S @@ -141,6 +141,22 @@ _start: move.l #__got_start, %a5 /* put relocation table address to a5 */ +#if defined(CONFIG_SYS_MALLOC_F) + move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE), %sp + + /* allocate reserved area from current top of stack */ + move.l %sp, -(%sp) + bsr board_init_f_alloc_reserve + + /* update stack and frame-pointers */ + move.l %d0, %sp + move.l %sp, %fp + + /* initialize reserved area */ + move.l %d0, -(%sp) + bsr board_init_f_init_reserve +#endif + /* run low-level CPU init code (from flash) */ move.l #cpu_init_f, %a1 jsr (%a1) diff --git a/arch/m68k/cpu/mcf52x2/start.S b/arch/m68k/cpu/mcf52x2/start.S index 4af691f..e60d51e 100644 --- a/arch/m68k/cpu/mcf52x2/start.S +++ b/arch/m68k/cpu/mcf52x2/start.S @@ -198,6 +198,22 @@ _after_flashbar_copy: move.l #__got_start, %a5 /* put relocation table address to a5 */ +#if defined(CONFIG_SYS_MALLOC_F) + move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE), %sp + + /* allocate reserved area from current top of stack */ + move.l %sp, -(%sp) + bsr board_init_f_alloc_reserve + + /* update stack and frame-pointers */ + move.l %d0, %sp + move.l %sp, %fp + + /* initialize reserved area */ + move.l %d0, -(%sp) + bsr board_init_f_init_reserve +#endif + /* run low-level CPU init code (from flash) */ move.l #cpu_init_f, %a1 jsr (%a1) 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..9740b59 100644 --- a/arch/m68k/cpu/mcf530x/start.S +++ b/arch/m68k/cpu/mcf530x/start.S @@ -137,6 +137,22 @@ _start: /* put relocation table address to a5 */ move.l #__got_start, %a5 +#if defined(CONFIG_SYS_MALLOC_F) + move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE), %sp + + /* allocate reserved area from current top of stack */ + move.l %sp, -(%sp) + bsr board_init_f_alloc_reserve + + /* update stack and frame-pointers */ + move.l %d0, %sp + move.l %sp, %fp + + /* initialize reserved area */ + move.l %d0, -(%sp) + bsr board_init_f_init_reserve +#endif + /* 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 131ad6e..558c8d5 100644 --- a/arch/m68k/cpu/mcf532x/start.S +++ b/arch/m68k/cpu/mcf532x/start.S @@ -155,6 +155,22 @@ _start: move.l #__got_start, %a5 /* put relocation table address to a5 */ +#if defined(CONFIG_SYS_MALLOC_F) + move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE), %sp + + /* allocate reserved area from current top of stack */ + move.l %sp, -(%sp) + bsr board_init_f_alloc_reserve + + /* update stack and frame-pointers */ + move.l %d0, %sp + move.l %sp, %fp + + /* initialize reserved area */ + move.l %d0, -(%sp) + bsr board_init_f_init_reserve +#endif + /* run low-level CPU init code (from flash) */ move.l #cpu_init_f, %a1 jsr (%a1) diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S index f50f147..49c8d30 100644 --- a/arch/m68k/cpu/mcf5445x/start.S +++ b/arch/m68k/cpu/mcf5445x/start.S @@ -664,6 +664,22 @@ _start: move.l #__got_start, %a5 /* put relocation table address to a5 */ +#if defined(CONFIG_SYS_MALLOC_F) + move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE), %sp + + /* allocate reserved area from current top of stack */ + move.l %sp, -(%sp) + bsr board_init_f_alloc_reserve + + /* update stack and frame-pointers */ + move.l %d0, %sp + move.l %sp, %fp + + /* initialize reserved area */ + move.l %d0, -(%sp) + bsr board_init_f_init_reserve +#endif + /* run low-level CPU init code (from flash) */ move.l #cpu_init_f, %a1 jsr (%a1) diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S index 75de22d..34cfbf0 100644 --- a/arch/m68k/cpu/mcf547x_8x/start.S +++ b/arch/m68k/cpu/mcf547x_8x/start.S @@ -148,6 +148,22 @@ _start: move.l #__got_start, %a5 /* put relocation table address to a5 */ +#if defined(CONFIG_SYS_MALLOC_F) + move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE), %sp + + /* allocate reserved area from current top of stack */ + move.l %sp, -(%sp) + bsr board_init_f_alloc_reserve + + /* update stack and frame-pointers */ + move.l %d0, %sp + move.l %sp, %fp + + /* initialize reserved area */ + move.l %d0, -(%sp) + bsr board_init_f_init_reserve +#endif + jbsr cpu_init_f /* run low-level CPU init code (from flash) */ jbsr board_init_f /* run low-level board init code (from flash) */