[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] creating a flash partition
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/