public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* mtdparts howto required!!
@ 2004-03-15 22:49 Robin Gilks
  2004-03-17 23:30 ` Robin Gilks
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Gilks @ 2004-03-15 22:49 UTC (permalink / raw)
  To: mtd list

Greetings

I'm trying to map 3 partitions into a single flash device using the 
mtdparts command line stuff. I'm using a 2.4.22 kernel cross compiled 
from i686 to PowerPC with mtd patches from CVS as of 19th Feb.

My Linux config is:
# Memory Technology Devices (MTD)
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_CFI_INTELEXT=y
# CONFIG_MTD_CFI_AMDSTD is not set
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_OBSOLETE_CHIPS is not set
# CONFIG_MTD_AMDSTD is not set
# CONFIG_MTD_SHARP is not set
# CONFIG_MTD_JEDEC is not set
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=40000000
CONFIG_MTD_PHYSMAP_LEN=400000
CONFIG_MTD_PHYSMAP_BUSWIDTH=2
# CONFIG_MTD_CFI_FLAGADM is not set
# CONFIG_MTD_PCI is not set
# CONFIG_MTD_PCMCIA is not set
# Self-contained MTD device drivers
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLKMTD is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
# CONFIG_MTD_DOCPROBE is not set
# CONFIG_MTD_NAND is not set

My Linux boot command line is:
mtdparts=phys:7M(jffs2),256K(u-boot),-(kernel)

and when I turn on debugging in cmdlineparts I see:
DEBUG-CMDLINE-PART: parsing <7M(jffs2),256K(u-Boot),-(kernel)>
DEBUG-CMDLINE-PART: partition 2: name <kernel>, offset 0, size ffffffff, 
mask flags 0
DEBUG-CMDLINE-PART: partition 1: name <u-Boot>, offset 0, size 40000, 
mask flags 0
DEBUG-CMDLINE-PART: partition 0: name <jffs2>, offset 0, size 700000, 
mask flags 0
DEBUG-CMDLINE-PART: mtdid=<phys> num_parts=<3>

So what happened to the offsets? Shouldn't they allow for the size of 
the previous partition? and when I look in /proc/mtd I see:

/ # cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00800000 00010000 "Physically mapped flash"

So what happened to the partitions I just parsed?


Other information reported at boot (note: RedBoot not enabled) is:

physmap flash device: 400000 at 40000000
Physically mapped flash: Found 1 x16 devices at 0x0 in 16-bit mode
  Intel/Sharp Extended Query Table at 0x0035
cfi_cmdset_0001: Erase suspend on write enabled
Using buffer write method
kmod: failed to exec /sbin/modprobe -s -k RedBoot, errno = 2
RedBoot partition parsing not available


-- 
Robin Gilks
Senior Design Engineer          Phone: (+64)(3) 357 1569
Tait Electronics                Fax  :  (+64)(3) 359 4632
PO Box 1645 Christchurch        Email : robin.gilks@tait.co.nz
New Zealand

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mtdparts howto required!!
  2004-03-15 22:49 mtdparts howto required!! Robin Gilks
@ 2004-03-17 23:30 ` Robin Gilks
  2004-03-18  8:42   ` David Woodhouse
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Gilks @ 2004-03-17 23:30 UTC (permalink / raw)
  To: mtd list

Don't you just love it when someone replies to their own post!!

Problem solved - it would be nice if it were written down somewhere that 
the physmap.c example is only that - a non-working example in that it 
doesn't define a master mtd device which means you can't define the 
partitions on it!!

Also, when a master device is defined there is nothing to indicate that 
the mtdparts command line has to use the same name as the mtd_id - in 
fact I've found nothing that defines what mtd_id is. Who would have 
believed that I needed a command line of the form
mtdparts=phys_mapped_flash:7M(jffs2),256K(u-boot),-(kernel)
in order to use the default name (which doesn't work for reasons above 
anyway!!)

Oh well - its kept me entertained for 3 days instead of doing real work...

Robin Gilks wrote:
> Greetings
> 
> I'm trying to map 3 partitions into a single flash device using the 
> mtdparts command line stuff. I'm using a 2.4.22 kernel cross compiled 
> from i686 to PowerPC with mtd patches from CVS as of 19th Feb.
> 
[snip]


-- 
Robin Gilks
Senior Design Engineer          Phone: (+64)(3) 357 1569
Tait Electronics                Fax  :  (+64)(3) 359 4632
PO Box 1645 Christchurch        Email : robin.gilks@tait.co.nz
New Zealand

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mtdparts howto required!!
  2004-03-17 23:30 ` Robin Gilks
@ 2004-03-18  8:42   ` David Woodhouse
  2004-03-18 22:16     ` Robin Gilks
  0 siblings, 1 reply; 4+ messages in thread
From: David Woodhouse @ 2004-03-18  8:42 UTC (permalink / raw)
  To: Robin Gilks; +Cc: mtd list

On Thu, 2004-03-18 at 12:30 +1300, Robin Gilks wrote:
> Don't you just love it when someone replies to their own post!!

I do when they've solved their own problem. :)

> Problem solved - it would be nice if it were written down somewhere that 
> the physmap.c example is only that - a non-working example in that it 
> doesn't define a master mtd device which means you can't define the 
> partitions on it!!

I'm not sure I understand this. What does physmap.c need to do other
than passing in the 'master' mtd device as the first argument to
parse_mtd_partitions()?

> Also, when a master device is defined there is nothing to indicate that 
> the mtdparts command line has to use the same name as the mtd_id - in 
> fact I've found nothing that defines what mtd_id is.

cmdlinepart.c line 13:
 * <mtd-id>  := unique name used in mapping driver/device

I'll add '(mtd->name)' to that in the hope of making it clearer.

> Oh well - its kept me entertained for 3 days instead of doing real work...

Patches to improve documentation are always welcome :)

-- 
dwmw2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mtdparts howto required!!
  2004-03-18  8:42   ` David Woodhouse
@ 2004-03-18 22:16     ` Robin Gilks
  0 siblings, 0 replies; 4+ messages in thread
From: Robin Gilks @ 2004-03-18 22:16 UTC (permalink / raw)
  To: mtd list

David Woodhouse wrote:
> On Thu, 2004-03-18 at 12:30 +1300, Robin Gilks wrote:

[snip]

> 
> I'm not sure I understand this. What does physmap.c need to do other
> than passing in the 'master' mtd device as the first argument to
> parse_mtd_partitions()?

The ioremap fails before it can get this far because there is no start 
address or size defined for the default device. I've patched in a 
generic map as follows and its then fine.

struct map_info physmap_map = {
	.name = "phys_mapped_flash",
	.size = CONFIG_MTD_PHYSMAP_LEN,
	.buswidth = CONFIG_MTD_PHYSMAP_BUSWIDTH,
	.phys = CONFIG_MTD_PHYSMAP_START,
};


I may have missed something here - perhaps something is supposed to set 
these values by probing but if thats the case I've missed it I'm afraid!!



-- 
Robin Gilks
Senior Design Engineer          Phone: (+64)(3) 357 1569
Tait Electronics                Fax  :  (+64)(3) 359 4632
PO Box 1645 Christchurch        Email : robin.gilks@tait.co.nz
New Zealand

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-03-18 22:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-15 22:49 mtdparts howto required!! Robin Gilks
2004-03-17 23:30 ` Robin Gilks
2004-03-18  8:42   ` David Woodhouse
2004-03-18 22:16     ` Robin Gilks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox