mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "antonynpavlov@gmail.com" <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: ARM: stack region-related issue
Date: Tue, 16 Jul 2013 12:30:12 +0400	[thread overview]
Message-ID: <20130716123012.3cea8ffd77234ce1edd94493@gmail.com> (raw)

Hi, all!

We have common request_sdram_region("stack", ...)
in mem_malloc_resource() (common/memory.c).

But we also have ARM-special request_sdram_region("stack", ...)
inside arm_request_stack() initcall.

In normal situation there is no problem at all.

Here is the 'iomem' log for versatile qemu virtual board:

0x00000000 - 0x03ffffff (size 0x04000000) ram0
0x00c00000 - 0x00ffffff (size 0x00400000) malloc space
0x01000000 - 0x0102d5f3 (size 0x0002d5f4) barebox
0x0102d5f4 - 0x0102f307 (size 0x00001d14) barebox data
0x0102f308 - 0x010346db (size 0x000053d4) bss
0x03ff8000 - 0x03ffffff (size 0x00008000) stack

But if the board use MEMORY_LAYOUT_FIXED then
we can have a problem.

I enabled CONFIGURABLE_MEMORY_LAYOUT for versatile.
Here is a patch:

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index bd10591..2969b19 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -134,6 +134,7 @@ config ARCH_VERSATILE
 	bool "ARM Versatile boards (ARM926EJ-S)"
 	select CPU_ARM926T
 	select GPIOLIB
+	select HAVE_CONFIGURABLE_MEMORY_LAYOUT
 
 config ARCH_VEXPRESS
 	bool "ARM Vexpres boards"

I have rebuilt barebox with this memory layout:

CONFIG_HAVE_CONFIGURABLE_MEMORY_LAYOUT=y
# CONFIG_MEMORY_LAYOUT_DEFAULT is not set
CONFIG_MEMORY_LAYOUT_FIXED=y
CONFIG_STACK_BASE=0x20000
CONFIG_STACK_SIZE=0x8000
CONFIG_MALLOC_BASE=0x00c00000
CONFIG_MALLOC_SIZE=0x400000

Here is the 'iomem' log for MEMORY_LAYOUT_FIXED:

0x00000000 - 0x03ffffff (size 0x04000000) ram0
0x00020000 - 0x00027fff (size 0x00008000) stack
0x00c00000 - 0x00ffffff (size 0x00400000) malloc space
0x01000000 - 0x0102d61b (size 0x0002d61c) barebox
0x0102d61c - 0x0102f327 (size 0x00001d0c) barebox data
0x0102f328 - 0x010346fb (size 0x000053d4) bss
0x03ff8000 - 0x03ffffff (size 0x00008000) stack

The result is confusing!
We got two stack regions:
 * the first region registered by common code (CONFIG_STACK_BASE=0x20000);
 * the second region registered by ARM-specific code.

-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2013-07-16  8:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16  8:30 antonynpavlov [this message]
2013-07-17  9:27 ` Sascha Hauer

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=20130716123012.3cea8ffd77234ce1edd94493@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /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