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.

am3352 boot with kernel & FS on NAND

Other Parts Discussed in Thread: AM3352

Hi All,


We have a custom board based on AM3352, and the boot sequence is as follows.

I have 2MB SPI flash, where in I have MLO & u-boot

I want to save kernel & filesystem on NAND.

1) I am able to detect NAND in u-boot

U-Boot# nand info

Device 0: nand0, sector size 128 KiB
  Page size       2048 b
  OOB size          64 b
  Erase size    131072 b
  subpagesize      512 b
  options     0x       c
  bbt options 0x    8000

2) I am unable to find nandecc command, is it mandatory to set the ecc type?

3) My NAND layout contains kernel & filesystem, kernel starting from 0x0 to 0x500000, Booting from uSD I am able to write kernel Image to NAND

Kernel version I have is 3.8 & using dts, so what is the Kernel Image I have to use, whether uImage or uImage-dtb.bone-black ?

When I used uImage-dtb.bone-black, it starts booting and stops after the print "Uncompressing Linux... done, booting the kernel."

When I used uImage I see the following message.

U-Boot SPL 2015.07-00260-g7757405-dirty (Oct 07 2015 - 21:17:31)
reading u-boot.img
reading u-boot.img


U-Boot 2015.07-00260-g7757405-dirty (Oct 07 2015 - 21:17:31 +0530)

       Watchdog enabled
I2C:   ready
DRAM:  256 MiB
NAND:  1024 MiB
MMC:   OMAP SD/MMC: 0
SF: Detected M25P16 with page size 256 Bytes, erase size 64 KiB, total 2 MiB
Net:   cpsw
Hit any key to stop autoboot:  0
U-Boot# nand read ${loadaddr} 0x0 0x500000

NAND read: device 0 offset 0x0, size 0x500000
 5242880 bytes read: OK
U-Boot# bootm ${loadaddr}
## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   Linux-3.8.13-00774-g18e2dc2
   Created:      2015-10-12   6:58:20 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4363160 Bytes = 4.2 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000e05).

Available machine support:

ID (hex)    NAME
ffffffff    Generic OMAP4 (Flattened Device Tree)
ffffffff    Generic AM33XX (Flattened Device Tree)
ffffffff    Generic OMAP3-GP (Flattened Device Tree)
ffffffff    Generic OMAP3 (Flattened Device Tree)
0000060a    OMAP3 Beagle Board
00000a9d    IGEP OMAP3 module
00000928    IGEP v2 board
00000ae7    OMAP4 Panda board

Please check your kernel config and/or bootloader.

Please give information which type of kernle Image I have to write to NAND, should I need to keep another copy of kernel Image ??

How to add NAND device & partitions in kernel dts file, so that it is detected by kernle?

Please help at the earliest.

Thanks & Regards,

gvk51.

  • Hi,

    Kernel v3.8 is not released by TI and is not supported on this forum. For support please ask on: beagleboard.org/.../Forums
  • Hi Biser,


    Thanks for the information.


    Do you have any reference like how to add the NAND device in dts file and the partitions so that kernel recognizes it. It will be a great help.

  • Hi,
    "Do you have any reference like how to add the NAND device in dts file and the partitions so that kernel recognizes it. It will be a great help."
    You can have a look in latest TI SDK, in arch/arm/boot/dts/am335x-evm.dts:
    &gpmc {
       status = "okay";
       pinctrl-names = "default", "sleep";
       pinctrl-0 = <&nandflash_pins_default>;
       pinctrl-1 = <&nandflash_pins_sleep>;
       ranges = <0 0 0x08000000 0x10000000>; /* CS0: NAND */
       nand@0,0 {
            reg = <0 0 0>; /* CS0, offset 0 */
            ti,nand-ecc-opt = "bch8";
            ti,elm-id = <&elm>;
            nand-bus-width = <8>;
            gpmc,device-width = <1>;
            gpmc,sync-clk-ps = <0>;
            gpmc,cs-on-ns = <0>;
            gpmc,cs-rd-off-ns = <44>;
            gpmc,cs-wr-off-ns = <44>;
            gpmc,adv-on-ns = <6>;
            gpmc,adv-rd-off-ns = <34>;
            gpmc,adv-wr-off-ns = <44>;
            gpmc,we-on-ns = <0>;
            gpmc,we-off-ns = <40>;
            gpmc,oe-on-ns = <0>;
            gpmc,oe-off-ns = <54>;
            gpmc,access-ns = <64>;
            gpmc,rd-cycle-ns = <82>;
            gpmc,wr-cycle-ns = <82>;
            gpmc,wait-on-read = "true";
            gpmc,wait-on-write = "true";
            gpmc,bus-turnaround-ns = <0>;
            gpmc,cycle2cycle-delay-ns = <0>;
            gpmc,clk-activation-ns = <0>;
            gpmc,wait-monitoring-ns = <0>;
            gpmc,wr-access-ns = <40>;
            gpmc,wr-data-mux-bus-ns = <0>;
            /* MTD partition table */
            /* All SPL-* partitions are sized to minimal length
            * which can be independently programmable. For
            * NAND flash this is equal to size of erase-block */
            #address-cells = <1>;
            #size-cells = <1>;
            partition@0 {
                 label = "NAND.SPL";
                 reg = <0x00000000 0x000020000>;
            };
            partition@1 {
                 label = "NAND.SPL.backup1";
                 reg = <0x00020000 0x00020000>;
            };
            partition@2 {
                 label = "NAND.SPL.backup2";
                 reg = <0x00040000 0x00020000>;
            };
            partition@3 {
                 label = "NAND.SPL.backup3";
                 reg = <0x00060000 0x00020000>;
            };
            partition@4 {
                 label = "NAND.u-boot-spl-os";
                 reg = <0x00080000 0x00040000>;
            };
            partition@5 {
                 label = "NAND.u-boot";
                 reg = <0x000C0000 0x00100000>;
            };
            partition@6 {
                 label = "NAND.u-boot-env";
                 reg = <0x001C0000 0x00020000>;
            };
            partition@7 {
                 label = "NAND.u-boot-env.backup1";
                 reg = <0x001E0000 0x00020000>;
            };
            partition@8 {
                 label = "NAND.kernel";
                 reg = <0x00200000 0x00800000>;
            };
            partition@9 {
                 label = "NAND.file-system";
                 reg = <0x00A00000 0x0F600000>;
            };
       };
    };

    Best Regards, 

    Yordan

  • Hi Yordan,


    Thanks for the inputs, I have tried adding the device and now I am able to see the additional prints from kernel, I understand driver is probing and trying to read the nand chip.

    following are the prints from kernel log

    enabling NAND BCH ecc with 8-bit correction
    [    1.161647] nand_get_flash_type: second ID read did not match 4e,46 against 49,02
    [    1.169498] No NAND device found
    [    1.173054] nand_get_flash_type: second ID read did not match 49,43 against 52,4f
    [    1.180902] No NAND device found

    Following is the NAND part information we are using, do we need to configure the GPMC values based on NAND part we use??

    Open NAND Flash Interface (ONFI) 1.0-compliant 1
    • Single-level cell (SLC) technology
    • Organization
    – Page size x8: 2112 bytes (2048 + 64 bytes)
    – Page size x16: 1056 words (1024 + 32 words)
    – Block size: 64 pages (128K + 4K bytes)
    – Plane size: 2 planes x 2048 blocks per plane
    – Device size: 4Gb: 4096 blocks; 8Gb: 8192 blocks 16Gb: 16,384 blocks

    I am working to debug the issue based on the log, mean while your inputs will be helpful to debug more precisely.

    Thanks & Regards,

    gvk51

  • Improper NAND timings or SYSBOOT[15:14] settings will cause this second ID read mismatch.