[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] creating a flash partition



I have a Spartan3E-1600 dev board that I'm trying to create a flash disk on. By "flash disk" I mean jffs2 mounted on a flash partition so I can have persistent config files and such.

Initially, I have this:
# more /proc/mtd
dev:    size   erasesize  name
mtd0: 00161000 00001000 "ROMfs"
# more /proc/partitions
major minor  #blocks  name

 31     0       1412 mtdblock0


u-boot tells me this:
U-Boot> flinfo

Bank # 1: CFI conformant FLASH (8 x 8)  Size: 16 MB in 128 Sectors
Erase timeout 4096 ms, write timeout 1 ms, buffer write timeout 2 ms, buffer size 32
 Sector Start Addresses:
21000000 21020000 21040000 21060000 21080000 210A0000 210C0000 210E0000 21100000 (RO) 21120000 (RO) 21140000 21160000 21180000 211A0000 211C0000 211E0000 21200000 21220000 21240000 21260000 21280000 212A0000 212C0000 212E0000 21300000 etc...

For some reason I have 15 MTD devices (is this the default with petalinux?):
# ls /dev
console     mtd6        mtdblock7   mtdr8       ptypc       ttyp5
fb0         mtd7        mtdblock8   mtdr9       ptypd       ttyp6
flash       mtd8        mtdblock9   null        ptype       ttyp7
kmem        mtd9        mtdr0       nvram       ptypf       ttyp8
mem         mtdblock0   mtdr1       ptyp0       random      ttyp9
mtd0        mtdblock1   mtdr10      ptyp1       rtc         ttypa
mtd1        mtdblock10  mtdr11      ptyp2       tty         ttypb
mtd10       mtdblock11  mtdr12      ptyp3       ttyS0       ttypc
mtd11       mtdblock12  mtdr13      ptyp4       ttyS1       ttypd
mtd12       mtdblock13  mtdr14      ptyp5       ttyS2       ttype
mtd13       mtdblock14  mtdr2       ptyp6       ttyS3       ttypf
mtd14       mtdblock2   mtdr3       ptyp7       ttyp0       urandom
mtd2        mtdblock3   mtdr4       ptyp8       ttyp1       zero
mtd3        mtdblock4   mtdr5       ptyp9       ttyp2
mtd4        mtdblock5   mtdr6       ptypa       ttyp3
mtd5        mtdblock6   mtdr7       ptypb       ttyp4

I have this, from the flash partition table section of menuconfig:
# ls -al /dev/flash
crw-r--r--    1 root     0         90,   0 Jan  1 00:00 bitstream
crw-r--r--    1 root     0         90,   2 Jan  1 00:00 boot
crw-r--r--    1 root     0         90,   4 Jan  1 00:00 bootenv
crw-r--r--    1 root     0         90,   6 Jan  1 00:00 config
crw-r--r--    1 root     0         90,   8 Jan  1 00:00 image
crw-r--r--    1 root     0         90,  10 Jan  1 00:00 jimfs
crw-r--r--    1 root     0         90,  12 Jan  1 00:00 spare

(I created jimfs as a test).

What I want to do is use a range of flash sectors for a (jffs2 probably) partition. I added the jimfs partition but I can't seem to do anything useful with it. I.e. dd/cat on /dev/flash/jimfs fails.

I tried to set up a CFI flash device physical memory map and got this:
physmap platform flash device: 01000000 at 21000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 8-bit bank
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
erase region 0: offset=0x0,size=0x20000,blocks=128
cmdlinepart partition parsing not available
RedBoot partition parsing not available
kobject_add failed for physmap-flash.0 with -EEXIST, don't try to register things with the same name in the same directory.

Stack:
 23fe9ea0 00000000 220d5dfc 23fdf9d0 221842f8 220d5e0c 221712cc 221842fc
 000000a0 220b9e30 000041ed ffffffff 22184290 00000001 22184288 ffffffea
 220db258 22184288 221745b0 22184334 21d5ffff 23e08c18 ffffffff 0000001c
Call Trace: [<220d5dfc>] [<220d5e0c>] [<220b9e30>] [<220db258>] [<220db2c8>] [<2219bb8c>] [<2219bb5c>] [<220001c8>] [<220001c8>] [<2200111c>] [<2200110c>]
uclinux[mtd]: RAM probe address=0x221b5938 size=0x161000
Creating 1 MTD partitions on "RAM":
0x00000000-0x00161000 : "ROMfs"
uclinux[mtd]: set ROMfs to be root filesystem index=1


I have read every resource I can find on this topic and still no joy. This seems like a simple operation: create a partition, copy a jffs2 image to it, then mount it.
Anyone know the secret?

thanks.

___________________________
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/