U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: Tony Dinh <mibodhi@gmail.com>, Michael Walle <michael@walle.cc>,
	sjg@chromium.org, u-boot@lists.denx.de
Subject: Re: Converting to DM SERIAL for Kirkwood boards
Date: Tue, 20 Dec 2022 09:07:53 +0100	[thread overview]
Message-ID: <20221220080753.5bchy5ygv7lyroo7@pali> (raw)
In-Reply-To: <4b5d5a78-714d-5260-339b-c34ddcb00b5d@denx.de>

On Tuesday 20 December 2022 07:20:15 Stefan Roese wrote:
> Hi Tony,
> 
> On 12/20/22 02:36, Tony Dinh wrote:
> > Hi Stefan,
> > 
> > On Mon, Dec 19, 2022 at 4:06 PM Tony Dinh <mibodhi@gmail.com> wrote:
> > > 
> > > Hi Stefan,
> > > 
> > > On Mon, Dec 19, 2022 at 1:22 PM Tony Dinh <mibodhi@gmail.com> wrote:
> > > > 
> > > > Hi Stefan,
> > > > 
> > > > On Sun, Dec 18, 2022 at 11:29 PM Stefan Roese <sr@denx.de> wrote:
> > > > > 
> > > > > Hi Tony,
> > > > > 
> > > > > On 12/19/22 07:17, Stefan Roese wrote:
> > > > > 
> > > > > <snip>
> > > > > 
> > > > > > > git checkout 37bb396669b27aa62fe8bc5eeb6bfde92e09c2d3
> > > > > > > Previous HEAD position was 3b44b3fdf2 arm: mvebu: Add support for
> > > > > > > programming LD0 and LD1 eFuse
> > > > > > > HEAD is now at 37bb396669 timer: orion-timer: Only init timer once
> > > > > > > 
> > > > > > > This is where the Pogo V4 was frozen during boot. Among the Kirkwood
> > > > > > > boards that I have and used for testing, it is the only one that has
> > > > > > > CONFIG_BOOTSTAGE=y.
> > > > > > 
> > > > > > Thanks for testing and git bi-secting.
> > > > > > 
> > > > > > > Should I create a new post for would like to continue this topic here
> > > > > > > in this thread?
> > > > > > 
> > > > > > Let me check, if I can find the root cause and this problem quickly. If
> > > > > > not, then we should probably disable CONFIG_BOOTSTAGE on the Pogo v4 for
> > > > > > a short while until we've fixed this issue.
> > > > > 
> > > > > I fail to spot the problem with this small commit 37bb396669b27a. I can
> > > > > also not reproduce this on my Armada XP board - it uses SPL though, this
> > > > > might make a difference.
> > > > > 
> > > > > Could you perhaps apply this attached debug patch and make sure, that
> > > > > you have DEBUG_UART enabled in your Pogo v4 config. And boot into the
> > > > > resulting image.
> > > > 
> > > > Here is the kwboot log with DEBUG_UART. Note that number 322322 below
> > > > is part of the log.
> > > > 
> > > > 322322
> > > > 
> > > > U-Boot 2023.01-rc3-00057-g9bd3d354a1-dirty (Dec 19 2022 - 01:29:21 -0800)
> > > > Pogoplug V4
> > > > 
> > > > SoC:   Kirkwood 88F6281_A1
> > > > Model: Cloud Engines PogoPlug Series 4
> > > > DRAM:  128 MiB
> > > > 322322322Core:  19 devices, 15 uclasses, devicetree: separate
> > > > NAND:  4
> > > > 
> > > 
> > > Going a bit further with your debug patch, I've added more prints.
> > > 
> > >   static void orion_timer_init(void *base, enum input_clock_type type)
> > >   {
> > >          /* Only init the timer once */
> > > -       if (early_init_done)
> > > +       if (early_init_done) {
> > > +               printch('6'); // test-only
> > >                  return;
> > > +       }
> > > 
> > > And the boot log below shows somehow the early_init_done is already
> > > true by the time the orion_timer_init is called. Pretty weird, to say
> > > the least!
> > > 
> > > --BEGIN LOG--
> > > 3262632626
> > > 
> > > U-Boot 2023.01-rc4-dirty (Dec 19 2022 - 15:35:26 -0800)
> > > Pogoplug V4
> > > 
> > > SoC:   Kirkwood 88F6281_A1
> > > Model: Cloud Engines PogoPlug Series 4
> > > DRAM:  128 MiB
> > > 326263262632626Core:  19 devices, 15 uclasses, devicetree: separate
> > > NAND:  456
> > > --END LOG--
> > > 
> > 
> > I tried this change in drivers/timer/orion-timer.c and it seems to
> > work consistently.
> > 
> > -static bool early_init_done __section(".data") = false;
> > +static bool early_init_done = false;
> > 
> > I still can't see why it would make a difference. Why does the
> > __section macro not work? does the reallocation timing have anything
> > to do with this variable being of the wrong value?
> 
> Hmmm, so we might have a problem with memory being overwritten? You
> should perhaps where the sections (especially data) are located and
> where the stack etc is located. I suggest to also enable DEBUG in
> board_f/c.c to see a bit more of the addresses being used.
> 
> Thanks,
> Stefan

Maybe similar issue as with mbus or atsha?
https://lore.kernel.org/u-boot/20220810124609.5765-1-pali@kernel.org/
https://lore.kernel.org/u-boot/20220408143015.23163-2-pali@kernel.org/

static variables do not work correctly _before_ u-boot relocation. You
should avoid usage global OR static variables in code which may be
called before relocation. And on some boards are all global, static and
bss variables read-only (those which use execute-in-place, e.g. ppc
flash).

  reply	other threads:[~2022-12-20  8:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJaLiFxnRPEPv83wasDBeuxzV2o39qF=hvSQvkft14irmH=L9A@mail.gmail.com>
2022-12-09  3:55 ` Converting to DM SERIAL for Kirkwood boards Tony Dinh
2022-12-09  6:56   ` Stefan Roese
2022-12-09 20:45     ` Tony Dinh
2022-12-12  9:03       ` Michael Walle
2022-12-13  1:18         ` Tony Dinh
2022-12-16  2:42           ` Tony Dinh
2022-12-16  6:29             ` Stefan Roese
2022-12-23  6:34               ` Tony Dinh
2022-12-16  7:56             ` Pali Rohár
2022-12-16 21:49               ` Tony Dinh
2022-12-19  0:17                 ` Tony Dinh
2022-12-19  6:17                   ` Stefan Roese
2022-12-19  7:29                     ` Stefan Roese
2022-12-19 21:22                       ` Tony Dinh
2022-12-20  0:06                         ` Tony Dinh
2022-12-20  1:36                           ` Tony Dinh
2022-12-20  6:20                             ` Stefan Roese
2022-12-20  8:07                               ` Pali Rohár [this message]
2022-12-21  9:29                                 ` Stefan Roese
2022-12-21 21:35                                   ` Tony Dinh
2022-12-20  6:10                         ` Stefan Roese

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=20221220080753.5bchy5ygv7lyroo7@pali \
    --to=pali@kernel.org \
    --cc=mibodhi@gmail.com \
    --cc=michael@walle.cc \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --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