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.

c6a816x booting from ramdisk

Other Parts Discussed in Thread: PMP

hi.

I'd like to inquire about booting from ramdisk.

I need reference about this.

Best Regards.

  • Hello, Hokyun Yu

    Here you can see how to create  "ramdisk.gz":

    http://processors.wiki.ti.com/index.php/Creating_a_RAMDISK

    And perhaps after that you have to modify your u-boot environment to something like this as you would have assumed:

    <U-BOOT># setenv bootargs 'mem=256M console=ttyO0,115200n8 root=/dev/ram0 rw initrd=0x82000000,11M'

    <U-BOOT>#  setenv bootcmd 'mmc rescan 0;fatload mmc 0 81000000 uImage; fatload mmc 0 82000000 ramdisk.gz; bootm 0x81000000'

    It is likely that you will need adjust this a bit. That's the case of SD card boot.

    BR

  • Hi,

    It will be created </home/user/targetfs> folder when I install c6a816x ezsdk.,

    I tried it on nfs and jffs2.

    And I want to try to boot using ramdisk, I created ramdisk.gz file refer to the above wiki page.


    $> sudo cp -r /home/user/targetfs targetfs

    $> sudo chmod 777 -R targetfs

    $> dd if=/dev/zero of=ramdisk bs=1M count=320

    320+0 records in
    320+0 records out
    335544320 bytes (336 MB) copied, 1.98387 s, 169 MB/s

    $> mkfs ramdisk

    mke2fs 1.41.11 (14-Mar-2010)
    ramdisk is not a block special device.
    Proceed anyway? (y,n) y
    Filesystem label=
    OS type: Linux
    Block size=1024 (log=0)
    Fragment size=1024 (log=0)
    Stride=0 blocks, Stripe width=0 blocks
    81920 inodes, 327680 blocks
    16384 blocks (5.00%) reserved for the super user
    First data block=1
    Maximum filesystem blocks=67633152
    40 block groups
    8192 blocks per group, 8192 fragments per group
    2048 inodes per group
    Superblock backups stored on blocks:
    8193, 24577, 40961, 57345, 73729, 204801, 221185

    Writing inode tables: done
    Writing superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 21 mounts or
    180 days, whichever comes first. Use tune2fs -c or -i to override.

    $> sudo mkdir mnt

    $> sudo mount -o loop ramdisk mnt

    $> sudo cp -r /home/user/targetfs/* mnt

    $> sudo umount mnt

    $> gzip ramdisk

    And,

    Now u-boot and Kernel is flashed on nand.

    TI8168_EVM#printenv
    bootdelay=3
    baudrate=115200
    verify=yes
    ramdisk_file=ramdisk.gz
    loadaddr=0x81000000
    script_addr=0x80900000
    loadbootscript=fatload mmc 1 ${script_addr} boot.scr
    bootscript= echo Running bootscript from MMC/SD to set the ENV...; source ${script_addr}
    ethact=DaVinci EMAC
    autoload=no
    bootfile=uImage
    ethaddr=00:08:65:23:22:19
    nfsserver=192.168.1.230
    filesize=88A451D
    fileaddr=81000000
    netmask=255.255.255.0
    ipaddr=192.168.1.241
    serverip=192.168.1.230
    bootcmd=nand read 0x81000000 0x280000 0x1f0000;nand read 0x82000000 0x6c0000 0x8900000;bootm
    bootargs=console=ttyS2,115200n8 mem=320M earlyprintk root=/dev/ram rw initrd=0x82000000,320M
    stdin=serial
    stdout=serial
    stderr=serial
    ver=U-Boot 2010.06 (Nov 18 2010 - 22:36:59)

    Environment size: 718/8188 bytes

    Besides, I've tried to several ways.

    I don't know how to set bootcmd and bootargs.

    Or, how to set it when create ramdisk.gz?

    BR!

  • Hello, Hokyun Yu

    Please, try:

    setenv bootargs 'console=ttyS2,115200n8 mem=256M earlyprintk root=/dev/ram rw initrd=0x82000000,11M'
    setenv bootcmd 'nand read 0x81000000 0x280000 0x1f0000;nand read 0x82000000 0x6c0000 0x8900000;bootm 0x81000000'

    11M is the size of ramdisk.gz; change that value if your case is different. Also, verify that "partition size" parameter values of the "nand read" command are correct.

    If it is still not working, please describe the behaviour of the system.

    BR

  • setenv bootargs 'console=ttyS2,115200n8 mem=256M earlyprintk root=/dev/ram rw initrd=0x82000000,11M'

    setenv bootcmd 'nand read 0x81000000 0x280000 0x1f0000;nand read 0x82000000 0x6c0000 0x8900000;bootm 0x81000000'

    11M is the size of ramdisk.gz; change that value if your case is different. Also, verify that "partition size" parameter values of the "nand read" command are correct.

    I tried that, kernel message is :

    U-Boot 2010.06 (Nov 18 2010 - 22:36:59)

    TI8168-GP rev 1.0

    ARM clk: 987MHz
    DDR clk: 398MHz

    I2C: ready
    DRAM: 2 GiB
    NAND: 256 MiB
    :,;;:;:;;;;;;;;r;;:,;;:;:;;;;;;;;:,;;:;:;;;;;;;;:,;;:;:;;;;;;;;:;;;;;;;;:,;;:;:
    ;,;:::;;;;r;;;rssiSiS552X5252525259GX2X9hX9X9XX2325S55252i5:,;;:;:;;;;;;;;:,;;:
    ;:;;;;;;;rrssSsS52S22h52299GGAAMHMM#BBH#B#HMM#HMBA&&XX2255S2S5Si:,;;:;:;;;;;;;;
    ;:;;r;;rsrrriiXS5S329&A&MH#BMB#A&9XXA252GXiSXX39AAMMMBB&G22S5i2SSiiiisi:,;;:;:;
    ;;;;;r;rr2iisiih393HB#B#AA99i22irrrX3X52AGsisss2Xii2299HBMA&X2S5S5iSiisSsi:,;;:
    r:r;rrsrsihXSi2&##MHB&Ahh3AGHGA9G9h&#H##@@@##MAMMXXX9SSS29&&HGGX2i5iisiiisisi:,
    ;;rrrrsSiiiA&ABH&A9GAGhAhBAMHA9HM@@@@@@@@@@@@@@@@@@@HHhAh2S2SX9&Gh22SSiisiiisii
    r:rrssisiS2XM##&h3AGAX&3GG3Ssr5H@M#HM2; ;2X&&&MHMB###GBB#B&XXSSs529XX55iSsisisi
    r;rsrisSi2XHAhX99A3XXG&&XS;:,rH#HGhAS @@@@3rs2XBM@@A552&&AHA2XiisSS252SSsisSs
    r;issi5S22&&3iSSX292&hXsr;;:;h@&G339&S9@@@@2@MA&9&HB##Xris29ABMAAX2ir;rsSi5iss5
    rrsSi2XhG&9GXh399&X99i;;;;;;r#H&293H9X#@@@@@@@B&9GhAH@XrrsrsiXABHB&HG2rr;rrSiSi
    ;:rsisS599&AA9XG&3A35r;:::;,;BMh&&2iX5A@@@@@@@&392X5GB2;;;r;iSX393A##A&Xi:::rsi
    ;:rss552222X553&XHMhir;;::,:,h#HhGSXhG3#@@@@#AXXS2XAHA;::;;;;ss55XShBA3239r:,;;
    r;ii2S5SSi2i53hirsh2srr::,,,,;MMXX359&Ah3h&Si59SX99A#i:,::::;;sri2,.2r;:SGAr;,:
    ;:;rrrrssiriXGSi::shs;;;,,,:,,rBBA9h5s5h5iS5isi2SAHB5:,,,:::;rrs5&SrisSX5Srrr:,
    ;,r;;;;rsriSSrrrr;;5Xrr;;,:,,.,;9AA2SsisS5323XXXG9&i:.,,::;;r;;;srrrrrr;;:;::::
    :,;r;r;rrissrrr;:;::;s;;;;,:,,..,r293h222hXXAAGGGX;:,,,:,:,::;:;::,:,,,,...,,,,
    ;,;;;;rrrrrrrrirr;,.,,:::::::,,,,.,;SX&ABAB2hhXir:,,.,,.,,:,,,,..,,,..,..,,,..:
    :.:;:;;;:;;;;r;rrs;:.. ,,:::::,:,:,,.::rrsrr;;,,.......,..,....,,,,,,,...,.,,:,
    :.:::,::::::;;r;rrr;:.......,.,.,,:::,,...............,,::.,,,,:,::,,:,:,,,:,;:
    ,.::,:,,,,,;;;;;;;;r;;::,..............................;;;:;::::,:::::::,:,:,,,
    : ,,:,,,,,,,,,,,,,:;rrr;;:;,,,,,,,::,.,.:.,.,;s,:;;;;:;:;;;;;::::,:::,:::,:,:,:
    ,.,,,,,,,...,,.,,....................................:,............:,,,:,:,,,,,

    Net: Ethernet PHY: GENERIC @ 0x01
    DaVinci EMAC
    Hit any key to stop autoboot: 0
    TI8168_EVM#printenv
    bootdelay=3
    baudrate=115200
    verify=yes
    ramdisk_file=ramdisk.gz
    loadaddr=0x81000000
    script_addr=0x80900000
    loadbootscript=fatload mmc 1 ${script_addr} boot.scr
    bootscript= echo Running bootscript from MMC/SD to set the ENV...; source ${script_addr}
    ethact=DaVinci EMAC
    autoload=no
    bootfile=uImage
    ethaddr=00:08:65:23:22:19
    nfsserver=192.168.1.230
    filesize=CE5F7B
    fileaddr=81000000
    netmask=255.255.255.0
    ipaddr=192.168.1.241
    serverip=192.168.1.230
    bootargs=console=ttyS2,115200n8 mem=256M earlyprintk root=/dev/ram rw initrd=0x82000000,11M
    bootcmd=nand read 0x81000000 0x280000 0x1f0000;nand read 0x82000000 0x6c0000 0x8900000;bootm 0x81000000
    stdin=serial
    stdout=serial
    stderr=serial
    ver=U-Boot 2010.06 (Nov 18 2010 - 22:36:59)

    Environment size: 727/8188 bytes
    TI8168_EVM#boot

    NAND read: device 0 offset 0x280000, size 0x1f0000
    2031616 bytes read: OK

    NAND read: device 0 offset 0x6c0000, size 0x8900000
    143654912 bytes read: OK
    ## Booting kernel from Legacy Image at 81000000 ...
    Image Name: Arago/2.6.34-psp04.00.00.07/c6a8
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1993832 Bytes = 1.9 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.34 (x0029463@swubn01) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #1 Thu Nov 18 22:18:53 IST 2010
    CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
    CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
    Machine: ti8168evm
    bootconsole [earlycon0] enabled
    reserved size = 0 at 0
    Memory policy: ECC disabled, Data cache writeback
    OMAP chip is TI8168
    Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
    Kernel command line: console=ttyS2,115200n8 mem=256M earlyprintk root=/dev/ram rw initrd=0x82000000,11M
    PID hash table entries: 1024 (order: 0, 4096 bytes)
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    Memory: 256MB = 256MB total
    Memory: 244384k/244384k available, 17760k reserved, 0K highmem
    Virtual kernel memory layout:
    vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
    DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
    vmalloc : 0xd0800000 - 0xf8000000 ( 632 MB)
    lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
    modules : 0xbf000000 - 0xc0000000 ( 16 MB)
    .init : 0xc0008000 - 0xc0031000 ( 164 kB)
    .text : 0xc0031000 - 0xc03c9000 (3680 kB)
    .data : 0xc03ca000 - 0xc03f0280 ( 153 kB)
    SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    Hierarchical RCU implementation.
    NR_IRQS:160
    GPMC revision 6.0
    IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    Total of 128 interrupts on 1 active controller
    OMAP clockevent source: GPTIMER2 at 27000000 Hz
    Console: colour dummy device 80x30
    Calibrating delay loop... 986.31 BogoMIPS (lpj=4931584)
    Security Framework initialized
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    devtmpfs: initialized
    NET: Registered protocol family 16
    Found NAND on CS0
    Registering NAND on CS0
    registered ti816x_vpss device
    Registered ti81xx_fb device
    ti816x_pcie: Invoking PCI BIOS...
    ti816x_pcie: Setting up Host Controller...
    ti816x_pcie: Register base mapped @0xd0808000
    ti816x_pcie: Starting PCI scan...
    PCI: bus0: Fast back to back transfers enabled
    bio: create slab <bio-0> at 0
    vgaarb: loaded
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    i2c_omap i2c_omap.1: bus 1 rev4.0 at 100 kHz
    i2c_omap i2c_omap.2: bus 2 rev4.0 at 100 kHz
    Advanced Linux Sound Architecture Driver Version 1.0.22.1.
    Switching to clocksource gp timer
    musb_hdrc: version 6.0, cppi4.1-dma, host, debug=0
    cppi41_queue_mgr_init done
    registerd cppi-dma Intr @ IRQ 17
    musb_hdrc: kernel must blacklist external hubs
    musb_hdrc: USB Host mode controller at d080e000 using DMA, IRQ 18
    musb_hdrc musb_hdrc.0: MUSB HDRC host driver
    musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 1
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    musb_hdrc: kernel must blacklist external hubs
    musb_hdrc: USB Host mode controller at d081e800 using DMA, IRQ 19
    musb_hdrc musb_hdrc.1: MUSB HDRC host driver
    musb_hdrc musb_hdrc.1: new USB bus registered, assigned bus number 2
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 1 port detected
    NET: Registered protocol family 2
    IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
    TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
    TCP: Hash tables configured (established 8192 bind 8192)
    TCP reno registered
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    NET: Registered protocol family 1
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    Trying to unpack rootfs image as initramfs...
    rootfs image is not initramfs (no cpio magic); looks like an initrd
    Freeing initrd memory: 11264K
    NetWinder Floating Point Emulator V0.97 (double precision)
    JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
    msgmni has been set to 499
    io scheduler noop registered
    io scheduler deadline registered
    io scheduler cfq registered (default)
    Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    serial8250.0: ttyS0 at MMIO 0x48020000 (irq = 72) is a ST16654
    serial8250.1: ttyS1 at MMIO 0x48022000 (irq = 73) is a ST16654
    serial8250.2: ttyS2 at MMIO 0x48024000 (irq = 74) is a ST16654
    console [ttyS2] enabled, bootconsole disabled
    console [ttyS2] enabled, bootconsole disabled
    brd: module loaded
    loop: module loaded
    ahci ahci: forcing port_map 0x0 -> 0x3
    ahci ahci: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl platform mode
    ahci ahci: flags: ncq sntf pm led clo only pmp pio slum part ccc
    scsi0 : ahci
    scsi1 : ahci
    ata1: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x100 irq 16
    ata2: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x180 irq 16
    omap2-nand driver initializing
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Micron NAND 256MiB 3,3V 16-bit)
    Creating 5 MTD partitions on "omap2-nand":
    0x000000000000-0x000000260000 : "U-Boot"
    0x000000260000-0x000000280000 : "U-Boot Env"
    0x000000280000-0x0000006c0000 : "Kernel"
    0x0000006c0000-0x00000cee0000 : "File System"
    0x00000cee0000-0x000010000000 : "Reserved"
    usbmon: debugfs is not available
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    mice: PS/2 mouse device common for all mice
    i2c /dev entries driver
    PSTATE 1f20000
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
    No device for DAI tlv320aic3x
    asoc: tlv320aic3x <-> davinci-i2s mapping ok
    ALSA device list:
    #0: TI816x EVM (tlv320aic3x)
    TCP cubic registered
    NET: Registered protocol family 17
    VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    emac-mii: probed
    mdio_bus 1:01: DaVinci EMAC: mii bus found 31
    net eth1: DaVinci EMAC eth1 PHY not found
    davinci_emac: probe of davinci_emac.1 failed with error -1
    ata1: SATA link down (SStatus 0 SControl 300)
    ata2: SATA link down (SStatus 0 SControl 300)
    RAMDISK: gzip image found at block 0
    RAMDISK: incomplete write (16417 != 16453)
    write error
    VFS: Mounted root (ext2 filesystem) on device 1:0.
    attempt to access beyond end of device
    ram0: rw=0, want=115214, limit=32768
    EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=14337, block=57606
    devtmpfs: error mounting -5
    Freeing init memory: 164K
    attempt to access beyond end of device
    ram0: rw=0, want=589832, limit=32768
    EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=73729, block=294915
    attempt to access beyond end of device
    ram0: rw=0, want=32776, limit=32768
    EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=4097, block=16387
    attempt to access beyond end of device
    ram0: rw=0, want=98312, limit=32768
    EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=12289, block=49155
    attempt to access beyond end of device
    ram0: rw=0, want=98312, limit=32768
    EXT2-fs (ram0): error: ext2_get_inode: unable to read inode block - inode=12289, block=49155
    Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
    Backtrace:
    [<c0035390>] (dump_backtrace+0x0/0x110) from [<c02d8fe4>] (dump_stack+0x18/0x1c)
    r7:00000000 r6:00000000 r5:00000000 r4:c03f0b10
    [<c02d8fcc>] (dump_stack+0x0/0x1c) from [<c02d9034>] (panic+0x4c/0xc8)
    [<c02d8fe8>] (panic+0x0/0xc8) from [<c003157c>] (init_post+0xa4/0xc4)
    r3:cfcafe00 r2:00000000 r1:c06205e0 r0:c036cca6
    [<c00314d8>] (init_post+0x0/0xc4) from [<c0008670>] (kernel_init+0x114/0x14c)
    r5:00000000 r4:c03f0280
    [<c000855c>] (kernel_init+0x0/0x14c) from [<c0055fec>] (do_exit+0x0/0x5bc)
    r5:00000000 r4:000000

    Also, file system size is :

    I'll try to change other parameters.

    BR

  • Hello, Hokyun Yu

    Please, try:

    setenv bootargs 'console=ttyS2,115200n8 mem=256M earlyprintk root=/dev/ram0 rw initrd=0x82000000,137M'

    setenv bootcmd 'nand read 0x81000000 0x280000 0x1f0000;nand read 0x82000000 0x6c0000 0x8900000;bootm 0x81000000'

    Tell me, is it working now. Thank you.

    BR

  • Hi,

    Already tried.

    Kernel message is :

    NAND read: device 0 offset 0x280000, size 0x1f0000
    2031616 bytes read: OK

    NAND read: device 0 offset 0x6c0000, size 0x8900000
    143654912 bytes read: OK
    ## Booting kernel from Legacy Image at 81000000 ...
    Image Name: Arago/2.6.34-psp04.00.00.07/c6a8
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1993832 Bytes = 1.9 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.34 (x0029463@swubn01) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #1 Thu Nov 18 22:18:53 IST 2010
    CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
    CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
    Machine: ti8168evm
    bootconsole [earlycon0] enabled
    reserved size = 0 at 0
    Memory policy: ECC disabled, Data cache writeback
    OMAP chip is TI8168
    Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
    Kernel command line: console=ttyS2,115200n8 mem=256M earlyprintk root=/dev/ram0 rw initrd=0x82000000,137M
    PID hash table entries: 1024 (order: 0, 4096 bytes)
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    Memory: 256MB = 256MB total
    Memory: 115360k/115360k available, 146784k reserved, 0K highmem
    Virtual kernel memory layout:
    vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
    DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
    vmalloc : 0xd0800000 - 0xf8000000 ( 632 MB)
    lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
    modules : 0xbf000000 - 0xc0000000 ( 16 MB)
    .init : 0xc0008000 - 0xc0031000 ( 164 kB)
    .text : 0xc0031000 - 0xc03c9000 (3680 kB)
    .data : 0xc03ca000 - 0xc03f0280 ( 153 kB)
    SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    Hierarchical RCU implementation.
    NR_IRQS:160
    GPMC revision 6.0
    IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    Total of 128 interrupts on 1 active controller
    OMAP clockevent source: GPTIMER2 at 27000000 Hz
    Console: colour dummy device 80x30
    Calibrating delay loop... 986.31 BogoMIPS (lpj=4931584)
    Security Framework initialized
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    devtmpfs: initialized
    NET: Registered protocol family 16
    Found NAND on CS0
    Registering NAND on CS0
    registered ti816x_vpss device
    Registered ti81xx_fb device
    ti816x_pcie: Invoking PCI BIOS...
    ti816x_pcie: Setting up Host Controller...
    ti816x_pcie: Register base mapped @0xd0808000
    ti816x_pcie: Starting PCI scan...
    PCI: bus0: Fast back to back transfers enabled
    bio: create slab <bio-0> at 0
    vgaarb: loaded
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    i2c_omap i2c_omap.1: bus 1 rev4.0 at 100 kHz
    i2c_omap i2c_omap.2: bus 2 rev4.0 at 100 kHz
    Advanced Linux Sound Architecture Driver Version 1.0.22.1.
    Switching to clocksource gp timer
    musb_hdrc: version 6.0, cppi4.1-dma, host, debug=0
    cppi41_queue_mgr_init done
    registerd cppi-dma Intr @ IRQ 17
    musb_hdrc: kernel must blacklist external hubs
    musb_hdrc: USB Host mode controller at d080e000 using DMA, IRQ 18
    musb_hdrc musb_hdrc.0: MUSB HDRC host driver
    musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 1
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    musb_hdrc: kernel must blacklist external hubs
    musb_hdrc: USB Host mode controller at d081e800 using DMA, IRQ 19
    musb_hdrc musb_hdrc.1: MUSB HDRC host driver
    musb_hdrc musb_hdrc.1: new USB bus registered, assigned bus number 2
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 1 port detected
    NET: Registered protocol family 2
    IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
    TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
    TCP: Hash tables configured (established 8192 bind 8192)
    TCP reno registered
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    NET: Registered protocol family 1
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    Trying to unpack rootfs image as initramfs...
    rootfs image is not initramfs (no cpio magic); looks like an initrd
    swapper invoked oom-killer: gfp_mask=0x200d2, order=0, oom_adj=0
    Backtrace:
    [<c0035390>] (dump_backtrace+0x0/0x110) from [<c02d8fe4>] (dump_stack+0x18/0x1c)
    r7:cfc28000 r6:00000000 r5:00000000 r4:c03cd750
    [<c02d8fcc>] (dump_stack+0x0/0x1c) from [<c0081828>] (dump_header+0x44/0x110)
    [<c00817e4>] (dump_header+0x0/0x110) from [<c0081df8>] (__out_of_memory+0x144/0x194)
    r5:00000000 r4:c03cd750
    [<c0081cb4>] (__out_of_memory+0x0/0x194) from [<c0081edc>] (out_of_memory+0x94/0xcc)
    [<c0081e48>] (out_of_memory+0x0/0xcc) from [<c0084b94>] (__alloc_pages_nodemask+0x418/0x50c)
    r5:cfc26000 r4:00000000
    [<c008477c>] (__alloc_pages_nodemask+0x0/0x50c) from [<c007f85c>] (grab_cache_page_write_begin+0x58/0x98)
    [<c007f804>] (grab_cache_page_write_begin+0x0/0x98) from [<c00bd38c>] (simple_write_begin+0x28/0xe4)
    [<c00bd364>] (simple_write_begin+0x0/0xe4) from [<c007eac4>] (generic_file_buffered_write+0xe4/0x21c)
    r7:00000000 r6:06f8a000 r5:06f8a000 r4:00001000
    [<c007e9e0>] (generic_file_buffered_write+0x0/0x21c) from [<c0080770>] (__generic_file_aio_write+0x428/0x478)
    [<c0080348>] (__generic_file_aio_write+0x0/0x478) from [<c0080834>] (generic_file_aio_write+0x74/0xd8)
    [<c00807c0>] (generic_file_aio_write+0x0/0xd8) from [<c00a3348>] (do_sync_write+0xa0/0xec)
    [<c00a32a8>] (do_sync_write+0x0/0xec) from [<c00a3d24>] (vfs_write+0xb0/0xd8)
    r8:c2000000 r7:08900000 r6:cfc29f08 r5:c2000000 r4:cfc73800
    [<c00a3c74>] (vfs_write+0x0/0xd8) from [<c00a3e10>] (sys_write+0x44/0x70)
    r7:08900000 r6:cfc73800 r5:00000000 r4:00000000
    [<c00a3dcc>] (sys_write+0x0/0x70) from [<c000aebc>] (populate_rootfs+0x1b4/0x1f8)
    r8:00000000 r7:cfcf4000 r6:cfcf4048 r5:00000000 r4:00000000
    [<c000ad08>] (populate_rootfs+0x0/0x1f8) from [<c003135c>] (do_one_initcall+0x64/0x1bc)
    [<c00312f8>] (do_one_initcall+0x0/0x1bc) from [<c00085f4>] (kernel_init+0x98/0x14c)
    r7:00000000 r6:00000000 r5:00000000 r4:c0028700
    [<c000855c>] (kernel_init+0x0/0x14c) from [<c0055fec>] (do_exit+0x0/0x5bc)
    r5:00000000 r4:00000000
    Mem-info:
    Normal per-cpu:
    CPU 0: hi: 90, btch: 15 usd: 6
    active_anon:0 inactive_anon:0 isolated_anon:0
    active_file:0 inactive_file:0 isolated_file:0
    unevictable:28554 dirty:0 writeback:0 unstable:0
    free:0 slab_reclaimable:43 slab_unreclaimable:121
    mapped:0 shmem:0 pagetables:0 bounce:0
    Normal free:0kB min:0kB low:0kB high:0kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:114216kB io
    lowmem_reserve[]: 0 0
    Normal: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 0kB
    28554 total pagecache pages
    65536 pages of RAM
    25 free pages
    36696 reserved pages
    122 slab pages
    0 pages shared
    0 pages swap cached
    Kernel panic - not syncing: Out of memory and no killable processes...

    Backtrace:
    [<c0035390>] (dump_backtrace+0x0/0x110) from [<c02d8fe4>] (dump_stack+0x18/0x1c)
    r7:cfc28000 r6:00000000 r5:00000000 r4:c03f0b10
    [<c02d8fcc>] (dump_stack+0x0/0x1c) from [<c02d9034>] (panic+0x4c/0xc8)
    [<c02d8fe8>] (panic+0x0/0xc8) from [<c0081e00>] (__out_of_memory+0x14c/0x194)
    r3:00000000 r2:c03d3e00 r1:00003320 r0:c0376bfd
    [<c0081cb4>] (__out_of_memory+0x0/0x194) from [<c0081edc>] (out_of_memory+0x94/0xcc)
    [<c0081e48>] (out_of_memory+0x0/0xcc) from [<c0084b94>] (__alloc_pages_nodemask+0x418/0x50c)
    r5:cfc26000 r4:00000000
    [<c008477c>] (__alloc_pages_nodemask+0x0/0x50c) from [<c007f85c>] (grab_cache_page_write_begin+0x58/0x98)
    [<c007f804>] (grab_cache_page_write_begin+0x0/0x98) from [<c00bd38c>] (simple_write_begin+0x28/0xe4)
    [<c00bd364>] (simple_write_begin+0x0/0xe4) from [<c007eac4>] (generic_file_buffered_write+0xe4/0x21c)
    r7:00000000 r6:06f8a000 r5:06f8a000 r4:00001000
    [<c007e9e0>] (generic_file_buffered_write+0x0/0x21c) from [<c0080770>] (__generic_file_aio_write+0x428/0x478)
    [<c0080348>] (__generic_file_aio_write+0x0/0x478) from [<c0080834>] (generic_file_aio_write+0x74/0xd8)
    [<c00807c0>] (generic_file_aio_write+0x0/0xd8) from [<c00a3348>] (do_sync_write+0xa0/0xec)
    [<c00a32a8>] (do_sync_write+0x0/0xec) from [<c00a3d24>] (vfs_write+0xb0/0xd8)
    r8:c2000000 r7:08900000 r6:cfc29f08 r5:c2000000 r4:cfc73800
    [<c00a3c74>] (vfs_write+0x0/0xd8) from [<c00a3e10>] (sys_write+0x44/0x70)
    r7:08900000 r6:cfc73800 r5:00000000 r4:00000000
    [<c00a3dcc>] (sys_write+0x0/0x70) from [<c000aebc>] (populate_rootfs+0x1b4/0x1f8)
    r8:00000000 r7:cfcf4000 r6:cfcf4048 r5:00000000 r4:00000000
    [<c000ad08>] (populate_rootfs+0x0/0x1f8) from [<c003135c>] (do_one_initcall+0x64/0x1bc)
    [<c00312f8>] (do_one_initcall+0x0/0x1bc) from [<c00085f4>] (kernel_init+0x98/0x14c)
    r7:00000000 r6:00000000 r5:00000000 r4:c0028700
    [<c000855c>] (kernel_init+0x0/0x14c) from [<c0055fec>] (do_exit+0x0/0x5bc)
    r5:00000000 r4:00000000


    I guess that...

    The problem is creating ramdisk.gz.

    Here you can see block size of NAND :

    http://processors.wiki.ti.com/index.php/DM816x_AM389x_PSP_U-Boot#U-Boot_NAND_Support

    Micron Nand parts (page size 2KB, block size 128KB) are supported on DM816xEVM platforms.

    So,

    In this wiki page,  http://processors.wiki.ti.com/index.php/Creating_a_RAMDISK,

    [root@localhost jjd]# dd if=/dev/zero of=ramdisk bs=1M count=32 32+0 records in 32+0 records out 33554432 bytes (34 MB) copied, 0.243921 s, 138 MB/s
    
    
    is right?
    
    
    I tried the following :

    $> dd if=/dev/zero of=ramdisk bs=128K count=2660
    2660+0 records in
    2660+0 records out
    348651520 bytes (349 MB) copied, 2.48309 s, 140 MB/s


    But failed.

    See also :

  • Hello, Hokyun Yu

    Did you try with:

                     dd if=/dev/zero of=ramdisk bs=1M count=349


    BR

  • Hokyun Yu,


    Your log says:


    Trying to unpack rootfs image as initramfs...
    rootfs image is not initramfs (no cpio magic); looks like an initrd


    It seems that your kernel is configured for initramfs, but you pass what is for the initrd  configuration.


    Please try to follow also the instructions here:


    http://processors.wiki.ti.com/index.php/Initrd

    Your case is initrd, but alternatively you can try initramfs. The file system and kernel in initramfs configuration are in one image.

    BR

  • 1st. initrd

    $> cd ti-ezsdk_c6a816x-evm_5_00_00_56

    $> make linux_clean

    $> source linux-devkit/environment –setup

    $> cd psp/linux-2.6.34-psp04.00.00.07

    $> make –C ./ ARCH=arm CROSS_COMPILE=/home/user/CodeSourcery/Sourcery_G++_Lite/bin/arm-non-linux-gnuebi- clean

    $> make –C ./ ARCH=arm CROSS_COMPILE=/home/user/CodeSourcery/Sourcery_G++_Lite/bin/arm-non-linux-gnuebi- ti8168_evm_defconfig

    $> gedit .config

    $> make –C ./ ARCH=arm CROSS_COMPILE=/home/user/CodeSourcery/Sourcery_G++_Lite/bin/arm-non-linux-gnuebi- uImage

    make ramdisk.gz

    $> dd if=dev/zero of=ramdisk bs=1M count=320M

    $> mkfs ramdisk

    $> sudo mount -o loop ramdisk mnt

    $> sudo cp -r /home/user/targetfs_fs/* mnt

    $> sudo umount mnt

    $> gzip ramdisk

    set u-boot env

    bootcmd=nand read 0x81000000 0x280000 0x1f0000;nand read 0x82000000 0x6c0000 0x7500000; bootm 0x81000000
    bootargs=console=ttyS2,115200n8 mem=512M earlyprintk root=/dev/ram0 rw initrd=0x82000000,320M

    boot

    but, same message :

    Trying to unpack rootfs image as initramfs...
    rootfs image is not initramfs (junk in compressed archive); looks like an initrd

    2nd. initramfs

    $> mkdir target_fs

    $> sudo cp –r /home/user/targetfs/* /target_fs

    $> sudo chmod 777 –R target_fs

    $> cd target_fs

    $> ln –s ./bin/busybox ./init

    $> find . | cpio -H newc -o > ../target_fs.cpio

    $> cd ..

    $> cd ti-ezsdk_c6a816x-evm_5_00_00_56/psp/linux-2.6.34-psp04.00.00.07

    $> gedit .config

    CONFIG_INITRAMFS_SOURCE="/home/user/target_fs"

    CONFIG_BLK_DEV_RAM=y
    CONFIG_BLK_DEV_RAM_COUNT=320
    CONFIG_BLK_DEV_RAM_SIZE=335544320
    CONFIG_BLK_dEV_RAM_BLOCKSIZE=1048576

    set u-boot env

    TI8168_EVM#printenv

    bootdelay=3
    baudrate=115200
    verify=yes
    ramdisk_file=ramdisk.gz
    loadaddr=0x81000000
    script_addr=0x80900000
    loadbootscript=fatload mmc 1 ${script_addr} boot.scr
    bootscript= echo Running bootscript from MMC/SD to set the ENV...; source ${script_addr}
    ethact=DaVinci EMAC
    autoload=no
    bootfile=uImage
    ethaddr=00:08:65:23:22:19
    nfsserver=192.168.1.230
    filesize=7491670
    fileaddr=81000000
    netmask=255.255.255.0
    ipaddr=192.168.1.241
    serverip=192.168.1.230
    bootcmd=nand read 0x81000000 0x280000 0x7500000;bootm 0x81000000
    stdin=serial
    stdout=serial
    stderr=serial
    ver=U-Boot 2010.06 (Nov 18 2010 - 22:36:59)

    Environment size: 597/8188 bytes

    boot


    TI8168_EVM#boot

    NAND read: device 0 offset 0x280000, size 0x7500000
       122683392 bytes read: OK
    ## Booting kernel from Legacy Image at 81000000 ...
          Image Name: Linux-2.6.34
          Image Type: ARM Linux Kernel Image (uncompressed)
          Data Size: 122230320 Bytes = 116.6 MiB
          Load Address: 80008000
          Entry Point: 80008000
          Verifying Checksum ... OK
          Loading Kernel Image ...

    ... just stopped.

    gg........Please explain easily....  T.T

  • Hello, Hokyun Yu

    About initrd:

    Please, try to create ramdisk.gz exactly how it is described here:

    http://processors.wiki.ti.com/index.php/Initrd#Creation

    http://processors.wiki.ti.com/index.php/Initrd#Filling

    =================================

    About initramfs:

    You don't have bootargs variable in your u-boot environment.

    Besides, this line:

    sudo cp –r /home/user/targetfs/* /target_fs

    should be:

    sudo cp –r /home/user/targetfs/* target_fs

    or

    sudo cp –r /home/user/targetfs/* /home/user/target_fs

    Please, also be sure to check this:

    "Then, if you compile the kernel, e.g. by make uImage, the cpio archive is generated and embedded into the kernel:

     ...
     CHK     include/linux/compile.h
     GEN     usr/initramfs_data.cpio.gz
     AS      usr/initramfs_data.o
     LD      usr/built-in.o
     ..."
    

    Thank you.

    BR

  • About initramfs :

    http://processors.wiki.ti.com/index.php/Initrd - initramfs - installation,

    "If you start the kernel, the initramfs is already there. Therefore, there is no root=/dev/ram0 rw initrd=0x87000000,8M bootargs option necessary. Remove this if you still have it!"

    So I deleted the bootargs.

    And set 'bootargs=console=ttyS2,115200n8 mem=512M earlyprintk' also.

    In addition, kernel size is 116MB. Is it right?



    Please, also be sure to check this:

    "Then, if you compile the kernel, e.g. by make uImage, the cpio archive is generated and embedded into the kernel:

     ...
     CHK     include/linux/compile.h
     GEN     usr/initramfs_data.cpio.gz
     AS      usr/initramfs_data.o
     LD      usr/built-in.o
     ..."
    

    I have checked that.

    Could you explain about 'initramfs - creation'?

    Especially init.

    I'll try to above initrd.

    I'm so sorry but please help.

  • Hello, Hokyun Yu

    initrd

    Please, try to follow the instructions on how to create ramdisk.gz under sections "Creation" and "Filling". And use that ramdisk.gz, not one that is created previously with another procedure.

    ========================

    initramfs

    You didn't have such line

    bootargs=console=ttyS2,115200n8 mem=512M earlyprintk

    when you posted your "printenv" output. That way your console isn't set up and that is why you see nothing after:

    TI8168_EVM#boot

    NAND read: device 0 offset 0x280000, size 0x7500000
       122683392 bytes read: OK
    ## Booting kernel from Legacy Image at 81000000 ...
          Image Name: Linux-2.6.34
          Image Type: ARM Linux Kernel Image (uncompressed)
          Data Size: 122230320 Bytes = 116.6 MiB
          Load Address: 80008000
          Entry Point: 80008000
          Verifying Checksum ... OK
          Loading Kernel Image ...

    //stops here

    So please, make sure that the bootargs are added and tell me is initramfs working now, and if it is not - what is the error now.

    BR

  • initramfs

    You didn't have such line

    bootargs=console=ttyS2,115200n8 mem=512M earlyprintk

    when you posted your "printenv" output. That way your console isn't set up and that is why you see nothing after:

    TI8168_EVM#boot

    NAND read: device 0 offset 0x280000, size 0x7500000
       122683392 bytes read: OK
    ## Booting kernel from Legacy Image at 81000000 ...
          Image Name: Linux-2.6.34
          Image Type: ARM Linux Kernel Image (uncompressed)
          Data Size: 122230320 Bytes = 116.6 MiB
          Load Address: 80008000
          Entry Point: 80008000
          Verifying Checksum ... OK
          Loading Kernel Image ...

    //stops here

    So please, make sure that the bootargs are added and tell me is initramfs working now, and if it is not - what is the error now.

    BR

    Set the bootargs, same error.

    Already tried.

    Just stopped.

  • Hello, Hokyun Yu

    How about the Initrd? Is it working now? That is the more standard method. I tried it myself before some time and it was OK.

    BR

  • Not yet.

    Please inform me if you already had tried initrd.

    I don't know what is the right method;

    http://processors.wiki.ti.com/index.php/Creating_a_RAMDISK or http://processors.wiki.ti.com/index.php/Initrd#initramfs.

    target_fs size is 72.9MB4130.target_fs.tar.gz

  • I succeeded in the initrd.

    kernel compile

    $> cd c6a816x/psp/linux

    $> make -C ./ ARCH=arm CROSS_COMPILE=/home/yuhk/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- ti8168_evm_defconfig

    .config;

    CONFIG_BLK_DEV_RAM_COUNT=320

    CONFIG_BLK_DEV_RAM_SIZE=3277680

    $> make -C ./ ARCH=arm CROSS_COMPILE=/home/yuhk/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- uImage

    $> make -C ./ ARCH=arm CROSS_COMPILE=/home/yuhk/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- modules

    $> make -C ./ ARCH=arm CROSS_COMPILE=/home/yuhk/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi- linux_install

    $> cp ./arch/arm/boot/uImage /tftpboot



    make ramdisk

    $> dd if=/dev/zero of=ramdisk bs=1M count=320

    $> mkfs ramdisk

    $> mount -o loop mnt

    $> cp -r ./targetfs/* mnt

    $> umount mnt

    set u-boot env

    bootargs=console=ttyS2,115200n8 mem=512M earlyprintk root=/dev/ram0 rw initrd=0x82000000,123M

    bootcmd=nand read 0x81000000 0x280000 0x1f0000;nand read 0x82000000 0x6c0000 0x7b00000;bootm 0x81000000

  • Hello, Hokyun Yu

    Congrats for your success, I am glad that we've resolved this. Write again if you have another questions. Thank you.

    BR

  • How about the initramfs?

  • Hello, Hokyun Yu

    I am only aware of this HOWTO (the one that you know):

    http://processors.wiki.ti.com/index.php/Initrd#initramfs

    I don't think that there are some further instructions about it. Perhaps it works, but I haven't tried it myself. Keep in mind that it is possible some tuning to be required on your side in order to make it working.

    BR

  • Hi,

    I am trying the similar ramdisk (cpio format) as the root filesystem with ti8168 plus DSP with Syslink, and I am having problem with DSP failing processing audio (G.711).

    Can using ramdisk (about 300M) mess up with some DSP's memory mapping?  It seems Syslink's kernel module is doing some memory mapping

    The same compiled code and apps are working correctly on the audio when booting with NFS filesystem.

    Any help would be appreciated,

    --Joe

  • Hello Joe,

    Can you please start new forum thread regarding this one? Also please post, where in the memory you load your cpio kernel image with "bootcmd" in u-boot.

    Thank you.

    BR

    Vladimir