[U-Boot] i.MX35PDK: Starting U-Boot from serial NOR-Flash

Hornung, Michael mhornung at init-ka.de
Tue Jul 10 21:08:33 CEST 2012


On Mon, Jul 9, 2012 at 9:45 PM, Fabio Estevam <festevam at gmail.com> wrote:
> Hi Michael,

Hi Fabio,

>
> On Mon, Jul 9, 2012 at 9:57 AM, Hornung, Michael <mhornung at init-ka.de> wrote:
>
>> +++ b/board/freescale/mx35pdk/imximage.cfg
>>
>> +BOOT_FROM      spi
>
> Please see the Freescale U-boot, you missed the initialization of the CS5:
>
>   //WEIM config-CS5 init
>   DCDGEN(1, 4, 0xB8002050, 0x0000d843)
>   DCDGEN(1_1, 4, 0xB8002054, 0x22252521)
>   DCDGEN(1_2, 4, 0xB8002058, 0x22220a00)
>
> ...

>
> Most likely it is because it will try to access the network, but you
> missed to setup the CS5 as per the Freescale U-boot init sequence.

Sorry for that, I really missed it. So here what I did:

+++ b/board/freescale/mx35pdk/imximage.cfg

+#WEIM config-CS5 init
+DATA 4 0xB8002050 0x0000d843
+DATA 4 0xB8002054 0x22252521
+DATA 4 0xB8002058 0x22220a00
+
 # DDR2 init


+++ b/config.mk
 RELFLAGS= $(PLATFORM_RELFLAGS)
-DBGFLAGS= -g # -DDEBUG
+DBGFLAGS= -g -DDEBUG


+++ b/board/freescale/mx35pdk/imximage.cfg
 # spi, sd (the board has no nand neither onenand)

-BOOT_FROM      spi
+BOOT_FROM      sd


According to your advise I burned the image to a SD card and changed
BT_MEM_TYPE[1:0] to 00 (SD, MMC, eMMC, or eSD). You are so right, flashing
a SD card is a lot easier.


Then compiled a debugging version of U-Boot:

tools/mkimage -n  "board/freescale/mx35pdk/imximage.cfg" -T imximage \
                -e 0x87800000 -d u-boot.bin u-boot.imx
Image Type:   Freescale IMX Boot Image
Image Ver:    1 (i.MX25/35/51 compatible)
Data Size:    273724 Bytes = 267.31 kB = 0.26 MB
Load Address: 877ff800
Entry Point:  87800000


and here is the visible ouput to the serial line:

U-Boot 2012.04.01-00081-gc831844 (Jul 10 2012 - 17:45:27)

U-Boot code: 87800000 -> 8783B87C  BSS: -> 878422BC
CPU:   Freescale i.MX35 rev 2.1 at 532 MHz.
Reset cause: POR
I2C:   ready


After some trial and error I came up with the follwing:

+++ b/arch/arm/lib/board.c
 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
        init_func_i2c,
 #endif
-       dram_init,              /* configure available RAM banks */
+       //dram_init,            /* configure available RAM banks */
        NULL,
 };

@@ -426,8 +426,8 @@ void board_init_f(ulong bootflag)

        gd->bd->bi_baudrate = gd->baudrate;
        /* Ram ist board specific, so move it to board code ... */
-       dram_init_banksize();
-       display_dram_config();  /* and display it */
+       //dram_init_banksize();
+       //display_dram_config();        /* and display it */

        gd->relocaddr = addr;
        gd->start_addr_sp = addr_sp;



After those changes, U-Boot is going a little further:


U-Boot 2012.04.01-00080-gd0921d3-dirty (Jul 10 2012 - 11:31:37)

U-Boot code: 87800000 -> 8783B87C  BSS: -> 878422BC
CPU:   Freescale i.MX35 rev 2.1 at 532 MHz.
Reset cause: RST
I2C:   ready
monitor len: 000422BC
ramsize: 00000000
TLB table at: 7fff0000
Top of RAM usable for U-Boot at: 7fff0000
Reserving 264k for U-Boot at: 7ffad000
Reserving 1280k for malloc() at: 7fe6d000
Reserving 44 Bytes for Board Info at: 7fe6cfd4
Reserving 120 Bytes for Global Data at: 7fe6cf5c
New Stack Pointer is: 7fe6cf50
RAM Configuration:
Bank #0: 00000000 0 Bytes
Bank #1: 00000000 0 Bytes
relocation Offset is: f87ad000


The last (with my very limited knowledge) traceable function call is
"relocate_code(addr_sp, id, addr);" from within "arch/arm/lib/board.c".


Maybe you have another idea what to do next?

By the way: Do you use a BDI3000 for debugging and if so, could you please
send your board configuration file (.cfg) and your register definitions (.def).

>
> Regards,
>
> Fabio Estevam
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



Thank you very much for your help!

With best regards


Michael Hornung


More information about the U-Boot mailing list