i.mx28 nand boot

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

i.mx28 nand boot

30,692 Views
mehmet
Contributor I

Hi,

I use i.mx28 evk. And I have to boot from nand. I did steps from 5.1.3.2 nand boot header on linux_bsp_ug.pdf

flash_eraseall /dev/mtd0

kobs-ng init /boot/imx28_ivt_linux.sb

flash_eraseall /dev/mtd1

nandwrite /dev/mtd1 /boot/rootfs.jffs2

 

I set boot mode select 01001 for nand boot. I press KEY1 for nand rootfs while starting. Linux begins from nand but linux cannot mount rootfs. If I don't press KEY1, linux(from nand)  mounts rootfs on sd card.

I have changed alternative cmd line 1 from;

noinitrd console=ttyAM0,115200 ubi.mtd=1 root=ubi0:rootfs0 rootfstype=ubifsrw gpmi

to;

noinitrd console=ttyAM0,115200 root=/dev/mtdblock1 rootfstype=jffs2

 

But nothing has been changed.

 

What can I do for boot from nand?

 

Thanks.

Mehmet Kurnaz

Tags (1)
0 Kudos
55 Replies

4,336 Views
VikramU_ng
Contributor III

Hi Guys,

  Is this related to the Nand Utility.<http://imxcommunity.org/main/search/search?q=kobs-ng+imx233>?.

 

Core issue is that the board indicates valid sectors for NAND but fails to get programmed from the Windows MFGUtility tool.

0 Kudos

4,337 Views
snan1z
Contributor I

Thank you Jon,

 

it works

Sinan Emre Kutlu said:

Jon,

 

Thank you. when i try this way, i will inform you.

 

 

Regards,

Sinan

0 Kudos

4,337 Views
snan1z
Contributor I

Jon,

 

Thank you. when i try this way, i will inform you.

 

 

Regards,

Sinan

0 Kudos

4,336 Views
JonSzymaniak
Contributor II

Hi Sinan,

 

To prepare my rootfs, I copied the rootfs directory generated by LTIB to a temporary location (e.g., /tmp/ubi-rootfs) and then removed the /boot directory from this copied root filesystem, as we don't need it when using the bootstream:

host$ sudo cp -a rootfs/* /tmp/ubi-rootfs/  # Run from your LTIB dir
host$ sudo rm -rf /tmp/ubi-rootfs/boot/*

 

I didn't bother creating a tarball -- because I'm using an NFS root, I just copied my entire ubi-rootfs directory into my NFS rootfs, and from there to the UBIFS mounts.

 

At an rate, /tmp/ubi-rootfs contains the rootfs that you copy onto the UBIFS roots that you mount. You can use tar cvvf ubirootfs.tar /tmp/ubi-rootfs if you wish to create the tarball.

0 Kudos

4,336 Views
snan1z
Contributor I

Hi Jon,

i am following your instructions but i cant understand how you created ubirootfs.tar file ?

 

please reply,

 

Sinan

Robert M Girard said:

Jon,

Great news. Glad to be of help.

FYI: This works as well =

mount -t ubifs ubi0:rootfs0 /mnt/ubifs

I have attached an "A to Z" summary of the UBIFS flashing process with printout results for each command:

 

 

Question:

Where in the configuration of the build image is the partition file that results in the default / BSP :

$ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01400000 00020000 "gpmi-nfc-0-boot"
mtd1: 06c00000 00020000 "gpmi-nfc-general-use"

?

I want to add another partition, but I dont know where the file is to change the existing setup

 

Thanks,

Regards

Robert

 

 

0 Kudos

4,337 Views
RobertMGirard
Contributor I

Jon,

 

Thanks!

This is a good place to start. Somewhere there must be a .h file or something that gpmi-nfc-mil.c uses for partition info.

It shouldnt be too much of a stretch to hunt that down.

 

Regards

Robert

0 Kudos

4,337 Views
JonSzymaniak
Contributor II

Those seem to be hardcoded in gpmi-nfc-mil.c:

 

    /*
     * Here we declare the static strings we use to name partitions. We use
     * static strings because, as of 2.6.31, the partitioning code *always*
     * registers the partition MTDs it creates and leaves behind *no* other
     * trace of its work. So, once we've created a partition, we must search
     * the master MTD table to find the MTDs we created. Since we're using
     * static strings, we can simply search the master table for an MTD with
     * a name field pointing to a known address.
     */

    static char  *chip_0_boot_name      = "gpmi-nfc-0-boot";
    static char  *chip_0_remainder_name = "gpmi-nfc-0-remainder";
    static char  *chip_1_boot_name      = "gpmi-nfc-1-boot";
    static char  *medium_remainder_name = "gpmi-nfc-remainder";
    static char  *general_use_name      = "gpmi-nfc-general-use";

These seem to be used when CONFIG_MTD_PARTITIONS is defined:

 

/* Chip 0 Boot */

        partitions[0].name       = chip_0_boot_name;
        partitions[0].offset     = 0;
        partitions[0].size       = rom->boot_area_size_in_bytes;
        partitions[0].mask_flags = 0;

        /* General Use */

        partitions[1].name       = general_use_name;
        partitions[1].offset     = rom->boot_area_size_in_bytes;
        partitions[1].size       = MTDPART_SIZ_FULL;
        partitions[1].mask_flags = 0;

        /* Construct and register the partitions. */

        add_mtd_partitions(mtd, partitions, 2);

If it's configurable, I'm definitely not seeing where those options are. :/


Robert M Girard said:

Jon,

Great news. Glad to be of help.

FYI: This works as well =

mount -t ubifs ubi0:rootfs0 /mnt/ubifs

I have attached an "A to Z" summary of the UBIFS flashing process with printout results for each command:

 

 

Question:

Where in the configuration of the build image is the partition file that results in the default / BSP :

$ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01400000 00020000 "gpmi-nfc-0-boot"
mtd1: 06c00000 00020000 "gpmi-nfc-general-use"

?

I want to add another partition, but I dont know where the file is to change the existing setup

 

Thanks,

Regards

Robert

 

 

0 Kudos

4,337 Views
RobertMGirard
Contributor I

Jon,

Great news. Glad to be of help.

FYI: This works as well =

mount -t ubifs ubi0:rootfs0 /mnt/ubifs

I have attached an "A to Z" summary of the UBIFS flashing process with printout results for each command:

 

 

Question:

Where in the configuration of the build image is the partition file that results in the default / BSP :

$ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 01400000 00020000 "gpmi-nfc-0-boot"
mtd1: 06c00000 00020000 "gpmi-nfc-general-use"

?

I want to add another partition, but I dont know where the file is to change the existing setup

 

Thanks,

Regards

Robert

0 Kudos

4,337 Views
JonSzymaniak
Contributor II

Success! I ended up using the UBIFS parameters posted by Robert on May 19, 2011 at 9:30pm, and am not seeing any obvious issues. I flashed the image using an NFS root and the instructions in iMX233_LinuxBSP_DevelopTool_Environment.ppt.

 

The only little issue I ran into was that I had to use "/dev/ubi0_X" instead of "/ubi0:rootfsX" when mounting the rootfs volumes.

 

Thanks again!


Jon Szymaniak said:

Robert,

 

Thanks so much! I'll probably have a chance to try this out on Monday and will post back for completeness.

 

Thanks!

Jon

0 Kudos

4,337 Views
RobertMGirard
Contributor I

Brad,

At this point I am asking my local FAE to communicate with the Freescale BSP team for this target to look into the likelihood that the lastest release has problems with JFFS2. I am likely not able to have the same results as you due to the version differences, or possible the hardware release versions. Seems like you have much earlier hardware.

 

So for now, I will be using the UBIFS method, which I got to work the first time with no problems once I got the correct settings in ltib. For JFFS2, I tried at least 10 - 15 different attempts with no success as far as ECC errors. 

 

Thanks for all you help on this. I will post results when Freescale concludes the issue here

 

Regards

Robert 

0 Kudos

4,337 Views
Brad1z
Contributor I

You are correct Robert; the default page size is set to 4kB. I had neglected that parameter.



Robert M Girard said:

Brad,

My default for page size is "4" ( 4kbyte )

This clearly does not work for my NAND, and based on the fact that our NAND Flash parts have the same page geometry, I doubt you are using 4k as the page size either.

So either the BSP update changed the default from "2" ( yours ) to "4" ( mine ), or you changed it yourself at some point.

At your convenience, would you mind checking that config value as a sanity check?

Sorry for the hassle, but i just want to be sure I have exactly what you have and go from there.

 

Thanks

Robert

0 Kudos

4,337 Views
JonSzymaniak
Contributor II

Robert,

 

Thanks so much! I'll probably have a chance to try this out on Monday and will post back for completeness.

 

Thanks!

Jon

0 Kudos

4,337 Views
RobertMGirard
Contributor I

Jon,

A couple of other very useful docs attached here

http://www.alterawiki.com/wiki/UBIFS

0 Kudos

4,337 Views
RobertMGirard
Contributor I

Hello Jon,

 

Here are my UBIFS ltib settings for the attached NAND device:

128k - PEB

126976 - LEB

1024 - LEB count

2048 I/O unit size

 

The LEB was the one I didnt get right the first time, but seems correct now.

Good luck!

Robert

0 Kudos

4,337 Views
JonSzymaniak
Contributor II

Hi Robert,

 

Congrats on getting UBIFS working!  Mind sharing what you found as far as mapping device parameters from datasheet (page size, erase block size, etc.) to the UBIFS parameters in the LTIB menu? I didn't have a chance to look into UBIFS yet, but it seemed that I'd just need to run through a few formulas using parameters in the device datasheet.  I'm working with a 2 Gb NAND flash (MT29F2G08) that seemed to have similar parameters to your device.

 

Thanks!

Jon

0 Kudos

4,337 Views
RobertMGirard
Contributor I

Mehmet, Brad,

 

I was able to get the UBIFS NAND boot to work today with no errors.

Still no success on JFFS2, but I may just go with UBIFS for the time being.

If you need any advise on getting UBIFS working let me know.

 

Thanks

Robert

0 Kudos

4,339 Views
RobertMGirard
Contributor I

Brad,

My default for page size is "4" ( 4kbyte )

This clearly does not work for my NAND, and based on the fact that our NAND Flash parts have the same page geometry, I doubt you are using 4k as the page size either.

So either the BSP update changed the default from "2" ( yours ) to "4" ( mine ), or you changed it yourself at some point.

At your convenience, would you mind checking that config value as a sanity check?

Sorry for the hassle, but i just want to be sure I have exactly what you have and go from there.

 

Thanks

Robert

Brad Bierschenk said:

Erase block size is only thing I changed; if I needed to change something else from defaults, I neglected it.

Robert M Girard said:

Brad,

Thanks for the info.

Based on the data sheet -

Were these the entries/settings you used for the LTIB/JFFS2 config:

Erase Block size - "128"

tmpfs size - "512k"

page size - "2"

?

For the kernel config:

Did you have the JFFS2 write buffereing support enabled as well as GPMI?

If I neglected any special config requirements, please advise.

 

Thanks again very much

Robert

 

 

 

0 Kudos

4,339 Views
RobertMGirard
Contributor I

Ok Thanks.

This is great info for me to work with.

Although I believe my settings are correct based on what you have done, there are differences in the Flashing procedure I can try.

Also, our BSP and EVK versions are not the same . I will likely have to resolve these with Freescale Support if that's what it comes down to.

 

Regards

Robert

0 Kudos

4,339 Views
Brad1z
Contributor I
Erase block size is only thing I changed; if I needed to change something else from defaults, I neglected it.

Robert M Girard said:

Brad,

Thanks for the info.

Based on the data sheet -

Were these the entries/settings you used for the LTIB/JFFS2 config:

Erase Block size - "128"

tmpfs size - "512k"

page size - "2"

?

For the kernel config:

Did you have the JFFS2 write buffereing support enabled as well as GPMI?

If I neglected any special config requirements, please advise.

 

Thanks again very much

Robert

 

 

 

0 Kudos

4,339 Views
RobertMGirard
Contributor I

Brad,

Thanks for the info.

Based on the data sheet -

Were these the entries/settings you used for the LTIB/JFFS2 config:

Erase Block size - "128"

tmpfs size - "512k"

page size - "2"

?

For the kernel config:

Did you have the JFFS2 write buffereing support enabled as well as GPMI?

If I neglected any special config requirements, please advise.

 

Thanks again very much

Robert

0 Kudos