All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aneesh V <aneesh@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] omap: spl: fix build break due to changes in FAT
Date: Tue, 4 Oct 2011 20:41:06 +0530	[thread overview]
Message-ID: <1317741066-31121-1-git-send-email-aneesh@ti.com> (raw)
In-Reply-To: <CAKnK67SBY0stg6dgVKT-5CZ2h-Q86jNE6yXGs8nZsgVVXBFY5A@mail.gmail.com>

From: a0393566local (none) <a0393566local@ula0393566>

FAT library now uses malloc() and free(). But SPL doesn't
have heap until now. Setup a heap in SDRAM to fix this issue.

However this increases SPL footprint beyond the available SRAM
budget. So, compile out some fancy features in the SDARM init
bring back footprint under control

CC: Sandeep Paulraj <s-paulraj@ti.com>
CC: Wolfgang Denk <wd@denx.de>
Signed-off-by: Aneesh V <aneesh@ti.com>
---
---
 arch/arm/cpu/armv7/omap-common/spl.c |    4 ++++
 common/Makefile                      |    2 +-
 include/configs/omap4_common.h       |   19 +++++++++++--------
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
index c76fea6..46a1413 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -35,6 +35,7 @@
 #include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
 #include <image.h>
+#include <malloc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -106,6 +107,9 @@ void board_init_r(gd_t *id, ulong dummy)
 	u32 boot_device;
 	debug(">>spl:board_init_r()\n");
 
+	mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
+			CONFIG_SYS_SPL_MALLOC_SIZE);
+
 	timer_init();
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 
diff --git a/common/Makefile b/common/Makefile
index 2edbd71..b424beb 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -29,7 +29,6 @@ LIB	= $(obj)libcommon.o
 ifndef CONFIG_SPL_BUILD
 COBJS-y += main.o
 COBJS-y += command.o
-COBJS-y += dlmalloc.o
 COBJS-y += exports.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
 COBJS-y += image.o
@@ -176,6 +175,7 @@ COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
 endif
 
 COBJS-y += console.o
+COBJS-y += dlmalloc.o
 COBJS-y += memsize.o
 COBJS-y += stdio.o
 
diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
index 228eac5..f438fc2 100644
--- a/include/configs/omap4_common.h
+++ b/include/configs/omap4_common.h
@@ -238,6 +238,7 @@
 #endif
 
 /* Defines for SDRAM init */
+#define CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
 #ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
 #define CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION
 #define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
@@ -251,6 +252,16 @@
 
 #define CONFIG_SPL_BSS_START_ADDR	0x80000000
 #define CONFIG_SPL_BSS_MAX_SIZE		0x80000		/* 512 KB */
+/*
+ * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
+ * 64 bytes before this address should be set aside for u-boot.img's
+ * header. That is 0x800FFFC0--0x80100000 should not be used for any
+ * other needs.
+ */
+#define CONFIG_SYS_TEXT_BASE		0x80100000
+#define CONFIG_SYS_SPL_MALLOC_START	0x80200000
+#define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
+
 
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	0x300 /* address 0x60000 */
 #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS	0x200 /* 256 KB */
@@ -266,12 +277,4 @@
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/omap-common/u-boot-spl.lds"
 
-/*
- * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
- * 64 bytes before this address should be set aside for u-boot.img's
- * header. That is 0x800FFFC0--0x80100000 should not be used for any
- * other needs.
- */
-#define CONFIG_SYS_TEXT_BASE		0x80100000
-
 #endif /* __CONFIG_OMAP4_COMMON_H */
-- 
1.7.1

  parent reply	other threads:[~2011-10-04 15:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03 18:50 [U-Boot] Master branch broken for omap4_panda (SPL_BUILD) Aguirre, Sergio
2011-10-04 14:15 ` Aneesh V
2011-10-04 14:51   ` Wolfgang Denk
2011-10-04 15:37     ` Aneesh V
2011-10-04 18:05       ` Wolfgang Denk
2011-10-05  9:42         ` Aneesh V
2011-10-07  1:40     ` Tom Rini
2011-10-07  5:27       ` Wolfgang Denk
2011-10-04 15:11 ` Aneesh V [this message]
2011-10-04 15:38   ` [U-Boot] [PATCH] omap: spl: fix build break due to changes in FAT Wolfgang Denk
2011-10-04 16:00     ` Aneesh V
2011-10-04 16:17     ` Scott Wood

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=1317741066-31121-1-git-send-email-aneesh@ti.com \
    --to=aneesh@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.