From: Thorsten Haas <haas@deutaeit.de>
To: Ralph Siemsen <ralphs@netwinder.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: CFI physmap - how to create partitions
Date: Fri, 20 May 2005 09:26:24 +0200 [thread overview]
Message-ID: <1116573984.2737.13.camel@shrek> (raw)
In-Reply-To: <428C7E60.3090908@netwinder.org>
Am Donnerstag, den 19.05.2005, 07:54 -0400 schrieb Ralph Siemsen:
> Thorsten Haas wrote:
>
> > Solved. I used mphysmap.c, because there are two banks of flash on my
> > board, but mphysmap.c does not support partitioning yet. Though,
> > physmap.c does provide commandline partition parsing.
> > Sadly, mtd-id's seem not to be well-documented. I looked the one for
> > mappings to the physical memory area up in the source. It's
> > "phys_mapped_flash". Huzaa.
>
> Hmm, are the two banks the same (eg. two chips of same type), and are
> they consecutive in memory or parallel on the bus? Then you can
> actually use physmap. Just pass it the combined size of both chips, the
> MTD code will handle the rest. There is no need to call probe function
> for each bank, or to partition each bank separately. This seems to be
> another one of the MTD undocumented "features".
Yes, they are the same. Yes, they are consecutive in memory. Yes, I
tried that. Yes, it's now less undocumented, because my diff contains
this information :)
Well, actually, when using physmap.c I am able to create partitions, but
there is still some trouble when using the mtd partitions: erasing and
mounting fails.
Does someone have an idea, what I am doing wrong?
# flash_erase /dev/mtd0
File open error
# flash_erase /dev/mtd4 0x0 0x40
Erase Total 64 Units
Performing Flash Erase of length 131072 at offset 0x160000
MTD Erase failure: Invalid argument
# ls -la /dev/mtd*
crw-r--r-- 1 0 0 90, 0 Jan 9 2005 /dev/mtd0
crw-r--r-- 1 0 0 90, 1 May 13 2005 /dev/mtd1
crw-r--r-- 1 0 0 90, 2 May 15 2005 /dev/mtd2
crw-r--r-- 1 0 0 90, 3 May 15 2005 /dev/mtd3
crw-r--r-- 1 0 0 90, 4 May 18 2005 /dev/mtd4
crw-r--r-- 1 0 0 90, 5 May 18 2005 /dev/mtd5
brw-r--r-- 1 0 0 31, 0 May 15 2005 /dev/mtdblock0
brw-r--r-- 1 0 0 31, 1 May 15 2005 /dev/mtdblock1
brw-r--r-- 1 0 0 31, 2 May 15 2005 /dev/mtdblock2
brw-r--r-- 1 0 0 31, 3 May 15 2005 /dev/mtdblock3
brw-r--r-- 1 0 0 31, 4 May 18 2005 /dev/mtdblock4
brw-r--r-- 1 0 0 31, 5 May 18 2005 /dev/mtdblock5
# cat /proc/partitions
major minor #blocks name
31 0 5632 mtdblock0
31 1 1024 mtdblock1
31 2 1408 mtdblock2
31 3 128 mtdblock3
31 4 8192 mtdblock4
# cat /proc/mtd
dev: size erasesize name
mtd0: 00580000 00020000 "root"
mtd1: 00100000 00020000 "kernel"
mtd2: 00160000 00020000 "initrd"
mtd3: 00020000 00020000 "reset"
mtd4: 00800000 00020000 "jffs2"
Here's the output of dmesg:
physmap flash device: 1000000 at 38000000
phys_mapped_flash: Found 1 x16 devices at 0x0 in 16-bit bank
phys_mapped_flash: Found 1 x16 devices at 0x800000 in 16-bit bank
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
0: offset=0x0,size=0x20000,blocks=64
1: offset=0x800000,size=0x20000,blocks=64
5 cmdlinepart partitions found on MTD device phys_mapped_flash
Creating 5 MTD partitions on "phys_mapped_flash":
0x00000000-0x00580000 : "root"
0x00580000-0x00680000 : "kernel"
0x00680000-0x007e0000 : "initrd"
0x007e0000-0x00800000 : "reset"
0x00800000-0x01000000 : "jffs2"
Kernel version: 2.6.11.8, mtd cvs snapshot 2005-05-15.
next prev parent reply other threads:[~2005-05-20 7:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-18 8:05 CFI physmap - how to create partitions Thorsten Haas
2005-05-18 22:35 ` Ralph Siemsen
2005-05-19 8:06 ` Thorsten Haas
2005-05-19 11:54 ` Ralph Siemsen
2005-05-20 7:26 ` Thorsten Haas [this message]
2005-05-20 12:58 ` Ralph Siemsen
2005-05-20 13:20 ` Thorsten Haas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1116573984.2737.13.camel@shrek \
--to=haas@deutaeit.de \
--cc=linux-mtd@lists.infradead.org \
--cc=ralphs@netwinder.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox