LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-01-2013, 02:10 AM   #1
ranjana kumari
LQ Newbie
 
Registered: Jul 2012
Posts: 16

Rep: Reputation: Disabled
not able to load filesystem into nand flash


I am trying to put filesystem into nand flash from sd card.
My target board is having Tis320dm368 controller with linux platform.
Nand flash of the target and sd card has Bootloader - U-Boot 2010.12-rc2 , Kernel- Linux-2.6.18-pro500-davinci_IPNC.

I am able to put bootloader and kernel into nand flash but loading filesytem into nand is giving pain

When my target board is up using sd card I ran following commands on EVM to copy the default filesystem in NAND flash



target # flash_eraseall /dev/mtd3
target # mount /dev/mtdblock3 /mnt/nand -t jffs2
target # cd /mnt/nand
target # tar zxf /home/root/filesystem.tar.gz

I got this error message "Cannot open: Input/output error"

and the nand flash is corrupted.

please suggest some solution
 
Old 01-01-2013, 04:57 AM   #2
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,420

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
have you tried
Quote:
cd /tmp
mkdir flash
cd flash
tar -zxvf /home/root/filesystem.tar.gz
cp -a * /mnt/nand
 
Old 01-02-2013, 02:29 AM   #3
ranjana kumari
LQ Newbie
 
Registered: Jul 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
when i tried the following steps

cd /tmp
mkdir flash
cd flash
tar -zxvf /home/root/filesystem.tar.gz
cp -a * /mnt/nand

and rebooted the target board I got the following message

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde0000: 0xc600 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde0004: 0x2046 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde0008: 0x4142 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde000c: 0x400c instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde0010: 0x0108 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde0014: 0x8006 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde0018: 0x8209 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde001c: 0x7140 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde0020: 0x2004 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0dde0024: 0x4000 instead
Further such events for this erase block will not be printed
Old JFFS2 bitmask found at 0x0dde75b8
You cannot use older JFFS2 filesystems with newer kernels
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de00000: 0xc200 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de00004: 0x2846 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de00008: 0x4862 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de0000c: 0x500a instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de00010: 0x0108 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de00014: 0xc104 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de00018: 0x030d instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de0001c: 0x5140 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de00020: 0x2900 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0de00024: 0xc400 instead
Further such events for this erase block will not be printed
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 184K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to kernel.

no idea what to do next..
 
Old 01-02-2013, 02:46 AM   #4
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,420

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
Quote:
You cannot use older JFFS2 filesystems with newer kernels
So now you know the problem!
 
Old 01-02-2013, 07:24 AM   #5
ranjana kumari
LQ Newbie
 
Registered: Jul 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
Now I am able to mount filesytem into nand .But when i reset the target board entire nand flash got erased.

So I booted the target board with sd card but i got the following message

nand_read_bbt: Bad block at 0x00001f820000
nand_read_bbt: Bad block at 0x00001f840000
nand_read_bbt: Bad block at 0x00001f860000
nand_read_bbt: Bad block at 0x00001f880000
nand_read_bbt: Bad block at 0x00001f8a0000
nand_read_bbt: Bad block at 0x00001f8c0000
nand_read_bbt: Bad block at 0x00001f8e0000
nand_read_bbt: Bad block at 0x00001f900000
nand_read_bbt: Bad block at 0x00001f920000
nand_read_bbt: Bad block at 0x00001f940000
nand_read_bbt: Bad block at 0x00001f960000
nand_read_bbt: Bad block at 0x00001f980000
nand_read_bbt: Bad block at 0x00001f9a0000
nand_read_bbt: Bad block at 0x00001f9c0000
nand_read_bbt: Bad block at 0x00001f9e0000
nand_read_bbt: Bad block at 0x00001fa00000
nand_read_bbt: Bad block at 0x00001fa20000
nand_read_bbt: Bad block at 0x00001fa40000
nand_read_bbt: Bad block at 0x00001fa60000
nand_read_bbt: Bad block at 0x00001fa80000
nand_read_bbt: Bad block at 0x00001faa0000

I think this message is giving problem..not sure
 
Old 01-02-2013, 07:36 AM   #6
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,420

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
Have you tried EITHER
going back to an old kernel (no idea on version)

OR

Using a different filesystem that is supported by the kernel?
 
Old 01-02-2013, 11:01 PM   #7
ranjana kumari
LQ Newbie
 
Registered: Jul 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
Nand flash size is 256 Mb and I m having JFFS2 filesystem. I cant switch to other filesystem .

So please suggest whether nand partition size is giving problem or JFFS2 is not compatible with Kernel- Linux-2.6.18-pro500-davinci_IPNC
 
Old 01-02-2013, 11:35 PM   #8
ranjana kumari
LQ Newbie
 
Registered: Jul 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
As i had mentioned in previous post that my target board is booting from Sd card, I am posting the boot message.

This may help to get the solution

DM36x initialization passed!
TI UBL Version: 1.50
Booting Catalog Boot Loader
BootMode = SD/MMC
Starting SDMMC Copy...
DONE
Jumping to entry point at 0x81080000.


U-Boot 2010.12-rc2 (Mar 24 2011 - 16:49:26)

Cores: ARM 432 MHz
DDR: 340 MHz
I2C: ready
DRAM: 128 MiB
NAND: 512 MiB
MMC: davinci: 0, davinci: 1
Bad block table not found for chip 0
Bad block table not found for chip 1
Bad block table not found for chip 0
Bad block table not found for chip 1
Bad block table written to 0x00000ffe0000, version 0x01
Bad block table written to 0x00000ffc0000, version 0x01
Bad block table written to 0x00001ffe0000, version 0x01
Bad block table written to 0x00001ffc0000, version 0x01
*** Warning - readenv() failed, using default environment

Net: Read from EEPROM @ 0x50 failed
No ETH PHY detected!!!
DaVinci-EMAC
Hit any key to stop autoboot: 0
reading boot.scr

388 bytes read
## Executing script at 80600000
reading uImage

1872980 bytes read
## Booting kernel from Legacy Image at 80700000 ...
Image Name: Linux-2.6.18_pro500-davinci_IPNC
Created: 2013-01-02 3:56:01 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1872916 Bytes = 1.8 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux............................................................................................... .............................. done, booti.
Linux version 2.6.18_pro500-davinci_IPNC_1.5 (root@sandeep-desktop) (gcc version 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30)) #1 PREEMPT Fri Sep 28 2
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
Machine: DaVinci DM365 EVM
Memory policy: ECC disabled, Data cache writeback
DaVinci DM0365 variant 0x8
PLL0: fixedrate: 24000000, commonrate: 170000000, vpssrate: 340000000
PLL0: vencrate_sd: 75555555, ddrrate: 340000000 mmcsdrate: 97142857
PLL1: armrate: 432000000, voicerate: 20571428, vencrate_hd: 27000000
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
Built 1 zonelists. Total pages: 15360
Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw ip=off mem=60M video=davincifb:vid0=OFF:vid1=OFFsd0=480x272x16,4050K dm365_imp.oper_mot
Unknown boot option `dm365_imp.oper_mode=0': ignoring
Unknown boot option `vpfe_capture.interface=1': ignoring
PID hash table entries: 256 (order: 8, 1024 bytes)
Clock event device timer0_0 configured with caps set: 07
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 60MB = 60MB total
Memory: 56716KB available (3209K code, 660K data, 184K init)
Security Framework v1.0.0 initialized
Capability LSM initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
MUX: initialized SPI0_SCLK
MUX: initialized SPI0_SDO)
MUX: initialized SPI0_SDI
MUX: initialized SPI0_SDENA0
DaVinci: 104 gpio irqs
MUX: initialized GPIO20
MUX: initialized I2C_SCL
Generic PHY: Registered new driver
ch0 default output "LCD", mode "NTSC"
VPBE Encoder Initialized
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 512 (order: -1, 2048 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
enable CCD power Vout4
MUX: initialized GPIO40
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
squashfs: version 3.1 (2006/08/19) Phillip Lougher
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
yaffs Aug 4 2012 15:49:25 Installing.
SGI XFS with no debug enabled
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered (default)
LTT : ltt-facilities init
LTT : ltt-facility-core init in kernel
DAVINCI-WDT: DaVinci Watchdog Timer: heartbeat 60 sec
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO map 0x1c20000 mem 0xfbc20000 (irq = 40) is a 16550A
serial8250.0: ttyS1 at MMIO map 0x1d06000 mem 0xfbd06000 (irq = 41) is a 16550A
RAMDISK driver initialized: 1 RAM disks of 32768K size 1024 blocksize
Davinci EMAC MII Bus: probed
MAC address is deadbeaf
TI DaVinci EMAC Linux version updated 4.0
netconsole: not configured, aborting
Linux video capture interface: v2.00
Trying to register davinci display video device.
layer=c0660e00,layer->video_dev=c0660f60
Trying to register davinci display video device.
layer=c0660c00,layer->video_dev=c0660d60
davinci_initaVinci V4L2 Display Driver V1.0 loaded
i2c /dev entries driver
nand_davinci nand_davinci.0: Using 4-bit hardware ECC
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
2 NAND chips detected
Bad block table not found for chip 0
Bad block table not found for chip 1
Bad block table not found for chip 0
Bad block table not found for chip 1
Scanning device for bad blocks
Scanning device for bad blocks
Creating 5 MTD partitions on "nand_davinci.0":
0x00000000-0x003c0000 : "bootloader"
0x003c0000-0x00400000 : "params"
0x00400000-0x00800000 : "kernel"
0x00800000-0x02800000 : "filesystem1"
0x02800000-0x20000000 : "filesystem2"
nand_davinci nand_davinci.0: hardware revision: 2.3
musb_hdrc: version 6.0, cppi-dma, peripheral, debug=0
MUX: initialized GPIO33
musb_hdrc: USB Peripheral mode controller at c401c000 using DMA, IRQ 12
media_bind()
media_gadget_init()
rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: proc
rtc_davinci_dm365 rtc_davinci_dm365.0: rtc intf: dev (254:0)
rtc_davinci_dm365 rtc_davinci_dm365.0: rtc core: registered rtc_davinci_dm365 as rtc0
davinci-mmc davinci-mmc.0: Supporting 4-bit mode
davinci-mmc davinci-mmc.0: Using DMA mode
Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50 2006 UTC).
ASoC version 0.13.1
CQ0093 Voice Codec 0.1
asoc: cq93vc <-> davinci-vcif mapping ok
ALSA device list:
#0: On-chip voice codec (cq93vc)
IPv4 over IPv4 tunneling driver
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
rtc_davinci_dm365 rtc_davinci_dm365.0: setting the system clock to 2000-01-01 00:00:00 (946684800)
Time: timer0_1 clocksource has been installed.
Clock event device timer0_0 configured with caps set: 08
Switched to high resolution mode on CPU 0
mmcblk0: mmc0:0002 00000 1955840KiB
mmcblk0: p1 p2
kjournald starting. Commit interval 5 seconds
EXT3 FS on mmcblk0p2, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem).
Freeing init memory: 184K
INIT: version 2.86 booting
0
Starting the hotplug events dispatcher: udevd.
Synthesizing the initial hotplug events...done.
Waiting for /dev to be fully populated...done.
0
Activating swap...done.
Remounting root filesystem...done.
Starting mounting local filesystems: mount none on /dev/shm type tmpfs (rw,size=5M)
none on /var/run type tmpfs (rw)
none on /tmp type tmpfs (rw,sync)
Setting up networking ....
Starting hotplug subsystem:
pci
pci [success]
usb
usb [success]
isapnp
isapnp [success]
ide
ide [success]
input
input [success]
scsi
scsi [success]
done.
Starting portmap daemon: portmap.
./av_capture_load.sh: ./av_capture_load.sh: 5: ./csl_load.sh: not found
insmod: ./drv.ko: No such file or directory
BusyBox v1.2.2 (2007.03.11-00:56+0000) multi-call binary

Usage: mknod [OPTIONS] NAME TYPE MAJOR MINOR

Create a special file (block, character, or pipe).

Options:
-m create the special file using the specified mode (default a=rw)

TYPEs include:
b: Make a block (buffered) device
c or u: Make a character (un-buffered) device
p: Make a named pipe. MAJOR and MINOR are ignored for named pipes

BusyBox v1.2.2 (2007.03.11-00:56+0000) multi-call binary

Usage: mknod [OPTIONS] NAME TYPE MAJOR MINOR

Create a special file (block, character, or pipe).

Options:
-m create the special file using the specified mode (default a=rw)

TYPEs include:
b: Make a block (buffered) device
c or u: Make a character (un-buffered) device
p: Make a named pipe. MAJOR and MINOR are ignored for named pipes

insmod: cmemk.ko: No such file or directory
insmod: edmak.ko: No such file or directory
insmod: irqk.ko: No such file or directory
INIT: Entering runlevel: 3
Starting internet superserver: inetd.

MontaVista(R) Linux(R) Professional Edition 5.0.0 (0702774)

(none) login:
 
Old 01-03-2013, 03:07 AM   #9
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,420

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
Have you addressed the situation I highlighted in post #4? If so, how?

You won't get very far until you do. If you can't get away from jffs2, you need to have kernel support for it.
 
Old 01-03-2013, 08:16 AM   #10
ranjana kumari
LQ Newbie
 
Registered: Jul 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
now i am using the following kernel
Linux version 2.6.32.17-davinci...but I am stuck..
when the target board is up with the above kernel and filesytem, i entered cat /proc/mtd
but cat /proc/mtd is empty.its displaying only -
dev: size erasesize name
 
Old 01-03-2013, 08:37 AM   #11
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,420

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
At the bottom of this is some embedded board. You are going to need a compatible kernel in your box. As for kernel support:

bash-4.2$ grep -n JFFS2 /usr/src/linux-3.7.1/.config
3484:# CONFIG_JFFS2_FS is not set

It seems to be in the kernel since 2.4.10. . .
Is JFFS2 what you are using? Rebuild your kernel and include it!
 
  


Reply

Tags
arm9, embedded, linux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Samsung contributes F2FS NAND filesystem to Linux LXer Syndicated Linux News 0 10-08-2012 12:30 PM
[SOLVED] Which filesystem for NAND? littlebigman Linux - Embedded & Single-board computer 3 06-09-2011 02:40 AM
Problem on Linux NAND root filesystem cfnielse Linux - Embedded & Single-board computer 5 04-10-2011 12:30 PM
R/W from nand flash linux_newbie79 Linux - Newbie 3 08-19-2009 08:35 AM
nand flash: need help jier Programming 0 05-03-2006 11:05 PM


All times are GMT -5. The time now is 11:28 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration