This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

flashing MLO to nand(mtd0) from userland..

Dear experts,

I am trying to flash MLO from userland by using mtd-utils (nandwrite) into nand (mtd0 partition i am using for MLO). I can able to erase and write  mtd0 partition from userland. but when i am trying to reboot its not booting. Same MLO i flashed at u-boot level and reset it is booting...

Can anybody help how to flash MLO from userland??

Below these are the steps i have followed..

Board has two boot modes

1.SD card 2.NAND

from sd card boot we need to flash first bootloader,u-boot,kernel,rootfs onto NAND.

This can be done two ways: 1. At u-boot level 2.from userland(after root prompt up) using mtd utils

1.at u-boot level( using SD boot..)

/** flashing first boot loader into nand **/

TI8148_EVM# mmc rescan 0

TI8148_EVM# fatls mmc 0

TI8148_EVM# mw.b 0x81000000 0xFF 0x20000

TI8148_EVM$ fatload mmc 0 0x81000000 MLO

TI8148_EVM# nandecc hw 2

TI8148_EVM# nand erase 0x0 0x20000

TI8148_EVM# nand write.i 0x81000000 0x0 0x20000

TI8148_EVM# nandecc hw 0

/** flashing u-boot into nand **/

TI8148_EVM# mmc rescan 0

TI8148_EVM# fatls mmc 0

TI8148_EVM# mw.b 0x81000000 0xFF 0x20000

TI8148_EVM$ fatload mmc 0 0x81000000 u-boot.bin

TI8148_EVM# nandecc hw 0

TI8148_EVM# nand erase 0x20000 0x60000

TI8148_EVM# nand write.i 0x81000000 0x20000 0x60000

2.from userland(after root prompt up) using mtd utils

root@ti814x:~#

root@ti814x:~# flash_erase /dev/mtd0 0 0

Erasing 128 Kibyte @ 0 -- 100 % complete

root@ti814x:~# flash_erase /dev/mtd1 0 0

Erasing 128 Kibyte @ 1e0000 -- 100 % complete

root@ti814x:~# flash_erase /dev/mtd4 0 0

Erasing 128 Kibyte @ 3e0000 -- 100 % complete

root@ti814x:~# nandwrite -p /dev/mtd0 /media/UPLOAD_mmc/MLO

Writing data to block 0 at offset 0x0

root@ti814x:~# nandwrite -p /dev/mtd1 /media/UPLOAD_mmc/u-boot.bin

Writing data to block 0 at offset 0x0

Writing data to block 1 at offset 0x20000

root@ti814x:~# nandwrite -p /dev/mtd4 /media/UPLOAD_mmc/uImage

Writing data to block 0 at offset 0x0

Writing data to block 1 at offset 0x20000

Writing data to block 2 at offset 0x40000

.....

.....

Writing data to block 21 at offset 0x2a0000

after reebooting.....

board is not booting. Just it get struck giving ccc in minicom window..

CCCCCCCCCCCCCCCCCCC      (here i get struck )

Now i switched to SD card boot mode and flashed only first boot loader..

1.at u-boot level( using SD boot..)

TI8148_EVM#mmc rescan 0

TI8148_EVM#mw.b 0x81000000 0xFF 0x20000

TI8148_EVM#fatload mmc 0 0x81000000 MLO

reading MLO

70544 bytes read

TI8148_EVM#nandecc hw 2

HW ECC BCH8 Selected

TI8148_EVM#nand erase 0x0 0x20000

NAND erase: device 0 offset 0x0, size 0x20000

Erasing at 0x0 -- 100% complete.

OK

TI8148_EVM#nand write.i 0x81000000 0x0 0x20000

NAND write: device 0 offset 0x0, size 0x20000

131072 bytes written: OK

TI8148_EVM#nandecc hw 0

HW ECC Hamming Code selected

switch to NAND BOOT mode... reset the board..

U-Boot 2010.06 (May 13 2012 - 10:13:17)

TI8148-GP rev 2.1

ARM clk: 600MHz

DDR clk: 400MHz

I2C: ready

DRAM: 2 GiB

NAND: HW ECC Hamming Code selected

256 MiB

*** Warning - bad CRC or NAND, using default environment

MMC: OMAP SD/MMC: 0

Net: <ethaddr> not set. Reading from E-fuse

Detected MACID:90:d7:eb:c6:3d:66

cpsw

Hit any key to stop autoboot: 0

device 0 offset 0x240000, size 0x4

NAND read: device 0 offset 0x260000, size 0x400000

4194304 bytes read: OK

Booting from NAND

## Booting kernel from Legacy Image at 81000000 ...

Image Name: MontaVista Automotive Technology

Image Type: ARM Linux Kernel Image (uncompressed)

Data Size: 2814088 Bytes = 2.7 MiB

Load Address: 80008000

Entry Point: 80008000

Verifying Checksum ... OK

Loading Kernel Image ... OK

OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Linux version 2.6.37.6.ps-110721-ti-jacinto5 (mallikarjuna@mallikarjuna-desktop) (gcc version 4.4.1 (MontaVista Linux G++ 4.4-111220) ) #7 PREEMPT Thu May 17 11:48:07 IST 2012

CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f

CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache

Machine: ti8148evm

vram size = 52428800 at 0x0

reserved size = 52428800 at 0x0

FB: Reserving 52428800 bytes SDRAM for VRAM

Memory policy: ECC disabled, Data cache writeback

OMAP chip is TI8148 2.0

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 30126

Kernel command line: console=ttyO0,115200 rootfstype=jffs2 root=/dev/mtdblock5 rootwait rw ip=:::::eth0:off mem=169M notifyk.vpssm3_sva=0xBF900000 vram=50M ti814xfb.vram=0:16M,1:16M,2:6M

PID hash table entries: 512 (order: -1, 2048 bytes)

Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)

Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)

Memory: 119MB = 119MB total

its booging and got the root prompt..

ti814x login: root

root@ti814x:~# l

.

Regards,

Mallikarjuna Reddy A