[U-Boot] [PATCH] Use common function to set GPIOs for MX3 and MX5

Stefano Babic sbabic at denx.de
Mon Aug 23 12:28:33 CEST 2010


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
=====================================================================


More information about the U-Boot mailing list