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

Fabio Estevam festevam at gmail.com
Thu Aug 2 14:55:34 CEST 2012


On 8/2/12, Michael Hornung <mhornung.linux at gmail.com> wrote:
> Hi Fabio,
>
>>>
>>> Have you had any progress on this?
>>
>
> I had some progress on my issue, here a summary of what I did:
>
> - I configured a SD-Card as described in doc/README.imximage
> - I did the following changes to the U-Boot sources:
>
> +++ b/board/freescale/mx35pdk/imximage.cfg
>
> +BOOT_FROM      sd
>
> +#WEIM config-CS5 init
> +DATA 4 0xB8002050 0x0000d843
> +DATA 4 0xB8002054 0x22252521
> +DATA 4 0xB8002058 0x22220a00
> +
> +# DDR2 init
> +DATA 4 0xB8001010 0x00000304
> +DATA 4 0xB8001010 0x0000030C
> +DATA 4 0xB8001004 0x007ffc3f
> +DATA 4 0xB8001000 0x92220000
> +DATA 4 0x80000400 0x12345678
> +DATA 4 0xB8001000 0xA2220000
> +DATA 4 0x80000000 0x87654321
> +DATA 4 0x80000000 0x87654321
> +DATA 4 0xB8001000 0xB2220000
> +DATA 1 0x80000233 0xda
> +DATA 1 0x82000780 0xda
> +DATA 1 0x82000400 0xda
> +DATA 4 0xB8001000 0x82226080
> +DATA 4 0xB8001004 0x007ffc3f
> +DATA 4 0xB800100C 0x007ffc3f
> +DATA 4 0xB8001010 0x00000304
> +DATA 4 0xB8001008 0x00002000
>
> +++ b/boards.cfg
>
> -mx35pdk                 arm         arm1136     -
> freescale          mx35
> +mx35pdk                arm         arm1136     -
> freescale          mx35
> mx35pdk:IMX_CONFIG=board/freescale/mx35pdk/imximage.cfg
>
> +++ b/include/configs/mx35pdk.h
>
> -#define CONFIG_SYS_TEXT_BASE   0xA0000000
> +#define CONFIG_SYS_TEXT_BASE   0x87800000
>
> +++ b/config.mk
>
> -DBGFLAGS= -g # -DDEBUG
> +DBGFLAGS= -g -DDEBUG
>

Didn't you also had to remove the init_sdram call in lowlevel_init.S ?


> This ended up as described earlier, with an U-Boot promp stoppping
> with the following output:
>
>> CPU:   Freescale i.MX35 rev 2.1 at 532 MHz.
>> Reset cause: POR
>> I2C:   ready
>
>
> Then I did the following change:
>
> +++ b/board/freescale/mx35pdk/mx35pdk.c
>
>         size1 = get_ram_size((void *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
> -       size2 = get_ram_size((void *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
> +        size2 = 0;
> +       /*size2 = get_ram_size((void *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);*/

I think we should not touch this.

>
>         gd->ram_size = size1 + size2;
>
>
> And here the result:
>
> U-Boot 2012.07-00024-g181e4a3 (Aug 02 2012 - 09:49:35)
>
> U-Boot code: 87800000 -> 8783ACC8  BSS: -> 87841704
> CPU:   Freescale i.MX35 rev 2.1 at 532 MHz.
> Reset cause: POR
> I2C:   ready
> monitor len: 00041704
> ramsize: 08000000
> TLB table at: 87ff0000
> Top of RAM usable for U-Boot at: 87ff0000
> Reserving 261k for U-Boot at: 87fae000
> Reserving 1280k for malloc() at: 87e6e000
> Reserving 40 Bytes for Board Info at: 87e6dfd8
> Reserving 120 Bytes for Global Data at: 87e6df60
> New Stack Pointer is: 87e6df50
> RAM Configuration:
> Bank #0: 80000000 128 MiB
> Bank #1: 90000000 128 MiB
> relocation Offset is: 007ae000
> dram_bank_mmu_setup: bank: 0
> dram_bank_mmu_setup: bank: 1
> monitor flash len: 00041508
> Now running in RAM - U-Boot at: 87fae000
> Flash: flash detect cfi
> fwc addr a0000000 cmd f0 f0 8bit x 8 bit
> fwc addr a0000000 cmd ff ff 8bit x 8 bit
> fwc addr a0000055 cmd 98 98 8bit x 8 bit
> is= cmd 51(Q) addr a0000010 is= 14 51
> fwc addr a0000555 cmd 98 98 8bit x 8 bit
> is= cmd 51(Q) addr a0000010 is= 14 51
> fwc addr a0000000 cmd f0 f0f0 16bit x 8 bit
> fwc addr a0000000 cmd ff ffff 16bit x 8 bit
> fwc addr a00000aa cmd 98 9898 16bit x 8 bit
> is= cmd 51(Q) addr a0000020 is= 0051 5151
> fwc addr a0000aaa cmd 98 9898 16bit x 8 bit
> is= cmd 51(Q) addr a0000020 is= 0051 5151
> fwc addr a0000000 cmd f0 00f0 16bit x 16 bit
> fwc addr a0000000 cmd ff 00ff 16bit x 16 bit
> fwc addr a00000aa cmd 98 0098 16bit x 16 bit
> is= cmd 51(Q) addr a0000020 is= 0051 0051
> is= cmd 52(R) addr a0000022 is= 0052 0052
> is= cmd 59(Y) addr a0000024 is= 0059 0059
> device interface is 2
> found port 2 chip 2 port 16 bits chip 16 bits
> 00 : 51 52 59 02 00 40 00 00 00 00 00 27 36 00 00 06  QRY.. at .....'6...
> 10 : 06 09 13 03 05 03 02 1a 02 00 06 00 01 ff 01 00  ................
> 20 : 02 00 00 00 00 00 00 00 00 00 00 00 00 8b fb 87  ................
> fwc addr a0000000 cmd f0 00f0 16bit x 16 bit
> fwc addr a0000aaa cmd aa 00aa 16bit x 16 bit
> fwc addr a0000554 cmd 55 0055 16bit x 16 bit
> fwc addr a0000aaa cmd 90 0090 16bit x 16 bit
> fwc addr a0000000 cmd f0 00f0 16bit x 16 bit
> fwc addr a00000aa cmd 98 0098 16bit x 16 bit
> manufacturer is 2
> manufacturer id is 0x1
> device id is 0x227e
> device id2 is 0x2301
> cfi version is 0x3133
> size_ratio 1 port 16 bits chip 16 bits
> found 1 erase regions
> erase region 0: 0x020001ff
> erase_region_count = 512 erase_region_size = 131072
> fwc addr a0000000 cmd f0 00f0 16bit x 16 bit
> flash_protect ON: from 0xA0000000 to 0xA0041507
> fwc addr a0000000 cmd 70 0070 16bit x 16 bit
> flash_is_busy: 0
> protect on 0
> fwc addr a0020000 cmd 70 0070 16bit x 16 bit
> flash_is_busy: 0
> protect on 1
> fwc addr a0040000 cmd 70 0070 16bit x 16 bit
> flash_is_busy: 0
> protect on 2
> flash_protect ON: from 0xA0080000 to 0xA009FFFF
> fwc addr a0080000 cmd 70 0070 16bit x 16 bit
> flash_is_busy: 0
> protect on 4
> flash_protect ON: from 0xA00A0000 to 0xA00BFFFF
> fwc addr a00a0000 cmd 70 0070 16bit x 16 bit
> flash_is_busy: 0
> protect on 5
> 64 MiB
> NAND:  4096 MiB
> Destroy Hash Table: 87fe94c4 table = (null)
> Create Hash Table: N=512
> INSERT: table 87fe94c4, filled 1/521 rv 87e90f44 ==> name="addip"
> value="if test -n ${ipdyn};then run addip_dyn;else run addip_sta;fi"
> INSERT: table 87fe94c4, filled 2/521 rv 87e90a34 ==> name="addip_dyn"
> value="setenv bootargs ${bootargs} ip=dhcp"
> INSERT: table 87fe94c4, filled 3/521 rv 87e91028 ==> name="addip_sta"
> value="setenv bootargs ${bootargs}
> ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off
> panic=1"
> INSERT: table 87fe94c4, filled 4/521 rv 87e90a70 ==> name="addmisc"
> value="setenv bootargs ${bootargs} ${misc}"
> INSERT: table 87fe94c4, filled 5/521 rv 87e91898 ==> name="addmtd"
> value="setenv bootargs ${bootargs} ${mtdparts}"
> INSERT: table 87fe94c4, filled 6/521 rv 87e91ad8 ==> name="addtty"
> value="setenv bootargs ${bootargs} console=ttymxc0,${baudrate}"
> INSERT: table 87fe94c4, filled 7/521 rv 87e90e60 ==> name="baudrate"
> value="115200"
> INSERT: table 87fe94c4, filled 8/521 rv 87e91eec ==>
> name="bootargs_nfs" value="setenv bootargs console=ttymxc0,${baudrate}
> root=/dev/nfs ip=${ipaddr} rw nfsroot=${serverip}:${rootpath}"
> INSERT: table 87fe94c4, filled 9/521 rv 87e910dc ==> name="bootcmd"
> value="run net_nfs"
> INSERT: table 87fe94c4, filled 10/521 rv 87e915e0 ==> name="bootdelay"
> value="3"
> INSERT: table 87fe94c4, filled 11/521 rv 87e912bc ==> name="bootfile"
> value="/3stack/uImage"
> INSERT: table 87fe94c4, filled 12/521 rv 87e91058 ==> name="ethact"
> value="smc911x-0"
> INSERT: table 87fe94c4, filled 13/521 rv 87e90cec ==> name="ethaddr"
> value="00:04:9f:01:2f:9a"
> INSERT: table 87fe94c4, filled 14/521 rv 87e90b24 ==> name="ethprime"
> value="smc911x"
> INSERT: table 87fe94c4, filled 15/521 rv 87e909d4 ==> name="flash_nfs"
> value="run bootargs_nfs; nand read ${loadaddr} 0x300000 0x200000;
> bootm"
> INSERT: table 87fe94c4, filled 16/521 rv 87e9173c ==>
> name="flash_self" value="run ramargs addip addtty addmtd addmisc;bootm
> ${kernel_addr} ${ramdisk_addr}"
> INSERT: table 87fe94c4, filled 17/521 rv 87e91928 ==> name="hostname"
> value=""mx35pdk""
> INSERT: table 87fe94c4, filled 18/521 rv 87e91e68 ==> name="ipaddr"
> value="192.168.1.10"
> INSERT: table 87fe94c4, filled 19/521 rv 87e91118 ==>
> name="kernel_addr_r" value="80800000"
> INSERT: table 87fe94c4, filled 20/521 rv 87e915d4 ==> name="load"
> value="tftp ${loadaddr} ${u-boot}"
> INSERT: table 87fe94c4, filled 21/521 rv 87e914fc ==> name="loadaddr"
> value="0x80800000"
> INSERT: table 87fe94c4, filled 22/521 rv 87e90854 ==> name="net_nfs"
> value="tftp ${load_addr} ${bootfile}; run bootargs_nfs; bootm
> ${load_addr}"
> INSERT: table 87fe94c4, filled 23/521 rv 87e913d0 ==>
> name="net_self_load" value="tftp ${kernel_addr_r} ${bootfile};tftp
> ${ramdisk_addr_r} ${ramdisk_file};"
> INSERT: table 87fe94c4, filled 24/521 rv 87e91f34 ==> name="netdev"
> value="eth0"
> INSERT: table 87fe94c4, filled 25/521 rv 87e90950 ==> name="nfsargs"
> value="setenv bootargs root=/dev/nfs rw
> nfsroot=${serverip}:${rootpath}"
> INSERT: table 87fe94c4, filled 26/521 rv 87e90704 ==> name="ramargs"
> value="setenv bootargs root=/dev/ram rw"
> INSERT: table 87fe94c4, filled 27/521 rv 87e918f8 ==>
> name="ramdisk_file" value=""mx35pdk"/uRamdisk"
> INSERT: table 87fe94c4, filled 28/521 rv 87e91664 ==> name="rootpath"
> value="/opt/eldk-5.2.1/armv6/rootfs-qte-sdk"
> INSERT: table 87fe94c4, filled 29/521 rv 87e90fa4 ==> name="serverip"
> value="192.168.1.1"
> INSERT: table 87fe94c4, filled 30/521 rv 87e91340 ==> name="stderr"
> value="serial"
> INSERT: table 87fe94c4, filled 31/521 rv 87e90e00 ==> name="stdin"
> value="serial"
> INSERT: table 87fe94c4, filled 32/521 rv 87e91850 ==> name="stdout"
> value="serial"
> INSERT: table 87fe94c4, filled 33/521 rv 87e91af0 ==> name="u-boot"
> value=""mx35pdk"/u-boot.bin"
> INSERT: table 87fe94c4, filled 34/521 rv 87e91ef8 ==>
> name="uboot_addr" value="0xa0000000"
> INSERT: table 87fe94c4, filled 35/521 rv 87e91040 ==> name="upd"
> value="if run load;then echo Updating u-boot;if run update;then echo
> U-Boot updated;else echo Error updating u-boot !;echo Board without
> bootloader !!;fi;else echo U-Boot not downloaded..exiting;fi"
> INSERT: table 87fe94c4, filled 36/521 rv 87e910f4 ==> name="update"
> value="protect off ${uboot_addr} +40000;erase ${uboot_addr}
> +40000;cp.b ${loadaddr} ${uboot_addr} ${filesize}"
> INSERT: free(data = 87e706d0)
> INSERT: done
> In:    serial
> Out:   serial
> Err:   serial
> Board: MX35 PDK 2.0
> Net:   eth_init: fec_probe(bd)
> fec_mii_setspeed: mii_speed 0000001a
> smc911x-0, FEC
> ### main_loop entered: bootdelay=3
>
> ### main_loop: bootcmd="run net_nfs"
> Hit any key to stop autoboot:  0
> MX35 U-Boot >
>
>
> U-Boot is running now (any idea why?), but unfortunately it does not
> run the kernel:
>
>
> MX35 U-Boot > run  net_nfs
> Trying smc911x-0
> smc911x: detected LAN9217 controller
> smc911x: phy initialized
> smc911x: MAC 00:04:9f:01:2f:9a
> TFTP blocksize = 1468, timeout = 5000 ms
> Using smc911x-0 device
> TFTP from server 192.168.1.1; our IP address is 192.168.1.10
> Filename '/3stack/uImage'.
> Load address: 0x80800000
> Loading: send option "timeout 5"
> Got OACK: timeout 5
> Blocksize ack: 1468, 1468
> #################################################################
>          #################################################################
>          #########
> done
> Bytes transferred = 2036440 (1f12d8 hex)
> CACHE: Misaligned operation at range [80800000, 809f12d8]
> ## Current stack ends at 0x87e6dbf8 *  kernel: default image load
> address = 0x80800000
> ## Booting kernel from Legacy Image at 80800000 ...
>    Image Name:   Linux-2.6.31-00203-g63769bf
>    Created:      2012-05-15  10:06:22 UTC
>    Image Type:   ARM Linux Kernel Image (uncompressed)
>    Data Size:    2036376 Bytes = 1.9 MiB
>    Load Address: 80008000
>    Entry Point:  80008000
>    Verifying Checksum ... OK
>    kernel data at 0x80800040, len = 0x001f1298 (2036376)
> ## No init Ramdisk
>    ramdisk start = 0x00000000, ramdisk end = 0x00000000
>    Loading Kernel Image ... OK
> OK
>    kernel loaded at 0x80008000, end = 0x801f9298
> using: ATAGS
> ## Transferring control to Linux (at address 80008000)...
>
> Starting kernel ...
>
> Uncompressing
> Linux......................................................................................................................................
> done, booting the kernel.
>
> And that's it, no more kernel output.
>
> Here my environment
>
> addip=if test -n ${ipdyn};then run addip_dyn;else run addip_sta;fi
> addip_dyn=setenv bootargs ${bootargs} ip=dhcp
> addip_sta=setenv bootargs ${bootargs}
> ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off
> panic=1
> addmisc=setenv bootargs ${bootargs} ${misc}
> addmtd=setenv bootargs ${bootargs} ${mtdparts}
> addtty=setenv bootargs ${bootargs} console=ttymxc0,${baudrate}
> baudrate=115200
> bootargs_nfs=setenv bootargs console=ttymxc0,${baudrate} root=/dev/nfs
> ip=${ipaddr} rw nfsroot=${serverip}:${rootpath}
> bootcmd=run net_nfs
> bootdelay=3
> bootfile=/3stack/uImage
> ethact=smc911x-0
> ethaddr=00:04:9f:01:2f:9a
> ethprime=smc911x
> flash_nfs=run bootargs_nfs; nand read ${loadaddr} 0x300000 0x200000; bootm
> flash_self=run ramargs addip addtty addmtd addmisc;bootm
> ${kernel_addr} ${ramdisk_addr}
> hostname="mx35pdk"
> ipaddr=192.168.1.10
> kernel_addr_r=80800000
> load=tftp ${loadaddr} ${u-boot}
> loadaddr=0x80800000
> net_nfs=tftp ${load_addr} ${bootfile}; run bootargs_nfs; bootm ${load_addr}
> net_self_load=tftp ${kernel_addr_r} ${bootfile};tftp ${ramdisk_addr_r}
> ${ramdisk_file};
> netdev=eth0
> nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
> ramargs=setenv bootargs root=/dev/ram rw
> ramdisk_file="mx35pdk"/uRamdisk
> rootpath=/opt/eldk-5.2.1/armv6/rootfs-qte-sdk
> serverip=192.168.1.1
> stderr=serial
> stdin=serial
> stdout=serial
> u-boot="mx35pdk"/u-boot.bin
> uboot_addr=0xa0000000
> upd=if run load;then echo Updating u-boot;if run update;then echo
> U-Boot updated;else echo Error updating u-boot !;echo Board without
> bootloader !!;fi;else echo U-Boot not downloaded..exiting;fi
> update=protect off ${uboot_addr} +40000;erase ${uboot_addr}
> +40000;cp.b ${loadaddr} ${uboot_addr} ${filesize}
>
>
> Doing changes to the environment is not possible, the command
> "saveenv" ends up with an endless loop of the following message:
>
> MX35 U-Boot > saveenv
> Saving Environment to Flash...
> Protect off A00A0000 ... A00BFFFF
> Un-Protecting sectors 5..5 in bank 1
> fwc addr a00a0000 cmd 70 0070 16bit x 16 bit
> flash_is_busy: 0
> . done
> Un-Protected 1 sectors
> Protect off A0080000 ... A009FFFF
> Un-Protecting sectors 4..4 in bank 1
> fwc addr a0080000 cmd 70 0070 16bit x 16 bit
> flash_is_busy: 0
> . done
> Un-Protected 1 sectors
> EXPORT  table = 87fe94c4, htab.size = 521, htab.filled = 36, size = 131067
> Unsorted: n=36
>           0: 87e90704 ==> ramargs    => setenv bootargs root=/dev/ram rw
>           1: 87e90854 ==> net_nfs    => tftp ${load_addr} ${bootfile};
> run bootargs_nfs; bootm ${load_addr}
>           2: 87e90950 ==> nfsargs    => setenv bootargs root=/dev/nfs
> rw nfsroot=${serverip}:${rootpath}
>           3: 87e909d4 ==> flash_nfs  => run bootargs_nfs; nand read
> ${loadaddr} 0x300000 0x200000; bootm
>           4: 87e90a34 ==> addip_dyn  => setenv bootargs ${bootargs} ip=dhcp
>           5: 87e90a70 ==> addmisc    => setenv bootargs ${bootargs} ${misc}
>           6: 87e90b24 ==> ethprime   => smc911x
>           7: 87e90cec ==> ethaddr    => 00:04:9f:01:2f:9a
>           8: 87e90e00 ==> stdin      => serial
>           9: 87e90e60 ==> baudrate   => 115200
>          10: 87e90f44 ==> addip      => if test -n ${ipdyn};then run
> addip_dyn;else run addip_sta;fi
>          11: 87e90fa4 ==> serverip   => 192.168.1.1
>          12: 87e91028 ==> addip_sta  => setenv bootargs ${bootargs}
> ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off
> panic=1
>          13: 87e91040 ==> upd        => if run load;then echo Updating
> u-boot;if run update;then echo U-Boot updated;else echo Error updating
> u-boot !;echo Board without bootloader !!;fi;else echo U-Boot not
> downloaded..exiting;fi
>          14: 87e91058 ==> ethact     => smc911x-0
>          15: 87e910dc ==> bootcmd    => run net_nfs
>          16: 87e910f4 ==> update     => protect off ${uboot_addr}
> +40000;erase ${uboot_addr} +40000;cp.b ${loadaddr} ${uboot_addr}
> ${filesize}
>          17: 87e91118 ==> kernel_addr_r => 80800000
>          18: 87e912bc ==> bootfile   => /3stack/uImage
>          19: 87e91340 ==> stderr     => serial
>          20: 87e913d0 ==> net_self_load => tftp ${kernel_addr_r}
> ${bootfile};tftp ${ramdisk_addr_r} ${ramdisk_file};
>          21: 87e914fc ==> loadaddr   => 0x80800000
>          22: 87e915d4 ==> load       => tftp ${loadaddr} ${u-boot}
>          23: 87e915e0 ==> bootdelay  => 3
>          24: 87e91664 ==> rootpath   =>
> /opt/eldk-5.2.1/armv6/rootfs-qte-sdk
>          25: 87e9173c ==> flash_self => run ramargs addip addtty
> addmtd addmisc;bootm ${kernel_addr} ${ramdisk_addr}
>          26: 87e91850 ==> stdout     => serial
>          27: 87e91898 ==> addmtd     => setenv bootargs ${bootargs}
> ${mtdparts}
>          28: 87e918f8 ==> ramdisk_file => "mx35pdk"/uRamdisk
>          29: 87e91928 ==> hostname   => "mx35pdk"
>          30: 87e91ad8 ==> addtty     => setenv bootargs ${bootargs}
> console=ttymxc0,${baudrate}
>          31: 87e91af0 ==> u-boot     => "mx35pdk"/u-boot.bin
>          32: 87e91e68 ==> ipaddr     => 192.168.1.10
>          33: 87e91eec ==> bootargs_nfs => setenv bootargs
> console=ttymxc0,${baudrate} root=/dev/nfs ip=${ipaddr} rw
> nfsroot=${serverip}:${rootpath}
>          34: 87e91ef8 ==> uboot_addr => 0xa0000000
>          35: 87e91f34 ==> netdev     => eth0
> Erasing Flash... A0080000 ... A009FFFF ...Erase Flash from 0xa0080000
> to 0xa009ffff in Bank # 1
> fwc addr a0080aaa cmd aa 00aa 16bit x 16 bit
> fwc addr a0080554 cmd 55 0055 16bit x 16 bit
> fwc addr a0080aaa cmd 80 0080 16bit x 16 bit
> fwc addr a0080aaa cmd aa 00aa 16bit x 16 bit
> fwc addr a0080554 cmd 55 0055 16bit x 16 bit
> fwc addr a0080000 cmd 30 0030 16bit x 16 bit
> flash_is_busy: 1
> flash_is_busy: 1
> flash_is_busy: 1
> ...
>
> Could you please give me some hits what to do next?

Can you please try to remove  #define CONFIG_ENV_IS_IN_FLASH and insert:

#define CONFIG_SYS_NO_FLASH

#define CONFIG_ENV_OFFSET      (6 * 64 * 1024)
#define CONFIG_ENV_SIZE        (8 * 1024)
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV

Cced Stefano in case he has any suggestions.

Regards,

Fabio Estevam


More information about the U-Boot mailing list