Project

General

Profile

Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND

Added by Omar Rahim over 11 years ago

Customer states that they are having difficulty flashing MLO and U-Boot into the 3354-GX-X38 module. No issues encountered when flashing MLO and U-Boot in the 3359-GX-226 module.


Replies (46)

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Michael Karasoff over 11 years ago

Tim,

Thanks. Does this resolve the issue, or do you still need to modify ECC on the MLO?

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Tim Iskander over 11 years ago

Mike
unfortunately, that was just a secondary issue. Currently there is no support for the 4K page size NAND in any of the TI provided software. There is a patch to the main-line u-boot that I am in the process of back-porting to the TI u-boot. I have the bulk of the code in, I just need to untangle the mess of NAND ECC management.

cheers
/Tim

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Tim Iskander over 11 years ago

Just a pre-weekend update...
We had to switch from the TI PSP u-boot to the mainline u-boot, which is what has kept me busy these last couple of days.
I just got to the point where I can boot the board... have not been able to check NAND yet... Monday's task!

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Tim Iskander over 11 years ago

Another pre-weekend update...
I finally (after battling mr. Murphy numerous times) got the MLO and U-Boot loading from the 4k page flash.
I need to get the rest of u-boot in order now, but the MityARM-335X DDR3 module with the 512MB flash definitely boots from NAND!

cheers
/Tim

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Tim Iskander over 11 years ago

Finally... I have a u-boot image that will boot from the 512MB (4096k page) NAND.
It is now based on the main-line u-boot instead of the TI PSP flavor.
Use the u-boot-2013.01 branch from the CL repository support.criticallink.com:/home/git/u-boot-mityarm-335x.git
Build instructions have not changed..

make O=mityarm335x ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- mityarm335x_config
make -j 2 O=mityarm335x ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- mityarm335x

This will put MLO and u-boot.img in the mityarm335x directory under the u-boot build tree.

Images are attached to this post. The networking is working on the CL dev kit.
Note that due to the larger page size on the new nand part, the mtdparts have changed

U-Boot# mtdparts
mtdparts variable not set, see 'help mtdparts'
no partitions defined

defaults:
mtdids  : nand0=nand
mtdparts: mtdparts=nand:1024k@0(mlo),2048k@1024k(uboot),256k@3072k(env),5m@3328k(kernel),515840k(userfs)

to load the images into NAND from the SD card, I use the following commands
On a PC... copy MLO and u-boot.img to the boot partition on the SD card
It is important to use the new u-boot to program the NAND, so it will use the BCH-16 ECC mode.
put the SD card in the dev kit and boot from it (just into u-boot)
then type the following commands...
o To have u-boot scan the SD card and load drivers, etc...

mmc rescan

o To load the MLO into RAM and then NAND
mw.b 82000000 ff 100000;fatload mmc 0 82000000 MLO;nand erase 0 40000;nand write.i 82000000 0 $filesize

o The NAND erase/write cycle can be repeated to program up to 4 copies of the MLO (not needed in dev... may want to do this for production)
nand erase 40000 40000;nand write.i 82000000 40000 $filesize
nand erase 80000 40000;nand write.i 82000000 80000 $filesize
nand erase c0000 40000;nand write.i 82000000 c0000 $filesize

o To load the u-boot into RAM and then NAND
mw.b 82000000 ff 100000;nand erase 100000 100000;fatload mmc 0 82000000 u-boot.img;nand write.i 82000000 100000 $filesize

Note -- These images have not been updated completely for generic support of all nand sizes... for the smaller NAND devices I recommend you stay with the existing u-boot until
further notice.

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Kim Weller over 11 years ago

I encountered an error building branch u-boot-2013.01. Files in board/cl/mityarm335x are missing. Here's the make error:

make[3]: Leaving directory `/home/mitydsp/mtg/u-boot-mityarm/arch/arm/cpu/armv7/omap-common'
make -C /home/mitydsp/mtg/u-boot-mityarm/board/cl/mityarm335x/
make[3]: Entering directory `/home/mitydsp/mtg/u-boot-mityarm/board/cl/mityarm335x'
make[3]: *** No targets specified and no makefile found.  Stop.
make[3]: Leaving directory `/home/mitydsp/mtg/u-boot-mityarm/board/cl/mityarm335x'
make[2]: *** [/home/mitydsp/mtg/u-boot-mityarm/mityarm335x/spl/board/cl/mityarm335x/libmityarm335x.o] Error 2

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Tim Iskander over 11 years ago

Apologies...
I checked the git status before pushing and completely missed the board/cl tree (for some reason I was expecting to see all the files in the dir as untracked, not just the top of the untracked tree).
Anyway... I updated git and files are all there. Tested a clean pull/build cycle.
sorry
/Tim

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Anonymous over 11 years ago

Tim,
We just ran across this exact problem with our newly purchased 3354 module(we had been using the 3359's).
I had followed the original instructions for cloning the repository and building it but then modified portions of
the following files for our custom portion of our baseboard:
diff --git a/Makefile b/Makefile
diff --git a/board/cl/mityarm335x/som.c b/board/cl/mityarm335x/som.c
diff --git a/boards.cfg b/boards.cfg
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
diff --git a/drivers/mtd/spi/spi_flash_internal.h b/drivers/mtd/spi/spi_flash_internal.h
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
diff --git a/include/configs/mityarm335x.h b/include/configs/mityarm335x.h

How to I get the changes you made for this fix in your repository merged into our current uboot?

Thanks,
John C.

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Jonathan Cormier over 11 years ago

John,

Depending on how you did your changes you should be able to do a git pull and git will update the repo, merging with your changes where necessary.

-Jonathan

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Anonymous over 11 years ago

Hey Jonathan,

I've simply modified the files with-in the u-boot-mityarm-335x directory. Would there be
any way to diff the changes made to the repo?

Thanks,
John C.

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Anonymous over 11 years ago

It seem the git diif shows me the differences between what I originally cloned from Critical Link and my current changes in the directory.

John C.

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Michael Karasoff about 11 years ago

I am still having trouble programming the MLO and uboot into NAND from u-boot on an AM3354.

I've tried the MLO, uEnv.txt, and uboot.img posted for the 512M device, and here is what a boot into uboot from an SD Card looks like:

U-Boot# CCCCCCCC
U-Boot SPL 2013.01.01 (Jul 23 2013 - 09:57:04)
MityARM335x profile 1 - Model No: 3354-GX-X38-RC Serial No: 124507
Configuring for 512 MB DDR3
303MHz
som.c:470 config_am335x_ddr3 RAM size = 536870912
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img

U-Boot 2013.01.01 (Jul 23 2013 - 09:59:03)

AMAM335X-GP rev 0
I2C: ready
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: ECC Mode = 2 lo = 56/0
512 MiB
MMC: OMAP SD/MMC: 0
  • Warning - readenv() failed, using default environment

Net: cpsw:1 is connected to cpsw. Reconnecting to cpsw
Vitesse VSC8601 PHY detected at addr 1
Auto negotitation failed
cpsw
Hit any key to stop autoboot: 0

@

To program the MLO and u-boot into NAND, I followed Tim's instructions:

mmc rescan
mw.b 82000000 ff 100000;fatload mmc 0 82000000 MLO;nand erase 0 40000;nand write.i 82000000 0 $filesize
nand erase 40000 40000;nand write.i 82000000 40000 $filesize
nand erase 80000 40000;nand write.i 82000000 80000 $filesize
nand erase c0000 40000;nand write.i 82000000 c0000 $filesize
mw.b 82000000 ff 100000;nand erase 100000 100000;fatload mmc 0 82000000 u-boot.img;nand write.i 82000000 100000 $filesize

I'm using the critical link dev kit as my platform, with a jumper configuration of (MSB-LSB, 0=Jumper install, 1=removed) 000111100100

A few head scratchers:
1. After a reboot, every block I've programmed will show up as a bad block.

2. Readenv() fails at boot, and the default MTDParts is not what is shown in this thread:
@U-Boot# mtdparts
mtdparts variable not set, see 'help mtdparts'
no partitions defined

defaults:
mtdids : nand0=nand
mtdparts: mtdparts=nand:512k@0(mlo),1920k@512k(uboot),128k@2432k(env),5m@2560k(kernel),97152k(userfs)@

3. At boot, NAND reports ECC hw mode 2 (HW BCH8), but earlier in this thread it was mention that the ROM is looking for BCH16 (presumably hw mode 3).

4. Any attempt to change the nandecc mode throws the system into SW ECC:
U-Boot# nandecc sw 3
SW ECC selected
No oob scheme defined for oobsize 224

Is it possible that the binaries posted are not the latest and greatest?

Thanks
Mike

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Jonathan Cormier about 11 years ago

Mike,

I've added the correct mtdparts and other information on flashing the nand in the following wiki: http://support.criticallink.com/redmine/projects/armc8-platforms/wiki/UBIFS_Nand_Boot.

U-boot

Though it sounds like you might not have the correct u-boot. You can build the u-boot images yourself by cloning out git repo git://support.criticallink.com/home/git/u-boot-mityarm-335x.git and changing to branch u-boot-2013.01. http://support.criticallink.com/redmine/projects/armc8-platforms/wiki/Das_U-Boot_Port#Building-u-Boot

Linux

Note for linux to be able to read/write the bigger nand, you need to be using the 3.2 branch of our kernel with the CONFIG_NAND_MITYARM_LARGE_PAGE_SUPPORT option enabled as noted here:
http://support.criticallink.com/redmine/projects/armc8-platforms/wiki/Das_U-Boot_Port#Building-u-Boot

Instructions for building the kernel can be found here: http://support.criticallink.com/redmine/projects/armc8-platforms/wiki/Linux_Kernel#Building-the-Kernel. Note the "Customize the kernel" step, here you would navigate to System Type -> TI OMAP2/3/4 Specific Features and near the bottom you would enable large page support.

-Jonathan

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Michael Karasoff about 11 years ago

Jonathan,

Thanks. Yes, my suspicion is that I don't have the correct u-boot. I've built u-boot from source, the u-boot-2013.01 branch, and still not working. The results (and the uboot version - 2013.01.01-g6818f7c) are identical to the binary supplied by Critical Link on the wiki. Can you confirm that I am building the proper commit: 6818f7ccc8ceff4ab9f52f87a40d63f3ccd1c2ef ?

As for the mtdparts, thanks for the link, but I'm not sure how that helps if I can't program the flash correctly. I only posted the default mtdparts to illustrate that mtdparts supplied by u-boot do not match what is shown in the thread. And I have the same problems programming the environment to flash that I do programming MLO and the bootloader - saveenv does not seem to be working.

Has anyone reported that programming flash from u-boot works? Are you suggesting that I should program via the kernel only? Is it possible that there may be something else wrong (like jumper settings) that I am missing?

Thanks,
Mike

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Jonathan Cormier about 11 years ago

Mike can you run "nand bad"?

Did you use an older u-boot before you got the updated one? Its possible the older u-boot already marked all the blocks bad. To clear the bad blocks you need to run "nand scrub.chip". This command will wipe everything including the bad block markers, don't do this as normal operation however as it also clears the factory marked bad blocks (although with this chip you've already lost that info as they are all marked bad now i.e. can't differentiate between fake bad and true bad).

Note i didn't have to run the nandecc command as the uboot is hardcoded for now to do bch16

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Jonathan Cormier about 11 years ago

Jumpers only affect where the board looks for bootup code. The ubifs wiki page has my jumper config for booting from nand vs sd card.

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Michael Karasoff about 11 years ago

Jonathan,

I found the problem - looks like a bug in your u-boot code. For some reason, the MITYARM_4K_PAGE_NAND environment variable was not getting set. To the top of include/configs/mityarm335x.h I added:

#define MITYARM_4K_PAGE_NAND

I'm sure there is a more elegant way to do this (perhaps in the configuration?) but this hack produced a build that worked form me.

FYI, it looks like all of the 512MB u-boot images that Critical Link has posted on its web site do not support programming the 512MB flash. You may want to fix this...

Mike

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Tim Iskander about 11 years ago

Mike
Sorry about that!
I did add a board type for this configuration, but didn't really document it very well. :(
Use the mityarm335x_4kpage configuration to define the MITYARM_4K_PAGE_NAND preprocessor macro.

The goal is eventually to make a unified u-boot to deal with all this, but we are not there yet.
-- p.s. You need the 2013.1 branch for this to work, but you are probably already there

As for the broken 512MB u-boot images... did yo download the 'UBoot Files 512MB NAND or MORE' from the wiki (which is http://support.criticallink.com/redmine/attachments/download/3805/UBoot_512MB_NAND_plus.zip)?
We will look at it to to see if we messed up.

cheers
/Tim

RE: Difficulty in flashing MLO and U-Boot to the AM3354 with 512MB NAND - Added by Michael Karasoff about 11 years ago

Tim,

No worries! I appreciate you getting the 512MB to work!

I downloaded from three different places on the CL website, this thread, the u-boot wiki page, and the link you posted. All three binaries were the same - no joy.

Mike

(26-46/46) Go to top
Add picture from clipboard (Maximum size: 1 GB)