public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vignesh R <vigneshr@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] QSPI XIP boot on am437x
Date: Fri, 13 Nov 2015 11:22:19 +0530	[thread overview]
Message-ID: <56457A93.9030600@ti.com> (raw)
In-Reply-To: <20151111100335.5d303fe2@lilith>

Hi,

On 11/11/2015 02:33 PM, Albert ARIBAUD wrote:

[...]

> Alternatively, you could test the patch at
> 
> 	http://patchwork.ozlabs.org/patch/542558/
> 
> Let us know if this solves your issue. If it does, then it will confirm
> the issue is with arch_setup_gd not being able to set up your GD for
> some reason.
> 
> IMPORTANT: patch 542558 is *not* a final patch (there will be at least
> a v3), and may even never land in u-boot/master; but some equivalent will
> eventually do. Right now, patch 542558 is only a way to test if your
> issue is a GD one.
> 

The above patch affects the code that executes after s_init(), therefore
I don't think above patch matters (_main is run after s_init()).

As you said in your first reply "If s_init() runs before
board_init_f_mem(), then you must move it to
run after board_init_f_mem().", this is the problem with my case.
s_init() is running *before* setting up of global_data in
arch/arm/lib/crt0.S (in _main), hence IMO, calling serial_init() in
s_init() is wrong. This has to be moved to board_init_f() (in
arch/arm/cpu/armv7/am33xx/board.c).
The comment in arch/arm/cpu/armv7/lowlevel_init.S that calls s_init()
also says *not* to access global_data and not to try to start console.
Therefore, I intend to do something like this:

diff --git a/arch/arm/cpu/armv7/am33xx/board.c
b/arch/arm/cpu/armv7/am33xx/board.c
index bd14326cf479..351fc37b0483 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -256,6 +256,11 @@ void board_init_f(ulong dummy)
 {
        board_early_init_f();
        sdram_init();
+#if defined(CONFIG_NOR_BOOT) || defined(CONFIG_QSPI_BOOT)
+       gd->baudrate = CONFIG_BAUDRATE;
+       serial_init();
+       gd->have_console = 1;
+#endif
 }
 #endif /* end  CONFIG_SPL_BUILD */

@@ -273,12 +278,6 @@ void s_init(void)
        set_uart_mux_conf();
        setup_clocks_for_console();
        uart_soft_reset();
-#if defined(CONFIG_NOR_BOOT) || defined(CONFIG_QSPI_BOOT)
-       /* TODO: This does not work, gd is not available yet */
-       gd->baudrate = CONFIG_BAUDRATE;
-       serial_init();
-       gd->have_console = 1;
-#endif
 #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
        /* Enable RTC32K clock */
        rtc32k_enable();


Do you see any issues with above change?
-- 
Regards
Vignesh

  reply	other threads:[~2015-11-13  5:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10  8:59 [U-Boot] QSPI XIP boot on am437x Vignesh R
2015-11-10 12:14 ` Albert ARIBAUD
2015-11-11  6:12   ` R, Vignesh
2015-11-11  7:15     ` Albert ARIBAUD
2015-11-11  9:03       ` Albert ARIBAUD
2015-11-13  5:52         ` Vignesh R [this message]
2015-11-13  6:28           ` Albert ARIBAUD
2015-11-16 10:30             ` Vignesh R
2015-11-16 11:46               ` Albert ARIBAUD
2015-11-16 11:48                 ` Vignesh R

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=56457A93.9030600@ti.com \
    --to=vigneshr@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox