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

Re: [microblaze-uclinux] creating a flash partition



Actually, one issue on that. It does seem to work correctly but I get this message on bootup:
=============================
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
7 cmdlinepart partitions found on MTD device physmap-flash.0
Creating 7 MTD partitions on "physmap-flash.0":
0x00000000-0x000c0000 : "bitstream"
0x000c0000-0x00100000 : "boot"
0x00100000-0x00140000 : "bootenv"
0x00140000-0x00160000 : "config"
0x00160000-0x00560000 : "image"
0x00560000-0x00660000 : "jimfs"
0x00660000-0x00f60000 : "spare"

*** this thing here ***
kobject_add failed for physmap-flash.0 with -EEXIST, don't try to register things with the same name in the same directory.

Stack:
 23fe9ea4 00000000 220d3098 23fde9d0 2218030c 220d30a4 2216d2cc 22180310
 000000a0 220b76cc 000041ed ffffffff 221802a4 2218029c 22180348 ffffffea
 220d81f8 2218029c 221705b0 22180348 21ffffff 2217a060 ffffffff 00000001
Call Trace: [<220d3098>] [<220d30a4>] [<220b76cc>] [<220d81f8>] [<220d8258>] [<220d8250>] [<2219790c>] [<221978dc>] [<220001c4>] [<220001c4>] [<220010d4>] [<220010c8>]
uclinux[mtd]: RAM probe address=0x221b1944 size=0x164000
Creating 1 MTD partitions on "RAM":
0x00000000-0x00164000 : "ROMfs"
uclinux[mtd]: set ROMfs to be root filesystem index=7

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

If I change the partition names in the bootargs then I don't get that message, for instance
bitstreamj, bootj, bootenvj etc.


John Williams wrote:
Hi Jim,

Jim Van Vorst wrote:
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...

That all looks good - u-boot can see your flash.

For some reason I have 15 MTD devices (is this the default with petalinux?):

Yes - these /dev/mtd??? entries are just device nodes, they may or may not actualyl be backed by a device, depending on how many partitions you create. They take up very little room on the romfs/cramfs image, so we haven't tried to minimise their number yet.

# 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.

What is the contents of /proc/partitions, and /proc/mtd?

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

This is good - the kernel can see your flash.

cmdlinepart partition parsing not available

this is bad - you need to MTD command line partition table support enabled.

We've tried to make MTD / flash partition management as easy and automated as possible in PetaLinux. In general, the advice is

1. always use the physmap-auto MTD mapping driver
2. always enable the commandline partition parsing options, as that's how we get u-boot to tell the kernel about your partitions 3. always specify your MDT flash partitions in the top level menuconfig -> user/vendor -> system configuration menu 4. If you change the flash table, you need to reconfigure u-boot so that it knows about the partitions. This is done when you do download the ub.config.img u-boot script into u-boot.

In u-boot, do a "printenv", look for the mtdparts variable - that shows you what u-boot thinks your flash table looks like, and what it will tell the kernel. That must match the reality.

Hope this clears things up a little. Please let us know how you go - it is probably a worthy subject for a FAQ.

Regards,

John

That should be about it.
___________________________
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/


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