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.

OpenEmbedded on DM368

Hello,

I have an issue getting the kernel to recognize a rootfs image. I'm running a stock build of a DM368 image built from the 2011.03 OpenEmbedded release. The bootloader is the default 1.3.4 u-boot shipped with the development unit. I've flashed the kernel image to the unit, and the kernel boots, but I reach an error trying to load the JFFS2 image on the flash as the initrd. Below is the u-boot environment varibles, and a log of the kernel boot.

I'm loading the rootfs into memory, and then pointing the kernel to it, but that doesn't seem to be working. Can I point the kernel to a location on flash? Am I missing a driver that should be enabled in the kernel?

FYI, The rootfs was loaded onto the flash via Minicom's loady file transfer, and then written to flash via nand write.jffs2.

U-Boot Variables:

bootdelay=1
baudrate=115200
bootfile="uImage"
autostart=no
filesize=B80000
bootargs=mem=76M console=ttyS0,115200n8 root=/dev/ram0 rw initrd=0x82000000,8M ip=off video=davincifb:vid0=OFF:vid1=OFF:osd0=720x576x16,4050K dm365_imp.oper_mode=0 davinci_capture.device_type=4
bootcmd=nand read.jffs2 0x82000000 0x800000 0xb80000;nboot 0x80700000 0 0x400000;bootm
stdin=serial
stdout=serial
stderr=serial
ethaddr=00:0C:0C:A0:02:b5

Kernel Log:

0243.Kernel Boot.log

  • Hi Richard,

    In the bootargs you need to specify the rootfstype, in your case it will be rootfstype=jffs2

    Regards

    --Prabhakar

  • I've appended the rootfstype bootarg option, but that doesn't seem to be working. I re-flashed the rootfs to make sure the image wasn't corrupted using the following commands:

    Leopard 365 :>loady 0x80300000
    ## Ready for binary (ymodem) download to 0x80300000 at 115200 bps...
    CTX)/0(CAN) packets, 5 retries
    ## Total Size = 0x00b80000 = 12058624 Bytes
    Leopard 365 :>nand erase 0x800000 0xb80000

    NAND erase: device 0 offset 0x800000, size 0xb80000
    Erasing at 0x1360000 -- 100% complete.
    OK
    Leopard 365 :>nand write.jffs2 0x80300000 0x800000 0xb80000

    NAND write: device 0 offset 0x800000, size 0xb80000
    12058624 bytes written: OK
    Leopard 365 :>

    I've also simplified the bootargs to the following:

    mem=76M console=ttyS0,115200n8 root=/dev/ram0 rw initrd=0x82000000,0xb80000 rootfstype=jffs2

    Attached is my boot log:

    3146.kernelboot.log

    I also think I might be loading the JFFS2 partition in a weird way. I was thinking that I shouldn't have to load it into RAM entirely, but be able to point the kernel to a MTD flash partition to use there. But, the typical MTD layout hard-coded in the kernel doesn't seem to be dumped during the kernel boot as well, which is puzzling me.

  • Here is a copy of my kernel config as well:

  • Hi Richard,

    In the bootargs, root = /dev/ram0 means the ramdisk is used as root filesystem media,  from your above steps looks like you are writing onto the NAND.

    For nand support ,root=/dev/mtdblock3 means that mtdblock3 partition on the NAND is used as root filesystem media.

    if you issue a command 'mtdparts' in uboot you will see

    mtdids  : nand0=davinci_nand.0
    mtdparts: mtdparts=davinci_nand.0:2m(bootloader)ro,4m(kernel),-(filesystem).

    one more thing the kernel should  be enabled for jffs2 support refer this link for enabling.

    you can use MTD Utilities to perform operations on Flash devices.

     

    Regards

    --Prabhakar Lad

  • I have JSFF2 with writebuffer support enabled in the kernel. I've tried replacing the root=/dev/ram0 bootargs option with the root=/dev/mtdblock3 (adjusting to mtdblock2) option, and appending the mtdparts option (tweaking it so the filesystem partition starts at 8M, which is where my JFFS2 rootfs is located). They are now the following:

    bootdelay=1
    baudrate=115200
    bootfile="uImage"
    autostart=no
    filesize=B80000
    bootcmd=nboot 0x80700000 0 0x400000;bootm
    stdin=serial
    stdout=serial
    stderr=serial
    ethaddr=00:0C:0C:A0:02:b5
    ver=U-Boot 1.3.4-svn56 (Mar 24 2011 - 13:53:45)
    bootargs=mem=76M console=ttyS0,115200n8 root=root=/dev/mtdblock2 rootfstype=jffs2 mtdparts=davinci_nand.0:4m(bootloader)ro,4m(kernel),-(filesystem)

    Attached is my bootlog:

    8625.mtdboot.log

    I think my main problem is that the kernel is not seeing the flash. I think I should typically see something like this in my kernel bootlog:

    nand_davinci nand_davinci.0: Using 4-bit hardware ECC 
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND 1GiB 3,3V 8-bit)
    ....
    Creating 5 MTD partitions on "nand_davinci.0":
    0x00000000-0x003c0000 : "bootloader"
    0x003c0000-0x00400000 : "params"
    0x00400000-0x00800000 : "kernel"
    0x00800000-0x20800000 : "filesystem"

    But that is not appearing anywhere. I'm not sure what I'm missing, since I've enabled everything I should need for NAND flash according to http://processors.wiki.ti.com/index.php/Filesystem_in_NOR_or_NAND#NAND. Any idea what it may be?

  • I noticed that you have "root=root=/dev/mtdblock2" in your bootargs. it should be "root=/dev/mtdblock2" if you are sure mtdblock2 already have the rootfs being populated in.

    don't know why you are not seeing nand partittions message during the boot. Are you sure nand is enabled in kernel?

    Regards,

    Yan

  • I've found my problem, seems a couple options in the kernel config were not turned on. Attached is a copy.