[prev in list] [next in list] [prev in thread] [next in thread]
List: uclinux-dev
Subject: [uClinux-dev] how to mount flash via jffs2 as dir /mnt ?
From: "Falk Brettschneider" <falk.brettschneider () gmx ! de>
Date: 2006-03-17 10:28:35
Message-ID: 1093.1142591315 () www067 ! gmx ! net
[Download RAW message or body]
This is a MIME encapsulated multipart message -
please use a MIME-compliant e-mail program to open it.
Dies ist eine mehrteilige Nachricht im MIME-Format -
bitte verwenden Sie zum Lesen ein MIME-konformes Mailprogramm.
Hi,
I don't get it what mistake I make as I want to mount my flash (16MB,
AM29LV128M) via jffs2, it seems to me there isn't much to change. So can
anybody have a look, please?
In the end I want to read/write my flash via filesystem mount.
My system is:
- microblaze
- CVS-tag "uClinux-2_4_32-uc0"
- CVS-tag "uClinux-dist-20051014"
attached to this mail: my boot logging and the MTD stuff from the kernel
.config file.
(Note that I just want to use the last 4MB of the 16MB flash memory, that's
why the direct physical memory mapping.)
The root filesystem is correctly loaded as ROM filesystem via the common
approach used for microblaze (make romfs image). Additionally, I create a
RAM disk by "mount -t ramfs none /var" in the rc file during the bootup.
-----------
The booting:
The flash is correctly detected during the bootup:
...
physmap flash device: 400000 at fec00000
Amd/Fujitsu Extended Query Table v1.3 at 0x0040
number of CFI chips: 1
Somewhat seems to me also been registered to the MTD control (flash memory
or the 32MB SDRAM?):
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
mtd: Giving out device 0 to Physically mapped flash
physmap: no partition info available, registering whole flash at once
mtd: Giving out device 1 to Physically mapped flash
The romfs image seems to be registered to MTD this way:
uclinux[mtd]: RAM probe address=0x800d622c size=0x61000
mtd: Giving out device 2 to RAM
uclinux[mtd]: root filesystem index=2
init_mtdchar: allocated major number 90.
init_mtdblock: allocated major number 31.
mtdblock_open
ok
mtdblock: read on "RAM" at 0x0, size 0x400
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 36K
mtdblock: read on "RAM" at 0x5f800, size 0x400
mtdblock: read on "RAM" at 0x5fc00, size 0x400
mtdblock: read on "RAM" at 0x60000, size 0x400
...
-------------
After bootup I can read:
/> cat /proc/mtd
dev: size erasesize name
mtd0: 01000000 00010000 "Physically mapped flash"
mtd1: 01000000 00010000 "Physically mapped flash"
mtd2: 00061000 00001000 "RAM"
Here it looks like mtd0 and mtd1 is the flash, although the boot log looks
like
-------------
What mtd device is the flash now? I have /dev/mtd0 to /dev/mtd7
/> ls -l /dev/mtd*
crw------- 1 0 0 90, 15 /dev/mtdr7
crw------- 1 0 0 90, 13 /dev/mtdr6
crw------- 1 0 0 90, 11 /dev/mtdr5
crw------- 1 0 0 90, 9 /dev/mtdr4
crw------- 1 0 0 90, 7 /dev/mtdr3
crw------- 1 0 0 90, 5 /dev/mtdr2
crw------- 1 0 0 90, 3 /dev/mtdr1
crw------- 1 0 0 90, 1 /dev/mtdr0
brw------- 1 0 0 31, 7 /dev/mtdblock7
brw------- 1 0 0 31, 6 /dev/mtdblock6
brw------- 1 0 0 31, 5 /dev/mtdblock5
brw------- 1 0 0 31, 4 /dev/mtdblock4
brw------- 1 0 0 31, 3 /dev/mtdblock3
brw------- 1 0 0 31, 2 /dev/mtdblock2
brw------- 1 0 0 31, 1 /dev/mtdblock1
brw------- 1 0 0 31, 0 /dev/mtdblock0
crw------- 1 0 0 90, 14 /dev/mtd7
crw------- 1 0 0 90, 12 /dev/mtd6
crw------- 1 0 0 90, 10 /dev/mtd5
crw------- 1 0 0 90, 8 /dev/mtd4
crw------- 1 0 0 90, 6 /dev/mtd3
crw------- 1 0 0 90, 4 /dev/mtd2
crw------- 1 0 0 90, 2 /dev/mtd1
crw------- 1 0 0 90, 0 /dev/mtd0
/>
----------
Huh? Block device?:
/> mount -t jffs2 /dev/mtd3 /mnt
mount: Mounting /dev/mtd3 on /mnt failed: Block device required
pid 18: failed 256
/>
-------------
Why does fdisk do such strange things for mtd0 and mtd1 (same output)?
/> fdisk /dev/mtd0
MTD_open
MTD_ioctl
Invalid ioctl 1260 (MEMGETINFO = 80204d01)
MTD_ioctl
Invalid ioctl 301 (MEMGETINFO = 80204d01)
MTD_read
MTD_read
Device contains neither a validMTD_read
DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
You must set heads sectors and cylinders.
You can do this from the extra functions menu.
Command (m for help): p
Disk /dev/mtd0: 0 heads, 0 sectors, 0 cylinders
Units = cylinders of 1 * 512 bytes
Device Boot Start End Blocks Id System
/dev/mtd0p1 ? 0 -2 2147483647+ ff BBT
/dev/mtd0p2 ? 0 -2 2147483647+ ff BBT
/dev/mtd0p3 ? 0 -2 2147483647+ ff BBT
/dev/mtd0p4 ? 0 65534 32767+ ff BBT
-------------------
What's up with mtd2?:
/> fdisk /dev/mtd2
MTD_open
MTD_ioctl
Invalid ioctl 1260 (MEMGETINFO = 80204d01)
MTD_ioctl
Invalid ioctl 301 (MEMGETINFO = 80204d01)
MTD_read
MTD_read
Device contains neither a validMTD_read
DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
You must set heads sectors and cylinders.
You can do this from the extra functions menu.
Command (m for help): p
Disk /dev/mtd2: 0 heads, 0 sectors, 0 cylinders
Units = cylinders of 1 * 512 bytes
Device Boot Start End Blocks Id System
/dev/mtd2p2 121 121 0 73 Unknown
/dev/mtd2p3 1 -1936783616 1179091840 2 XENIX root
Partition table entries are not in disk order
-----------
and I cannot look at mtd3 (?):
/> fdisk /dev/mtd3
MTD_open
MTD_open
Unable to open /dev/mtd3
pid 19: failed 256
/>
How can one configure the microblaze uClinux system to use that AMD flash?
I also read this but does not really give me a clue:
http://mailman.uclinux.org/pipermail/uclinux-dev/2005-July/033680.html
http://www.enseirb.fr/~kadionik/embedded/uclinux/mtd/howto_mtd.html
http://www.cyberguard.info/snapgear/tb20020917.html
http://www.ucdot.org/article.pl?sid=03/01/11/1049210&mode=thread
TIA + Cheers,
F@lk
--
Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer!
Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer
["bootlog.txt" (text/plain)]
Linux version 2.4.32-uc0 (fbr@linux) (gcc version 3.4.1 ( Xilinx EDK 8.1 Build \
EDK_I.17 121005 )) #1 Do Mär 16 17:27:00 CET 2006
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
CPU: MICROBLAZE
Kernel command line:
Console: xmbserial on UARTLite
Calibrating delay loop... 47.20 BogoMIPS
Memory: 32MB = 32MB total
Memory: 31164KB available (662K code, 581K data, 36K init)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Microblaze UARTlite serial driver version 1.00
ttyS0 at 0xffff2000 (irq = 1) is a Microblaze UARTlite
ttyS1 at 0xffff4000 (irq = 2) is a Microblaze UARTlite
Starting kswapd
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
Allocated 399036 bytes for deflate workspace
Allocated 46912 bytes for inflate workspace
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
vsint: loading VeriSens interrupt handler driver...
enable_irq(4) unbalanced from 00000000
physmap flash device: 400000 at fec00000
Amd/Fujitsu Extended Query Table v1.3 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
mtd: Giving out device 0 to Physically mapped flash
physmap: no partition info available, registering whole flash at once
mtd: Giving out device 1 to Physically mapped flash
uclinux[mtd]: RAM probe address=0x800d622c size=0x61000
mtd: Giving out device 2 to RAM
uclinux[mtd]: root filesystem index=2
init_mtdchar: allocated major number 90.
init_mtdblock: allocated major number 31.
mtdblock_open
ok
mtdblock: read on "RAM" at 0x0, size 0x400
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 36K
mtdblock: read on "RAM" at 0x5f800, size 0x400
mtdblock: read on "RAM" at 0x5fc00, size 0x400
mtdblock: read on "RAM" at 0x60000, size 0x400
mtdblock: read on "RAM" at 0x60800, size 0x400
mtdblock: read on "RAM" at 0x9c00, size 0x400
mtdblock: read on "RAM" at 0x14000, size 0x400
mtdblock: read on "RAM" at 0x14400, size 0x400
mtdblock: read on "RAM" at 0x14800, size 0x400
mtdblock: read on "RAM" at 0x14c00, size 0x400
mtdblock: read on "RAM" at 0x15000, size 0x400
mtdblock: read on "RAM" at 0x15400, size 0x400
mtdblock: read on "RAM" at 0x15800, size 0x400
mtdblock: read on "RAM" at 0x15c00, size 0x400
mtdblock: read on "RAM" at 0x16000, size 0x400
mtdblock: read on "RAM" at 0x16400, size 0x400
mtdblock: read on "RAM" at 0x16800, size 0x400
mtdblock: read on "RAM" at 0x16c00, size 0x400
mtdblock: read on "RAM" at 0x17000, size 0x400
mtdblock: read on "RAM" at 0x17400, size 0x400
mtdblock: read on "RAM" at 0x17800, size 0x400
mtdblock: read on "RAM" at 0x17c00, size 0x400
mtdblock: read on "RAM" at 0x18000, size 0x400
mtdblock: read on "RAM" at 0x18400, size 0x400
mtdblock: read on "RAM" at 0x60400, size 0x400
mtdblock: read on "RAM" at 0x400, size 0x400
mtdblock: read on "RAM" at 0x800, size 0x400
mtdblock: read on "RAM" at 0xc00, size 0x400
mtdblock: read on "RAM" at 0x1000, size 0x400
mtdblock: read on "RAM" at 0x1400, size 0x400
mtdblock: read on "RAM" at 0x1800, size 0x400
mtdblock: read on "RAM" at 0x1c00, size 0x400
mtdblock: read on "RAM" at 0x2000, size 0x400
mtdblock: read on "RAM" at 0x2400, size 0x400
mtdblock: read on "RAM" at 0x2800, size 0x400
mtdblock: read on "RAM" at 0x2c00, size 0x400
mtdblock: read on "RAM" at 0x3000, size 0x400
mtdblock: read on "RAM" at 0x3400, size 0x400
mtdblock: read on "RAM" at 0x3800, size 0x400
mtdblock: read on "RAM" at 0x3c00, size 0x400
mtdblock: read on "RAM" at 0x4000, size 0x400
mtdblock: read on "RAM" at 0x4400, size 0x400
mtdblock: read on "RAM" at 0x4800, size 0x400
mtdblock: read on "RAM" at 0x4c00, size 0x400
mtdblock: read on "RAM" at 0x5000, size 0x400
mtdblock: read on "RAM" at 0x5400, size 0x400
mtdblock: read on "RAM" at 0x5800, size 0x400
mtdblock: read on "RAM" at 0x5c00, size 0x400
mtdblock: read on "RAM" at 0x6000, size 0x400
mtdblock: read on "RAM" at 0x6400, size 0x400
mtdblock: read on "RAM" at 0x6800, size 0x400
mtdblock: read on "RAM" at 0x6c00, size 0x400
mtdblock: read on "RAM" at 0x7000, size 0x400
mtdblock: read on "RAM" at 0x7400, size 0x400
mtdblock: read on "RAM" at 0x7800, size 0x400
mtdblock: read on "RAM" at 0x7c00, size 0x400
mtdblock: read on "RAM" at 0x8000, size 0x400
mtdblock: read on "RAM" at 0x8400, size 0x400
mtdblock: read on "RAM" at 0x8800, size 0x400
mtdblock: read on "RAM" at 0x8c00, size 0x400
mtdblock: read on "RAM" at 0x9000, size 0x400
mtdblock: read on "RAM" at 0x9400, size 0x400
mtdblock: read on "RAM" at 0x9800, size 0x400
Shell invoked to run file: /etc/rc
Command:
Command:
Command:
Command:
Command: mount -t proc proc /proc
mtdblock: read on "RAM" at 0x21400, size 0x400
mtdblock: read on "RAM" at 0x2fc00, size 0x400
mtdblock: read on "RAM" at 0x33400, size 0x400
mtdblock: read on "RAM" at 0x36000, size 0x400
mtdblock: read on "RAM" at 0x3a000, size 0x400
mtdblock: read on "RAM" at 0x3d400, size 0x400
mtdblock: read on "RAM" at 0x41800, size 0x400
mtdblock: read on "RAM" at 0x45800, size 0x400
mtdblock: read on "RAM" at 0x51800, size 0x400
mtdblock: read on "RAM" at 0x51c00, size 0x400
mtdblock: read on "RAM" at 0x52000, size 0x400
mtdblock: read on "RAM" at 0x52400, size 0x400
mtdblock: read on "RAM" at 0x52800, size 0x400
mtdblock: read on "RAM" at 0x52c00, size 0x400
mtdblock: read on "RAM" at 0x53000, size 0x400
mtdblock: read on "RAM" at 0x53400, size 0x400
mtdblock: read on "RAM" at 0x53800, size 0x400
mtdblock: read on "RAM" at 0x53c00, size 0x400
mtdblock: read on "RAM" at 0x54000, size 0x400
mtdblock: read on "RAM" at 0x54400, size 0x400
mtdblock: read on "RAM" at 0x54800, size 0x400
mtdblock: read on "RAM" at 0x54c00, size 0x400
mtdblock: read on "RAM" at 0x55000, size 0x400
mtdblock: read on "RAM" at 0x55400, size 0x400
mtdblock: read on "RAM" at 0x55800, size 0x400
mtdblock: read on "RAM" at 0x55c00, size 0x400
mtdblock: read on "RAM" at 0x56000, size 0x400
mtdblock: read on "RAM" at 0x56400, size 0x400
mtdblock: read on "RAM" at 0x56800, size 0x400
mtdblock: read on "RAM" at 0x56c00, size 0x400
mtdblock: read on "RAM" at 0x57000, size 0x400
mtdblock: read on "RAM" at 0x57400, size 0x400
mtdblock: read on "RAM" at 0x57800, size 0x400
mtdblock: read on "RAM" at 0x57c00, size 0x400
mtdblock: read on "RAM" at 0x58000, size 0x400
mtdblock: read on "RAM" at 0x58400, size 0x400
mtdblock: read on "RAM" at 0x58800, size 0x400
mtdblock: read on "RAM" at 0x58c00, size 0x400
mtdblock: read on "RAM" at 0x59000, size 0x400
mtdblock: read on "RAM" at 0x59400, size 0x400
mtdblock: read on "RAM" at 0x59800, size 0x400
mtdblock: read on "RAM" at 0x59c00, size 0x400
mtdblock: read on "RAM" at 0x5a000, size 0x400
mtdblock: read on "RAM" at 0x5a400, size 0x400
mtdblock: read on "RAM" at 0x5a800, size 0x400
mtdblock: read on "RAM" at 0x5ac00, size 0x400
mtdblock: read on "RAM" at 0x5b000, size 0x400
mtdblock: read on "RAM" at 0x5b400, size 0x400
mtdblock: read on "RAM" at 0x5b800, size 0x400
mtdblock: read on "RAM" at 0x5bc00, size 0x400
mtdblock: read on "RAM" at 0x5c000, size 0x400
mtdblock: read on "RAM" at 0x5c400, size 0x400
mtdblock: read on "RAM" at 0x5c800, size 0x400
mtdblock: read on "RAM" at 0x5cc00, size 0x400
mtdblock: read on "RAM" at 0x5d000, size 0x400
mtdblock: read on "RAM" at 0x5d400, size 0x400
mtdblock: read on "RAM" at 0x5d800, size 0x400
mtdblock: read on "RAM" at 0x5dc00, size 0x400
mtdblock: read on "RAM" at 0x5e000, size 0x400
mtdblock: read on "RAM" at 0x5e400, size 0x400
mtdblock: read on "RAM" at 0x5e800, size 0x400
mtdblock: read on "RAM" at 0x5ec00, size 0x400
mtdblock: read on "RAM" at 0x5f000, size 0x400
mtdblock: read on "RAM" at 0x5f400, size 0x400
Command: mount -t ramfs none /var
init: Failed to open /etc/inittab.
Sash command shell (version 1.1.1)
/>
["config.txt" (text/plain)]
#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=3
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_UCBOOTSTRAP_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CFI_AMDSTD=y
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_RAM=y
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_OBSOLETE_CHIPS is not set
# CONFIG_MTD_AMDSTD is not set
# CONFIG_MTD_SHARP is not set
# CONFIG_MTD_JEDEC is not set
# CONFIG_MTD_PSD4256G is not set
#
# Mapping drivers for chip access
#
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=fec00000
CONFIG_MTD_PHYSMAP_LEN=400000
CONFIG_MTD_PHYSMAP_BUSWIDTH=2
# CONFIG_MTD_UCBOOTSTRAP is not set
# CONFIG_MTD_DRAGONIX is not set
# CONFIG_MTD_NETtel is not set
# CONFIG_MTD_SNAPGEODE is not set
# CONFIG_MTD_NETteluC is not set
# CONFIG_MTD_MBVANILLA is not set
# CONFIG_MTD_MB_AUTO is not set
# CONFIG_MTD_ML401 is not set
# CONFIG_MTD_SUZAKU is not set
# CONFIG_MTD_KeyTechnology is not set
# CONFIG_MTD_SED_SIOSIII is not set
CONFIG_MTD_UCLINUX=y
# CONFIG_MTD_PCI is not set
# CONFIG_MTD_PCMCIA is not set
#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_MTDCNXT is not set
# CONFIG_MTD_BLKMTD is not set
# CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
# CONFIG_MTD_DOCPROBE is not set
#
# NAND Flash Device Drivers
#
# CONFIG_MTD_NAND is not set
#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_CISS_SCSI_TAPE is not set
# CONFIG_CISS_MONITOR_THREAD is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_BLK_DEV_RAMDISK_DATA is not set
# CONFIG_BLK_DEV_BLKMEM is not set
# CONFIG_BLK_STATS is not set
#
# File systems
#
# CONFIG_JFFS_FS is not set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=2
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic