All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Use common function to set GPIOs for MX3 and MX5
Date: Mon, 23 Aug 2010 12:28:33 +0200	[thread overview]
Message-ID: <4C724D51.2000105@denx.de> (raw)
In-Reply-To: <201008231050.53956.david.jander@protonic.nl>

David Jander wrote:
> Hi again,
> 
Hi David,

> Are you sure? In arch/arm/lib/board.c function start_armboot(), init_sequence 
> is processed first, which contains env_init() before dram_init() and just 
> after completing init_sequence, mem_malloc_init() is called. How can you have 
> working malloc then?

Well, I tried to investigate to see if I get the same issue, env_init is
called before mem_malloc_init, but it does nothing (in env_sf.c):


int env_init(void)
{
        /* SPI flash isn't usable before relocation */
        gd->env_addr = (ulong)&default_environment[0];
        gd->env_valid = 1;

        return 0;
}

And really I can see that mem_malloc_init() is called before
spi_setup_slave(). I guess there is a different configuration on our
targets, that makes the difference, but I do not know which one.

> I don't know if that is possible. I know that physically RAM is initialized 
> before u-boot even starts (it runs from RAM), but logically, dram_init() is 
> called _after_ env_init(), so I'm not sure if you are supposed to call 
> mem_malloc_init() in env_init()...

Yes, but as I see env_init does not read from flash and does not call
spi_setup_flash(). This is done by env_relocate_spec(), but this
function is called later.

> I am slowly progressing... now the transfer succeeds, but I only read FF ;-)

I think I have a good status now. I can correctly read/write the whole
flash. I have still an issue with saveenv (the first time does not work,
and it works after I called "sf probe"...crazy, but probably depends on
my target, I am investigating), but I should find a fix for that too.

> A good point. I was following the premise that u-boot drivers should be 
> simple, but a little bit of speed for booting is surely not a bad idea ;-)

Even using the whole FIFO I need about 8 Seconds to read the whole Flash
(4 MB). In normal case, this means I need 3 Seconds for a kernel.

> I am just now picking up where I left last week, so give me a few hours and I  
> should have something working, I guess.

Ok. We can make a point later. As I said, things are not so bad on my
target.

> I always say: "Electronics work on smoke. If the smoke escapes, it stops 
> working" :-)

;-)))

Best regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  parent reply	other threads:[~2010-08-23 10:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-20  8:20 [U-Boot] [PATCH] Use common function to set GPIOs for MX3 and MX5 Stefano Babic
2010-08-20  8:46 ` David Jander
2010-08-20  9:29 ` David Jander
2010-08-20 10:01   ` Stefano Babic
2010-08-20 10:07     ` David Jander
2010-08-20 10:20       ` Stefano Babic
2010-08-20 10:30         ` David Jander
2010-08-20 11:19           ` Stefano Babic
2010-08-20 12:15             ` David Jander
2010-08-20 13:35               ` Stefano Babic
2010-08-23  8:50                 ` David Jander
2010-08-23  9:14                   ` David Jander
2010-08-23 10:37                     ` Stefano Babic
2010-08-23 11:30                       ` David Jander
2010-08-23 15:55                         ` Stefano Babic
2010-08-23 17:18                           ` Stefan Roese
2010-08-23 21:03                             ` Detlev Zundel
2010-08-23 21:53                               ` Mike Frysinger
2010-08-26  9:09                                 ` Detlev Zundel
2010-08-23 10:28                   ` Stefano Babic [this message]
2010-08-20 10:55 ` [U-Boot] [PATCH V2] " Stefano Babic

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=4C724D51.2000105@denx.de \
    --to=sbabic@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 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.