mx28,is there a example which use the uboot to burn ubifs rootfs to nandflash by tftp or mmc??thanks!!

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

mx28,is there a example which use the uboot to burn ubifs rootfs to nandflash by tftp or mmc??thanks!!

2,471 Views
HaohuaQIN
Contributor III

Before,when debugging embeded linux system(like as TI's am335x),i usually  receive ubi.img through TFTP in uboot,and then burn to nand rootfs mtdpart.like is:

tftp 0x82000000 ubi.img; nand erase 0x780000 0xF880000; nandecc hw 2; nand write 0x82000000 0x780000 ${filesize}


And,when small production, i usually read ubi.img from mmc in uboot,and then burn to nand rootfs mtdpart.like is:

mmc rescan; fatload mmc 0 0x82000000 ubi.img; nand erase 0x780000 0xF880000; nandecc hw 2; nand write 0x82000000 0x780000 ${filesize}

It's so fast and convenient.


i want to know that wheather in the mx28 uboot,can do it at the same as above??

thanks!!

Labels (1)
0 Kudos
Reply
3 Replies

1,392 Views
HaohuaQIN
Contributor III

ubinize.cfg:

[rootfs]

   mode=ubi

   image=ubifs.img

   vol_id=1

   vol_size=80MiB

   vol_type=dynamic

   vol_name=rootfs

   vol_flags=autoresize

mkfs.ubifs -r rootfs   -m 2048 -e 126976 -c 1900 -o ubifs.img

ubinize -o ubi.img -m 2048 -p 128KiB -s 2048 ubinize.cfg

I test that tftp update rootfs to nandflash is ok!!

I haven't test mmc update rootfs.

0 Kudos
Reply

1,392 Views
igorpadykov
NXP Employee
NXP Employee

Hi Haohua

please look at link below it explains methods of

i.MX28 NAND programming

iMX28: NAND boot "no init found"

Best regards

chip

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,392 Views
HaohuaQIN
Contributor III

in mx28_evk.h i add define parameters

#define MTDIDS_DEFAULT "nand0=nandflash0"

#define MTDPARTS_DEFAULT "mtdparts=nandflash0:1536k(bootloder),"\

                                                "512k(params),"\

                                                "18m(kernel),"\

                                                "-(rootfs)"

I use 128MB nandflash,20MB (0x1400000)for boot and kernel,the rest(0x6c00000) for rootfs.

in uboot,i use this cmd:

tftp 0x42000000 ubi.img

nand erase 0x1400000 0x6c00000

nand write 0x42000000 0x1400000 ${filesize}

uboot print:

MX28-QHH U-Boot > tftp 0x42000000 ubi.img

Using FEC0 device

TFTP from server 192.168.1.51; our IP address is 192.168.1.110

Filename 'ubi.img'.

Load address: 0x42000000

Loading: FEC: Link is down 7809

T ###############################

        #######
done
Bytes transferred = 48758784 (2e80000 hex)
MX28-QHH U-Boot > nand erase 0x1400000 0x6c00000

NAND erase: device 0 offset 0x1400000, size 0x6c00000
Skipping bad block at  0x2a6000000000000                                         
Skipping bad block at  0x34e000000000000                                         
Skipping bad block at  0x3c0000000000000                                         
Skipping bad block at  0x4ba000000000000                                         
Erasing at 0x7fe000000000000 --   0% complete.
OK
MX28-QHH U-Boot > nand write 0x42000000 0x1400000 ${filesize}

NAND write: device 0 offset 0x1400000, size 0x2e80000
Skip bad block 0x2a6000000000000
Skip bad block 0x34e000000000000
Skip bad block 0x3c0000000000000
48758784 bytes written: OK
MX28-QHH U-Boot >

then,i reset board,console print:

Creating 2 MTD partitions on "gpmi-nfc-main":

0x000000000000-0x000001400000 : "gpmi-nfc-0-boot"

0x000001400000-0x000008000000 : "gpmi-nfc-general-use"

UBI: attaching mtd1 to ubi0

UBI: physical eraseblock size:   131072 bytes (128 KiB)

UBI: logical eraseblock size:    126976 bytes

UBI: smallest flash I/O unit:    2048

UBI: VID header offset:          2048 (aligned 2048)

UBI: data offset:                4096

UBI error: validate_ec_hdr: bad VID header offset 512, expected 2048

UBI error: validate_ec_hdr: bad EC header

UBI error: ubi_io_read_ec_hdr: validation failed for PEB 0

UBI error: ubi_init: cannot attach mtd1

FEC Ethernet Driver

fec_enet_mii_bus: probed

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

fsl-ehci fsl-ehci: Freescale On-Chip EHCI Host Controller

fsl-ehci fsl-ehci: new USB bus registered, assigned bus number 1

fsl-ehci fsl-ehci: irq 93, io base 0x80080000

fsl-ehci fsl-ehci: USB 2.0 started, EHCI 1.00

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 1 port detected

fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller

fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 2

fsl-ehci fsl-ehci.0: irq 92, io base 0x80090000

fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00

hub 2-0:1.0: USB hub found

hub 2-0:1.0: 1 port detected

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

usbcore: registered new interface driver usbserial

usbserial: USB Serial Driver core

USB Serial support registered for cp210x

usbcore: registered new interface driver cp210x

cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver

USB Serial support registered for FTDI USB Serial Device

usbcore: registered new interface driver ftdi_sio

ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

USB Serial support registered for pl2303

usbcore: registered new interface driver pl2303

pl2303: Prolific PL2303 USB to serial adaptor driver

ARC USBOTG Device Controller driver (1 August 2005)

mice: PS/2 mouse device common for all mice

input: MXS touchscreen as /devices/virtual/input/input0

rtc-pcf8563 0-0051: chip found, driver version 0.4.3

rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0

i2c /dev entries driver

IR NEC protocol handler initialized

IR RC5(x) protocol handler initialized

IR RC6 protocol handler initialized

IR JVC protocol handler initialized

IR Sony protocol handler initialized

Linux video capture interface: v2.00

mxs-pxp mxs-pxp.0: initialized

mxs watchdog: initialized, heartbeat 19 sec

mxs-mmc: MXS SSP Controller MMC Interface driver

__mxs_reset_block(f0010000): timeout when resetting

__mxs_reset_block(f0010000): timeout when resetting

usb 2-1: new full speed USB device using fsl-ehci and address 2

mxs-mmc mxs-mmc.0: mmc0: MXS SSP MMC DMAIRQ 82 ERRIRQ 96

dcp dcp.0: DCP crypto enabled.!

usbcore: registered new interface driver hiddev

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

ALSA device list:

  No soundcards found.

TCP cubic registered

NET: Registered protocol family 17

can: controller area network core (rev 20090105 abi 8)

NET: Registered protocol family 29

can: raw protocol (rev 20090105)

rtc-pcf8563 0-0051: low voltage detected, date/time is not reliable.

rtc-pcf8563 0-0051: setting system clock to 2014-06-06 05:05:33 UTC (1402031133)

hub 2-1:1.0: USB hub found

hub 2-1:1.0: 4 ports detected

UBIFS error (pid 1): ubifs_get_sb: cannot open "ubi0:rootfs", error -19

VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)

Please append a correct "root=" boot option; here are the available partitions:

1f00           20480 mtdblock0 (driver?)

1f01          110592 mtdblock1 (driver?)

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Backtrace:

[<c0034450>] (dump_backtrace+0x0/0x114) from [<c03ce964>] (dump_stack+0x18/0x1c)

r7:c0029a24 r6:00008000 r5:c7f91000 r4:c0540e58

[<c03ce94c>] (dump_stack+0x0/0x1c) from [<c03ce9e0>] (panic+0x78/0xf4)

[<c03ce968>] (panic+0x0/0xf4) from [<c000902c>] (mount_block_root+0x1d8/0x218)

r3:00000000 r2:00000001 r1:c7c27f78 r0:c0481d85

[<c0008e54>] (mount_block_root+0x0/0x218) from [<c00091fc>] (prepare_namespace+0x94/0x1c4)

[<c0009168>] (prepare_namespace+0x0/0x1c4) from [<c00084f8>] (kernel_init+0x128/0x170)

r5:c0028d94 r4:c053ffc0

[<c00083d0>] (kernel_init+0x0/0x170) from [<c004fcf0>] (do_exit+0x0/0x6dc)

r5:c00083d0 r4:00000000

thanks!!

0 Kudos
Reply