public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 4/6] arm: spl: Allow board_init_r() to run with a larger stack
Date: Wed, 4 Mar 2015 10:42:26 -0500	[thread overview]
Message-ID: <20150304154226.GS25373@bill-the-cat> (raw)
In-Reply-To: <1425394982-16196-5-git-send-email-sjg@chromium.org>

On Tue, Mar 03, 2015 at 08:03:00AM -0700, Simon Glass wrote:

> At present SPL uses a single stack, either CONFIG_SPL_STACK or
> CONFIG_SYS_INIT_SP_ADDR. Since some SPL features (such as MMC and
> environment) require a lot of stack, some boards set CONFIG_SPL_STACK to
> point into SDRAM. They then set up SDRAM very early, before board_init_f(),
> so that the larger stack can be used.
> 
> This is an abuse of lowlevel_init(). That function should only be used for
> essential start-up code which cannot be delayed. An example of a valid use is
> when only part of the SPL code is visible/executable, and the SoC must be set
> up so that board_init_f() can be reached. It should not be used for SDRAM
> init, console init, etc.
> 
> Add a CONFIG_SPL_STACK_R option, which allows the stack to be moved to a new
> address before board_init_r() is called in SPL.
> 
> The expected SPL flow (for CONFIG_SPL_FRAMEWORK) is documented in the README.
[snip]
> diff --git a/Kconfig b/Kconfig
> index 91a0618..8de731d 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -96,6 +96,24 @@ config SPL
>  	help
>  	  If you want to build SPL as well as the normal image, say Y.
>  
> +config CONFIG_SPL_STACK_R
> +	depends on SPL
> +	bool "Enable SDRAM location for SPL stack"
> +	help
> +	  SPL starts off execution in SRAM and thus typically has only a small
> +	  stack available. Since SPL sets up DRAM while in its board_init_f()
> +	  function, it is possible for the stack to move there before
> +	  board_init_r() is reached. This option enables a special SDRAM
> +	  location for the SPL stack. U-Boot SPL switches to this after
> +	  board_init_f() completes, and before board_init_r() starts.
> +
> +config CONFIG_SPL_STACK_R_ADDR
> +	depends on CONFIG_SPL_STACK_R

I found my problem!  Incorrect Kconfig syntax, no CONFIG_ in 'config' or
'depends' lines only help lines.  So I was right in that my stack wasn't
moving because I was doing it via the defconfig and that was broken :)

I'm just going to pick up 1-5 (with this fixed) and send out my own 6
after I test it on omap3 and omap4/5 which also need a similar
conversion.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150304/50169024/attachment.sig>

  parent reply	other threads:[~2015-03-04 15:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 15:02 [U-Boot] [PATCH v6 0/6] Clean out SPL and enable driver model Simon Glass
2015-03-03 15:02 ` [U-Boot] [PATCH v6 1/6] arm: Reduce the scope of lowlevel_init() Simon Glass
2015-03-04 22:16   ` Tom Rini
2015-03-03 15:02 ` [U-Boot] [PATCH v6 2/6] arm: spl: Avoid setting up a duplicate global data structure Simon Glass
2015-03-04 22:16   ` Tom Rini
2015-03-03 15:02 ` [U-Boot] [PATCH v6 3/6] dm: tegra: Enable driver model in SPL and adjust the GPIO driver Simon Glass
2015-03-04 22:16   ` Tom Rini
2015-03-08 21:00     ` Stephen Warren
2015-03-09 17:04       ` Simon Glass
2015-03-09 17:23         ` Stephen Warren
2015-03-10  1:15           ` Simon Glass
2015-03-03 15:03 ` [U-Boot] [PATCH v6 4/6] arm: spl: Allow board_init_r() to run with a larger stack Simon Glass
2015-03-03 17:49   ` Tom Rini
2015-03-03 19:04     ` Simon Glass
2015-03-03 20:14       ` Tom Rini
2015-03-04  3:23         ` Simon Glass
2015-03-04 13:38           ` Tom Rini
2015-03-04 15:10             ` Tom Rini
2015-03-04 15:42   ` Tom Rini [this message]
2015-03-04 19:14     ` Simon Glass
2015-03-04 22:16   ` Tom Rini
2015-03-03 15:03 ` [U-Boot] [PATCH v6 5/6] Make export interface support CONFIG_SYS_MALLOC_SIMPLE Simon Glass
2015-03-04 22:16   ` Tom Rini
2015-03-03 15:03 ` [U-Boot] [PATCH v6 6/6] ti: armv7: am33xx: Move SPL SDRAM into the correct place Simon Glass
2015-03-03 15:15   ` Tom Rini
2015-03-03 15:17     ` Simon Glass
2015-03-04 16:30   ` [U-Boot] [PATCH v7 6/6] ti: armv7: Move SPL SDRAM init to the right place, drop unused CONFIG_SPL_STACK Tom Rini
2015-03-04 19:07     ` Simon Glass
2015-03-04 22:16     ` Tom Rini

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=20150304154226.GS25373@bill-the-cat \
    --to=trini@konsulko.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