How do I recover from a failed u-boot flash on the LS1021A?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I recover from a failed u-boot flash on the LS1021A?

5,303 Views
hyei
Contributor I

I have corrupted both bank0 and bank1 on the LS1021A while attempting to flash a custom u-boot image, so am looking to restore the board to a working state.

However, I am having trouble restoring the recovery image from the Freescale 1.3 SDK found under flash-image/LS1021A_SDK_1.3_LS1021ATWR_20141027_NOR_FLASH.bin. Is there some trick to this that I am missing while following the documentation included with the 1.3 SDK (QorIQ LS1021A SDK v1.3 mini uberPDF - Final Release.pdf)?

I have a rev X4 board if that makes a difference.

I'm able to load the recovery u-boot (u-boot-with-spl-pbl-ls1021atwr_sdcard-2013.10+fslgit-r0.bin) from SDCard, and attempted to flash LS1021A_SDK_1.3_LS1021ATWR_20141027_NOR_FLASH.bin found under the flash-image directory with the instructions from the documentation:

I have copied LS1021A_SDK_1.3_LS1021ATWR_20141027_NOR_FLASH.bin as img.bin and tried both tftp and fatload methods, which seem to successfully load it to 0x82000000 (default loadaddr value)

=> tftp $loadaddr img.bin

=> protect off all

=> erase 60000000 67ffffff

=> cp.b $loadaddr 60000000 8000000

After the above cmds successfully complete, I set SW2:1 back to ON and SW2:3 to OFF to boot from NOR Flash, but I don't get any output from the console as I would expect.

Any pointers to what I am doing wrong would be much appreciated!

0 Kudos
11 Replies

2,522 Views
hwei
Contributor III

Hi Henry,

1) You write u-boot to the wrong address.

2) You need to write RCW file into nor flash too.

Here is what I found:

=> tftp 81000000 u-boot.bin

=> tftp 82000000 rcw_1000.bin

· For bank0

=> protect off all;erase 67f80000 67ffffff;cp.b 81000000 67f80000 80000

=> protect off all;erase 60000000 6001ffff;cp.b 82000000 60000000 100

· For bank1

=> protect off all;erase 63f80000 63ffffff;cp.b 81000000 63f80000 80000

=> protect off all;erase 64000000 6401ffff;cp.b 82000000 64000000 100

2,522 Views
hyei
Contributor I

Thanks, those should indeed bring back the u-boot and resurrect the board.

I am still wondering about why LS1021A_SDK_1.3_LS1021ATWR_20141027_NOR_FLASH.bin does not work as I expected. This should contain the RCW, uboot, kernel and rootfs for both bank1 and 2 from what I understand. Can you elaborate whether the the instructions in (QorIQ LS1021A SDK v1.3 mini uberPDF - Final Release.pdf) for flashing the entire recovery image are even relevant?

0 Kudos

2,522 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Henry Yei,


The procedure which you used for deploying recovery flash image is correct.

I confirmed with the Linux SDK testing team, probably this is the trick, for current bank the user needs to use "LPUART", for the alternate bank General UART is used, so after flash the image, please try whether it could work if jump to the alternate bank.

General UART port setting for TWR board:

1. J19 and J20 short 2-3.

2. Power on the board first and then connect J5 with USB serial port to host.

3. Waiting for auto-install the USB serial port driver on the host.

4. Decompress "Serial_driver.tar".

5. Install "2_mbedWinSerial_16466.exe"(for windows host).

LPUART console setting.

1. J19 and J20 short 1-2.

2. Use rcw: rcw_1000_lpuart.bin.

3. Follow the general UART port setting steps above to install the drivers.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

2,522 Views
hyei
Contributor I

It turns out that the u-boot-with-spl-pbl-ls1021atwr_sdcard-2013.10+fslgit-r0.bin file included with the 1.3 SDK disables NOR flash initialization, and nothing was being flashed correctly. I had to patch u-boot and rebuild it to enable the NOR flash which was disabled for QSPI/DSPI verification.

0 Kudos

2,522 Views
sinanakman
Senior Contributor III

Hi Henry

I don't know if you are still working on this

but I have the board here and I am

am able to recover the board fine. Reading your

notes above, I don't believe the image you

have includes RCW. I am using here the

mainline u-boot. What you need is to

program u-boot image and the RCW

separately. You can grab an RCW for

NOR boot from FSL's SDK or I can send

you. Once you have both the u-boot image

and the RCW then the above instructions

from H Wei still hold :

=> tftp 81000000 u-boot.bin

=> tftp 82000000 rcw_1000.bin

· For bank0

=> protect off all;erase 67f80000 67ffffff;cp.b 81000000 67f80000 80000

=> protect off all;erase 60000000 6001ffff;cp.b 82000000 60000000 100

· For bank1

=> protect off all;erase 63f80000 63ffffff;cp.b 81000000 63f80000 80000

=> protect off all;erase 64000000 6401ffff;cp.b 82000000 64000000 100

Also if you program your flash as above after booting from SD make sure

that you change the switch setting to boot from NOR.

Let me know how it goes and if you have other questions.

Regards

Sinan Akman

2,522 Views
hyei
Contributor I

Your instructions work if I have u-boot with NOR FLASH enabled. However, both 1.3 and 1.7 SDK's did not include a proper recovery u-boot (load from SDCard) that enabled the nor flash.  It looks like flash was disabled for the sdcard loadable u-boot for testing purposes.

None of my flash instructions were being executed properly. If there is one included, please give me the exact name of the file. Once I patched the u-boot and rebuilt u-boot with UBOOT_CONFIG = "sdcard" in my local.conf, I was able to flash the recovery image.

0 Kudos

2,522 Views
janbrand
Contributor II

Hello Henry,

i've got the same problem here. NOR is disabled in the u-boot sd-card binary "u-boot-with-spl-pbl-ls1021atwr_sdcard-2013.10+fslgit-r0.bin". Can you describe in detail, how you rebuild the u-boot sdcard image with NOR enabled?

Kind Regards

Jan Brand

0 Kudos

2,522 Views
yipingwang
NXP TechSupport
NXP TechSupport

Henry Yei,


For ls1021xa, IFC and QSPI/SPI are pin multiplexed, in previous SDK 1.3 and SDK 1.7 release, IFC isn't supported and QSPI/SPI is supported in SD boot. We have a patch to adjust the feature to support IFC in SD boot.

I attached this patch for you, probably you need to modify the source code manually according to this patch, if you use SDK 1.3.


If you use SDK 1.7 Yocto build environment, you could use the following procedure to rebuild u-boot.

1. $ bitbake u-boot -c cleansstate

2. In the configuration file meta-fsl-arm/conf/machine/ls1021atwr.conf modify UBOOT_CONFIG as "sdcard".

$ bitbake u-boot -c patch

Get source code in build_ls1021atwr_release/tmp/work/ls1021atwr-fsl-linux-gnueabi/u-boot-ls1/2013.10-r0/git/

Apply the patch with (patch -p<*.patch).

3. $bitbake u-boot

Get u-boot image in build_ls1021atwr_release/tmp/deploy/images/.


For any problem, please feel free to let me know.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

2,522 Views
sinanakman
Senior Contributor III

Hi Henry

I don't know if this answers your question but

here is how I am running this with mainline u-boot :

- I build two images, one for SD boot and another

for NOR boot. I use the SD boot image placed

in an SD and I boot with it. To do this I make

sure switches are set properly to boot from SD.

- Once I have u-boot running I program the other

u-boot image and the RCW to NOR (the mainline

u-boot includes NOR support when images are

built with default configs).

- Then I change the switch settings back to

booting from NOR and reset.

This works fine for me with the mainline u-boot.

Perhaps you can give it a try.

Regards

Sinan Akman

0 Kudos

2,522 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Henry Yei ,

If you are in target board bringing up stage, probably you could update software to QorIQ SDK 1.7 including ls1021 support, which is more stable than SDK 1.3.

Thanks,

Yiping

0 Kudos

2,522 Views
hwei
Contributor III

0 Kudos