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

Dear list,
I have an i.MX35PDK (mx35_3stack) with one U-Boot running within the NAND flash and one U-Boot running within the parallel NOR flash.
I am now trying to get another one running in a serial NOR flash (S25FL064K) I soldered to the CSPI1 lines with CSPI1_SS1 as chip select line.
Then I changed the bootstrap switches as follows:
BOOT_MODE[1:0]: 00 Internal boot BT_MEM_CTL[1:0]: 11 Expansion device (... , serial ROM) BT_BUS_WIDTH: 1 3-byte address SPI device (serial Flash) BT_MEM_TYPE[1:0] 11 Serial ROM via SPI
According to my oscilloscope (SPI decoder included), the hardware setup behaves as it should do. The processor clocks, it activates the SS1 line, it sends read commands (0x03) following an address and the serial flash sends answers with bytes matching the u-boot.bin file.
I tried the following to build the u-boot binary:
1. $ make mx35pdk Then I burned u-boot.bin to the serial flash starting at address 0x00
2. See 1. but burning the u-boot.bin file to the serial flash starting at address 0x400 (doc/README.imximage)
3. $ make mx35pdk $ cp board/freescale/mx51evk/imximage.cfg board/freescale/mx35pdk/ $ ./tools/mkimage -n ./board/freescale/mx35pdk/imximage.cfg -T imximage -e 0xA0000000 -d u-boot.bin u-boot.imx Then I burned u-boot.imx to the serial flash starting at address 0x00
4. See 3. but burning the u-boot.imx file to the serial flash starting at address 0x400 (doc/README.imximage)
As you might guess, none of the above attempts works. I get no serial output from U-Boot.
Has anyone a short description how to compile U-Boot in order to run from serial NOR flash?
Thank you very much in advance.
With best regards
Michael Hornung

Hi Michael,
On Wed, Jul 4, 2012 at 10:29 AM, Hornung, Michael mhornung@init-ka.de wrote:
$ make mx35pdk $ cp board/freescale/mx51evk/imximage.cfg board/freescale/mx35pdk/
This is not correct. You can not use the DDR settings from mx51evk directly into mx35pdk.
You would need to create a imximage.cfg for mx35pdk.
Take a look at Freescale U-boot as a reference: http://opensource.freescale.com/git?p=imx/uboot-imx.git;a=blob;f=board/frees...
With these values you can create a correct imximage.cfg file for mx35pdk.
Currently mx35pdk does not support internal boot mode and that is the reason you don't find a imximage currently.
So my suggestion for you is to try to boot from internal boot mode first. Try booting from SD card first as this would be easier.
Once you managed to boot from SD card, you will be also able to boot it from SPI NOR.
Regards,
Fabio Estevam

On Wed, Jul 4, 2012 at 2:31 PM, Fabio Estevam festevam@gmail.com wrote:
Take a look at Freescale U-boot as a reference: http://opensource.freescale.com/git?p=imx/uboot-imx.git;a=blob;f=board/frees...
Just to clarify: this file has the RAM settings for two versions of the board. Earlier mx35pdk came with mDDR and the more recent boards have DDR2. Most likely your mx35pdk has DDR2 populated, do the values you need to use are:
//DDR2 init DCDGEN(2, 4, 0xB8001010, 0x00000304) DCDGEN(3, 4, 0xB8001010, 0x0000030C) DCDGEN(4, 4, 0xB8001004, 0x007ffc3f) DCDGEN(5, 4, 0xB8001000, 0x92220000) DCDGEN(6, 4, 0x80000400, 0x12345678) DCDGEN(7, 4, 0xB8001000, 0xA2220000) DCDGEN(8, 4, 0x80000000, 0x87654321) DCDGEN(9, 4, 0x80000000, 0x87654321) DCDGEN(10, 4, 0xB8001000, 0xB2220000) DCDGEN(11, 1, 0x80000233, 0xda) DCDGEN(12, 1, 0x82000780, 0xda) DCDGEN(13, 1, 0x82000400, 0xda) DCDGEN(14, 4, 0xB8001000, 0x82226080) DCDGEN(15, 4, 0xB8001004, 0x007ffc3f) DCDGEN(16, 4, 0xB800100C, 0x007ffc3f) DCDGEN(17, 4, 0xB8001010, 0x00000304) DCDGEN(18, 4, 0xB8001008, 0x00002000)
You just need to convert these values into the proper syntax for imximage.cfg.

On Thu, Jul 5, 2012 at 6:09 AM, Estevam, wrote:
Hi Michael,
Hi Fabio,
Thank you very much for your support, I'm getting closer.
The best way to generate 'u-boot.imx' is to simply do 'make u-boot.imx' and then you don't need to pass the above line manually.
In internal mode you should do:
#define CONFIG_LOADADDR 0x80800000 #define CONFIG_SYS_TEXT_BASE 0x87800000
You probably will need to skip the RAM init in board/freescale/mx35pdk/lowlevel_init.S
For a quick test I would remove the call to 'setup_sdram' there, because RAM will be inited by the values from your created imximage.cfg file.
OK, here what I did:
--- a/boards.cfg +++ b/boards.cfg
-mx35pdk arm arm1136 - freescale mx35 +mx35pdk arm arm1136 mx35pdk freescale mx35 mx35pdk:IMX_CONFIG=board/freescale/mx35pdk/imximage.cfg
--- a/include/configs/mx35pdk.h +++ b/include/configs/mx35pdk.h
-#define CONFIG_SYS_TEXT_BASE 0xA0000000 +#define CONFIG_SYS_TEXT_BASE 0x87800000
+++ b/board/freescale/mx35pdk/imximage.cfg
+BOOT_FROM spi
+# 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
--- a/board/freescale/mx35pdk/lowlevel_init.S +++ b/board/freescale/mx35pdk/lowlevel_init.S
init_sdram_start: /*init_sdram*/ - setup_sdram + /* setup_sdram */
And here the result (output on the serial line):
--------------------------------------------------------------------------------------------------- U-Boot 2012.04.01-00077-g48bcd18-dirty (Jul 09 2012 - 15:22:31)
CPU: Freescale i.MX35 rev 2.1 at 532 MHz. Reset cause: POR I2C: ready ----------------------------------------------------------------------------------------------------
And that's it, no more output after "I2C: ready". Perhaps you have some more hints about what to do?
With best regards
Michael Hornung
participants (2)
-
Fabio Estevam
-
Hornung, Michael