[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] Mount JFFS2 returns "No such device" on existing device.
On Thu, 2009-09-17 at 17:39 +0200, Michael Allwright wrote:
> G'day All
>
> This is a question that has been going around for awhile without any
> solution, and i think its about time it was solved and posted onto the web.
>
> The problem is related to mounting partitions in Petalinux, in this
> particular example we are running petalinux off a Spartan 3A DSP 1800a
> development board using bitstream configuration from BPI flash. The
> target partition to mount is to be formated to JFFS2 to provide a
> persistant storage for applications, config etc
>
> The BPI flash, is a 128Mbit = 16MByte NOR parallel flash device from
> intel, and goes by the model number JS28F128J3D.
>
> As shown below, at the current configuration stage, BPI has been
> partitioned, bitstream loaded onto mtd0, uboot loaded and configured in
> mtd1-3, and linux kernel sitting in mtd4. The system is configured and
> automatically boots straight into petalinux on power on. the target
> partition is approx 10MBytes (slight larger) located on mtd5 and is to
> be setup up with a JFFS2 file system
>
> # cat /proc/mtd
> dev: size erasesize name
> mtd0: 00100000 00020000 "fpga"
> mtd1: 00040000 00020000 "boot"
> mtd2: 00020000 00020000 "bootenv"
> mtd3: 00020000 00020000 "config"
> mtd4: 00400000 00020000 "image"
> mtd5: 00a80000 00020000 "home" /* JFFS2 file system here */
> mtd6: 0015d000 00001000 "ROMfs"
>
> Also shown below the output of the "cat /proc/partitions" - i don't
> think this shows much useful information.
>
> # cat /proc/partitions
> major minor #blocks name
>
> 31 0 1024 mtdblock0
> 31 1 256 mtdblock1
> 31 2 128 mtdblock2
> 31 3 128 mtdblock3
> 31 4 4096 mtdblock4
> 31 5 10752 mtdblock5
> 31 6 1396 mtdblock6
> #
>
> auto-config has been used and the uboot recognises the partitions
> passing theses into the kernel on boot.
>
> the JFFS2 image was build on a pc using the following command:
>
> "mkfs.jffs2 -r ~/workspace/flashData/jffs2_image/ -o home.jffs2 -e 128
> -b --pad=10485760"
>
> where,
>
> "-r ~/workspace/flashData/jffs2_image/" was the source directory for the
> image containing a text file for testing purposes
> "-o home.jffs2" is the output image file
> "-e 128" was erase block size - set to 128 following the JS28F128J3D BPI
> datasheet specifications
> "-b" for big endian format - same as the microblaze processor
> "--pad=10485760" was to pad the image file up to 10Mbytes, to create a
> 10Mbyte partition
>
> I've hosted this image file for your inspection:
> http://allsey.homeip.net/uploaded%20data/home.jffs2
>
> I have written this image to flash in a couple of ways
>
> 1. From uboot using
> tftp $(clobstart) home.jffs2
> erase $(homestart) +$(homesize)
> cp.b $(clobstart) $(homestart) 0x00A00000
>
> - where homesize and homestart are variables i calculated and stored
> using the setenv cmd and 0x00A00000 is 10MBytes in bytes in hex.
>
> 2. In linux, using wget to download the home.jffs2 to /var directory
> (linked to RW RAMfs)
> erased partition using "eraseall /dev/mtd5"
> then attempted to use flashcp to find this is not built into the
> petalinux mtd-utils - is there any reason to why this is the case?
> from here i used "dd if=/var/home.jffs2 of=/dev/mtdblock5" instead -
> this seems to works and returns to stdout
> 20480+0 records in
> 20480+0 records out
>
> Either way the main problem is when i write the command: "mount -t jffs2
> /dev/mtd5 /usr" it returns the error:
> mount: Mounting /dev/mtd5 on /usr failed: No such device
>
> Now this error just doesn't make sense to me, i mean how is that
> writting the image and erasing seems to work fine, but come time to
> mount - it suddenly doesn't exist anymore...
Maybe the problem is the mount command.../dev/mtd5 is a char device.
Try /dev/mtdblock5 instead.
>
> the output from this next command proves that the device exists and that
> it can be accessed from the mtd-utils app eraseall - note device mtd8
> actually doesn't exist and is used for comparison.
>
> # eraseall /dev/mtd8
> eraseall: /dev/mtd8: No such device /* okay fair enough this device
> doesn't exist */
> # eraseall /dev/mtd5
> Erasing 128 Kibyte @ a0000 -- 5 % complete. /* clearly the device exists */
>
> Any feedback will be greatly appreciated - for further output please
> also reply and i will post back - hopefully we can get this problem
> solved once & for all.
>
> Cheers, Michael Allwright
>
> Mechatronics Undergrad Student
> Swinburne University - Melbourne, Australia.
Regards,
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/